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

Loading…
Cancel
Save