Alexandre Julliard : configure: Check that the cross-compiler that we found actually works.

Alexandre Julliard julliard at winehq.org
Wed Aug 4 12:27:23 CDT 2010


Module: wine
Branch: master
Commit: c2a29dbb9c61af31f5031cd9c6e4d0c532fabce9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c2a29dbb9c61af31f5031cd9c6e4d0c532fabce9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug  4 13:16:19 2010 +0200

configure: Check that the cross-compiler that we found actually works.

---

 configure    |   54 +++++++++++++++++++++++++++++++++++++++---------------
 configure.ac |   37 ++++++++++++++++++++++---------------
 2 files changed, 61 insertions(+), 30 deletions(-)

diff --git a/configure b/configure
index 9b94f09..05a9317 100755
--- a/configure
+++ b/configure
@@ -7054,22 +7054,46 @@ test -n "$CROSSCC" || CROSSCC="false"
 
     if test "$CROSSCC" != "false"
     then
-        CROSSTEST_DISABLE=""
-        set x $CROSSCC
-        shift
-        target=""
-        while test $# -ge 1
-        do
-            case "$1" in
-              *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;;
-            esac
-            shift
-        done
-        if test -n "$target"
-        then
-            CROSSTARGET="$target"
+        ac_save_CC="$CC"
+        CC="$CROSSCC"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CROSSCC works" >&5
+$as_echo_n "checking whether $CROSSCC works... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-        fi
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                           set x $CROSSCC
+                           shift
+                           target=""
+                           while test $# -ge 1
+                           do
+                               case "$1" in
+                                 *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;;
+                               esac
+                               shift
+                           done
+                           if test -n "$target"
+                           then
+                               CROSSTEST_DISABLE=""
+                               CROSSTARGET="$target"
+
+                           fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        CC="$ac_save_CC"
     fi
 fi
 
diff --git a/configure.ac b/configure.ac
index 30f04ac..eedfec5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -838,21 +838,28 @@ then
     WINE_CHECK_MINGW_PROG(CROSSCC,gcc,false)
     if test "$CROSSCC" != "false"
     then
-        CROSSTEST_DISABLE=""
-        set x $CROSSCC
-        shift
-        target=""
-        while test $# -ge 1
-        do
-            case "$1" in
-              *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;;
-            esac
-            shift
-        done
-        if test -n "$target"
-        then
-            AC_SUBST(CROSSTARGET,"$target")
-        fi
+        ac_save_CC="$CC"
+        CC="$CROSSCC"
+        AC_MSG_CHECKING([whether $CROSSCC works])
+        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
+                          [AC_MSG_RESULT([yes])
+                           set x $CROSSCC
+                           shift
+                           target=""
+                           while test $# -ge 1
+                           do
+                               case "$1" in
+                                 *-gcc) target=`expr "$1" : '\(.*\)-gcc'` ;;
+                               esac
+                               shift
+                           done
+                           if test -n "$target"
+                           then
+                               CROSSTEST_DISABLE=""
+                               AC_SUBST(CROSSTARGET,"$target")
+                           fi],
+                          [AC_MSG_RESULT([no])])
+        CC="$ac_save_CC"
     fi
 fi
 




More information about the wine-cvs mailing list