configure: Check for working -mabi=ms support on x86_64.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2022-03-01 14:32:27 +01:00
parent bf3ef684e2
commit 9226d0c3d8
2 changed files with 37 additions and 20 deletions

45
configure vendored
View File

@ -19273,34 +19273,41 @@ if test "x$ac_cv_cflags__Wno_format" = xyes
then :
EXTRACFLAGS="$EXTRACFLAGS -Wno-format"
fi ;;
*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -mabi=ms" >&5
printf %s "checking whether the compiler supports -mabi=ms... " >&6; }
if test ${ac_cv_cflags__mabi_ms+y}
*) if test -z "$CROSSTARGET"
then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -mabi=ms" >&5
printf %s "checking for working -mabi=ms... " >&6; }
if test ${ac_cv_mabi_ms+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -mabi=ms"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
CFLAGS="$CFLAGS -mabi=ms"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
#include <stdarg.h>
int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_cflags__mabi_ms=yes
ac_cv_mabi_ms=yes
else $as_nop
ac_cv_cflags__mabi_ms=no
ac_cv_mabi_ms=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$saved_CFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__mabi_ms" >&5
printf "%s\n" "$ac_cv_cflags__mabi_ms" >&6; }
if test "x$ac_cv_cflags__mabi_ms" = xyes
then :
MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms"
fi ;;
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mabi_ms" >&5
printf "%s\n" "$ac_cv_mabi_ms" >&6; }
test $ac_cv_mabi_ms = yes || as_fn_error $? "The compiler doesn't support -mabi=ms. Use gcc instead of clang, or install mingw-w64." "$LINENO" 5
fi
MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;;
esac ;;
esac

View File

@ -1893,7 +1893,17 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
dnl Mingw uses Windows 64-bit types, not Unix ones
cygwin*|mingw32*) WINE_TRY_CFLAGS([-Wno-format]) ;;
dnl Default to ms_abi on 64-bit
*) WINE_TRY_CFLAGS([-mabi=ms],[MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms"]) ;;
*) if test -z "$CROSSTARGET"
then
AC_CACHE_CHECK([for working -mabi=ms], ac_cv_mabi_ms,
[CFLAGS="$CFLAGS -mabi=ms"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }]])],
[ac_cv_mabi_ms=yes],[ac_cv_mabi_ms=no])
CFLAGS=$saved_CFLAGS])
test $ac_cv_mabi_ms = yes || AC_MSG_ERROR([The compiler doesn't support -mabi=ms. Use gcc instead of clang, or install mingw-w64.])
fi
MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;;
esac ;;
esac