Don't add C++11 switch flags to CXXFLAGS

This commit is contained in:
Tatsuhiro Tsujikawa 2016-01-30 19:14:38 +09:00
parent e4d4eabd85
commit 2a4d39b7e8
3 changed files with 15 additions and 2 deletions

View File

@ -132,9 +132,19 @@ AC_LANG([C++])
PKG_PROG_PKG_CONFIG([0.20])
# Check C++ compiler supports C++0x/C++11 feature
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
CXX1XCXXFLAGS="$CXXFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
AC_SUBST([CXX1XCXXFLAGS])
# Check C++ compiler actually supports nullptr
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS"
AC_MSG_CHECKING([whether the c++ compiler supports nullptr])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
]],
@ -165,6 +175,8 @@ Derived x;
AC_DEFINE_UNQUOTED([CXX11_OVERRIDE], [$cxx11_override],
[Define `override` keyword if the compiler supports it])
CXXFLAGS=$ac_save_CXXFLAGS
# Check static build is requested
if test "x$ARIA2_STATIC" = "xyes"; then
case "$host" in
@ -1165,6 +1177,7 @@ CPPFLAGS: $CPPFLAGS
LDFLAGS: $LDFLAGS
LIBS: $LIBS
DEFS: $DEFS
CXX1XCXXFLAGS: $CXX1XCXXFLAGS
EXTRACXXFLAGS: $EXTRACXXFLAGS
EXTRACFLAGS: $EXTRACFLAGS
EXTRACPPFLAGS: $EXTRACPPFLAGS

View File

@ -763,5 +763,5 @@ LDADD = libaria2.la @ALLOCA@ \
AM_CFLAGS = @EXTRACFLAGS@
AM_CXXFLAGS = @WARNCXXFLAGS@ @EXTRACXXFLAGS@
AM_CXXFLAGS = @WARNCXXFLAGS@ @CXX1XCXXFLAGS@ @EXTRACXXFLAGS@

View File

@ -294,7 +294,7 @@ AM_LDFLAGS = \
AM_CFLAGS = @EXTRACFLAGS@
AM_CXXFLAGS = @WARNCXXFLAGS@ @EXTRACXXFLAGS@
AM_CXXFLAGS = @WARNCXXFLAGS@ @CXX1XCXXFLAGS@ @EXTRACXXFLAGS@
EXTRA_DIST = 4096chunk.txt\
chunkChecksumTestFile250.txt\