summaryrefslogtreecommitdiff
path: root/autoconf
diff options
context:
space:
mode:
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac19
1 files changed, 17 insertions, 2 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index c186ed55744..ce360109d2e 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1269,8 +1269,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=