summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorYonggang Luo2020-10-13 01:43:48 +0200
committerGerd Hoffmann2020-10-14 06:05:56 +0200
commit5285e593c33d7893ed7489b71f0fae95baa19e0a (patch)
tree317e933f2776cf3891eeacf23c63a85651e501ff /configure
parentwin32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defi... (diff)
downloadqemu-5285e593c33d7893ed7489b71f0fae95baa19e0a.tar.gz
qemu-5285e593c33d7893ed7489b71f0fae95baa19e0a.tar.xz
qemu-5285e593c33d7893ed7489b71f0fae95baa19e0a.zip
configure: Fixes ncursesw detection under msys2/mingw by convert them to meson
The mingw pkg-config are showing following absolute path and contains : as the separator, -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw: -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lncursesw -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lcursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20201012234348.1427-6-luoyonggang@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure118
1 files changed, 7 insertions, 111 deletions
diff --git a/configure b/configure
index 9a87685517..f839c2a557 100755
--- a/configure
+++ b/configure
@@ -295,7 +295,8 @@ unset target_list_exclude
brlapi=""
curl=""
-curses=""
+iconv="auto"
+curses="auto"
docs=""
fdt="auto"
netmap="no"
@@ -1173,13 +1174,13 @@ for opt do
;;
--disable-safe-stack) safe_stack="no"
;;
- --disable-curses) curses="no"
+ --disable-curses) curses="disabled"
;;
- --enable-curses) curses="yes"
+ --enable-curses) curses="enabled"
;;
- --disable-iconv) iconv="no"
+ --disable-iconv) iconv="disabled"
;;
- --enable-iconv) iconv="yes"
+ --enable-iconv) iconv="enabled"
;;
--disable-curl) curl="no"
;;
@@ -3441,102 +3442,6 @@ EOF
fi
##########################################
-# 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):"
- curses_lib_list="$($pkg_config --libs ncurses 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=:
- for curses_inc in $curses_inc_list; do
- # Make sure we get the wide character prototypes
- curses_inc="-DNCURSES_WIDECHAR $curses_inc"
- IFS=:
- 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
-
-##########################################
# curl probe
if test "$curl" != "no" ; then
if $pkg_config libcurl --exists; then
@@ -6200,16 +6105,6 @@ if test "$have_x11" = "yes" && test "$need_x11" = "yes"; then
echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak
echo "X11_LIBS=$x11_libs" >> $config_host_mak
fi
-if test "$iconv" = "yes" ; then
- echo "CONFIG_ICONV=y" >> $config_host_mak
- echo "ICONV_CFLAGS=$iconv_cflags" >> $config_host_mak
- echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak
-fi
-if test "$curses" = "yes" ; then
- echo "CONFIG_CURSES=y" >> $config_host_mak
- echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
- echo "CURSES_LIBS=$curses_lib" >> $config_host_mak
-fi
if test "$pipe2" = "yes" ; then
echo "CONFIG_PIPE2=y" >> $config_host_mak
fi
@@ -7181,6 +7076,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
-Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \
-Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \
+ -Diconv=$iconv -Dcurses=$curses \
$cross_arg \
"$PWD" "$source_path"