do not clobber user CFLAGS

Bug: 10791
Change-Id: I58c35c757039e69111a39100f5ccb306e098d591
Reviewed-on: https://code.wireshark.org/review/10519
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Jeroen Roovers 2015-09-13 19:10:55 -04:00 committed by Michael Mann
parent 72f3b9f74c
commit cf0d762d73
1 changed files with 14 additions and 14 deletions

View File

@ -1645,15 +1645,15 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
CFLAGS_saved="$CFLAGS"
if expr "x$GCC_OPTION" : "x-W.*" >/dev/null
then
CFLAGS="$CFLAGS $ac_wireshark_unknown_warning_option_error $GCC_OPTION"
CFLAGS="$ac_wireshark_unknown_warning_option_error $GCC_OPTION $CFLAGS"
elif expr "x$GCC_OPTION" : "x-f.*" >/dev/null
then
CFLAGS="$CFLAGS -Werror $GCC_OPTION"
CFLAGS="-Werror $GCC_OPTION $CFLAGS"
elif expr "x$GCC_OPTION" : "x-m.*" >/dev/null
then
CFLAGS="$CFLAGS -Werror $GCC_OPTION"
CFLAGS="-Werror $GCC_OPTION $CFLAGS"
else
CFLAGS="$CFLAGS $GCC_OPTION"
CFLAGS="$GCC_OPTION $CFLAGS"
fi
AC_COMPILE_IFELSE(
[
@ -1682,14 +1682,14 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
# added them, by setting CFLAGS to the saved value plus
# just the new option.
#
CFLAGS="$CFLAGS_saved $GCC_OPTION"
CFLAGS="$GCC_OPTION $CFLAGS_saved"
if test "$CC" = "$CC_FOR_BUILD"; then
#
# We're building the build tools with the same compiler
# with which we're building Wireshark, so add the flags
# to the flags for that compiler as well.
#
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION"
CFLAGS_FOR_BUILD="$GCC_OPTION $CFLAGS_FOR_BUILD"
fi
],
[
@ -1702,14 +1702,14 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
# added them, by setting CFLAGS to the saved value plus
# just the new option.
#
CFLAGS="$CFLAGS_saved $GCC_OPTION"
CFLAGS="$GCC_OPTION $CFLAGS_saved"
if test "$CC" = "$CC_FOR_BUILD"; then
#
# We're building the build tools with the same compiler
# with which we're building Wireshark, so add the flags
# to the flags for that compiler as well.
#
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION"
CFLAGS_FOR_BUILD="$GCC_OPTION $CFLAGS_FOR_BUILD"
fi
fi
],
@ -1743,15 +1743,15 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
CXXFLAGS_saved="$CXXFLAGS"
if expr "x$GCC_OPTION" : "x-W.*" >/dev/null
then
CXXFLAGS="$CXXFLAGS $ac_wireshark_unknown_warning_option_error $ac_wireshark_non_cxx_warning_option_error $GCC_OPTION"
CXXFLAGS="$ac_wireshark_unknown_warning_option_error $ac_wireshark_non_cxx_warning_option_error $GCC_OPTION $CXXFLAGS"
elif expr "x$GCC_OPTION" : "x-f.*" >/dev/null
then
CXXFLAGS="$CXXFLAGS -Werror $GCC_OPTION"
CXXFLAGS="-Werror $GCC_OPTION $CXXFLAGS"
elif expr "x$GCC_OPTION" : "x-m.*" >/dev/null
then
CXXFLAGS="$CXXFLAGS -Werror $GCC_OPTION"
CXXFLAGS="-Werror $GCC_OPTION $CXXFLAGS"
else
CXXFLAGS="$CXXFLAGS $GCC_OPTION"
CXXFLAGS="$GCC_OPTION $CXXFLAGS"
fi
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(
@ -1781,7 +1781,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
# added them, by setting CXXFLAGS to the saved value plus
# just the new option.
#
CXXFLAGS="$CXXFLAGS_saved $GCC_OPTION"
CXXFLAGS="$GCC_OPTION $CXXFLAGS_saved"
],
[
AC_MSG_RESULT(yes)
@ -1793,7 +1793,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
# added them, by setting CXXFLAGS to the saved value plus
# just the new option.
#
CXXFLAGS="$CXXFLAGS_saved $GCC_OPTION"
CXXFLAGS="$GCC_OPTION $CXXFLAGS_saved"
fi
],
[