1
# ===========================================================================
2
# http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
3
# ===========================================================================
7
# AC_CXX_COMPILE_STDCXX_0X
11
# Check for baseline language coverage in the compiler for the C++0x
16
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
18
# Copying and distribution of this file, with or without modification, are
19
# permitted in any medium without royalty provided the copyright notice
20
# and this notice are preserved.
22
AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [
23
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
24
ac_cv_cxx_compile_cxx0x_native,
31
static_assert(sizeof(int) <= sizeof(T), "not big enough");
34
typedef check<check<bool>> right_angle_brackets;
39
typedef check<int> check_type;
41
check_type&& cr = c;],,
42
ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
46
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
47
ac_cv_cxx_compile_cxx0x_cxx,
50
ac_save_CXXFLAGS="$CXXFLAGS"
51
CXXFLAGS="$CXXFLAGS -std=c++0x"
56
static_assert(sizeof(int) <= sizeof(T), "not big enough");
59
typedef check<check<bool>> right_angle_brackets;
64
typedef check<int> check_type;
66
check_type&& cr = c;],,
67
ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
68
CXXFLAGS="$ac_save_CXXFLAGS"
72
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
73
ac_cv_cxx_compile_cxx0x_gxx,
76
ac_save_CXXFLAGS="$CXXFLAGS"
77
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
82
static_assert(sizeof(int) <= sizeof(T), "not big enough");
85
typedef check<check<bool>> right_angle_brackets;
90
typedef check<int> check_type;
92
check_type&& cr = c;],,
93
ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
94
CXXFLAGS="$ac_save_CXXFLAGS"
98
if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
99
test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
100
test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
101
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])