summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-06-13 20:17:51 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-06-13 20:19:23 +0200
commit03af6cb62986cc99995a6bdc5f1fb9a99ff4b7fe (patch)
tree1eeb4fabb5cad7023c9dc46b69229bbc81bd5cd2 /configure.ac
parent5a8233df858bc06b1cec8f0bcd65333a743c098a (diff)
do not override C++11 decision made for libc++ on macosx
Removed in 44159c6cdf3127ef8ee628f07f3f2d38a93dc3b2 , but since it's set in CXX, this either has to pass, or it has to fail (or it shouldn't be hardcoded the way it is). Change-Id: If5b7b7096927f5d97c7c744cbbfea08e90f1de55
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac46
1 files changed, 28 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 4b47a3ef0b08..d834260d5d6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5564,22 +5564,28 @@ HAVE_CXX11=
if test "$GCC" = "yes"; then
CXXFLAGS_CXX11=
AC_MSG_CHECKING([whether $CXX supports C++11])
- for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
- save_CXXFLAGS=$CXXFLAGS
- CXXFLAGS="$CXXFLAGS $flag -Werror"
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag])
- AC_LANG_POP([C++])
- CXXFLAGS=$save_CXXFLAGS
- if test -n "$CXXFLAGS_CXX11"; then
- HAVE_CXX11=TRUE
- break
- fi
- done
- if test "$HAVE_CXX11" = TRUE; then
- AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
+ if test "$CPP_LIBRARY" = LIBCPP -a $_os = Darwin; then
+ : Already set CXX to contain -std=c++11
+ HAVE_CXX11=TRUE
+ AC_MSG_RESULT(yes)
else
- AC_MSG_RESULT(no)
+ for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
+ save_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $flag -Werror"
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag])
+ AC_LANG_POP([C++])
+ CXXFLAGS=$save_CXXFLAGS
+ if test -n "$CXXFLAGS_CXX11"; then
+ HAVE_CXX11=TRUE
+ break
+ fi
+ done
+ if test "$HAVE_CXX11" = TRUE; then
+ AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
+ else
+ AC_MSG_RESULT(no)
+ fi
fi
if test "$HAVE_CXX11" = TRUE; then
@@ -5684,9 +5690,13 @@ return !(i != 0 && j != 0);
CXXFLAGS=$save_CXXFLAGS
fi
- if test "$HAVE_CXX11" != "TRUE" -a -n "$CXXFLAGS_CXX11"; then
- AC_MSG_NOTICE([Disabling C++11 support])
- CXXFLAGS_CXX11=
+ if test "$HAVE_CXX11" != "TRUE"; then
+ if test -n "$CXXFLAGS_CXX11"; then
+ AC_MSG_NOTICE([Disabling C++11 support])
+ CXXFLAGS_CXX11=
+ elif test "$CPP_LIBRARY" = LIBCPP -a $_os = Darwin; then
+ AC_MSG_ERROR([Selected libc++ but C++11 support broken])
+ fi
fi
fi