1 # ============================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html
3 # ============================================================================
7 # AX_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. This file is offered as-is, without any
25 AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X])
26 AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
27 AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
28 ax_cv_cxx_compile_cxx0x_native,
35 static_assert(sizeof(int) <= sizeof(T), "not big enough");
38 typedef check<check<bool>> right_angle_brackets;
43 typedef check<int> check_type;
45 check_type&& cr = static_cast<check_type&&>(c);],,
46 ax_cv_cxx_compile_cxx0x_native=yes, ax_cv_cxx_compile_cxx0x_native=no)
50 AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
51 ax_cv_cxx_compile_cxx0x_cxx,
54 ac_save_CXXFLAGS="$CXXFLAGS"
55 CXXFLAGS="$CXXFLAGS -std=c++0x"
60 static_assert(sizeof(int) <= sizeof(T), "not big enough");
63 typedef check<check<bool>> right_angle_brackets;
68 typedef check<int> check_type;
70 check_type&& cr = static_cast<check_type&&>(c);],,
71 ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no)
72 CXXFLAGS="$ac_save_CXXFLAGS"
76 AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
77 ax_cv_cxx_compile_cxx0x_gxx,
80 ac_save_CXXFLAGS="$CXXFLAGS"
81 CXXFLAGS="$CXXFLAGS -std=gnu++0x"
86 static_assert(sizeof(int) <= sizeof(T), "not big enough");
89 typedef check<check<bool>> right_angle_brackets;
94 typedef check<int> check_type;
96 check_type&& cr = static_cast<check_type&&>(c);],,
97 ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no)
98 CXXFLAGS="$ac_save_CXXFLAGS"
102 if test "$ax_cv_cxx_compile_cxx0x_native" = yes ||
103 test "$ax_cv_cxx_compile_cxx0x_cxx" = yes ||
104 test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
105 AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])