Browse Source

build: update ax_cxx_compile_stdcxx to serial 4

0.13
Wladimir J. van der Laan 9 years ago
parent
commit
2aacc72727
  1. 34
      build-aux/m4/ax_cxx_compile_stdcxx.m4

34
build-aux/m4/ax_cxx_compile_stdcxx.m4

@ -9,9 +9,9 @@ @@ -9,9 +9,9 @@
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXXFLAGS to
# enable support. VERSION may be '11' (for the C++11 standard) or '14'
# (for the C++14 standard).
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 1
#serial 4
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
@ -74,14 +74,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl @@ -74,14 +74,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
@ -97,14 +100,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl @@ -97,14 +100,17 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
@ -115,7 +121,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl @@ -115,7 +121,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
else
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
@ -124,9 +130,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl @@ -124,9 +130,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi
AC_SUBST(HAVE_CXX$1)
fi
])

Loading…
Cancel
Save