1
0
mirror of https://github.com/moparisthebest/spdylay synced 2024-12-21 23:28:52 -05:00
spdylay/m4/ac_compile_stdcxx_11.m4
2012-02-14 23:54:23 +09:00

23 lines
605 B
Plaintext

# AC_COMPILE_STDCXX_11
AC_DEFUN([AC_COMPILE_STDCXX_11], [
AC_CACHE_CHECK(if g++ supports C++11 features with -std=c++0x,
ac_cv_cxx_compile_cxx11_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([
#include <functional>
std::function<int (int, int)> func;
],,
ac_cv_cxx_compile_cxx11_cxx=yes, ac_cv_cxx_compile_cxx11_cxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_compile_cxx11_cxx" = yes; then
AC_DEFINE(HAVE_STDCXX_11,,[Define if g++ supports C++11 features. ])
fi
])