configure: Check for supported warning flags also for the cross-compiler.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-04-05 18:47:44 +02:00
parent 3e6a4c4a5c
commit 870f99eced
5 changed files with 699 additions and 1 deletions

View File

@ -42,6 +42,7 @@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CROSSCFLAGS = @CROSSCFLAGS@
EXTRACFLAGS = @EXTRACFLAGS@
EXTRACROSSCFLAGS= @EXTRACROSSCFLAGS@
MSVCRTFLAGS = @BUILTINFLAG@
TARGETFLAGS = @TARGETFLAGS@
UNWINDFLAGS = @UNWINDFLAGS@

23
aclocal.m4 vendored
View File

@ -149,6 +149,29 @@ CFLAGS=$ac_wine_try_cflags_saved])
AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
AS_VAR_POPDEF([ac_var])])
dnl **** Check if we can link an empty program with special CFLAGS ****
dnl
dnl Usage: WINE_TRY_CROSSCFLAGS(flags,[action-if-yes,[action-if-no]])
dnl
dnl The default action-if-yes is to append the flags to EXTRACROSSCFLAGS.
dnl
AC_DEFUN([WINE_TRY_CROSSCFLAGS],
[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the cross-compiler supports $1], ac_var,
[ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS $1"
CC="$CROSSCC"
ac_exeext=".exe"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
[AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext])
AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS $1"])], [$3])dnl
AS_VAR_POPDEF([ac_var])])
dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
dnl
dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])

636
configure vendored
View File

@ -701,6 +701,7 @@ X_PRE_LIBS
X_CFLAGS
XMKMF
PTHREAD_LIBS
EXTRACROSSCFLAGS
CROSSCFLAGS
CROSSCC
CROSSTARGET
@ -9702,6 +9703,641 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CC="$ac_save_CC"
CROSSCFLAGS=${CROSSCFLAGS:-$CFLAGS}
EXTRACROSSCFLAGS="-DWINE_CROSSTEST -Wall"
saved_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -fno-strict-aliasing" >&5
$as_echo_n "checking whether the cross-compiler supports -fno-strict-aliasing... " >&6; }
if ${ac_cv_cflags__fno_strict_aliasing+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -fno-strict-aliasing"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__fno_strict_aliasing=yes
else
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
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_strict_aliasing" >&5
$as_echo "$ac_cv_cflags__fno_strict_aliasing" >&6; }
if test "x$ac_cv_cflags__fno_strict_aliasing" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -fno-strict-aliasing"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Werror=unknown-warning-option" >&5
$as_echo_n "checking whether the cross-compiler supports -Werror=unknown-warning-option... " >&6; }
if ${ac_cv_cflags__Werror_unknown_warning_option+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unknown_warning_option=yes
else
ac_cv_cflags__Werror_unknown_warning_option=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unknown_warning_option" >&5
$as_echo "$ac_cv_cflags__Werror_unknown_warning_option" >&6; }
if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Werror=unknown-warning-option"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wdeclaration-after-statement" >&5
$as_echo_n "checking whether the cross-compiler supports -Wdeclaration-after-statement... " >&6; }
if ${ac_cv_cflags__Wdeclaration_after_statement+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wdeclaration_after_statement=yes
else
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
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wdeclaration_after_statement" >&5
$as_echo "$ac_cv_cflags__Wdeclaration_after_statement" >&6; }
if test "x$ac_cv_cflags__Wdeclaration_after_statement" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wdeclaration-after-statement"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wempty-body" >&5
$as_echo_n "checking whether the cross-compiler supports -Wempty-body... " >&6; }
if ${ac_cv_cflags__Wempty_body+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wempty-body"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wempty_body=yes
else
ac_cv_cflags__Wempty_body=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wempty_body" >&5
$as_echo "$ac_cv_cflags__Wempty_body" >&6; }
if test "x$ac_cv_cflags__Wempty_body" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wempty-body"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wignored-qualifiers" >&5
$as_echo_n "checking whether the cross-compiler supports -Wignored-qualifiers... " >&6; }
if ${ac_cv_cflags__Wignored_qualifiers+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wignored-qualifiers"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wignored_qualifiers=yes
else
ac_cv_cflags__Wignored_qualifiers=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wignored_qualifiers" >&5
$as_echo "$ac_cv_cflags__Wignored_qualifiers" >&6; }
if test "x$ac_cv_cflags__Wignored_qualifiers" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wignored-qualifiers"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wpacked-not-aligned" >&5
$as_echo_n "checking whether the cross-compiler supports -Wpacked-not-aligned... " >&6; }
if ${ac_cv_cflags__Wpacked_not_aligned+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wpacked-not-aligned"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wpacked_not_aligned=yes
else
ac_cv_cflags__Wpacked_not_aligned=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpacked_not_aligned" >&5
$as_echo "$ac_cv_cflags__Wpacked_not_aligned" >&6; }
if test "x$ac_cv_cflags__Wpacked_not_aligned" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wno-packed-not-aligned"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wpragma-pack" >&5
$as_echo_n "checking whether the cross-compiler supports -Wpragma-pack... " >&6; }
if ${ac_cv_cflags__Wpragma_pack+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wpragma-pack"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wpragma_pack=yes
else
ac_cv_cflags__Wpragma_pack=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpragma_pack" >&5
$as_echo "$ac_cv_cflags__Wpragma_pack" >&6; }
if test "x$ac_cv_cflags__Wpragma_pack" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wno-pragma-pack"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wshift-overflow=2" >&5
$as_echo_n "checking whether the cross-compiler supports -Wshift-overflow=2... " >&6; }
if ${ac_cv_cflags__Wshift_overflow_2+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wshift-overflow=2"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wshift_overflow_2=yes
else
ac_cv_cflags__Wshift_overflow_2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wshift_overflow_2" >&5
$as_echo "$ac_cv_cflags__Wshift_overflow_2" >&6; }
if test "x$ac_cv_cflags__Wshift_overflow_2" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wshift-overflow=2"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wstrict-prototypes" >&5
$as_echo_n "checking whether the cross-compiler supports -Wstrict-prototypes... " >&6; }
if ${ac_cv_cflags__Wstrict_prototypes+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wstrict-prototypes"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wstrict_prototypes=yes
else
ac_cv_cflags__Wstrict_prototypes=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wstrict_prototypes" >&5
$as_echo "$ac_cv_cflags__Wstrict_prototypes" >&6; }
if test "x$ac_cv_cflags__Wstrict_prototypes" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wstrict-prototypes"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wtype-limits" >&5
$as_echo_n "checking whether the cross-compiler supports -Wtype-limits... " >&6; }
if ${ac_cv_cflags__Wtype_limits+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wtype-limits"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wtype_limits=yes
else
ac_cv_cflags__Wtype_limits=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wtype_limits" >&5
$as_echo "$ac_cv_cflags__Wtype_limits" >&6; }
if test "x$ac_cv_cflags__Wtype_limits" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wtype-limits"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wunused-but-set-parameter" >&5
$as_echo_n "checking whether the cross-compiler supports -Wunused-but-set-parameter... " >&6; }
if ${ac_cv_cflags__Wunused_but_set_parameter+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wunused-but-set-parameter"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wunused_but_set_parameter=yes
else
ac_cv_cflags__Wunused_but_set_parameter=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wunused_but_set_parameter" >&5
$as_echo "$ac_cv_cflags__Wunused_but_set_parameter" >&6; }
if test "x$ac_cv_cflags__Wunused_but_set_parameter" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wunused-but-set-parameter"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wvla" >&5
$as_echo_n "checking whether the cross-compiler supports -Wvla... " >&6; }
if ${ac_cv_cflags__Wvla+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wvla"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wvla=yes
else
ac_cv_cflags__Wvla=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wvla" >&5
$as_echo "$ac_cv_cflags__Wvla" >&6; }
if test "x$ac_cv_cflags__Wvla" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wvla"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wwrite-strings" >&5
$as_echo_n "checking whether the cross-compiler supports -Wwrite-strings... " >&6; }
if ${ac_cv_cflags__Wwrite_strings+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wwrite-strings"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wwrite_strings=yes
else
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
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wwrite_strings" >&5
$as_echo "$ac_cv_cflags__Wwrite_strings" >&6; }
if test "x$ac_cv_cflags__Wwrite_strings" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wwrite-strings"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wpointer-arith" >&5
$as_echo_n "checking whether the cross-compiler supports -Wpointer-arith... " >&6; }
if ${ac_cv_cflags__Wpointer_arith+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wpointer-arith"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wpointer_arith=yes
else
ac_cv_cflags__Wpointer_arith=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wpointer_arith" >&5
$as_echo "$ac_cv_cflags__Wpointer_arith" >&6; }
if test "x$ac_cv_cflags__Wpointer_arith" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wpointer-arith"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wlogical-op" >&5
$as_echo_n "checking whether the cross-compiler supports -Wlogical-op... " >&6; }
if ${ac_cv_cflags__Wlogical_op+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wlogical-op"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wlogical_op=yes
else
ac_cv_cflags__Wlogical_op=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wlogical_op" >&5
$as_echo "$ac_cv_cflags__Wlogical_op" >&6; }
if test "x$ac_cv_cflags__Wlogical_op" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wlogical-op"
fi
case $host_cpu in
*i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -fno-omit-frame-pointer" >&5
$as_echo_n "checking whether the cross-compiler supports -fno-omit-frame-pointer... " >&6; }
if ${ac_cv_cflags__fno_omit_frame_pointer+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -fno-omit-frame-pointer"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__fno_omit_frame_pointer=yes
else
ac_cv_cflags__fno_omit_frame_pointer=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_omit_frame_pointer" >&5
$as_echo "$ac_cv_cflags__fno_omit_frame_pointer" >&6; }
if test "x$ac_cv_cflags__fno_omit_frame_pointer" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -fno-omit-frame-pointer"
fi ;;
x86_64) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wno-format" >&5
$as_echo_n "checking whether the cross-compiler supports -Wno-format... " >&6; }
if ${ac_cv_cflags__Wno_format+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Wno-format"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Wno_format=yes
else
ac_cv_cflags__Wno_format=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wno_format" >&5
$as_echo "$ac_cv_cflags__Wno_format" >&6; }
if test "x$ac_cv_cflags__Wno_format" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wno-format"
fi ;;
esac
CFLAGS=$saved_CFLAGS
for ac_flag in $CFLAGS; do
case $ac_flag in
-g) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-2" >&5
$as_echo_n "checking whether the cross-compiler supports -gdwarf-2... " >&6; }
if ${ac_cv_cflags__gdwarf_2+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -gdwarf-2"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__gdwarf_2=yes
else
ac_cv_cflags__gdwarf_2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__gdwarf_2" >&5
$as_echo "$ac_cv_cflags__gdwarf_2" >&6; }
if test "x$ac_cv_cflags__gdwarf_2" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-2"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5
$as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; }
if ${ac_cv_cflags__gstrict_dwarf+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -gstrict-dwarf"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__gstrict_dwarf=yes
else
ac_cv_cflags__gstrict_dwarf=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__gstrict_dwarf" >&5
$as_echo "$ac_cv_cflags__gstrict_dwarf" >&6; }
if test "x$ac_cv_cflags__gstrict_dwarf" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf"
fi ;;
esac
done
test "x$enable_maintainer_mode" != "xyes" || { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Werror" >&5
$as_echo_n "checking whether the cross-compiler supports -Werror... " >&6; }
if ${ac_cv_cflags__Werror+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
ac_wine_try_cflags_saved_cc=$CC
ac_wine_try_cflags_saved_exeext=$ac_exeext
CFLAGS="$CFLAGS -Werror"
CC="$CROSSCC"
ac_exeext=".exe"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror=yes
else
ac_cv_cflags__Werror=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
CC=$ac_wine_try_cflags_saved_cc
ac_exeext=$ac_wine_try_cflags_saved_exeext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror" >&5
$as_echo "$ac_cv_cflags__Werror" >&6; }
if test "x$ac_cv_cflags__Werror" = xyes; then :
EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Werror"
fi
fi
fi
if test "x$CROSSTARGET" = "x"; then :

View File

@ -1019,6 +1019,42 @@ then
[AC_MSG_RESULT([no])])
CC="$ac_save_CC"
AC_SUBST(CROSSCFLAGS,${CROSSCFLAGS:-$CFLAGS})
AC_SUBST(EXTRACROSSCFLAGS,"-DWINE_CROSSTEST -Wall")
dnl clang needs to be told to fail on unknown options
saved_CFLAGS=$CFLAGS
WINE_TRY_CROSSCFLAGS([-fno-strict-aliasing])
WINE_TRY_CROSSCFLAGS([-Werror=unknown-warning-option])
WINE_TRY_CROSSCFLAGS([-Wdeclaration-after-statement])
WINE_TRY_CROSSCFLAGS([-Wempty-body])
WINE_TRY_CROSSCFLAGS([-Wignored-qualifiers])
WINE_TRY_CROSSCFLAGS([-Wpacked-not-aligned],[EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wno-packed-not-aligned"])
WINE_TRY_CROSSCFLAGS([-Wpragma-pack],[EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wno-pragma-pack"])
WINE_TRY_CROSSCFLAGS([-Wshift-overflow=2])
WINE_TRY_CROSSCFLAGS([-Wstrict-prototypes])
WINE_TRY_CROSSCFLAGS([-Wtype-limits])
WINE_TRY_CROSSCFLAGS([-Wunused-but-set-parameter])
WINE_TRY_CROSSCFLAGS([-Wvla])
WINE_TRY_CROSSCFLAGS([-Wwrite-strings])
WINE_TRY_CROSSCFLAGS([-Wpointer-arith])
WINE_TRY_CROSSCFLAGS([-Wlogical-op])
case $host_cpu in
*i[[3456789]]86*) WINE_TRY_CROSSCFLAGS([-fno-omit-frame-pointer]) ;;
x86_64) WINE_TRY_CROSSCFLAGS([-Wno-format]) ;;
esac
CFLAGS=$saved_CFLAGS
dnl Default to dwarf-2 debug info
for ac_flag in $CFLAGS; do
case $ac_flag in
-g) WINE_TRY_CROSSCFLAGS([-gdwarf-2])
WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
esac
done
test "x$enable_maintainer_mode" != "xyes" || WINE_TRY_CROSSCFLAGS([-Werror])
fi
fi
WINE_NOTICE_WITH(mingw,[test "x$CROSSTARGET" = "x"],

View File

@ -132,6 +132,7 @@ static struct strarray dll_flags;
static struct strarray target_flags;
static struct strarray msvcrt_flags;
static struct strarray extra_cflags;
static struct strarray extra_cross_cflags;
static struct strarray cpp_flags;
static struct strarray unwind_flags;
static struct strarray libs;
@ -2958,7 +2959,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
output_filenames( make->define_args );
output_filenames( extradefs );
if (make->use_msvcrt) output_filenames( msvcrt_flags );
output_filename( "-DWINE_CROSSTEST" );
output_filenames( extra_cross_cflags );
output_filenames( cpp_flags );
output_filename( "$(CROSSCFLAGS)" );
output( "\n" );
@ -4200,6 +4201,7 @@ int main( int argc, char *argv[] )
msvcrt_flags = get_expanded_make_var_array( top_makefile, "MSVCRTFLAGS" );
dll_flags = get_expanded_make_var_array( top_makefile, "DLLFLAGS" );
extra_cflags = get_expanded_make_var_array( top_makefile, "EXTRACFLAGS" );
extra_cross_cflags = get_expanded_make_var_array( top_makefile, "EXTRACROSSCFLAGS" );
cpp_flags = get_expanded_make_var_array( top_makefile, "CPPFLAGS" );
unwind_flags = get_expanded_make_var_array( top_makefile, "UNWINDFLAGS" );
libs = get_expanded_make_var_array( top_makefile, "LIBS" );