configure: Move cache handling into the WINE_TRY_CFLAGS macro.

This commit is contained in:
Alexandre Julliard 2006-08-25 13:22:33 +02:00
parent d75cc5aad5
commit 182d150aa9
3 changed files with 178 additions and 246 deletions

9
aclocal.m4 vendored
View File

@ -65,11 +65,18 @@ dnl **** Check if we can link an empty program with special CFLAGS ****
dnl
dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
dnl
dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
dnl
AC_DEFUN([WINE_TRY_CFLAGS],
[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
[ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS $1"
AC_TRY_LINK([],[],[$2],[$3])
AC_TRY_LINK([],[], [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
CFLAGS=$ac_wine_try_cflags_saved])
AS_IF([test AS_VAR_GET(ac_var) = yes],
[m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
AS_VAR_POPDEF([ac_var])])
dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
dnl

291
configure vendored
View File

@ -14386,9 +14386,10 @@ echo "${ECHO_T}$ac_cv_c_gcc_strength_bug" >&6; }
EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
fi
{ echo "$as_me:$LINENO: checking for gcc -fshort-wchar support" >&5
echo $ECHO_N "checking for gcc -fshort-wchar support... $ECHO_C" >&6; }
if test "${ac_cv_c_gcc_fshort_wchar+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -fshort-wchar" >&5
echo $ECHO_N "checking whether the compiler supports -fshort-wchar... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fshort_wchar+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -14442,32 +14443,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_gcc_fshort_wchar="yes"
ac_cv_cflags__fshort_wchar=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_gcc_fshort_wchar="no"
ac_cv_cflags__fshort_wchar=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_gcc_fshort_wchar" >&5
echo "${ECHO_T}$ac_cv_c_gcc_fshort_wchar" >&6; }
if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
then
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fshort_wchar" >&5
echo "${ECHO_T}$ac_cv_cflags__fshort_wchar" >&6; }
if test $ac_cv_cflags__fshort_wchar = yes; then
cat >>confdefs.h <<\_ACEOF
#define CC_FLAG_SHORT_WCHAR "-fshort-wchar"
_ACEOF
fi
fi
{ echo "$as_me:$LINENO: checking for gcc -fno-strict-aliasing support" >&5
echo $ECHO_N "checking for gcc -fno-strict-aliasing support... $ECHO_C" >&6; }
if test "${ac_cv_c_gcc_no_strict_aliasing+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -fno-strict-aliasing" >&5
echo $ECHO_N "checking whether the compiler supports -fno-strict-aliasing... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fno_strict_aliasing+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -14521,28 +14521,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_gcc_no_strict_aliasing="yes"
ac_cv_cflags__fno_strict_aliasing=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_gcc_no_strict_aliasing="no"
ac_cv_cflags__fno_strict_aliasing=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_gcc_no_strict_aliasing" >&5
echo "${ECHO_T}$ac_cv_c_gcc_no_strict_aliasing" >&6; }
if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fno_strict_aliasing" >&5
echo "${ECHO_T}$ac_cv_cflags__fno_strict_aliasing" >&6; }
if test $ac_cv_cflags__fno_strict_aliasing = yes; then
EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
fi
{ echo "$as_me:$LINENO: checking for gcc -gstabs+ support" >&5
echo $ECHO_N "checking for gcc -gstabs+ support... $ECHO_C" >&6; }
if test "${ac_cv_c_gcc_gstabs+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -gstabs+" >&5
echo $ECHO_N "checking whether the compiler supports -gstabs+... $ECHO_C" >&6; }
if test "${ac_cv_cflags__gstabsp+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -14596,28 +14595,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_gcc_gstabs="yes"
ac_cv_cflags__gstabsp=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_gcc_gstabs="no"
ac_cv_cflags__gstabsp=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_gcc_gstabs" >&5
echo "${ECHO_T}$ac_cv_c_gcc_gstabs" >&6; }
if test "$ac_cv_c_gcc_gstabs" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__gstabsp" >&5
echo "${ECHO_T}$ac_cv_cflags__gstabsp" >&6; }
if test $ac_cv_cflags__gstabsp = yes; then
EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
fi
{ echo "$as_me:$LINENO: checking for gcc -Wdeclaration-after-statement support" >&5
echo $ECHO_N "checking for gcc -Wdeclaration-after-statement support... $ECHO_C" >&6; }
if test "${ac_cv_c_gcc_decl_after_statement+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -Wdeclaration-after-statement" >&5
echo $ECHO_N "checking whether the compiler supports -Wdeclaration-after-statement... $ECHO_C" >&6; }
if test "${ac_cv_cflags__Wdeclaration_after_statement+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -14671,28 +14669,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_gcc_decl_after_statement="yes"
ac_cv_cflags__Wdeclaration_after_statement=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_gcc_decl_after_statement="no"
ac_cv_cflags__Wdeclaration_after_statement=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_gcc_decl_after_statement" >&5
echo "${ECHO_T}$ac_cv_c_gcc_decl_after_statement" >&6; }
if test "$ac_cv_c_gcc_decl_after_statement" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__Wdeclaration_after_statement" >&5
echo "${ECHO_T}$ac_cv_cflags__Wdeclaration_after_statement" >&6; }
if test $ac_cv_cflags__Wdeclaration_after_statement = yes; then
EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement"
fi
{ echo "$as_me:$LINENO: checking for gcc -Wwrite-strings support" >&5
echo $ECHO_N "checking for gcc -Wwrite-strings support... $ECHO_C" >&6; }
if test "${ac_cv_c_gcc_write_strings+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -Wwrite-strings" >&5
echo $ECHO_N "checking whether the compiler supports -Wwrite-strings... $ECHO_C" >&6; }
if test "${ac_cv_cflags__Wwrite_strings+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -14746,24 +14743,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_gcc_write_strings="yes"
ac_cv_cflags__Wwrite_strings=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_gcc_write_strings="no"
ac_cv_cflags__Wwrite_strings=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_gcc_write_strings" >&5
echo "${ECHO_T}$ac_cv_c_gcc_write_strings" >&6; }
if test "$ac_cv_c_gcc_write_strings" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__Wwrite_strings" >&5
echo "${ECHO_T}$ac_cv_cflags__Wwrite_strings" >&6; }
if test $ac_cv_cflags__Wwrite_strings = yes; then
EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings"
fi
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wpointer-arith -Werror"
@ -15519,9 +15516,9 @@ echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6; }
then
LDSHARED="\$(CC) -shared"
LDDLLFLAGS="-shared -Wl,-Bsymbolic"
{ echo "$as_me:$LINENO: checking whether the linker accepts soname" >&5
echo $ECHO_N "checking whether the linker accepts soname... $ECHO_C" >&6; }
if test "${ac_cv_c_sonames+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -15575,27 +15572,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_sonames="yes"
ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_sonames="no"
ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_sonames" >&5
echo "${ECHO_T}$ac_cv_c_sonames" >&6; }
if test "$ac_cv_c_sonames" = "yes"
then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
else
{ echo "$as_me:$LINENO: checking check to see if -h soname is an alternate" >&5
echo $ECHO_N "checking check to see if -h soname is an alternate... $ECHO_C" >&6; }
if test "${ac_cv_c_h_sonames+set}" = set; then
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1 = yes; then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
else
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -15649,29 +15645,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_h_sonames="yes"
ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_h_sonames="no"
ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_h_sonames" >&5
echo "${ECHO_T}$ac_cv_c_h_sonames" >&6; }
if test "$ac_cv_c_h_sonames" = "yes"
then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1 = yes; then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
fi
{ echo "$as_me:$LINENO: checking whether the linker accepts -z defs" >&5
echo $ECHO_N "checking whether the linker accepts -z defs... $ECHO_C" >&6; }
if test "${ac_cv_c_dll_zdefs+set}" = set; then
fi
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -15725,28 +15722,28 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_dll_zdefs="yes"
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_dll_zdefs="no"
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_zdefs" >&5
echo "${ECHO_T}$ac_cv_c_dll_zdefs" >&6; }
if test "$ac_cv_c_dll_zdefs" = "yes"
then
LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs = yes; then
LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
fi
{ echo "$as_me:$LINENO: checking whether the linker accepts -init and -fini" >&5
echo $ECHO_N "checking whether the linker accepts -init and -fini... $ECHO_C" >&6; }
if test "${ac_cv_c_dll_init_fini+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -15800,32 +15797,32 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_dll_init_fini="yes"
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_dll_init_fini="no"
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_dll_init_fini" >&5
echo "${ECHO_T}$ac_cv_c_dll_init_fini" >&6; }
if test "$ac_cv_c_dll_init_fini" = "yes"
then
LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini = yes; then
LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
fi
{ echo "$as_me:$LINENO: checking whether the linker accepts version scripts" >&5
echo $ECHO_N "checking whether the linker accepts version scripts... $ECHO_C" >&6; }
if test "${ac_cv_c_ld_version_scripts+set}" = set; then
echo '{ global: *; };' >conftest.map
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -shared -Wl,--version-script=conftest.map" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -shared -Wl,--version-script=conftest.map... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
echo '{ global: *; };' >conftest.map
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,--version-script=conftest.map"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@ -15876,29 +15873,29 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_ld_version_scripts="yes"
ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_ld_version_scripts="no"
ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
rm -f conftest.map
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_ld_version_scripts" >&5
echo "${ECHO_T}$ac_cv_c_ld_version_scripts" >&6; }
if test "$ac_cv_c_ld_version_scripts" = "yes"
then
LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&6; }
if test $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map = yes; then
LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
fi
{ echo "$as_me:$LINENO: checking whether the linker accepts --export-dynamic" >&5
echo $ECHO_N "checking whether the linker accepts --export-dynamic... $ECHO_C" >&6; }
if test "${ac_cv_c_export_dynamic+set}" = set; then
rm -f conftest.map
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -Wl,--export-dynamic... $ECHO_C" >&6; }
if test "${ac_cv_cflags__fPIC__Wl___export_dynamic+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -15952,29 +15949,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_export_dynamic="yes"
ac_cv_cflags__fPIC__Wl___export_dynamic=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_export_dynamic="no"
ac_cv_cflags__fPIC__Wl___export_dynamic=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_export_dynamic" >&5
echo "${ECHO_T}$ac_cv_c_export_dynamic" >&6; }
if test "$ac_cv_c_export_dynamic" = "yes"
then
LDEXECFLAGS="-Wl,--export-dynamic"
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fPIC__Wl___export_dynamic" >&5
echo "${ECHO_T}$ac_cv_cflags__fPIC__Wl___export_dynamic" >&6; }
if test $ac_cv_cflags__fPIC__Wl___export_dynamic = yes; then
LDEXECFLAGS="-Wl,--export-dynamic"
fi
fi
{ echo "$as_me:$LINENO: checking whether the linker accepts --rpath" >&5
echo $ECHO_N "checking whether the linker accepts --rpath... $ECHO_C" >&6; }
if test "${ac_cv_ld_rpath+set}" = set; then
as_ac_var=`echo "ac_cv_cflags_-fPIC -Wl,--rpath,\$ORIGIN/../lib" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking whether the compiler supports -fPIC -Wl,--rpath,\$ORIGIN/../lib" >&5
echo $ECHO_N "checking whether the compiler supports -fPIC -Wl,--rpath,\$ORIGIN/../lib... $ECHO_C" >&6; }
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -16028,31 +16026,32 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_ld_rpath="yes"
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_ld_rpath="no"
eval "$as_ac_var=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_ld_rpath" >&5
echo "${ECHO_T}$ac_cv_ld_rpath" >&6; }
if test "$ac_cv_ld_rpath" = "yes"
then
LDEXERPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
ac_res=`eval echo '${'$as_ac_var'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_var'}'` = yes; then
LDEXERPATH="-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
fi
fi
case $host_cpu in
*i[3456789]86* | x86_64)
{ echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x7bf00000" >&5
echo $ECHO_N "checking whether we can relocate the executable to 0x7bf00000... $ECHO_C" >&6; }
if test "${ac_cv_ld_reloc_exec+set}" = set; then
{ echo "$as_me:$LINENO: checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400" >&5
echo $ECHO_N "checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400... $ECHO_C" >&6; }
if test "${ac_cv_cflags__Wl___section_start__interp_0x7bf00400+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_wine_try_cflags_saved=$CFLAGS
@ -16106,24 +16105,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_ld_reloc_exec="yes"
ac_cv_cflags__Wl___section_start__interp_0x7bf00400=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_ld_reloc_exec="no"
ac_cv_cflags__Wl___section_start__interp_0x7bf00400=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6; }
if test "$ac_cv_ld_reloc_exec" = "yes"
then
LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
fi
{ echo "$as_me:$LINENO: result: $ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&5
echo "${ECHO_T}$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&6; }
if test $ac_cv_cflags__Wl___section_start__interp_0x7bf00400 = yes; then
LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
fi
;;
esac

View File

@ -915,47 +915,15 @@ int main(void) {
EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
fi
dnl Check for -fshort-wchar
AC_CACHE_CHECK([for gcc -fshort-wchar support], ac_cv_c_gcc_fshort_wchar,
[WINE_TRY_CFLAGS([-fshort-wchar],
ac_cv_c_gcc_fshort_wchar="yes",ac_cv_c_gcc_fshort_wchar="no")])
if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
then
AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", [Specifies the compiler flag that forces a short wchar_t])
fi
dnl Check for some compiler flags
dnl Check for -fno-strict-aliasing
AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing,
[WINE_TRY_CFLAGS([-fno-strict-aliasing],
ac_cv_c_gcc_no_strict_aliasing="yes",ac_cv_c_gcc_no_strict_aliasing="no")])
if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
fi
dnl Check for -gstabs+ option
AC_CACHE_CHECK([for gcc -gstabs+ support], ac_cv_c_gcc_gstabs,
[WINE_TRY_CFLAGS([-gstabs+],ac_cv_c_gcc_gstabs="yes", ac_cv_c_gcc_gstabs="no")])
if test "$ac_cv_c_gcc_gstabs" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
fi
dnl Check for -Wdeclaration-after-statement option
AC_CACHE_CHECK([for gcc -Wdeclaration-after-statement support], ac_cv_c_gcc_decl_after_statement,
[WINE_TRY_CFLAGS([-Wdeclaration-after-statement],ac_cv_c_gcc_decl_after_statement="yes", ac_cv_c_gcc_decl_after_statement="no")])
if test "$ac_cv_c_gcc_decl_after_statement" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement"
fi
dnl Check for -Wwrite-strings
AC_CACHE_CHECK([for gcc -Wwrite-strings support], ac_cv_c_gcc_write_strings,
[WINE_TRY_CFLAGS([-Wwrite-strings],ac_cv_c_gcc_write_strings="yes", ac_cv_c_gcc_write_strings="no")])
if test "$ac_cv_c_gcc_write_strings" = "yes"
then
EXTRACFLAGS="$EXTRACFLAGS -Wwrite-strings"
fi
WINE_TRY_CFLAGS([-fshort-wchar],
[AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar",
[Specifies the compiler flag that forces a short wchar_t])])
WINE_TRY_CFLAGS([-fno-strict-aliasing])
WINE_TRY_CFLAGS([-gstabs+])
WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
WINE_TRY_CFLAGS([-Wwrite-strings])
dnl Check for noisy string.h
saved_CFLAGS="$CFLAGS"
@ -1079,73 +1047,31 @@ case $host_os in
then
LDSHARED="\$(CC) -shared"
LDDLLFLAGS="-shared -Wl,-Bsymbolic"
AC_CACHE_CHECK([whether the linker accepts soname], ac_cv_c_sonames,
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
ac_cv_c_sonames="yes",ac_cv_c_sonames="no")])
if test "$ac_cv_c_sonames" = "yes"
then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
else
AC_CACHE_CHECK([check to see if -h soname is an alternate], ac_cv_c_h_sonames,
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
ac_cv_c_h_sonames="yes",ac_cv_c_h_sonames="no")])
if test "$ac_cv_c_h_sonames" = "yes"
then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
fi
fi
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
[LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"],
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
[LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"])])
AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
if test "$ac_cv_c_dll_zdefs" = "yes"
then
LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
fi
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs], [LDDLLFLAGS="$LDDLLFLAGS,-z,defs"])
AC_CACHE_CHECK([whether the linker accepts -init and -fini], ac_cv_c_dll_init_fini,
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
ac_cv_c_dll_init_fini="yes",ac_cv_c_dll_init_fini="no")])
if test "$ac_cv_c_dll_init_fini" = "yes"
then
LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
fi
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
[LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"])
AC_CACHE_CHECK([whether the linker accepts version scripts], ac_cv_c_ld_version_scripts,
[echo '{ global: *; };' >conftest.map
WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
ac_cv_c_ld_version_scripts="yes",ac_cv_c_ld_version_scripts="no")
rm -f conftest.map])
if test "$ac_cv_c_ld_version_scripts" = "yes"
then
LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
fi
echo '{ global: *; };' >conftest.map
WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
[LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"])
rm -f conftest.map
AC_CACHE_CHECK([whether the linker accepts --export-dynamic], ac_cv_c_export_dynamic,
[WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
ac_cv_c_export_dynamic="yes",ac_cv_c_export_dynamic="no")])
if test "$ac_cv_c_export_dynamic" = "yes"
then
AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])
fi
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])])
AC_CACHE_CHECK([whether the linker accepts --rpath], ac_cv_ld_rpath,
[WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
ac_cv_ld_rpath="yes",ac_cv_ld_rpath="no")])
if test "$ac_cv_ld_rpath" = "yes"
then
AC_SUBST(LDEXERPATH,["-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"])
fi
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
[AC_SUBST(LDEXERPATH,["-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"])])
case $host_cpu in
*i[[3456789]]86* | x86_64)
AC_CACHE_CHECK([whether we can relocate the executable to 0x7bf00000], ac_cv_ld_reloc_exec,
[WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
ac_cv_ld_reloc_exec="yes", ac_cv_ld_reloc_exec="no")])
if test "$ac_cv_ld_reloc_exec" = "yes"
then
LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
fi
WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
[LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"])
;;
esac