summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-10-10 20:21:05 +0300
committerTor Lillqvist <tml@collabora.com>2013-10-11 13:15:03 +0300
commit23df408dec36acb6fb6e96de14874fc2a42b7268 (patch)
tree27e269f720344a49ae38841efcf77c67429e84f4 /configure.ac
parent09d246c82fa87a51e8c8100a3c37fcd32ea56e35 (diff)
Move C++ library check a bit earlier and use result
Change-Id: I459308bbc0f957b11f3088e56cd21b4aeef9721a
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac74
1 files changed, 39 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac
index 735d20e8fcdf..37683da253e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6010,6 +6010,44 @@ AC_SUBST(HAVE_GCC_AVX)
AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
dnl ===================================================================
+dnl Identify the C++ library
+dnl ===================================================================
+
+AC_MSG_CHECKING([What the C++ library is])
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <utility>
+#ifndef __GLIBCXX__
+foo bar
+#endif
+]])],
+ [CPP_LIBRARY=GLIBCXX
+ cpp_library_name="GNU libstdc++"
+ ],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <utility>
+#ifndef _LIBCPP_VERSION
+foo bar
+#endif
+]])],
+ [CPP_LIBRARY=LIBCPP
+ cpp_library_name="LLVM libc++"
+ ],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <utility>
+#ifndef _MSC_VER
+foo bar
+#endif
+]])],
+ [CPP_LIBRARY=MSVCRT
+ cpp_library_name="Microsoft"
+ ],
+ AC_MSG_ERROR([Could not figure out what C++ library this is]))))
+AC_MSG_RESULT([$cpp_library_name])
+AC_LANG_POP([C++])
+AC_SUBST(CPP_LIBRARY)
+
+dnl ===================================================================
dnl C++11
dnl ===================================================================
@@ -6043,7 +6081,7 @@ elif test "$GCC" = "yes"; then
fi
fi
-if test "$HAVE_CXX11" = TRUE; then
+if test $CPP_LIBRARY = GLIBCXX -a "$HAVE_CXX11" = TRUE; then
AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -6145,40 +6183,6 @@ if test "$HAVE_CXX11" = TRUE; then
CXXFLAGS=$save_CXXFLAGS
fi
-AC_MSG_CHECKING([What the C++ library is])
-AC_LANG_PUSH([C++])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <utility>
-#ifndef __GLIBCXX__
-foo bar
-#endif
-]])],
- [CPP_LIBRARY=GLIBCXX
- cpp_library_name="GNU libstdc++"
- ],
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <utility>
-#ifndef _LIBCPP_VERSION
-foo bar
-#endif
-]])],
- [CPP_LIBRARY=LIBCPP
- cpp_library_name="LLVM libc++"
- ],
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <utility>
-#ifndef _MSC_VER
-foo bar
-#endif
-]])],
- [CPP_LIBRARY=MSVCRT
- cpp_library_name="Microsoft"
- ],
- AC_MSG_ERROR([Could not figure out what C++ library this is]))))
-AC_MSG_RESULT([$cpp_library_name])
-AC_LANG_POP([C++])
-AC_SUBST(CPP_LIBRARY)
-
if test "$HAVE_CXX11" = "TRUE"; then
AC_DEFINE(HAVE_CXX11)
elif test -n "$CXXFLAGS_CXX11"; then