From 7a6a59178a7099b6966d6d880a6e69aaf4c1391f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 30 Jan 2016 18:42:48 +0900 Subject: [PATCH] Don't taint CXXFLAGS from AX_CXX_COMPILE_STDCXX_11 --- configure.ac | 13 +++++++++++++ examples/Makefile.am | 2 +- src/Makefile.am | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 44e75d92..5ec4658c 100644 --- a/configure.ac +++ b/configure.ac @@ -189,10 +189,20 @@ else d]) fi +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= + AX_CXX_COMPILE_STDCXX_11([noext], [optional]) +CXX1XCXXFLAGS="$CXXFLAGS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_SUBST([CXX1XCXXFLAGS]) + AC_LANG_PUSH(C++) +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS" + # Check that std::future is available. AC_MSG_CHECKING([whether std::future is available]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( @@ -226,6 +236,8 @@ std::map().emplace(1, 2); [have_std_map_emplace=no AC_MSG_RESULT([no])]) +CXXFLAGS=$ac_save_CXXFLAGS + AC_LANG_POP() # Checks for libraries. @@ -797,6 +809,7 @@ AC_MSG_NOTICE([summary of build options: C preprocessor: ${CPP} CPPFLAGS: ${CPPFLAGS} WARNCFLAGS: ${WARNCFLAGS} + CXX1XCXXFLAGS: ${CXX1XCXXFLAGS} EXTRACFLAG: ${EXTRACFLAG} LIBS: ${LIBS} Library: diff --git a/examples/Makefile.am b/examples/Makefile.am index b9eb8e7b..ba00c225 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -24,7 +24,7 @@ if ENABLE_EXAMPLES AM_CFLAGS = $(WARNCFLAGS) -AM_CXXFLAGS = $(WARNCXXFLAGS) +AM_CXXFLAGS = $(WARNCXXFLAGS) $(CXX1XCXXFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/includes \ -I$(top_builddir)/lib/includes \ diff --git a/src/Makefile.am b/src/Makefile.am index d8423326..9c2cfa21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,7 +27,7 @@ check_PROGRAMS = TESTS = AM_CFLAGS = $(WARNCFLAGS) -AM_CXXFLAGS = $(WARNCXXFLAGS) +AM_CXXFLAGS = $(WARNCXXFLAGS) $(CXX1XCXXFLAGS) AM_CPPFLAGS = \ -DPKGDATADIR='"$(pkgdatadir)"' \ -I$(top_srcdir)/lib/includes \