Mercurial > hg > vamp-plugin-sdk
comparison configure @ 526:459cddd7e64a c++11-mutex
Switch from C++98 to C++11
author | Chris Cannam |
---|---|
date | Wed, 11 Sep 2019 14:30:14 +0100 |
parents | df32b473b9b6 |
children | db2cd87cef6f |
comparison
equal
deleted
inserted
replaced
525:8c18bdaad04f | 526:459cddd7e64a |
---|---|
628 SNDFILE_LIBS | 628 SNDFILE_LIBS |
629 SNDFILE_CFLAGS | 629 SNDFILE_CFLAGS |
630 PKG_CONFIG_LIBDIR | 630 PKG_CONFIG_LIBDIR |
631 PKG_CONFIG_PATH | 631 PKG_CONFIG_PATH |
632 PKG_CONFIG | 632 PKG_CONFIG |
633 HAVE_CXX11 | |
633 EGREP | 634 EGREP |
634 GREP | 635 GREP |
635 CPP | 636 CPP |
636 ac_ct_CC | 637 ac_ct_CC |
637 CFLAGS | 638 CFLAGS |
3668 as_fn_error $? "unknown endianness | 3669 as_fn_error $? "unknown endianness |
3669 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; | 3670 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; |
3670 esac | 3671 esac |
3671 | 3672 |
3672 | 3673 |
3674 # We now require C++11 | |
3675 | |
3676 ax_cxx_compile_cxx11_required=true | |
3677 ac_ext=cpp | |
3678 ac_cpp='$CXXCPP $CPPFLAGS' | |
3679 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3680 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3681 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu | |
3682 ac_success=no | |
3683 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 | |
3684 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } | |
3685 if ${ax_cv_cxx_compile_cxx11+:} false; then : | |
3686 $as_echo_n "(cached) " >&6 | |
3687 else | |
3688 cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3689 /* end confdefs.h. */ | |
3690 | |
3691 template <typename T> | |
3692 struct check | |
3693 { | |
3694 static_assert(sizeof(int) <= sizeof(T), "not big enough"); | |
3695 }; | |
3696 | |
3697 struct Base { | |
3698 virtual void f() {} | |
3699 }; | |
3700 struct Child : public Base { | |
3701 virtual void f() override {} | |
3702 }; | |
3703 | |
3704 typedef check<check<bool>> right_angle_brackets; | |
3705 | |
3706 int a; | |
3707 decltype(a) b; | |
3708 | |
3709 typedef check<int> check_type; | |
3710 check_type c; | |
3711 check_type&& cr = static_cast<check_type&&>(c); | |
3712 | |
3713 auto d = a; | |
3714 auto l = [](){}; | |
3715 | |
3716 _ACEOF | |
3717 if ac_fn_cxx_try_compile "$LINENO"; then : | |
3718 ax_cv_cxx_compile_cxx11=yes | |
3719 else | |
3720 ax_cv_cxx_compile_cxx11=no | |
3721 fi | |
3722 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3723 fi | |
3724 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 | |
3725 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } | |
3726 if test x$ax_cv_cxx_compile_cxx11 = xyes; then | |
3727 ac_success=yes | |
3728 fi | |
3729 | |
3730 | |
3731 | |
3732 if test x$ac_success = xno; then | |
3733 for switch in -std=c++11 -std=c++0x; do | |
3734 cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` | |
3735 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 | |
3736 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } | |
3737 if eval \${$cachevar+:} false; then : | |
3738 $as_echo_n "(cached) " >&6 | |
3739 else | |
3740 ac_save_CXXFLAGS="$CXXFLAGS" | |
3741 CXXFLAGS="$CXXFLAGS $switch" | |
3742 cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3743 /* end confdefs.h. */ | |
3744 | |
3745 template <typename T> | |
3746 struct check | |
3747 { | |
3748 static_assert(sizeof(int) <= sizeof(T), "not big enough"); | |
3749 }; | |
3750 | |
3751 struct Base { | |
3752 virtual void f() {} | |
3753 }; | |
3754 struct Child : public Base { | |
3755 virtual void f() override {} | |
3756 }; | |
3757 | |
3758 typedef check<check<bool>> right_angle_brackets; | |
3759 | |
3760 int a; | |
3761 decltype(a) b; | |
3762 | |
3763 typedef check<int> check_type; | |
3764 check_type c; | |
3765 check_type&& cr = static_cast<check_type&&>(c); | |
3766 | |
3767 auto d = a; | |
3768 auto l = [](){}; | |
3769 | |
3770 _ACEOF | |
3771 if ac_fn_cxx_try_compile "$LINENO"; then : | |
3772 eval $cachevar=yes | |
3773 else | |
3774 eval $cachevar=no | |
3775 fi | |
3776 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3777 CXXFLAGS="$ac_save_CXXFLAGS" | |
3778 fi | |
3779 eval ac_res=\$$cachevar | |
3780 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3781 $as_echo "$ac_res" >&6; } | |
3782 if eval test x\$$cachevar = xyes; then | |
3783 CXXFLAGS="$CXXFLAGS $switch" | |
3784 ac_success=yes | |
3785 break | |
3786 fi | |
3787 done | |
3788 fi | |
3789 ac_ext=c | |
3790 ac_cpp='$CPP $CPPFLAGS' | |
3791 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3792 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3793 ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3794 | |
3795 if test x$ax_cxx_compile_cxx11_required = xtrue; then | |
3796 if test x$ac_success = xno; then | |
3797 as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 | |
3798 fi | |
3799 else | |
3800 if test x$ac_success = xno; then | |
3801 HAVE_CXX11=0 | |
3802 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 | |
3803 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} | |
3804 else | |
3805 HAVE_CXX11=1 | |
3806 | |
3807 $as_echo "#define HAVE_CXX11 1" >>confdefs.h | |
3808 | |
3809 fi | |
3810 | |
3811 | |
3812 fi | |
3813 | |
3814 | |
3673 if pkg-config --modversion vamp-sdk >/dev/null 2>&1; then | 3815 if pkg-config --modversion vamp-sdk >/dev/null 2>&1; then |
3674 echo "WARNING: A version of the Vamp plugin SDK is already installed." | 3816 echo "WARNING: A version of the Vamp plugin SDK is already installed." |
3675 echo " Expect worries and sorrows if you install a new version" | 3817 echo " Expect worries and sorrows if you install a new version" |
3676 echo " without removing the old one first. (Continuing)" | 3818 echo " without removing the old one first. (Continuing)" |
3677 fi | 3819 fi |
3954 esac | 4096 esac |
3955 case " $CFLAGS " in | 4097 case " $CFLAGS " in |
3956 *[\ \ ]-fPIC\ -Wall[\ \ ]*) ;; | 4098 *[\ \ ]-fPIC\ -Wall[\ \ ]*) ;; |
3957 *) CFLAGS="$CFLAGS -fPIC -Wall -Wextra" ;; | 4099 *) CFLAGS="$CFLAGS -fPIC -Wall -Wextra" ;; |
3958 esac | 4100 esac |
3959 CXXFLAGS="$CXXFLAGS -std=c++98" | 4101 CXXFLAGS="$CXXFLAGS -std=c++11" |
3960 fi | 4102 fi |
3961 | 4103 |
3962 | 4104 |
3963 | 4105 |
3964 ac_config_files="$ac_config_files Makefile" | 4106 ac_config_files="$ac_config_files Makefile" |