diff options
-rw-r--r-- | acinclude.m4 | 24 | ||||
-rw-r--r-- | configure.ac | 10 |
2 files changed, 25 insertions, 9 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index ced7921a21..ff611b8162 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1675,10 +1675,14 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then # just the new option. # CFLAGS="$CFLAGS_saved $GCC_OPTION" - # - # Add it to the flags we use when building build tools. - # - CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION" + 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" + fi ], [ AC_MSG_RESULT(yes) @@ -1691,10 +1695,14 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then # just the new option. # CFLAGS="$CFLAGS_saved $GCC_OPTION" - # - # Add it to the flags we use when building build tools. - # - CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION" + 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" + fi fi ], [ diff --git a/configure.ac b/configure.ac index 1abc56ee46..dc69e7fb1b 100644 --- a/configure.ac +++ b/configure.ac @@ -1284,7 +1284,15 @@ else # documentation I can find online. # CFLAGS="-Ae +O2 $CFLAGS" - CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS" + if test "$CC" = "$CC_FOR_BUILD"; then + # + # We're building the build tools with the same + # compiler as the one with which we're building + # Wireshark, so add the flags to the flags for + # that compiler as well. + # + CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS" + fi CXXFLAGS="+O2 $CFLAGS" AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2) ;; |