qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* How to convert fowlloing code from configure to meson.build
@ 2020-09-18  8:47 罗勇刚(Yonggang Luo)
  2020-09-18 12:58 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-09-18  8:47 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-level

[-- Attachment #1: Type: text/plain, Size: 2949 bytes --]

##########################################
# iconv probe
if test "$iconv" != "no" ; then
  cat > $TMPC << EOF
#include <iconv.h>
int main(void) {
  iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
  return conv != (iconv_t) -1;
}
EOF
  iconv_prefix_list="/usr/local:/usr"
  iconv_lib_list=":-liconv"
  IFS=:
  for iconv_prefix in $iconv_prefix_list; do
    IFS=:
    iconv_cflags="-I$iconv_prefix/include"
    iconv_ldflags="-L$iconv_prefix/lib"
    for iconv_link in $iconv_lib_list; do
      unset IFS
      iconv_lib="$iconv_ldflags $iconv_link"
      echo "looking at iconv in '$iconv_cflags' '$iconv_lib'" >> config.log
      if compile_prog "$iconv_cflags" "$iconv_lib" ; then
        iconv_found=yes
        break
      fi
    done
    if test "$iconv_found" = yes ; then
      break
    fi
  done
  if test "$iconv_found" = "yes" ; then
    iconv=yes
  else
    if test "$iconv" = "yes" ; then
      feature_not_found "iconv" "Install iconv devel"
    fi
    iconv=no
  fi
fi

##########################################
# curses probe
if test "$iconv" = "no" ; then
  # curses will need iconv
  curses=no
fi
if test "$curses" != "no" ; then
  if test "$mingw32" = "yes" ; then
    curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null)
      $($pkg_config --cflags ncursesw 2>/dev/null)"
    curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null)
      $($pkg_config --libs ncursesw 2>/dev/null)
      -lpdcurses"
  else
    curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null)
      -I/usr/include/ncursesw:"
    curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null)
      -lncursesw
      -lcursesw"
  fi
  curses_found=no
  cat > $TMPC << EOF
#include <locale.h>
#include <curses.h>
#include <wchar.h>
int main(void) {
  wchar_t wch = L'w';
  setlocale(LC_ALL, "");
  resize_term(0, 0);
  addwstr(L"wide chars\n");
  addnwstr(&wch, 1);
  add_wch(WACS_DEGREE);
  return 0;
}
EOF
  IFS='
'                           # turn off variable value expansion except for
splitting at newlines
  for curses_inc in $curses_inc_list; do
    # Make sure we get the wide character prototypes
    curses_inc="-DNCURSES_WIDECHAR $curses_inc"
    IFS='
'                           # turn off variable value expansion except for
splitting at newlines
    for curses_lib in $curses_lib_list; do
      unset IFS
      if compile_prog "$curses_inc" "$curses_lib" ; then
        curses_found=yes
        break
      fi
    done
    if test "$curses_found" = yes ; then
      break
    fi
  done
  unset IFS
  if test "$curses_found" = "yes" ; then
    curses=yes
  else
    if test "$curses" = "yes" ; then
      feature_not_found "curses" "Install ncurses devel"
    fi
    curses=no
  fi
fi


seems that need compile a program, but I didn't found a demo
--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

[-- Attachment #2: Type: text/html, Size: 3907 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to convert fowlloing code from configure to meson.build
  2020-09-18  8:47 How to convert fowlloing code from configure to meson.build 罗勇刚(Yonggang Luo)
@ 2020-09-18 12:58 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2020-09-18 12:58 UTC (permalink / raw)
  To: luoyonggang, qemu-level

On 18/09/20 10:47, 罗勇刚(Yonggang Luo) wrote:
> 
> seems that need compile a program, but I didn't found a demo

You need "cc.compiles()" or "cc.links()".

Paolo



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-18 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18  8:47 How to convert fowlloing code from configure to meson.build 罗勇刚(Yonggang Luo)
2020-09-18 12:58 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).