diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2021-07-20 14:00:38 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2021-07-21 13:40:17 +0100 |
commit | e4d306cf706eef83f99d510c308eda1539d05875 (patch) | |
tree | 934b0b0a803e0edcbb5b815bd4104a482e891e5a /c++tools/configure.ac | |
parent | f8884b9c51faea329196bf5914bcd2d700622c38 (diff) | |
download | gcc-e4d306cf706eef83f99d510c308eda1539d05875.tar.gz |
c++tools, configury: Configure with C++; test checking status [PR98821].
The c++tools configure fragments need to be built with a C++ compiler.
In addition, the stand-alone server uses diagnostic mechanisms in common
with GCC, but needs to define implementations for gcc_assert and
supporting output functions.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/98821 - modules : c++tools configures with CC but code fragments assume CXX.
PR c++/98821
c++tools/ChangeLog:
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Configure using C++. Pull logic to
detect enabled checking modes; default to release
checking.
* server.cc (AI_NUMERICSERV): Define a fallback value.
(gcc_assert): New.
(gcc_unreachable): New.
(fancy_abort): Only build when checking is enabled.
Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'c++tools/configure.ac')
-rw-r--r-- | c++tools/configure.ac | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/c++tools/configure.ac b/c++tools/configure.ac index 70fcb641db9..f991f63077f 100644 --- a/c++tools/configure.ac +++ b/c++tools/configure.ac @@ -41,6 +41,8 @@ MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf]) AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader]) +AC_LANG(C++) + dnl Enabled by default AC_MSG_CHECKING([whether to build C++ tools]) AC_ARG_ENABLE(c++-tools, @@ -67,6 +69,35 @@ AC_MSG_RESULT([$maintainer_mode]) test "$maintainer_mode" = yes && MAINTAINER=yes AC_SUBST(MAINTAINER) +# Handle configuration of checking; for the tools in this directory we +# default to release checking and stricter checks do not change this. + +AC_ARG_ENABLE(checking, +[AS_HELP_STRING([[--enable-checking[=LIST]]], + [enable expensive run-time checks. With LIST, + enable only specific categories of checks. + Categories are: yes,no,all,none,release.])], +[ac_checking_flags="${enableval}"],[ +# Default to checking. +ac_checking_flags=yes +]) +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in release $ac_checking_flags +do + case $check in + # these set all the flags to specific states + yes|all|release|assert) ac_assert_checking=1 ; ;; + no|none) ac_assert_checking= ; ;; + *) ;; + esac +done +IFS="$ac_save_IFS" + +if test x$ac_assert_checking != x ; then + AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, +[Define if you want assertions enabled. This is a cheap check.]) +fi + # Check whether --enable-default-pie was given. AC_ARG_ENABLE(default-pie, [AS_HELP_STRING([--enable-default-pie], |