diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-04-09 13:31:03 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-04-09 14:09:24 -0400 |
commit | 41260ac25d541d9bdd039a0ce82c9ad31fceed35 (patch) | |
tree | b258c62ab91b74a2ef7bb50f452623679592c96d /gdb/configure | |
parent | c4a614e2395a7673395208cfd55d590e3c6c114f (diff) | |
download | gdb-41260ac25d541d9bdd039a0ce82c9ad31fceed35.zip gdb-41260ac25d541d9bdd039a0ce82c9ad31fceed35.tar.gz gdb-41260ac25d541d9bdd039a0ce82c9ad31fceed35.tar.bz2 |
Update ax_cv_cxx_compile_cxx.m4
This file provides the AX_CXX_COMPILE_STDCXX macro. In the context of
the following patch, I wanted to build and test GDB in c++17 mode. The
version of the macro we have in the repo does not support detecting
c++17 compilers, but the upstream version has been updated to do so.
Since we have local modifications to the file, I had to reconcile our
modifications and the updated upstream version (which was relatively
straightforward).
gdb/ChangeLog:
* ax_cxx_compile_stdcxx.m4: Sync with upstream.
* configure: Re-generate.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-x | gdb/configure | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gdb/configure b/gdb/configure index f2acc1b..b313152 100755 --- a/gdb/configure +++ b/gdb/configure @@ -4967,7 +4967,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # We require a C++11 compiler. Check if one is available, and if # necessary, set CXX_DIALECT to some -std=xxx switch. - ax_cxx_compile_cxx11_required=true + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5283,7 +5283,8 @@ $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } fi if test x$ac_success = xno; then - for switch in -std=gnu++11 -std=gnu++0x; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } @@ -5601,16 +5602,17 @@ $as_echo "$ac_res" >&6; } fi if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if { as_var=$cachevar; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5905,14 +5907,18 @@ else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXX="$ac_save_CXX" + CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX_DIALECT="$switch" - ac_success=yes + if eval test x\$$cachevar = xyes; then + CXX_DIALECT="$switch" + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done |