diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-28 09:58:47 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-28 09:58:47 +0000 |
commit | 61ed1f10c1953a1f235ec02d8795eb6ac2b9f71c (patch) | |
tree | 02e8deb1f6a0854b3d5c12df42f42b182142adcf /libcpp/configure.ac | |
parent | 3e88585b58d32cadbea3d6f9b6eb00cde3ef59fa (diff) | |
download | gcc-61ed1f10c1953a1f235ec02d8795eb6ac2b9f71c.tar.gz |
* configure.ac: Don't define ENABLE_CHECKING whenever
--enable-checking is seen, instead use similar --enable-checking=yes
vs. --enable-checking=release default as gcc/ subdir has and
define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
Define ENABLE_VALGRIND_CHECKING if requested.
* lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
struct first in the allocated buffer and result->base after it.
(_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
instead of buff->base.
* config.in: Regenerated.
* configure: Regenerated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196333 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/configure.ac')
-rw-r--r-- | libcpp/configure.ac | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/libcpp/configure.ac b/libcpp/configure.ac index 34ae5c20622..e0c4ae6958f 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -123,15 +123,53 @@ else fi AC_SUBST(MAINT) -AC_ARG_ENABLE(checking, -[ --enable-checking enable expensive run-time checks],, -enable_checking=no) +# Enable expensive internal checks +is_release= +if test -f $srcdir/../gcc/DEV-PHASE \ + && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then + is_release=yes +fi -if test $enable_checking != no ; then +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. + Flags are: misc,valgrind or other strings])], +[ac_checking_flags="${enableval}"],[ +# Determine the default checks. +if test x$is_release = x ; then + ac_checking_flags=yes +else + ac_checking_flags=release +fi]) +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) ac_checking=1 ; ac_valgrind_checking= ;; + no|none|release) ac_checking= ; ac_valgrind_checking= ;; + # these enable particular checks + misc) ac_checking=1 ;; + valgrind) ac_valgrind_checking=1 ;; + # accept + *) ;; + esac +done +IFS="$ac_save_IFS" + +if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want more run-time sanity checks.]) fi +if test x$ac_valgrind_checking != x ; then + AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1, +[Define if you want to workaround valgrind (a memory checker) warnings about + possible memory leaks because of libcpp use of interior pointers.]) +fi + AC_ARG_ENABLE(canonical-system-headers, [ --enable-canonical-system-headers enable or disable system headers canonicalization], |