llvm.org GIT mirror llvm / 0893113
Sink the autoconf check for sufficiently modern host toolchain below the enable flag that selects the C++ standard library to use with the host toolchain. Otherwise we end up testing the wrong config. I'm not really happy about this placement, but its pragmatic and should unblock the Apple builders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199325 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
2 changed file(s) with 337 addition(s) and 335 deletion(s). Raw diff Collapse all Expand all
113113 llvm_cv_cxx_compiler=gcc, [])])
114114 AC_LANG_POP([C++])
115115 AC_MSG_RESULT([${llvm_cv_cxx_compiler}])
116
117 dnl Check both GCC and Clang for sufficiently modern versions. These checks can
118 dnl be bypassed by passing a flag if necessary on a platform.
119 AC_ARG_ENABLE(compiler-version-checks,
120 AS_HELP_STRING([--enable-compiler-version-checks],
121 [Check the version of the host compiler (default is YES)]),,
122 enableval=default)
123 case "$enableval" in
124 no)
125 ;;
126 yes|default)
127 AC_LANG_PUSH([C++])
128 case "$llvm_cv_cxx_compiler" in
129 clang)
130 AC_MSG_CHECKING([whether Clang is new enough])
131 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
132 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
133 #error This version of Clang is too old to build LLVM
134 #endif
135 ]])],
136 [AC_MSG_RESULT([yes])],
137 [AC_MSG_RESULT([no])
138 AC_MSG_ERROR([
139 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
140 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
141 bypass these sanity checks.])])
142
143 dnl Note that libstdc++4.6 is known broken for C++11 builds. The errors
144 dnl are sometimes deeply confusing though. Here we test for an obvious
145 dnl incomplete feature in 4.6's standard library that was completed in
146 dnl 4.7's.
147 AC_MSG_CHECKING([whether Clang will select a modern C++ standard library])
148 llvm_cv_old_cxxflags="$CXXFLAGS"
149 CXXFLAGS="$CXXFLAGS -std=c++0x"
150 AC_LINK_IFELSE([AC_LANG_SOURCE([[
151 #include
152 std::atomic x(0.0f);
153 int main() { return (float)x; }
154 ]])],
155 [AC_MSG_RESULT([yes])],
156 [AC_MSG_RESULT([no])
157 AC_MSG_ERROR([
158 We detected a missing feature in the standard C++ library that was known to be
159 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
160 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
161 than 4.7. You will need to update your system and ensure Clang uses the newer
162 standard library.
163
164 If this error is incorrect or you need to force things to work, you may pass
165 '--disable-compiler-version-checks' to configure to bypass this test.])])
166 CXXFLAGS="$llvm_cv_old_cxxflags"
167 ;;
168 gcc)
169 AC_MSG_CHECKING([whether GCC is new enough])
170 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
171 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
172 #error This version of GCC is too old to build LLVM
173 #endif
174 ]])],
175 [AC_MSG_RESULT([yes])],
176 [AC_MSG_RESULT([no])
177 AC_MSG_ERROR([
178 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
179 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
180 bypass these sanity checks.])])
181 ;;
182 unknown)
183 ;;
184 esac
185 AC_LANG_POP([C++])
186 ;;
187 *)
188 AC_MSG_ERROR([Invalid setting for --enable-compiler-version-checks. Use "yes" or "no"])
189 ;;
190 esac
191116
192117 dnl Configure all of the projects present in our source tree. While we could
193118 dnl just AC_CONFIG_SUBDIRS on the set of directories in projects that have a
581506 *) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
582507 esac
583508
509 dnl Check both GCC and Clang for sufficiently modern versions. These checks can
510 dnl be bypassed by passing a flag if necessary on a platform. We have to do
511 dnl these checks here so that we have the configuration of the standard C++
512 dnl library finished.
513 AC_ARG_ENABLE(compiler-version-checks,
514 AS_HELP_STRING([--enable-compiler-version-checks],
515 [Check the version of the host compiler (default is YES)]),,
516 enableval=default)
517 case "$enableval" in
518 no)
519 ;;
520 yes|default)
521 AC_LANG_PUSH([C++])
522 case "$llvm_cv_cxx_compiler" in
523 clang)
524 AC_MSG_CHECKING([whether Clang is new enough])
525 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
526 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
527 #error This version of Clang is too old to build LLVM
528 #endif
529 ]])],
530 [AC_MSG_RESULT([yes])],
531 [AC_MSG_RESULT([no])
532 AC_MSG_ERROR([
533 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
534 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
535 bypass these sanity checks.])])
536
537 dnl Note that libstdc++4.6 is known broken for C++11 builds. The errors
538 dnl are sometimes deeply confusing though. Here we test for an obvious
539 dnl incomplete feature in 4.6's standard library that was completed in
540 dnl 4.7's.
541 AC_MSG_CHECKING([whether Clang will select a modern C++ standard library])
542 llvm_cv_old_cxxflags="$CXXFLAGS"
543 CXXFLAGS="$CXXFLAGS -std=c++0x"
544 AC_LINK_IFELSE([AC_LANG_SOURCE([[
545 #include
546 std::atomic x(0.0f);
547 int main() { return (float)x; }
548 ]])],
549 [AC_MSG_RESULT([yes])],
550 [AC_MSG_RESULT([no])
551 AC_MSG_ERROR([
552 We detected a missing feature in the standard C++ library that was known to be
553 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
554 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
555 than 4.7. You will need to update your system and ensure Clang uses the newer
556 standard library.
557
558 If this error is incorrect or you need to force things to work, you may pass
559 '--disable-compiler-version-checks' to configure to bypass this test.])])
560 CXXFLAGS="$llvm_cv_old_cxxflags"
561 ;;
562 gcc)
563 AC_MSG_CHECKING([whether GCC is new enough])
564 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
565 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
566 #error This version of GCC is too old to build LLVM
567 #endif
568 ]])],
569 [AC_MSG_RESULT([yes])],
570 [AC_MSG_RESULT([no])
571 AC_MSG_ERROR([
572 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
573 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
574 bypass these sanity checks.])])
575 ;;
576 unknown)
577 ;;
578 esac
579 AC_LANG_POP([C++])
580 ;;
581 *)
582 AC_MSG_ERROR([Invalid setting for --enable-compiler-version-checks. Use "yes" or "no"])
583 ;;
584 esac
585
584586 dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
585587 AC_ARG_ENABLE(cxx11,
586588 AS_HELP_STRING([--enable-cxx11],
13941394 Optional Features:
13951395 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
13961396 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1397 --enable-polly Use polly if available (default is YES)
1398 --enable-libcpp Use libc++ if available (default is NO)
13971399 --enable-compiler-version-checks
13981400 Check the version of the host compiler (default is
13991401 YES)
1400 --enable-polly Use polly if available (default is YES)
1401 --enable-libcpp Use libc++ if available (default is NO)
14021402 --enable-cxx11 Use c++11 if available (default is NO)
14031403 --enable-split-dwarf Use split-dwarf if available (default is NO)
14041404 --enable-clang-arcmt Enable building of clang ARCMT (default is YES)
37003700
37013701 { echo "$as_me:$LINENO: result: ${llvm_cv_cxx_compiler}" >&5
37023702 echo "${ECHO_T}${llvm_cv_cxx_compiler}" >&6; }
3703
3704 # Check whether --enable-compiler-version-checks was given.
3705 if test "${enable_compiler_version_checks+set}" = set; then
3706 enableval=$enable_compiler_version_checks;
3707 else
3708 enableval=default
3709 fi
3710
3711 case "$enableval" in
3712 no)
3713 ;;
3714 yes|default)
3715 ac_ext=cpp
3716 ac_cpp='$CXXCPP $CPPFLAGS'
3717 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3718 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3719 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
3720
3721 case "$llvm_cv_cxx_compiler" in
3722 clang)
3723 { echo "$as_me:$LINENO: checking whether Clang is new enough" >&5
3724 echo $ECHO_N "checking whether Clang is new enough... $ECHO_C" >&6; }
3725 cat >conftest.$ac_ext <<_ACEOF
3726 /* confdefs.h. */
3727 _ACEOF
3728 cat confdefs.h >>conftest.$ac_ext
3729 cat >>conftest.$ac_ext <<_ACEOF
3730 /* end confdefs.h. */
3731
3732 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
3733 #error This version of Clang is too old to build LLVM
3734 #endif
3735
3736 _ACEOF
3737 rm -f conftest.$ac_objext
3738 if { (ac_try="$ac_compile"
3739 case "(($ac_try" in
3740 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3741 *) ac_try_echo=$ac_try;;
3742 esac
3743 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3744 (eval "$ac_compile") 2>conftest.er1
3745 ac_status=$?
3746 grep -v '^ *+' conftest.er1 >conftest.err
3747 rm -f conftest.er1
3748 cat conftest.err >&5
3749 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3750 (exit $ac_status); } &&
3751 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
3752 { (case "(($ac_try" in
3753 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3754 *) ac_try_echo=$ac_try;;
3755 esac
3756 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3757 (eval "$ac_try") 2>&5
3758 ac_status=$?
3759 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3760 (exit $ac_status); }; } &&
3761 { ac_try='test -s conftest.$ac_objext'
3762 { (case "(($ac_try" in
3763 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3764 *) ac_try_echo=$ac_try;;
3765 esac
3766 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3767 (eval "$ac_try") 2>&5
3768 ac_status=$?
3769 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3770 (exit $ac_status); }; }; then
3771 { echo "$as_me:$LINENO: result: yes" >&5
3772 echo "${ECHO_T}yes" >&6; }
3773 else
3774 echo "$as_me: failed program was:" >&5
3775 sed 's/^/| /' conftest.$ac_ext >&5
3776
3777 { echo "$as_me:$LINENO: result: no" >&5
3778 echo "${ECHO_T}no" >&6; }
3779 { { echo "$as_me:$LINENO: error:
3780 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
3781 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
3782 bypass these sanity checks." >&5
3783 echo "$as_me: error:
3784 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
3785 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
3786 bypass these sanity checks." >&2;}
3787 { (exit 1); exit 1; }; }
3788 fi
3789
3790 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3791
3792 { echo "$as_me:$LINENO: checking whether Clang will select a modern C++ standard library" >&5
3793 echo $ECHO_N "checking whether Clang will select a modern C++ standard library... $ECHO_C" >&6; }
3794 llvm_cv_old_cxxflags="$CXXFLAGS"
3795 CXXFLAGS="$CXXFLAGS -std=c++0x"
3796 cat >conftest.$ac_ext <<_ACEOF
3797 /* confdefs.h. */
3798 _ACEOF
3799 cat confdefs.h >>conftest.$ac_ext
3800 cat >>conftest.$ac_ext <<_ACEOF
3801 /* end confdefs.h. */
3802
3803 #include
3804 std::atomic x(0.0f);
3805 int main() { return (float)x; }
3806
3807 _ACEOF
3808 rm -f conftest.$ac_objext conftest$ac_exeext
3809 if { (ac_try="$ac_link"
3810 case "(($ac_try" in
3811 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3812 *) ac_try_echo=$ac_try;;
3813 esac
3814 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3815 (eval "$ac_link") 2>conftest.er1
3816 ac_status=$?
3817 grep -v '^ *+' conftest.er1 >conftest.err
3818 rm -f conftest.er1
3819 cat conftest.err >&5
3820 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3821 (exit $ac_status); } &&
3822 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
3823 { (case "(($ac_try" in
3824 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3825 *) ac_try_echo=$ac_try;;
3826 esac
3827 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3828 (eval "$ac_try") 2>&5
3829 ac_status=$?
3830 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3831 (exit $ac_status); }; } &&
3832 { ac_try='test -s conftest$ac_exeext'
3833 { (case "(($ac_try" in
3834 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3835 *) ac_try_echo=$ac_try;;
3836 esac
3837 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3838 (eval "$ac_try") 2>&5
3839 ac_status=$?
3840 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3841 (exit $ac_status); }; }; then
3842 { echo "$as_me:$LINENO: result: yes" >&5
3843 echo "${ECHO_T}yes" >&6; }
3844 else
3845 echo "$as_me: failed program was:" >&5
3846 sed 's/^/| /' conftest.$ac_ext >&5
3847
3848 { echo "$as_me:$LINENO: result: no" >&5
3849 echo "${ECHO_T}no" >&6; }
3850 { { echo "$as_me:$LINENO: error:
3851 We detected a missing feature in the standard C++ library that was known to be
3852 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
3853 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
3854 than 4.7. You will need to update your system and ensure Clang uses the newer
3855 standard library.
3856
3857 If this error is incorrect or you need to force things to work, you may pass
3858 '--disable-compiler-version-checks' to configure to bypass this test." >&5
3859 echo "$as_me: error:
3860 We detected a missing feature in the standard C++ library that was known to be
3861 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
3862 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
3863 than 4.7. You will need to update your system and ensure Clang uses the newer
3864 standard library.
3865
3866 If this error is incorrect or you need to force things to work, you may pass
3867 '--disable-compiler-version-checks' to configure to bypass this test." >&2;}
3868 { (exit 1); exit 1; }; }
3869 fi
3870
3871 rm -f core conftest.err conftest.$ac_objext \
3872 conftest$ac_exeext conftest.$ac_ext
3873 CXXFLAGS="$llvm_cv_old_cxxflags"
3874 ;;
3875 gcc)
3876 { echo "$as_me:$LINENO: checking whether GCC is new enough" >&5
3877 echo $ECHO_N "checking whether GCC is new enough... $ECHO_C" >&6; }
3878 cat >conftest.$ac_ext <<_ACEOF
3879 /* confdefs.h. */
3880 _ACEOF
3881 cat confdefs.h >>conftest.$ac_ext
3882 cat >>conftest.$ac_ext <<_ACEOF
3883 /* end confdefs.h. */
3884
3885 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
3886 #error This version of GCC is too old to build LLVM
3887 #endif
3888
3889 _ACEOF
3890 rm -f conftest.$ac_objext
3891 if { (ac_try="$ac_compile"
3892 case "(($ac_try" in
3893 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3894 *) ac_try_echo=$ac_try;;
3895 esac
3896 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3897 (eval "$ac_compile") 2>conftest.er1
3898 ac_status=$?
3899 grep -v '^ *+' conftest.er1 >conftest.err
3900 rm -f conftest.er1
3901 cat conftest.err >&5
3902 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3903 (exit $ac_status); } &&
3904 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
3905 { (case "(($ac_try" in
3906 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3907 *) ac_try_echo=$ac_try;;
3908 esac
3909 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3910 (eval "$ac_try") 2>&5
3911 ac_status=$?
3912 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3913 (exit $ac_status); }; } &&
3914 { ac_try='test -s conftest.$ac_objext'
3915 { (case "(($ac_try" in
3916 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3917 *) ac_try_echo=$ac_try;;
3918 esac
3919 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3920 (eval "$ac_try") 2>&5
3921 ac_status=$?
3922 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3923 (exit $ac_status); }; }; then
3924 { echo "$as_me:$LINENO: result: yes" >&5
3925 echo "${ECHO_T}yes" >&6; }
3926 else
3927 echo "$as_me: failed program was:" >&5
3928 sed 's/^/| /' conftest.$ac_ext >&5
3929
3930 { echo "$as_me:$LINENO: result: no" >&5
3931 echo "${ECHO_T}no" >&6; }
3932 { { echo "$as_me:$LINENO: error:
3933 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
3934 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
3935 bypass these sanity checks." >&5
3936 echo "$as_me: error:
3937 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
3938 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
3939 bypass these sanity checks." >&2;}
3940 { (exit 1); exit 1; }; }
3941 fi
3942
3943 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3944 ;;
3945 unknown)
3946 ;;
3947 esac
3948 ac_ext=c
3949 ac_cpp='$CPP $CPPFLAGS'
3950 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3951 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3952 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3953
3954 ;;
3955 *)
3956 { { echo "$as_me:$LINENO: error: Invalid setting for --enable-compiler-version-checks. Use \"yes\" or \"no\"" >&5
3957 echo "$as_me: error: Invalid setting for --enable-compiler-version-checks. Use \"yes\" or \"no\"" >&2;}
3958 { (exit 1); exit 1; }; }
3959 ;;
3960 esac
39613703
39623704
39633705
47894531 { (exit 1); exit 1; }; } ;;
47904532 esac
47914533
4534 # Check whether --enable-compiler-version-checks was given.
4535 if test "${enable_compiler_version_checks+set}" = set; then
4536 enableval=$enable_compiler_version_checks;
4537 else
4538 enableval=default
4539 fi
4540
4541 case "$enableval" in
4542 no)
4543 ;;
4544 yes|default)
4545 ac_ext=cpp
4546 ac_cpp='$CXXCPP $CPPFLAGS'
4547 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4548 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4549 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
4550
4551 case "$llvm_cv_cxx_compiler" in
4552 clang)
4553 { echo "$as_me:$LINENO: checking whether Clang is new enough" >&5
4554 echo $ECHO_N "checking whether Clang is new enough... $ECHO_C" >&6; }
4555 cat >conftest.$ac_ext <<_ACEOF
4556 /* confdefs.h. */
4557 _ACEOF
4558 cat confdefs.h >>conftest.$ac_ext
4559 cat >>conftest.$ac_ext <<_ACEOF
4560 /* end confdefs.h. */
4561
4562 #if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
4563 #error This version of Clang is too old to build LLVM
4564 #endif
4565
4566 _ACEOF
4567 rm -f conftest.$ac_objext
4568 if { (ac_try="$ac_compile"
4569 case "(($ac_try" in
4570 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4571 *) ac_try_echo=$ac_try;;
4572 esac
4573 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4574 (eval "$ac_compile") 2>conftest.er1
4575 ac_status=$?
4576 grep -v '^ *+' conftest.er1 >conftest.err
4577 rm -f conftest.er1
4578 cat conftest.err >&5
4579 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4580 (exit $ac_status); } &&
4581 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
4582 { (case "(($ac_try" in
4583 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4584 *) ac_try_echo=$ac_try;;
4585 esac
4586 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4587 (eval "$ac_try") 2>&5
4588 ac_status=$?
4589 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4590 (exit $ac_status); }; } &&
4591 { ac_try='test -s conftest.$ac_objext'
4592 { (case "(($ac_try" in
4593 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4594 *) ac_try_echo=$ac_try;;
4595 esac
4596 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4597 (eval "$ac_try") 2>&5
4598 ac_status=$?
4599 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4600 (exit $ac_status); }; }; then
4601 { echo "$as_me:$LINENO: result: yes" >&5
4602 echo "${ECHO_T}yes" >&6; }
4603 else
4604 echo "$as_me: failed program was:" >&5
4605 sed 's/^/| /' conftest.$ac_ext >&5
4606
4607 { echo "$as_me:$LINENO: result: no" >&5
4608 echo "${ECHO_T}no" >&6; }
4609 { { echo "$as_me:$LINENO: error:
4610 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
4611 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
4612 bypass these sanity checks." >&5
4613 echo "$as_me: error:
4614 The selected Clang compiler is not new enough to build LLVM. Please upgrade to
4615 Clang 3.1. You may pass --disable-compiler-version-checks to configure to
4616 bypass these sanity checks." >&2;}
4617 { (exit 1); exit 1; }; }
4618 fi
4619
4620 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4621
4622 { echo "$as_me:$LINENO: checking whether Clang will select a modern C++ standard library" >&5
4623 echo $ECHO_N "checking whether Clang will select a modern C++ standard library... $ECHO_C" >&6; }
4624 llvm_cv_old_cxxflags="$CXXFLAGS"
4625 CXXFLAGS="$CXXFLAGS -std=c++0x"
4626 cat >conftest.$ac_ext <<_ACEOF
4627 /* confdefs.h. */
4628 _ACEOF
4629 cat confdefs.h >>conftest.$ac_ext
4630 cat >>conftest.$ac_ext <<_ACEOF
4631 /* end confdefs.h. */
4632
4633 #include
4634 std::atomic x(0.0f);
4635 int main() { return (float)x; }
4636
4637 _ACEOF
4638 rm -f conftest.$ac_objext conftest$ac_exeext
4639 if { (ac_try="$ac_link"
4640 case "(($ac_try" in
4641 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4642 *) ac_try_echo=$ac_try;;
4643 esac
4644 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4645 (eval "$ac_link") 2>conftest.er1
4646 ac_status=$?
4647 grep -v '^ *+' conftest.er1 >conftest.err
4648 rm -f conftest.er1
4649 cat conftest.err >&5
4650 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4651 (exit $ac_status); } &&
4652 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
4653 { (case "(($ac_try" in
4654 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4655 *) ac_try_echo=$ac_try;;
4656 esac
4657 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4658 (eval "$ac_try") 2>&5
4659 ac_status=$?
4660 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4661 (exit $ac_status); }; } &&
4662 { ac_try='test -s conftest$ac_exeext'
4663 { (case "(($ac_try" in
4664 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4665 *) ac_try_echo=$ac_try;;
4666 esac
4667 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4668 (eval "$ac_try") 2>&5
4669 ac_status=$?
4670 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4671 (exit $ac_status); }; }; then
4672 { echo "$as_me:$LINENO: result: yes" >&5
4673 echo "${ECHO_T}yes" >&6; }
4674 else
4675 echo "$as_me: failed program was:" >&5
4676 sed 's/^/| /' conftest.$ac_ext >&5
4677
4678 { echo "$as_me:$LINENO: result: no" >&5
4679 echo "${ECHO_T}no" >&6; }
4680 { { echo "$as_me:$LINENO: error:
4681 We detected a missing feature in the standard C++ library that was known to be
4682 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
4683 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
4684 than 4.7. You will need to update your system and ensure Clang uses the newer
4685 standard library.
4686
4687 If this error is incorrect or you need to force things to work, you may pass
4688 '--disable-compiler-version-checks' to configure to bypass this test." >&5
4689 echo "$as_me: error:
4690 We detected a missing feature in the standard C++ library that was known to be
4691 missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
4692 C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
4693 than 4.7. You will need to update your system and ensure Clang uses the newer
4694 standard library.
4695
4696 If this error is incorrect or you need to force things to work, you may pass
4697 '--disable-compiler-version-checks' to configure to bypass this test." >&2;}
4698 { (exit 1); exit 1; }; }
4699 fi
4700
4701 rm -f core conftest.err conftest.$ac_objext \
4702 conftest$ac_exeext conftest.$ac_ext
4703 CXXFLAGS="$llvm_cv_old_cxxflags"
4704 ;;
4705 gcc)
4706 { echo "$as_me:$LINENO: checking whether GCC is new enough" >&5
4707 echo $ECHO_N "checking whether GCC is new enough... $ECHO_C" >&6; }
4708 cat >conftest.$ac_ext <<_ACEOF
4709 /* confdefs.h. */
4710 _ACEOF
4711 cat confdefs.h >>conftest.$ac_ext
4712 cat >>conftest.$ac_ext <<_ACEOF
4713 /* end confdefs.h. */
4714
4715 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
4716 #error This version of GCC is too old to build LLVM
4717 #endif
4718
4719 _ACEOF
4720 rm -f conftest.$ac_objext
4721 if { (ac_try="$ac_compile"
4722 case "(($ac_try" in
4723 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4724 *) ac_try_echo=$ac_try;;
4725 esac
4726 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4727 (eval "$ac_compile") 2>conftest.er1
4728 ac_status=$?
4729 grep -v '^ *+' conftest.er1 >conftest.err
4730 rm -f conftest.er1
4731 cat conftest.err >&5
4732 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4733 (exit $ac_status); } &&
4734 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
4735 { (case "(($ac_try" in
4736 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4737 *) ac_try_echo=$ac_try;;
4738 esac
4739 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4740 (eval "$ac_try") 2>&5
4741 ac_status=$?
4742 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4743 (exit $ac_status); }; } &&
4744 { ac_try='test -s conftest.$ac_objext'
4745 { (case "(($ac_try" in
4746 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4747 *) ac_try_echo=$ac_try;;
4748 esac
4749 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4750 (eval "$ac_try") 2>&5
4751 ac_status=$?
4752 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4753 (exit $ac_status); }; }; then
4754 { echo "$as_me:$LINENO: result: yes" >&5
4755 echo "${ECHO_T}yes" >&6; }
4756 else
4757 echo "$as_me: failed program was:" >&5
4758 sed 's/^/| /' conftest.$ac_ext >&5
4759
4760 { echo "$as_me:$LINENO: result: no" >&5
4761 echo "${ECHO_T}no" >&6; }
4762 { { echo "$as_me:$LINENO: error:
4763 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
4764 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
4765 bypass these sanity checks." >&5
4766 echo "$as_me: error:
4767 The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
4768 to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
4769 bypass these sanity checks." >&2;}
4770 { (exit 1); exit 1; }; }
4771 fi
4772
4773 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4774 ;;
4775 unknown)
4776 ;;
4777 esac
4778 ac_ext=c
4779 ac_cpp='$CPP $CPPFLAGS'
4780 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4781 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4782 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4783
4784 ;;
4785 *)
4786 { { echo "$as_me:$LINENO: error: Invalid setting for --enable-compiler-version-checks. Use \"yes\" or \"no\"" >&5
4787 echo "$as_me: error: Invalid setting for --enable-compiler-version-checks. Use \"yes\" or \"no\"" >&2;}
4788 { (exit 1); exit 1; }; }
4789 ;;
4790 esac
4791
47924792 # Check whether --enable-cxx11 was given.
47934793 if test "${enable_cxx11+set}" = set; then
47944794 enableval=$enable_cxx11;