diff options
author | Derek Schuff <dschuff@chromium.org> | 2013-01-31 10:07:41 -0800 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2013-01-31 10:07:41 -0800 |
commit | 3d5de9e56f3e5af59772bdf2cbedb0903d938bb8 (patch) | |
tree | 300b7a72c61b009f0122ec1d8a155672c74459fd /autoconf | |
parent | 659ebb8c18832df528effd5c970bfde7662ea368 (diff) | |
parent | 9ccb76998f741a7d3f0f217392a783dfb99c6e87 (diff) |
Cherry-pick r174067
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 2a0fca571b..c46cb0d44a 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1274,8 +1274,23 @@ then then CXX_FLAG_CHECK(NO_UNINITIALIZED, [-Wno-uninitialized]) else - dnl AC_SUBST doesn't work with empty strings. - NO_UNINITIALIZED= + dnl Some versions of gcc accept unsupported -W flags if there is + dnl no warning but stop with an error when a warning is + dnl encountered. If this gcc is earlier than 4.7, just use + dnl -Wno-uninitialized. + gxx_version=`$CXX -dumpversion` + gxx_version_major=`echo $gxx_version | cut -d'.' -f1` + gxx_version_minor=`echo $gxx_version | cut -d'.' -f2` + gxx_version_patch=`echo $gxx_version | cut -d'.' -f3` + + if test "$gxx_version_major" -ge "4" \ + && test "$gxx_version_minor" -ge "7"; then + dnl AC_SUBST doesn't work with empty strings. + NO_UNINITIALIZED= + else + NO_MAYBE_UNINITIALIZED= + CXX_FLAG_CHECK(NO_UNINITIALIZED, [-Wno-uninitialized]) + fi fi else NO_UNINITIALIZED= |