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
This commit is contained in:
parent
819b72bb03
commit
0f3895a78e
1 changed files with 16 additions and 23 deletions
39
configure.ac
39
configure.ac
|
@ -2690,8 +2690,7 @@ if test $_os = Darwin; then
|
|||
AC_MSG_ERROR([--enable-libc++ requires --with-macosx-version-min-required >= 10.7])
|
||||
fi
|
||||
# Use libc++ instead of libstdc++ when possible
|
||||
# and also compile as C++11
|
||||
stdlib="-std=c++11 -stdlib=libc++"
|
||||
stdlib=-stdlib=libc++
|
||||
CPP_LIBRARY="LIBCPP"
|
||||
fi
|
||||
if test "$ENABLE_LTO" = TRUE; then
|
||||
|
@ -5956,28 +5955,22 @@ if test "$COM" = MSC; then
|
|||
elif test "$GCC" = "yes"; then
|
||||
CXXFLAGS_CXX11=
|
||||
AC_MSG_CHECKING([whether $CXX supports C++11])
|
||||
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
|
||||
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)
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue