summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-19 15:21:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-19 15:25:53 +0200
commit0032fc0385679d15992fb1a2e8dc0ff1c228c911 (patch)
treedb496b855533e0810fa9a18b85b62d8cd395eca4 /configure.ac
parenta38f8c2228f15611136ad6a4b69d77e167a2b781 (diff)
Fix check for broken standard library
The compiler's __GNUC__ etc. need not match the libstdc++ version used (esp. when using Clang as compiler), and libstdc++'s __GLIBCXX__ macro doesn't inrease monotonically with version numbers, so resort to a configure check. Change-Id: I06de6b68324169863f6f5c31ae5d855e8b04cd6b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6a30d8ac4735..4afc1d413b31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12764,6 +12764,27 @@ if test "$build_os" = "cygwin"; then
AC_SUBST(ILIB)
fi
+AC_MSG_CHECKING(
+ [whether C++11 use of const_iterator in standard containers is broken])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <list>
+ ]],[[
+ std::list<int> l;
+ l.erase(l.cbegin());
+ ]])],
+ [broken=no], [broken=yes])
+AC_LANG_POP([C++])
+LIBS=$save_LIBS
+CXXFLAGS=$save_CXXFLAGS
+AC_MSG_RESULT([$broken])
+if test "$broken" = yes; then
+ AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
+fi
+
+
AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
if test "$CROSS_COMPILING" = "TRUE"; then
broken='assuming not (cross-compiling)'