Mercurial > hg > svcore
comparison configure @ 1057:5c5d4863b428 tonioni
Merge from cxx11 branch
author | Chris Cannam |
---|---|
date | Mon, 23 Mar 2015 11:26:28 +0000 |
parents | 98d4dabbf740 |
children | 135c5899a71f |
comparison
equal
deleted
inserted
replaced
1056:c4898e57eea5 | 1057:5c5d4863b428 |
---|---|
671 PKG_CONFIG_PATH | 671 PKG_CONFIG_PATH |
672 PKG_CONFIG | 672 PKG_CONFIG |
673 EGREP | 673 EGREP |
674 GREP | 674 GREP |
675 CXXCPP | 675 CXXCPP |
676 HAVE_CXX11 | |
676 MKDIR_P | 677 MKDIR_P |
677 INSTALL_DATA | 678 INSTALL_DATA |
678 INSTALL_SCRIPT | 679 INSTALL_SCRIPT |
679 INSTALL_PROGRAM | 680 INSTALL_PROGRAM |
680 ac_ct_CXX | 681 ac_ct_CXX |
3447 fi | 3448 fi |
3448 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 | 3449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 |
3449 $as_echo "$MKDIR_P" >&6; } | 3450 $as_echo "$MKDIR_P" >&6; } |
3450 | 3451 |
3451 | 3452 |
3453 # We are daringly making use of C++11 now | |
3454 | |
3455 ax_cxx_compile_cxx11_required=true | |
3456 ac_ext=cpp | |
3457 ac_cpp='$CXXCPP $CPPFLAGS' | |
3458 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3459 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3460 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu | |
3461 ac_success=no | |
3462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 | |
3463 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } | |
3464 if ${ax_cv_cxx_compile_cxx11+:} false; then : | |
3465 $as_echo_n "(cached) " >&6 | |
3466 else | |
3467 cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3468 /* end confdefs.h. */ | |
3469 | |
3470 template <typename T> | |
3471 struct check | |
3472 { | |
3473 static_assert(sizeof(int) <= sizeof(T), "not big enough"); | |
3474 }; | |
3475 | |
3476 struct Base { | |
3477 virtual void f() {} | |
3478 }; | |
3479 struct Child : public Base { | |
3480 virtual void f() override {} | |
3481 }; | |
3482 | |
3483 typedef check<check<bool>> right_angle_brackets; | |
3484 | |
3485 int a; | |
3486 decltype(a) b; | |
3487 | |
3488 typedef check<int> check_type; | |
3489 check_type c; | |
3490 check_type&& cr = static_cast<check_type&&>(c); | |
3491 | |
3492 auto d = a; | |
3493 auto l = [](){}; | |
3494 | |
3495 _ACEOF | |
3496 if ac_fn_cxx_try_compile "$LINENO"; then : | |
3497 ax_cv_cxx_compile_cxx11=yes | |
3498 else | |
3499 ax_cv_cxx_compile_cxx11=no | |
3500 fi | |
3501 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3502 fi | |
3503 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 | |
3504 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } | |
3505 if test x$ax_cv_cxx_compile_cxx11 = xyes; then | |
3506 ac_success=yes | |
3507 fi | |
3508 | |
3509 | |
3510 | |
3511 if test x$ac_success = xno; then | |
3512 for switch in -std=c++11 -std=c++0x; do | |
3513 cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` | |
3514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 | |
3515 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } | |
3516 if eval \${$cachevar+:} false; then : | |
3517 $as_echo_n "(cached) " >&6 | |
3518 else | |
3519 ac_save_CXXFLAGS="$CXXFLAGS" | |
3520 CXXFLAGS="$CXXFLAGS $switch" | |
3521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3522 /* end confdefs.h. */ | |
3523 | |
3524 template <typename T> | |
3525 struct check | |
3526 { | |
3527 static_assert(sizeof(int) <= sizeof(T), "not big enough"); | |
3528 }; | |
3529 | |
3530 struct Base { | |
3531 virtual void f() {} | |
3532 }; | |
3533 struct Child : public Base { | |
3534 virtual void f() override {} | |
3535 }; | |
3536 | |
3537 typedef check<check<bool>> right_angle_brackets; | |
3538 | |
3539 int a; | |
3540 decltype(a) b; | |
3541 | |
3542 typedef check<int> check_type; | |
3543 check_type c; | |
3544 check_type&& cr = static_cast<check_type&&>(c); | |
3545 | |
3546 auto d = a; | |
3547 auto l = [](){}; | |
3548 | |
3549 _ACEOF | |
3550 if ac_fn_cxx_try_compile "$LINENO"; then : | |
3551 eval $cachevar=yes | |
3552 else | |
3553 eval $cachevar=no | |
3554 fi | |
3555 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3556 CXXFLAGS="$ac_save_CXXFLAGS" | |
3557 fi | |
3558 eval ac_res=\$$cachevar | |
3559 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3560 $as_echo "$ac_res" >&6; } | |
3561 if eval test x\$$cachevar = xyes; then | |
3562 CXXFLAGS="$CXXFLAGS $switch" | |
3563 ac_success=yes | |
3564 break | |
3565 fi | |
3566 done | |
3567 fi | |
3568 ac_ext=cpp | |
3569 ac_cpp='$CXXCPP $CPPFLAGS' | |
3570 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3571 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3572 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu | |
3573 | |
3574 if test x$ax_cxx_compile_cxx11_required = xtrue; then | |
3575 if test x$ac_success = xno; then | |
3576 as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 | |
3577 fi | |
3578 else | |
3579 if test x$ac_success = xno; then | |
3580 HAVE_CXX11=0 | |
3581 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 | |
3582 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} | |
3583 else | |
3584 HAVE_CXX11=1 | |
3585 | |
3586 $as_echo "#define HAVE_CXX11 1" >>confdefs.h | |
3587 | |
3588 fi | |
3589 | |
3590 | |
3591 fi | |
3592 | |
3452 | 3593 |
3453 ac_ext=cpp | 3594 ac_ext=cpp |
3454 ac_cpp='$CXXCPP $CPPFLAGS' | 3595 ac_cpp='$CXXCPP $CPPFLAGS' |
3455 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' | 3596 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
3456 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | 3597 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
4200 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" | 4341 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" |
4201 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" | 4342 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" |
4202 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" | 4343 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" |
4203 | 4344 |
4204 if test "x$GCC" = "xyes"; then | 4345 if test "x$GCC" = "xyes"; then |
4205 CXXFLAGS_DEBUG="-Wall -Wextra -Werror -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe" | 4346 CXXFLAGS_ANY="-Wall -Wextra -Werror -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe" |
4206 CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe" | 4347 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g" |
4207 CXXFLAGS_MINIMAL="-g0 -O0" | 4348 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O2" |
4349 CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0" | |
4208 fi | 4350 fi |
4209 | 4351 |
4210 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" | 4352 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" |
4211 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" | 4353 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" |
4212 | 4354 |