From cf0d762d7304aa569ea25faf999c74bbe94f9023 Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Sun, 13 Sep 2015 19:10:55 -0400 Subject: do not clobber user CFLAGS Bug: 10791 Change-Id: I58c35c757039e69111a39100f5ccb306e098d591 Reviewed-on: https://code.wireshark.org/review/10519 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris Reviewed-by: Michael Mann --- acinclude.m4 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 82b288a999..704d92408e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 ], [ -- cgit v1.2.1