[PATCH] configure: Check for __builtin_ms_va_list on all x86_64 platforms.

Charles Davis cdavis5x at gmail.com
Tue Sep 22 16:35:31 CDT 2015


If we're running configure, we're probably not going to be using Visual
C++, even on Windows. Everywhere else, we need this for variadic
argument lists to work.

Signed-off-by: Charles Davis <cdavis5x at gmail.com>
---
 configure.ac | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 135268f..e875431 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,14 +157,6 @@ case $host in
       AC_SUBST(TARGETFLAGS,"-m32")
       enable_win16=${enable_win16:-yes}
     else
-      if test "x${GCC}" = "xyes"
-      then
-        AC_MSG_CHECKING([whether $CC supports __builtin_ms_va_list])
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
-                          [AC_MSG_RESULT([yes])],
-                          [AC_MSG_RESULT([no])
-                           AC_MSG_ERROR([You need gcc >= 4.4 to build Wine as 64-bit.])])
-      fi
       host_cpu="x86_64"
       AC_SUBST(TARGETFLAGS,"-m64")
     fi
@@ -187,6 +179,22 @@ case $host in
     ;;
 esac
 
+case $host_cpu in
+  x86_64*|amd64*)
+    if test "x$enable_win64" == "xyes" -o "$cross_compiling" == "yes"
+    then
+      if test "x${GCC}" = "xyes"
+      then
+        AC_MSG_CHECKING([whether $CC supports __builtin_ms_va_list])
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
+                          [AC_MSG_RESULT([yes])],
+                          [AC_MSG_RESULT([no])
+                           AC_MSG_ERROR([You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit.])])
+      fi
+    fi
+    ;;
+esac
+
 dnl enable_win16 defaults to yes on x86, to no on other CPUs
 enable_win16=${enable_win16:-no}
 enable_win64=${enable_win64:-no}
-- 
2.5.3




More information about the wine-patches mailing list