aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-12-03 11:51:52 +0000
committerWerner Koch <[email protected]>2015-12-03 11:51:52 +0000
commit4e9957250eee3521dc979912a4818e58ffddc5b8 (patch)
tree8fd04b6d230d2c772c096204d6560c015c89d2f5
parentgpg: Additional comment on commit a28ac99e. (diff)
downloadgnupg-4e9957250eee3521dc979912a4818e58ffddc5b8.tar.gz
gnupg-4e9957250eee3521dc979912a4818e58ffddc5b8.zip
build: Change how caller provided CFLAGS are used by configure.
* configure.ac: Append instead of prepend caller provided CFLAGS. -- Suggested-by: Justus Winter Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--configure.ac34
1 files changed, 16 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 81a1eca61..412ea8b88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -661,14 +661,14 @@ case "${host}" in
*-*-hpux*)
if test -z "$GCC" ; then
- CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
+ CFLAGS="-Ae -D_HPUX_SOURCE $CFLAGS"
fi
;;
*-dec-osf4*)
if test -z "$GCC" ; then
# Suppress all warnings
# to get rid of the unsigned/signed char mismatch warnings.
- CFLAGS="$CFLAGS -w"
+ CFLAGS="-w $CFLAGS"
fi
;;
*-dec-osf5*)
@@ -677,7 +677,7 @@ case "${host}" in
# get rid of the unsigned/signed char mismatch warnings.
# Using this may hide other pointer mismatch warnings, but
# it at least lets other warning classes through
- CFLAGS="$CFLAGS -msg_disable ptrmismatch1"
+ CFLAGS="-msg_disable ptrmismatch1 $CFLAGS"
fi
;;
m68k-atari-mint)
@@ -1492,6 +1492,9 @@ AC_SUBST(W32SOCKLIBS)
#
AC_MSG_NOTICE([checking for cc features])
if test "$GCC" = yes; then
+ mycflags=
+ mycflags_save=$CFLAGS
+
# Check whether gcc does not emit a diagnositc for unknow -Wno-*
# options. This is the case for gcc >= 4.6
AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
@@ -1505,60 +1508,55 @@ if test "$GCC" = yes; then
# warning options and the user should have a chance of overriding
# them.
if test "$USE_MAINTAINER_MODE" = "yes"; then
- CFLAGS="$CFLAGS -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
- CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
+ mycflags="$mycflags -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+ mycflags="$mycflags -Wformat -Wno-format-y2k -Wformat-security"
if test x"$_gcc_silent_wno" = xyes ; then
_gcc_wopt=yes
else
AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
- _gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-missing-field-initializers"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[_gcc_wopt=yes],[_gcc_wopt=no])
AC_MSG_RESULT($_gcc_wopt)
- CFLAGS=$_gcc_cflags_save;
fi
if test x"$_gcc_wopt" = xyes ; then
- CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
+ mycflags="$mycflags -W -Wno-sign-compare"
+ mycflags="$mycflags -Wno-missing-field-initializers"
fi
AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
- _gcc_cflags_save=$CFLAGS
CFLAGS="-Wdeclaration-after-statement"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
AC_MSG_RESULT($_gcc_wopt)
- CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_wopt" = xyes ; then
- CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+ mycflags="$mycflags -Wdeclaration-after-statement"
fi
else
- CFLAGS="$CFLAGS -Wall"
+ mycflags="$mycflags -Wall"
fi
if test x"$_gcc_silent_wno" = xyes ; then
_gcc_psign=yes
else
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
- _gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[_gcc_psign=yes],[_gcc_psign=no])
AC_MSG_RESULT($_gcc_psign)
- CFLAGS=$_gcc_cflags_save;
fi
if test x"$_gcc_psign" = xyes ; then
- CFLAGS="$CFLAGS -Wno-pointer-sign"
+ mycflags="$mycflags -Wno-pointer-sign"
fi
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
- _gcc_cflags_save=$CFLAGS
CFLAGS="-Wpointer-arith"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
AC_MSG_RESULT($_gcc_psign)
- CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_psign" = xyes ; then
- CFLAGS="$CFLAGS -Wpointer-arith"
+ mycflags="$mycflags -Wpointer-arith"
fi
+
+ CFLAGS="$mycflags $mycflags_save"
fi