Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: configure

Issue 1570013002: Check for C++11 support in the configure script. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | configure.ac » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /bin/sh 1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles. 2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for breakpad 0.1. 3 # Generated by GNU Autoconf 2.69 for breakpad 0.1.
4 # 4 #
5 # Report bugs to <google-breakpad-dev@googlegroups.com>. 5 # Report bugs to <google-breakpad-dev@googlegroups.com>.
6 # 6 #
7 # 7 #
8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9 # 9 #
10 # 10 #
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 SELFTEST_FALSE 629 SELFTEST_FALSE
630 SELFTEST_TRUE 630 SELFTEST_TRUE
631 DISABLE_TOOLS_FALSE 631 DISABLE_TOOLS_FALSE
632 DISABLE_TOOLS_TRUE 632 DISABLE_TOOLS_TRUE
633 DISABLE_PROCESSOR_FALSE 633 DISABLE_PROCESSOR_FALSE
634 DISABLE_PROCESSOR_TRUE 634 DISABLE_PROCESSOR_TRUE
635 ANDROID_HOST_FALSE 635 ANDROID_HOST_FALSE
636 ANDROID_HOST_TRUE 636 ANDROID_HOST_TRUE
637 LINUX_HOST_FALSE 637 LINUX_HOST_FALSE
638 LINUX_HOST_TRUE 638 LINUX_HOST_TRUE
639 HAVE_CXX11
639 PTHREAD_CFLAGS 640 PTHREAD_CFLAGS
640 PTHREAD_LIBS 641 PTHREAD_LIBS
641 PTHREAD_CC 642 PTHREAD_CC
642 ax_pthread_config 643 ax_pthread_config
643 EGREP 644 EGREP
644 GREP 645 GREP
645 GCC_FALSE 646 GCC_FALSE
646 GCC_TRUE 647 GCC_TRUE
647 RANLIB 648 RANLIB
648 am__fastdepCXX_FALSE 649 am__fastdepCXX_FALSE
(...skipping 5330 matching lines...) Expand 10 before | Expand all | Expand 10 after
5979 while :; do 5980 while :; do
5980 # IRIX 6.2 and later do not support large files by default, 5981 # IRIX 6.2 and later do not support large files by default,
5981 # so use the C compiler's -n32 option if that helps. 5982 # so use the C compiler's -n32 option if that helps.
5982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 5983 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5983 /* end confdefs.h. */ 5984 /* end confdefs.h. */
5984 #include <sys/types.h> 5985 #include <sys/types.h>
5985 /* Check that off_t can represent 2**63 - 1 correctly. 5986 /* Check that off_t can represent 2**63 - 1 correctly.
5986 We can't simply define LARGE_OFF_T to be 9223372036854775807, 5987 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5987 since some C++ compilers masquerading as C compilers 5988 since some C++ compilers masquerading as C compilers
5988 incorrectly reject 9223372036854775807. */ 5989 incorrectly reject 9223372036854775807. */
5989 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) 5990 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5990 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 5991 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5991 && LARGE_OFF_T % 2147483647 == 1) 5992 && LARGE_OFF_T % 2147483647 == 1)
5992 ? 1 : -1]; 5993 ? 1 : -1];
5993 int 5994 int
5994 main () 5995 main ()
5995 { 5996 {
5996 5997
5997 ; 5998 ;
5998 return 0; 5999 return 0;
5999 } 6000 }
(...skipping 25 matching lines...) Expand all
6025 $as_echo_n "(cached) " >&6 6026 $as_echo_n "(cached) " >&6
6026 else 6027 else
6027 while :; do 6028 while :; do
6028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 6029 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6029 /* end confdefs.h. */ 6030 /* end confdefs.h. */
6030 #include <sys/types.h> 6031 #include <sys/types.h>
6031 /* Check that off_t can represent 2**63 - 1 correctly. 6032 /* Check that off_t can represent 2**63 - 1 correctly.
6032 We can't simply define LARGE_OFF_T to be 9223372036854775807, 6033 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6033 since some C++ compilers masquerading as C compilers 6034 since some C++ compilers masquerading as C compilers
6034 incorrectly reject 9223372036854775807. */ 6035 incorrectly reject 9223372036854775807. */
6035 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) 6036 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
6036 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 6037 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6037 && LARGE_OFF_T % 2147483647 == 1) 6038 && LARGE_OFF_T % 2147483647 == 1)
6038 ? 1 : -1]; 6039 ? 1 : -1];
6039 int 6040 int
6040 main () 6041 main ()
6041 { 6042 {
6042 6043
6043 ; 6044 ;
6044 return 0; 6045 return 0;
6045 } 6046 }
6046 _ACEOF 6047 _ACEOF
6047 if ac_fn_c_try_compile "$LINENO"; then : 6048 if ac_fn_c_try_compile "$LINENO"; then :
6048 ac_cv_sys_file_offset_bits=no; break 6049 ac_cv_sys_file_offset_bits=no; break
6049 fi 6050 fi
6050 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 6051 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6051 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 6052 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6052 /* end confdefs.h. */ 6053 /* end confdefs.h. */
6053 #define _FILE_OFFSET_BITS 64 6054 #define _FILE_OFFSET_BITS 64
6054 #include <sys/types.h> 6055 #include <sys/types.h>
6055 /* Check that off_t can represent 2**63 - 1 correctly. 6056 /* Check that off_t can represent 2**63 - 1 correctly.
6056 We can't simply define LARGE_OFF_T to be 9223372036854775807, 6057 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6057 since some C++ compilers masquerading as C compilers 6058 since some C++ compilers masquerading as C compilers
6058 incorrectly reject 9223372036854775807. */ 6059 incorrectly reject 9223372036854775807. */
6059 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) 6060 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
6060 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 6061 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6061 && LARGE_OFF_T % 2147483647 == 1) 6062 && LARGE_OFF_T % 2147483647 == 1)
6062 ? 1 : -1]; 6063 ? 1 : -1];
6063 int 6064 int
6064 main () 6065 main ()
6065 { 6066 {
6066 6067
6067 ; 6068 ;
6068 return 0; 6069 return 0;
6069 } 6070 }
(...skipping 24 matching lines...) Expand all
6094 $as_echo_n "(cached) " >&6 6095 $as_echo_n "(cached) " >&6
6095 else 6096 else
6096 while :; do 6097 while :; do
6097 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 6098 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6098 /* end confdefs.h. */ 6099 /* end confdefs.h. */
6099 #include <sys/types.h> 6100 #include <sys/types.h>
6100 /* Check that off_t can represent 2**63 - 1 correctly. 6101 /* Check that off_t can represent 2**63 - 1 correctly.
6101 We can't simply define LARGE_OFF_T to be 9223372036854775807, 6102 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6102 since some C++ compilers masquerading as C compilers 6103 since some C++ compilers masquerading as C compilers
6103 incorrectly reject 9223372036854775807. */ 6104 incorrectly reject 9223372036854775807. */
6104 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) 6105 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
6105 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 6106 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6106 && LARGE_OFF_T % 2147483647 == 1) 6107 && LARGE_OFF_T % 2147483647 == 1)
6107 ? 1 : -1]; 6108 ? 1 : -1];
6108 int 6109 int
6109 main () 6110 main ()
6110 { 6111 {
6111 6112
6112 ; 6113 ;
6113 return 0; 6114 return 0;
6114 } 6115 }
6115 _ACEOF 6116 _ACEOF
6116 if ac_fn_c_try_compile "$LINENO"; then : 6117 if ac_fn_c_try_compile "$LINENO"; then :
6117 ac_cv_sys_large_files=no; break 6118 ac_cv_sys_large_files=no; break
6118 fi 6119 fi
6119 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 6120 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6120 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 6121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6121 /* end confdefs.h. */ 6122 /* end confdefs.h. */
6122 #define _LARGE_FILES 1 6123 #define _LARGE_FILES 1
6123 #include <sys/types.h> 6124 #include <sys/types.h>
6124 /* Check that off_t can represent 2**63 - 1 correctly. 6125 /* Check that off_t can represent 2**63 - 1 correctly.
6125 We can't simply define LARGE_OFF_T to be 9223372036854775807, 6126 We can't simply define LARGE_OFF_T to be 9223372036854775807,
6126 since some C++ compilers masquerading as C compilers 6127 since some C++ compilers masquerading as C compilers
6127 incorrectly reject 9223372036854775807. */ 6128 incorrectly reject 9223372036854775807. */
6128 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) 6129 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
6129 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 6130 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
6130 && LARGE_OFF_T % 2147483647 == 1) 6131 && LARGE_OFF_T % 2147483647 == 1)
6131 ? 1 : -1]; 6132 ? 1 : -1];
6132 int 6133 int
6133 main () 6134 main ()
6134 { 6135 {
6135 6136
6136 ; 6137 ;
6137 return 0; 6138 return 0;
6138 } 6139 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
6637 if test "x$ac_cv_header_a_out_h" = xyes; then : 6638 if test "x$ac_cv_header_a_out_h" = xyes; then :
6638 cat >>confdefs.h <<_ACEOF 6639 cat >>confdefs.h <<_ACEOF
6639 #define HAVE_A_OUT_H 1 6640 #define HAVE_A_OUT_H 1
6640 _ACEOF 6641 _ACEOF
6641 6642
6642 fi 6643 fi
6643 6644
6644 done 6645 done
6645 6646
6646 6647
6648 # ===========================================================================
6649 # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
6650 # ===========================================================================
6651 #
6652 # SYNOPSIS
6653 #
6654 # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
6655 #
6656 # DESCRIPTION
6657 #
6658 # Check for baseline language coverage in the compiler for the specified
6659 # version of the C++ standard. If necessary, add switches to CXXFLAGS to
6660 # enable support. VERSION may be '11' (for the C++11 standard) or '14'
6661 # (for the C++14 standard).
6662 #
6663 # The second argument, if specified, indicates whether you insist on an
6664 # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
6665 # -std=c++11). If neither is specified, you get whatever works, with
6666 # preference for an extended mode.
6667 #
6668 # The third argument, if specified 'mandatory' or if left unspecified,
6669 # indicates that baseline support for the specified C++ standard is
6670 # required and that the macro should error out if no mode with that
6671 # support is found. If specified 'optional', then configuration proceeds
6672 # regardless, after defining HAVE_CXX${VERSION} if and only if a
6673 # supporting mode is found.
6674 #
6675 # LICENSE
6676 #
6677 # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
6678 # Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
6679 # Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
6680 # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov @google.com>
6681 # Copyright (c) 2015 Paul Norman <penorman@mac.com>
6682 # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
6683 #
6684 # Copying and distribution of this file, with or without modification, are
6685 # permitted in any medium without royalty provided the copyright notice
6686 # and this notice are preserved. This file is offered as-is, without any
6687 # warranty.
6688
6689 #serial 1
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711 ax_cxx_compile_cxx11_required=true
6712 ac_ext=cpp
6713 ac_cpp='$CXXCPP $CPPFLAGS'
6714 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6715 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex t $LIBS >&5'
6716 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6717 ac_success=no
6718 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
6719 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
6720 if ${ax_cv_cxx_compile_cxx11+:} false; then :
6721 $as_echo_n "(cached) " >&6
6722 else
6723 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6724 /* end confdefs.h. */
6725
6726
6727 // If the compiler admits that it is not ready for C++11, why torture it?
6728 // Hopefully, this will speed up the test.
6729
6730 #ifndef __cplusplus
6731
6732 #error "This is not a C++ compiler"
6733
6734 #elif __cplusplus < 201103L
6735
6736 #error "This is not a C++11 compiler"
6737
6738 #else
6739
6740 namespace cxx11
6741 {
6742
6743 namespace test_static_assert
6744 {
6745
6746 template <typename T>
6747 struct check
6748 {
6749 static_assert(sizeof(int) <= sizeof(T), "not big enough");
6750 };
6751
6752 }
6753
6754 namespace test_final_override
6755 {
6756
6757 struct Base
6758 {
6759 virtual void f() {}
6760 };
6761
6762 struct Derived : public Base
6763 {
6764 virtual void f() override {}
6765 };
6766
6767 }
6768
6769 namespace test_double_right_angle_brackets
6770 {
6771
6772 template < typename T >
6773 struct check {};
6774
6775 typedef check<void> single_type;
6776 typedef check<check<void>> double_type;
6777 typedef check<check<check<void>>> triple_type;
6778 typedef check<check<check<check<void>>>> quadruple_type;
6779
6780 }
6781
6782 namespace test_decltype
6783 {
6784
6785 int
6786 f()
6787 {
6788 int a = 1;
6789 decltype(a) b = 2;
6790 return a + b;
6791 }
6792
6793 }
6794
6795 namespace test_type_deduction
6796 {
6797
6798 template < typename T1, typename T2 >
6799 struct is_same
6800 {
6801 static const bool value = false;
6802 };
6803
6804 template < typename T >
6805 struct is_same<T, T>
6806 {
6807 static const bool value = true;
6808 };
6809
6810 template < typename T1, typename T2 >
6811 auto
6812 add(T1 a1, T2 a2) -> decltype(a1 + a2)
6813 {
6814 return a1 + a2;
6815 }
6816
6817 int
6818 test(const int c, volatile int v)
6819 {
6820 static_assert(is_same<int, decltype(0)>::value == true, "");
6821 static_assert(is_same<int, decltype(c)>::value == false, "");
6822 static_assert(is_same<int, decltype(v)>::value == false, "");
6823 auto ac = c;
6824 auto av = v;
6825 auto sumi = ac + av + 'x';
6826 auto sumf = ac + av + 1.0;
6827 static_assert(is_same<int, decltype(ac)>::value == true, "");
6828 static_assert(is_same<int, decltype(av)>::value == true, "");
6829 static_assert(is_same<int, decltype(sumi)>::value == true, "");
6830 static_assert(is_same<int, decltype(sumf)>::value == false, "");
6831 static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
6832 return (sumf > 0.0) ? sumi : add(c, v);
6833 }
6834
6835 }
6836
6837 namespace test_noexcept
6838 {
6839
6840 int f() { return 0; }
6841 int g() noexcept { return 0; }
6842
6843 static_assert(noexcept(f()) == false, "");
6844 static_assert(noexcept(g()) == true, "");
6845
6846 }
6847
6848 namespace test_constexpr
6849 {
6850
6851 template < typename CharT >
6852 unsigned long constexpr
6853 strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
6854 {
6855 return *s ? strlen_c_r(s + 1, acc + 1) : acc;
6856 }
6857
6858 template < typename CharT >
6859 unsigned long constexpr
6860 strlen_c(const CharT *const s) noexcept
6861 {
6862 return strlen_c_r(s, 0UL);
6863 }
6864
6865 static_assert(strlen_c("") == 0UL, "");
6866 static_assert(strlen_c("1") == 1UL, "");
6867 static_assert(strlen_c("example") == 7UL, "");
6868 static_assert(strlen_c("another\0example") == 7UL, "");
6869
6870 }
6871
6872 namespace test_rvalue_references
6873 {
6874
6875 template < int N >
6876 struct answer
6877 {
6878 static constexpr int value = N;
6879 };
6880
6881 answer<1> f(int&) { return answer<1>(); }
6882 answer<2> f(const int&) { return answer<2>(); }
6883 answer<3> f(int&&) { return answer<3>(); }
6884
6885 void
6886 test()
6887 {
6888 int i = 0;
6889 const int c = 0;
6890 static_assert(decltype(f(i))::value == 1, "");
6891 static_assert(decltype(f(c))::value == 2, "");
6892 static_assert(decltype(f(0))::value == 3, "");
6893 }
6894
6895 }
6896
6897 namespace test_uniform_initialization
6898 {
6899
6900 struct test
6901 {
6902 static const int zero {};
6903 static const int one {1};
6904 };
6905
6906 static_assert(test::zero == 0, "");
6907 static_assert(test::one == 1, "");
6908
6909 }
6910
6911 namespace test_lambdas
6912 {
6913
6914 void
6915 test1()
6916 {
6917 auto lambda1 = [](){};
6918 auto lambda2 = lambda1;
6919 lambda1();
6920 lambda2();
6921 }
6922
6923 int
6924 test2()
6925 {
6926 auto a = [](int i, int j){ return i + j; }(1, 2);
6927 auto b = []() -> int { return '0'; }();
6928 auto c = [=](){ return a + b; }();
6929 auto d = [&](){ return c; }();
6930 auto e = [a, &b](int x) mutable {
6931 const auto identity = [](int y){ return y; };
6932 for (auto i = 0; i < a; ++i)
6933 a += b--;
6934 return x + identity(a + b);
6935 }(0);
6936 return a + b + c + d + e;
6937 }
6938
6939 int
6940 test3()
6941 {
6942 const auto nullary = [](){ return 0; };
6943 const auto unary = [](int x){ return x; };
6944 using nullary_t = decltype(nullary);
6945 using unary_t = decltype(unary);
6946 const auto higher1st = [](nullary_t f){ return f(); };
6947 const auto higher2nd = [unary](nullary_t f1){
6948 return [unary, f1](unary_t f2){ return f2(unary(f1())); };
6949 };
6950 return higher1st(nullary) + higher2nd(nullary)(unary);
6951 }
6952
6953 }
6954
6955 namespace test_variadic_templates
6956 {
6957
6958 template <int...>
6959 struct sum;
6960
6961 template <int N0, int... N1toN>
6962 struct sum<N0, N1toN...>
6963 {
6964 static constexpr auto value = N0 + sum<N1toN...>::value;
6965 };
6966
6967 template <>
6968 struct sum<>
6969 {
6970 static constexpr auto value = 0;
6971 };
6972
6973 static_assert(sum<>::value == 0, "");
6974 static_assert(sum<1>::value == 1, "");
6975 static_assert(sum<23>::value == 23, "");
6976 static_assert(sum<1, 2>::value == 3, "");
6977 static_assert(sum<5, 5, 11>::value == 21, "");
6978 static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
6979
6980 }
6981
6982 // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
6983 // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
6984 // because of this.
6985 namespace test_template_alias_sfinae
6986 {
6987
6988 struct foo {};
6989
6990 template<typename T>
6991 using member = typename T::member_type;
6992
6993 template<typename T>
6994 void func(...) {}
6995
6996 template<typename T>
6997 void func(member<T>*) {}
6998
6999 void test();
7000
7001 void test() { func<foo>(0); }
7002
7003 }
7004
7005 } // namespace cxx11
7006
7007 #endif // __cplusplus >= 201103L
7008
7009
7010
7011 _ACEOF
7012 if ac_fn_cxx_try_compile "$LINENO"; then :
7013 ax_cv_cxx_compile_cxx11=yes
7014 else
7015 ax_cv_cxx_compile_cxx11=no
7016 fi
7017 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7018 fi
7019 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
7020 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
7021 if test x$ax_cv_cxx_compile_cxx11 = xyes; then
7022 ac_success=yes
7023 fi
7024
7025
7026
7027 if test x$ac_success = xno; then
7028 for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; d o
7029 cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
7030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C+ +11 features with $switch" >&5
7031 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
7032 if eval \${$cachevar+:} false; then :
7033 $as_echo_n "(cached) " >&6
7034 else
7035 ac_save_CXXFLAGS="$CXXFLAGS"
7036 CXXFLAGS="$CXXFLAGS $switch"
7037 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7038 /* end confdefs.h. */
7039
7040
7041 // If the compiler admits that it is not ready for C++11, why torture it?
7042 // Hopefully, this will speed up the test.
7043
7044 #ifndef __cplusplus
7045
7046 #error "This is not a C++ compiler"
7047
7048 #elif __cplusplus < 201103L
7049
7050 #error "This is not a C++11 compiler"
7051
7052 #else
7053
7054 namespace cxx11
7055 {
7056
7057 namespace test_static_assert
7058 {
7059
7060 template <typename T>
7061 struct check
7062 {
7063 static_assert(sizeof(int) <= sizeof(T), "not big enough");
7064 };
7065
7066 }
7067
7068 namespace test_final_override
7069 {
7070
7071 struct Base
7072 {
7073 virtual void f() {}
7074 };
7075
7076 struct Derived : public Base
7077 {
7078 virtual void f() override {}
7079 };
7080
7081 }
7082
7083 namespace test_double_right_angle_brackets
7084 {
7085
7086 template < typename T >
7087 struct check {};
7088
7089 typedef check<void> single_type;
7090 typedef check<check<void>> double_type;
7091 typedef check<check<check<void>>> triple_type;
7092 typedef check<check<check<check<void>>>> quadruple_type;
7093
7094 }
7095
7096 namespace test_decltype
7097 {
7098
7099 int
7100 f()
7101 {
7102 int a = 1;
7103 decltype(a) b = 2;
7104 return a + b;
7105 }
7106
7107 }
7108
7109 namespace test_type_deduction
7110 {
7111
7112 template < typename T1, typename T2 >
7113 struct is_same
7114 {
7115 static const bool value = false;
7116 };
7117
7118 template < typename T >
7119 struct is_same<T, T>
7120 {
7121 static const bool value = true;
7122 };
7123
7124 template < typename T1, typename T2 >
7125 auto
7126 add(T1 a1, T2 a2) -> decltype(a1 + a2)
7127 {
7128 return a1 + a2;
7129 }
7130
7131 int
7132 test(const int c, volatile int v)
7133 {
7134 static_assert(is_same<int, decltype(0)>::value == true, "");
7135 static_assert(is_same<int, decltype(c)>::value == false, "");
7136 static_assert(is_same<int, decltype(v)>::value == false, "");
7137 auto ac = c;
7138 auto av = v;
7139 auto sumi = ac + av + 'x';
7140 auto sumf = ac + av + 1.0;
7141 static_assert(is_same<int, decltype(ac)>::value == true, "");
7142 static_assert(is_same<int, decltype(av)>::value == true, "");
7143 static_assert(is_same<int, decltype(sumi)>::value == true, "");
7144 static_assert(is_same<int, decltype(sumf)>::value == false, "");
7145 static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
7146 return (sumf > 0.0) ? sumi : add(c, v);
7147 }
7148
7149 }
7150
7151 namespace test_noexcept
7152 {
7153
7154 int f() { return 0; }
7155 int g() noexcept { return 0; }
7156
7157 static_assert(noexcept(f()) == false, "");
7158 static_assert(noexcept(g()) == true, "");
7159
7160 }
7161
7162 namespace test_constexpr
7163 {
7164
7165 template < typename CharT >
7166 unsigned long constexpr
7167 strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
7168 {
7169 return *s ? strlen_c_r(s + 1, acc + 1) : acc;
7170 }
7171
7172 template < typename CharT >
7173 unsigned long constexpr
7174 strlen_c(const CharT *const s) noexcept
7175 {
7176 return strlen_c_r(s, 0UL);
7177 }
7178
7179 static_assert(strlen_c("") == 0UL, "");
7180 static_assert(strlen_c("1") == 1UL, "");
7181 static_assert(strlen_c("example") == 7UL, "");
7182 static_assert(strlen_c("another\0example") == 7UL, "");
7183
7184 }
7185
7186 namespace test_rvalue_references
7187 {
7188
7189 template < int N >
7190 struct answer
7191 {
7192 static constexpr int value = N;
7193 };
7194
7195 answer<1> f(int&) { return answer<1>(); }
7196 answer<2> f(const int&) { return answer<2>(); }
7197 answer<3> f(int&&) { return answer<3>(); }
7198
7199 void
7200 test()
7201 {
7202 int i = 0;
7203 const int c = 0;
7204 static_assert(decltype(f(i))::value == 1, "");
7205 static_assert(decltype(f(c))::value == 2, "");
7206 static_assert(decltype(f(0))::value == 3, "");
7207 }
7208
7209 }
7210
7211 namespace test_uniform_initialization
7212 {
7213
7214 struct test
7215 {
7216 static const int zero {};
7217 static const int one {1};
7218 };
7219
7220 static_assert(test::zero == 0, "");
7221 static_assert(test::one == 1, "");
7222
7223 }
7224
7225 namespace test_lambdas
7226 {
7227
7228 void
7229 test1()
7230 {
7231 auto lambda1 = [](){};
7232 auto lambda2 = lambda1;
7233 lambda1();
7234 lambda2();
7235 }
7236
7237 int
7238 test2()
7239 {
7240 auto a = [](int i, int j){ return i + j; }(1, 2);
7241 auto b = []() -> int { return '0'; }();
7242 auto c = [=](){ return a + b; }();
7243 auto d = [&](){ return c; }();
7244 auto e = [a, &b](int x) mutable {
7245 const auto identity = [](int y){ return y; };
7246 for (auto i = 0; i < a; ++i)
7247 a += b--;
7248 return x + identity(a + b);
7249 }(0);
7250 return a + b + c + d + e;
7251 }
7252
7253 int
7254 test3()
7255 {
7256 const auto nullary = [](){ return 0; };
7257 const auto unary = [](int x){ return x; };
7258 using nullary_t = decltype(nullary);
7259 using unary_t = decltype(unary);
7260 const auto higher1st = [](nullary_t f){ return f(); };
7261 const auto higher2nd = [unary](nullary_t f1){
7262 return [unary, f1](unary_t f2){ return f2(unary(f1())); };
7263 };
7264 return higher1st(nullary) + higher2nd(nullary)(unary);
7265 }
7266
7267 }
7268
7269 namespace test_variadic_templates
7270 {
7271
7272 template <int...>
7273 struct sum;
7274
7275 template <int N0, int... N1toN>
7276 struct sum<N0, N1toN...>
7277 {
7278 static constexpr auto value = N0 + sum<N1toN...>::value;
7279 };
7280
7281 template <>
7282 struct sum<>
7283 {
7284 static constexpr auto value = 0;
7285 };
7286
7287 static_assert(sum<>::value == 0, "");
7288 static_assert(sum<1>::value == 1, "");
7289 static_assert(sum<23>::value == 23, "");
7290 static_assert(sum<1, 2>::value == 3, "");
7291 static_assert(sum<5, 5, 11>::value == 21, "");
7292 static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
7293
7294 }
7295
7296 // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
7297 // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
7298 // because of this.
7299 namespace test_template_alias_sfinae
7300 {
7301
7302 struct foo {};
7303
7304 template<typename T>
7305 using member = typename T::member_type;
7306
7307 template<typename T>
7308 void func(...) {}
7309
7310 template<typename T>
7311 void func(member<T>*) {}
7312
7313 void test();
7314
7315 void test() { func<foo>(0); }
7316
7317 }
7318
7319 } // namespace cxx11
7320
7321 #endif // __cplusplus >= 201103L
7322
7323
7324
7325 _ACEOF
7326 if ac_fn_cxx_try_compile "$LINENO"; then :
7327 eval $cachevar=yes
7328 else
7329 eval $cachevar=no
7330 fi
7331 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7332 CXXFLAGS="$ac_save_CXXFLAGS"
7333 fi
7334 eval ac_res=\$$cachevar
7335 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
7336 $as_echo "$ac_res" >&6; }
7337 if eval test x\$$cachevar = xyes; then
7338 CXXFLAGS="$CXXFLAGS $switch"
7339 ac_success=yes
7340 break
7341 fi
7342 done
7343 fi
7344 ac_ext=c
7345 ac_cpp='$CPP $CPPFLAGS'
7346 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7347 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ LIBS >&5'
7348 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7349
7350 if test x$ax_cxx_compile_cxx11_required = xtrue; then
7351 if test x$ac_success = xno; then
7352 as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
7353 fi
7354 else
7355 if test x$ac_success = xno; then
7356 HAVE_CXX11=0
7357 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support wa s found" >&5
7358 $as_echo "$as_me: No compiler with C++11 support was found" >&6;}
7359 else
7360 HAVE_CXX11=1
7361
7362 $as_echo "#define HAVE_CXX11 1" >>confdefs.h
7363
7364 fi
7365
7366
7367 fi
7368
7369
6647 # Only build Linux client libs when compiling for Linux 7370 # Only build Linux client libs when compiling for Linux
6648 case $host in 7371 case $host in
6649 *-*-linux* | *-android* ) 7372 *-*-linux* | *-android* )
6650 LINUX_HOST=true 7373 LINUX_HOST=true
6651 ;; 7374 ;;
6652 esac 7375 esac
6653 if test x$LINUX_HOST = xtrue; then 7376 if test x$LINUX_HOST = xtrue; then
6654 LINUX_HOST_TRUE= 7377 LINUX_HOST_TRUE=
6655 LINUX_HOST_FALSE='#' 7378 LINUX_HOST_FALSE='#'
6656 else 7379 else
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
8247 exec 5>>config.log 8970 exec 5>>config.log
8248 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 8971 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
8249 # would make configure fail if this is the last instruction. 8972 # would make configure fail if this is the last instruction.
8250 $ac_cs_success || as_fn_exit 1 8973 $ac_cs_success || as_fn_exit 1
8251 fi 8974 fi
8252 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then 8975 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
8253 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_un recognized_opts" >&5 8976 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_un recognized_opts" >&5
8254 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} 8977 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
8255 fi 8978 fi
8256 8979
OLDNEW
« no previous file with comments | « no previous file | configure.ac » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698