From dfa66db214a12be52204def741e53450f670d38e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 12 Jan 2009 15:25:44 +0100 Subject: [PATCH] configure: Improve error reporting for missing 32-bit development environment. --- configure | 149 +++++++++++++++++++++++++++++++++++---------------- configure.ac | 45 +++++++++------- 2 files changed, 127 insertions(+), 67 deletions(-) diff --git a/configure b/configure index 65743ff621..0c82d0e6a2 100755 --- a/configure +++ b/configure @@ -747,6 +747,8 @@ CPP XMKMF TARGET TOOLSDIR +WIN16_INSTALL +WIN16_FILES CPPBIN ac_ct_CXX CXXFLAGS @@ -759,8 +761,6 @@ LDFLAGS CFLAGS CC SET_MAKE -WIN16_INSTALL -WIN16_FILES host_os host_vendor host_cpu @@ -2360,50 +2360,6 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -case $host in - x86_64*linux*) - if test "x$enable_win64" != "xyes" - then - CC="${CC:-gcc} -m32" - CXX="${CXX:-g++} -m32" - LD="${LD:-ld} -m elf_i386" - AS="${AS:-as} --32" - host_cpu="i386" - notice_platform="32-bit " - fi - ;; -esac - -case $host_cpu in - *i[3456789]86*) - enable_win16=${enable_win16:-yes} - ;; - *) - enable_win16=${enable_win16:-no} - enable_ifsmgr_vxd=${enable_ifsmgr_vxd:-no} - enable_mmdevldr_vxd=${enable_mmdevldr_vxd:-no} - enable_monodebg_vxd=${enable_monodebg_vxd:-no} - enable_vdhcp_vxd=${enable_vdhcp_vxd:-no} - enable_vmm_vxd=${enable_vmm_vxd:-no} - enable_vnbt_vxd=${enable_vnbt_vxd:-no} - enable_vnetbios_vxd=${enable_vnetbios_vxd:-no} - enable_vtdapi_vxd=${enable_vtdapi_vxd:-no} - enable_vwin32_vxd=${enable_vwin32_vxd:-no} - enable_w32skrnl=${enable_w32skrnl:-no} - enable_winedos=${enable_winedos:-no} - enable_winevdm=${enable_winevdm:-no} - ;; -esac - -WIN16_FILES="\$(WIN16_FILES)" - -WIN16_INSTALL="\$(WIN16_INSTALL)" - -if test "x$enable_win16" != "xyes" -then - WIN16_FILES="" - WIN16_INSTALL="" -fi case "$srcdir" in .) ;; @@ -3846,6 +3802,106 @@ else fi +case $host in + x86_64*) + if test "x$enable_win64" != "xyes" + then + CC="$CC -m32" + CXX="$CXX -m32" + { $as_echo "$as_me:$LINENO: checking whether $CC works" >&5 +$as_echo_n "checking whether $CC works... " >&6; } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:$LINENO: error: Cannot build a 32-bit program, you need to install 32-bit development libraries." >&5 +$as_echo "$as_me: error: Cannot build a 32-bit program, you need to install 32-bit development libraries." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LD="${LD:-ld} -m elf_i386" + AS="${AS:-as} --32" + host_cpu="i386" + notice_platform="32-bit " + fi + ;; +esac + +case $host_cpu in + *i[3456789]86*) + enable_win16=${enable_win16:-yes} + ;; + *) + enable_win16=${enable_win16:-no} + enable_ifsmgr_vxd=${enable_ifsmgr_vxd:-no} + enable_mmdevldr_vxd=${enable_mmdevldr_vxd:-no} + enable_monodebg_vxd=${enable_monodebg_vxd:-no} + enable_vdhcp_vxd=${enable_vdhcp_vxd:-no} + enable_vmm_vxd=${enable_vmm_vxd:-no} + enable_vnbt_vxd=${enable_vnbt_vxd:-no} + enable_vnetbios_vxd=${enable_vnetbios_vxd:-no} + enable_vtdapi_vxd=${enable_vtdapi_vxd:-no} + enable_vwin32_vxd=${enable_vwin32_vxd:-no} + enable_w32skrnl=${enable_w32skrnl:-no} + enable_winedos=${enable_winedos:-no} + enable_winevdm=${enable_winevdm:-no} + ;; +esac + +WIN16_FILES="\$(WIN16_FILES)" + +WIN16_INSTALL="\$(WIN16_INSTALL)" + +if test "x$enable_win16" != "xyes" +then + WIN16_FILES="" + WIN16_INSTALL="" +fi + { $as_echo "$as_me:$LINENO: checking for the directory containing the Wine tools" >&5 $as_echo_n "checking for the directory containing the Wine tools... " >&6; } if test "${wine_cv_toolsdir+set}" = set; then @@ -3880,7 +3936,6 @@ then fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.ac b/configure.ac index 604f3319bd..591d54131a 100644 --- a/configure.ac +++ b/configure.ac @@ -81,12 +81,34 @@ AC_ARG_WITH(xxf86vm, AS_HELP_STRING([--without-xxf86vm],[do not use XFree vide AC_ARG_WITH(wine-tools,AS_HELP_STRING([--with-wine-tools=DIR],[use Wine tools from directory DIR])) AC_CANONICAL_HOST + +dnl check for out of tree build with unclean source tree +case "$srcdir" in + .) ;; + *) if test -f "$srcdir/Makefile" -o -f "$srcdir/include/config.h"; then + AC_MSG_ERROR([you are building out of the source tree, but the source tree contains object files. +You need to run 'make distclean' in the source tree first.]) + fi ;; +esac + +dnl **** Check for some programs **** + +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_CXX +dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E +AC_CHECK_TOOL(CPPBIN,cpp,cpp) + case $host in - x86_64*linux*) + x86_64*) if test "x$enable_win64" != "xyes" then - CC="${CC:-gcc} -m32" - CXX="${CXX:-g++} -m32" + CC="$CC -m32" + CXX="$CXX -m32" + AC_MSG_CHECKING([whether $CC works]) + AC_LINK_IFELSE(AC_LANG_PROGRAM(),AC_MSG_RESULT([yes]), + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Cannot build a 32-bit program, you need to install 32-bit development libraries.])]) LD="${LD:-ld} -m elf_i386" AS="${AS:-as} --32" host_cpu="i386" @@ -126,23 +148,6 @@ then WIN16_INSTALL="" fi -dnl check for out of tree build with unclean source tree -case "$srcdir" in - .) ;; - *) if test -f "$srcdir/Makefile" -o -f "$srcdir/include/config.h"; then - AC_MSG_ERROR([you are building out of the source tree, but the source tree contains object files. -You need to run 'make distclean' in the source tree first.]) - fi ;; -esac - -dnl **** Check for some programs **** - -AC_PROG_MAKE_SET -AC_PROG_CC -AC_PROG_CXX -dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E -AC_CHECK_TOOL(CPPBIN,cpp,cpp) - AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir, [if test -z "$with_wine_tools"; then if test "$cross_compiling" = "yes"; then -- 2.32.0.93.g670b81a890