configure: Cache results of the compiler checks.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-04-14 14:51:29 +02:00
parent 86a5dc80d8
commit 9b75443c2f
2 changed files with 78 additions and 58 deletions

89
configure vendored
View File

@ -5525,10 +5525,13 @@ case $host in
then then
CC="$CC -m32" CC="$CC -m32"
CXX="$CXX -m32" CXX="$CXX -m32"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5
$as_echo_n "checking whether $CC works... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5
$as_echo_n "checking whether $CC works... " >&6; }
if ${wine_cv_cc_m32+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
int int
@ -5540,15 +5543,16 @@ main ()
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 wine_cv_cc_m32=yes
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 wine_cv_cc_m32=no
$as_echo "no" >&6; }
as_fn_error $? "Cannot build a 32-bit program, you need to install 32-bit development libraries." "$LINENO" 5
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_cc_m32" >&5
$as_echo "$wine_cv_cc_m32" >&6; }
test $wine_cv_cc_m32 != no || as_fn_error $? "Cannot build a 32-bit program, you need to install 32-bit development libraries." "$LINENO" 5
host_cpu="i386" host_cpu="i386"
notice_platform="32-bit " notice_platform="32-bit "
TARGETFLAGS="-m32" TARGETFLAGS="-m32"
@ -5561,7 +5565,10 @@ rm -f core conftest.err conftest.$ac_objext \
then then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5
$as_echo_n "checking whether $CC supports __builtin_ms_va_list... " >&6; } $as_echo_n "checking whether $CC supports __builtin_ms_va_list... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext if ${wine_cv_builtin_ms_va_list+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include <stdarg.h> #include <stdarg.h>
int int
@ -5573,14 +5580,15 @@ void func(__builtin_ms_va_list *args);
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 wine_cv_builtin_ms_va_list=yes
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 wine_cv_builtin_ms_va_list=no
$as_echo "no" >&6; }
as_fn_error $? "You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit." "$LINENO" 5
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_builtin_ms_va_list" >&5
$as_echo "$wine_cv_builtin_ms_va_list" >&6; }
test $wine_cv_builtin_ms_va_list != no || as_fn_error $? "You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit." "$LINENO" 5
fi fi
CC="$CC -m64" CC="$CC -m64"
CXX="$CXX -m64" CXX="$CXX -m64"
@ -5593,7 +5601,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
arm*) arm*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb" >&5
$as_echo_n "checking whether $CC supports Thumb... " >&6; } $as_echo_n "checking whether $CC supports Thumb... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext if ${wine_cv_thumb+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
int ac_test(int i) { return i; } int ac_test(int i) { return i; }
int int
@ -5605,15 +5616,16 @@ asm(".thumb\nblx ac_test\n.arm"); if (ac_test(1)) return 1
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 wine_cv_thumb=yes
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 wine_cv_thumb=no
$as_echo "no" >&6; }
as_fn_error $? "You need a target with Thumb support to build Wine for ARM." "$LINENO" 5
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb" >&5
$as_echo "$wine_cv_thumb" >&6; }
test $wine_cv_thumb != no || as_fn_error $? "You need a target with Thumb support to build Wine for ARM." "$LINENO" 5
case $with_float_abi in case $with_float_abi in
soft|softfp|hard) soft|softfp|hard)
float_abi=$with_float_abi ;; float_abi=$with_float_abi ;;
@ -5627,7 +5639,10 @@ rm -f core conftest.err conftest.$ac_objext \
CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5
$as_echo_n "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; } $as_echo_n "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext if ${wine_cv_float_abi+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
int int
@ -5639,16 +5654,20 @@ asm("vmrs r2,fpscr");
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 wine_cv_float_abi=yes
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 wine_cv_float_abi=no
$as_echo "no" >&6; }
float_abi=soft
as_fn_append wine_warnings "|Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries."
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_float_abi" >&5
$as_echo "$wine_cv_float_abi" >&6; }
if test $wine_cv_float_abi = no
then
float_abi=soft
as_fn_append wine_warnings "|Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries."
fi
CFLAGS=$saved_CFLAGS CFLAGS=$saved_CFLAGS
esac esac
;; ;;
@ -5660,7 +5679,10 @@ rm -f core conftest.err conftest.$ac_objext \
aarch64*) aarch64*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5
$as_echo_n "checking whether $CC supports __builtin_ms_va_list... " >&6; } $as_echo_n "checking whether $CC supports __builtin_ms_va_list... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext if ${wine_cv_builtin_ms_va_list+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include <stdarg.h> #include <stdarg.h>
int int
@ -5672,14 +5694,15 @@ void func(__builtin_ms_va_list *args);
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 wine_cv_builtin_ms_va_list=yes
$as_echo "yes" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 wine_cv_builtin_ms_va_list=no
$as_echo "no" >&6; }
as_fn_error $? "You need clang >= 5.0 to build Wine for arm64." "$LINENO" 5
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_builtin_ms_va_list" >&5
$as_echo "$wine_cv_builtin_ms_va_list" >&6; }
test $wine_cv_builtin_ms_va_list != no || as_fn_error $? "You need clang >= 5.0 to build Wine for arm64." "$LINENO" 5
;; ;;
i[3456789]86*) i[3456789]86*)
enable_win16=${enable_win16:-yes} enable_win16=${enable_win16:-yes}

View File

@ -152,10 +152,9 @@ case $host in
then then
CC="$CC -m32" CC="$CC -m32"
CXX="$CXX -m32" CXX="$CXX -m32"
AC_MSG_CHECKING([whether $CC works]) AC_CACHE_CHECK([whether $CC works], wine_cv_cc_m32,
AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]), [AC_LINK_IFELSE([AC_LANG_PROGRAM()],[wine_cv_cc_m32=yes],[wine_cv_cc_m32=no])])
[AC_MSG_RESULT([no]) test $wine_cv_cc_m32 != no || AC_MSG_ERROR([Cannot build a 32-bit program, you need to install 32-bit development libraries.])
AC_MSG_ERROR([Cannot build a 32-bit program, you need to install 32-bit development libraries.])])
host_cpu="i386" host_cpu="i386"
notice_platform="32-bit " notice_platform="32-bit "
AC_SUBST(TARGETFLAGS,"-m32") AC_SUBST(TARGETFLAGS,"-m32")
@ -165,11 +164,10 @@ case $host in
else else
if test "x${GCC}" = "xyes" if test "x${GCC}" = "xyes"
then then
AC_MSG_CHECKING([whether $CC supports __builtin_ms_va_list]) AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
[AC_MSG_RESULT([yes])], [wine_cv_builtin_ms_va_list=yes],[wine_cv_builtin_ms_va_list=no])])
[AC_MSG_RESULT([no]) test $wine_cv_builtin_ms_va_list != no || AC_MSG_ERROR([You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit.])
AC_MSG_ERROR([You need gcc >= 4.4 or clang >= 3.8 to build Wine as 64-bit.])])
fi fi
CC="$CC -m64" CC="$CC -m64"
CXX="$CXX -m64" CXX="$CXX -m64"
@ -179,11 +177,10 @@ case $host in
fi fi
;; ;;
arm*) arm*)
AC_MSG_CHECKING([whether $CC supports Thumb]) AC_CACHE_CHECK([whether $CC supports Thumb],wine_cv_thumb,
WINE_TRY_ASM_LINK([".thumb\nblx ac_test\n.arm"],[int ac_test(int i) { return i; }], [if (ac_test(1)) return 1], [WINE_TRY_ASM_LINK([".thumb\nblx ac_test\n.arm"],[int ac_test(int i) { return i; }], [if (ac_test(1)) return 1],
[AC_MSG_RESULT([yes])], [wine_cv_thumb=yes],[wine_cv_thumb=no])])
[AC_MSG_RESULT([no]) test $wine_cv_thumb != no || AC_MSG_ERROR([You need a target with Thumb support to build Wine for ARM.])
AC_MSG_ERROR([You need a target with Thumb support to build Wine for ARM.])])
case $with_float_abi in case $with_float_abi in
soft|softfp|hard) soft|softfp|hard)
float_abi=$with_float_abi ;; float_abi=$with_float_abi ;;
@ -195,12 +192,13 @@ case $host in
float_abi=softfp float_abi=softfp
saved_CFLAGS=$CFLAGS saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi" CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
AC_MSG_CHECKING([whether $CC supports -mfloat-abi=$float_abi]) AC_CACHE_CHECK([whether $CC supports -mfloat-abi=$float_abi],wine_cv_float_abi,
WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,, [WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,[wine_cv_float_abi=yes],[wine_cv_float_abi=no])])
[AC_MSG_RESULT([yes])], if test $wine_cv_float_abi = no
[AC_MSG_RESULT([no]) then
float_abi=soft float_abi=soft
WINE_WARNING([Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries.])]) WINE_WARNING([Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries.])
fi
CFLAGS=$saved_CFLAGS CFLAGS=$saved_CFLAGS
esac esac
;; ;;
@ -209,11 +207,10 @@ case $host in
AC_SUBST(TARGETFLAGS,"-marm -mfloat-abi=$float_abi") AC_SUBST(TARGETFLAGS,"-marm -mfloat-abi=$float_abi")
;; ;;
aarch64*) aarch64*)
AC_MSG_CHECKING([whether $CC supports __builtin_ms_va_list]) AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
[AC_MSG_RESULT([yes])], [wine_cv_builtin_ms_va_list=yes],[wine_cv_builtin_ms_va_list=no])])
[AC_MSG_RESULT([no]) test $wine_cv_builtin_ms_va_list != no || AC_MSG_ERROR([You need clang >= 5.0 to build Wine for arm64.])
AC_MSG_ERROR([You need clang >= 5.0 to build Wine for arm64.])])
;; ;;
i[[3456789]]86*) i[[3456789]]86*)
enable_win16=${enable_win16:-yes} enable_win16=${enable_win16:-yes}