Alexandre Julliard : configure: Add a check for broken 16-bit compile with Xcode 3.x.

Alexandre Julliard julliard at winehq.org
Tue Jun 23 10:02:47 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jun 23 13:04:49 2009 +0200

configure: Add a check for broken 16-bit compile with Xcode 3.x.

---

 configure    |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac |   17 ++++++++++++++
 2 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 2ebe28a..2d40991 100755
--- a/configure
+++ b/configure
@@ -7403,6 +7403,77 @@ done
 
         enable_winequartz_drv=${enable_winequartz_drv:-yes}
     fi
+        if test "x$enable_win16" = "xyes"
+    then
+        { $as_echo "$as_me:$LINENO: checking whether 16-bit code can be built correctly" >&5
+$as_echo_n "checking whether 16-bit code can be built correctly... " >&6; }
+        if test "$cross_compiling" = yes; then
+  { $as_echo "$as_me:$LINENO: result: cross-compiling, assuming yes" >&5
+$as_echo "cross-compiling, assuming yes" >&6; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+asm(".text\n"
+                                            "bad:\tnop;nop\n"
+                                            "good:\tnop;nop\n\t"
+                                            ".globl _testfunc\n"
+                                            "_testfunc:\tcallw good");
+                                        extern void testfunc();
+int
+main ()
+{
+unsigned short *p = (unsigned short *)testfunc;
+                                        return p[0] != 0xe866 || p[1] != 0xfffa
+  ;
+  return 0;
+}
+_ACEOF
+rm -f 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>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (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_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+                                       { { $as_echo "$as_me:$LINENO: error: Xcode 3.x cannot build 16-bit code correctly. Use --disable-win16 if you don't need 16-bit support." >&5
+$as_echo "$as_me: error: Xcode 3.x cannot build 16-bit code correctly. Use --disable-win16 if you don't need 16-bit support." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+    fi
     ;;
   *)
     DLLFLAGS="$DLLFLAGS -fPIC"
diff --git a/configure.ac b/configure.ac
index 3ef18dc..7f15375 100644
--- a/configure.ac
+++ b/configure.ac
@@ -609,6 +609,23 @@ case $host_os in
         AC_SUBST(CARBONLIB,"-framework Carbon")
         enable_winequartz_drv=${enable_winequartz_drv:-yes}
     fi
+    dnl Check for Xcode 3.x broken 16-bit support
+    if test "x$enable_win16" = "xyes"
+    then
+        AC_MSG_CHECKING([whether 16-bit code can be built correctly])
+        AC_RUN_IFELSE(AC_LANG_PROGRAM([[asm(".text\n"
+                                            "bad:\tnop;nop\n"
+                                            "good:\tnop;nop\n\t"
+                                            ".globl _testfunc\n"
+                                            "_testfunc:\tcallw good");
+                                        extern void testfunc();]],
+                                      [[unsigned short *p = (unsigned short *)testfunc;
+                                        return p[[0]] != 0xe866 || p[[1]] != 0xfffa]]),
+                                      AC_MSG_RESULT(yes),
+                                      [AC_MSG_RESULT(no)
+                                       AC_MSG_ERROR([Xcode 3.x cannot build 16-bit code correctly. Use --disable-win16 if you don't need 16-bit support.])],
+                                       AC_MSG_RESULT([[cross-compiling, assuming yes]]))
+    fi
     ;;
   *)
     DLLFLAGS="$DLLFLAGS -fPIC"




More information about the wine-cvs mailing list