Kaydet (Commit) 0f3895a7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Decouple setting -std=gnu++11/c++11 from setting -stdlib=libc++

Forcing -stdlib=c++11 into CXX upon --enable-libc++ instead of only into
CXXFLAGS_CXX11 as done normally caused external projects to unexpectedly pick it
up, causing build failures in firebird.

Change-Id: I588d75ccbde6b9fd4f38e10a0c67c2f6086f8977
üst 819b72bb
...@@ -2690,8 +2690,7 @@ if test $_os = Darwin; then ...@@ -2690,8 +2690,7 @@ if test $_os = Darwin; then
AC_MSG_ERROR([--enable-libc++ requires --with-macosx-version-min-required >= 10.7]) AC_MSG_ERROR([--enable-libc++ requires --with-macosx-version-min-required >= 10.7])
fi fi
# Use libc++ instead of libstdc++ when possible # Use libc++ instead of libstdc++ when possible
# and also compile as C++11 stdlib=-stdlib=libc++
stdlib="-std=c++11 -stdlib=libc++"
CPP_LIBRARY="LIBCPP" CPP_LIBRARY="LIBCPP"
fi fi
if test "$ENABLE_LTO" = TRUE; then if test "$ENABLE_LTO" = TRUE; then
...@@ -5956,28 +5955,22 @@ if test "$COM" = MSC; then ...@@ -5956,28 +5955,22 @@ if test "$COM" = MSC; then
elif test "$GCC" = "yes"; then elif test "$GCC" = "yes"; then
CXXFLAGS_CXX11= CXXFLAGS_CXX11=
AC_MSG_CHECKING([whether $CXX supports C++11]) AC_MSG_CHECKING([whether $CXX supports C++11])
if test "$CPP_LIBRARY" = LIBCPP -a $_os = Darwin; then for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
: Already set CXX to contain -std=c++11 save_CXXFLAGS=$CXXFLAGS
HAVE_CXX11=TRUE CXXFLAGS="$CXXFLAGS $flag -Werror"
AC_MSG_RESULT(yes) AC_LANG_PUSH([C++])
else AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag])
for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do AC_LANG_POP([C++])
save_CXXFLAGS=$CXXFLAGS CXXFLAGS=$save_CXXFLAGS
CXXFLAGS="$CXXFLAGS $flag -Werror" if test -n "$CXXFLAGS_CXX11"; then
AC_LANG_PUSH([C++]) HAVE_CXX11=TRUE
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag]) break
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
done
if test "$HAVE_CXX11" = TRUE; then
AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
else
AC_MSG_RESULT(no)
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment