diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2009-06-26 23:41:43 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2009-06-26 23:41:43 +0000 |
commit | 297710942213ef3bf4a06190459bbc1fb0362ffb (patch) | |
tree | fe2b790d3a7456a1756155bace7a1373ccd250be /configure.in | |
parent | 25c5550f48ae371dbbe4e7cd7048efcefa030670 (diff) | |
download | emacs-297710942213ef3bf4a06190459bbc1fb0362ffb.tar.gz |
(--enable-checking): New option.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/configure.in b/configure.in index 654985d6f18..d61162d8238 100644 --- a/configure.in +++ b/configure.in @@ -209,6 +209,70 @@ elif test "${enableval}" != "yes"; then locallisppath=${enableval} fi) +AC_ARG_ENABLE(checking, +[ --enable-checking[=LIST] + enable expensive run-time checks. With LIST, + enable only specific categories of checks. + Categories are: all,yes,no. + Flags are: stringbytes, stringoverrun, stringfreelist, + xmallocoverrun, conslist], +[ac_checking_flags="${enableval}"],[]) +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in $ac_checking_flags +do + case $check in + # these set all the flags to specific states + yes) ac_enable_checking=1 ;; + no) ac_enable_checking= ; + ac_gc_check_stringbytes= ; + ac_gc_check_string_overrun= ; + ac_gc_check_string_free_list= ; + ac_xmalloc_overrun= ; + ac_gc_check_cons_list= ;; + all) ac_enable_checking=1 ; + ac_gc_check_stringbytes=1 ; + ac_gc_check_string_overrun=1 ; + ac_gc_check_string_free_list=1 ; + ac_xmalloc_overrun=1 ; + ac_gc_check_cons_list=1 ;; + # these enable particular checks + stringbytes) ac_gc_check_stringbytes=1 ;; + stringoverrun) ac_gc_check_string_overrun=1 ;; + stringfreelist) ac_gc_check_string_free_list=1 ;; + xmallocoverrun) ac_xmalloc_overrun=1 ;; + conslist) ac_gc_check_cons_list=1 ;; + *) AC_MSG_ERROR(unknown check category $check) ;; + esac +done +IFS="$ac_save_IFS" + +if test x$ac_enable_checking != x ; then + AC_DEFINE(ENABLE_CHECKING, 1, +[Enable expensive run-time checking of data types?]) +fi +if test x$ac_gc_check_stringbytes != x ; then + AC_DEFINE(GC_CHECK_STRING_BYTES, 1, +[Define this temporarily to hunt a bug. If defined, the size of + strings is redundantly recorded in sdata structures so that it can + be compared to the sizes recorded in Lisp strings.]) +fi +if test x$ac_gc_check_stringoverrun != x ; then + AC_DEFINE(GC_CHECK_STRING_OVERRUN, 1, +[Define this to check for short string overrun.]) +fi +if test x$ac_gc_check_string_free_list != x ; then + AC_DEFINE(GC_CHECK_STRING_FREE_LIST, 1, +[Define this to check the string free list.]) +fi +if test x$ac_xmalloc_overrun != x ; then + AC_DEFINE(XMALLOC_OVERRUN_CHECK, 1, +[Define this to check for malloc buffer overrun.]) +fi +if test x$ac_gc_check_cons_list != x ; then + AC_DEFINE(GC_CHECK_CONS_LIST, 1, +[Define this to check for errors in cons list.]) +fi + #### Make srcdir absolute, if it isn't already. It's important to #### avoid running the path through pwd unnecessarily, since pwd can #### give you automounter prefixes, which can go away. We do all this @@ -2789,9 +2853,6 @@ typedef unsigned size_t; #define HAVE_X11R6_XIM #endif -/* Should we enable expensive run-time checking of data types? */ -#undef ENABLE_CHECKING - #if defined __GNUC__ && (__GNUC__ > 2 \ || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) #define NO_RETURN __attribute__ ((__noreturn__)) |