Add c++11 m4 check.
This commit is contained in:
parent
8230f935c4
commit
dc45060090
@ -39,8 +39,10 @@ AC_ENABLE_CXXMPH
|
|||||||
if test x$cxxmph = xtrue; then
|
if test x$cxxmph = xtrue; then
|
||||||
AC_COMPILE_STDCXX_0X
|
AC_COMPILE_STDCXX_0X
|
||||||
if test x$ac_cv_cxx_compile_cxx0x_native = "xno"; then
|
if test x$ac_cv_cxx_compile_cxx0x_native = "xno"; then
|
||||||
if test x$ac_cv_cxx_compile_cxx0x_cxx = "xyes"; then
|
if test x$ac_cv_cxx_compile_cxx11_cxx = "xyes"; then
|
||||||
CXXFLAGS="$CXXFLAGS -std=c++11"
|
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||||
|
elif test x$ac_cv_cxx_compile_cxx0x_cxx = "xyes"; then
|
||||||
|
CXXFLAGS="$CXXFLAGS -std=c++0x"
|
||||||
elif test x$ac_cv_cxx_compile_cxx0x_gxx = "xyes"; then
|
elif test x$ac_cv_cxx_compile_cxx0x_gxx = "xyes"; then
|
||||||
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
|
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
|
||||||
else
|
else
|
||||||
|
24
m4/cxx0x.m4
24
m4/cxx0x.m4
@ -23,6 +23,30 @@ AC_DEFUN([AC_COMPILE_STDCXX_0X], [
|
|||||||
AC_LANG_RESTORE
|
AC_LANG_RESTORE
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(if compiler supports C++0x features with -std=c++11,
|
||||||
|
ac_cv_cxx_compile_cxx11_cxx,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||||
|
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <unordered_map>
|
||||||
|
template <typename T>
|
||||||
|
struct check
|
||||||
|
{
|
||||||
|
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef check<check<bool>> right_angle_brackets;
|
||||||
|
|
||||||
|
int a;
|
||||||
|
decltype(a) b;],,
|
||||||
|
ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
|
||||||
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_CACHE_CHECK(if compiler supports C++0x features with -std=c++0x,
|
AC_CACHE_CHECK(if compiler supports C++0x features with -std=c++0x,
|
||||||
ac_cv_cxx_compile_cxx0x_cxx,
|
ac_cv_cxx_compile_cxx0x_cxx,
|
||||||
[AC_LANG_SAVE
|
[AC_LANG_SAVE
|
||||||
|
Loading…
Reference in New Issue
Block a user