summaryrefslogtreecommitdiff
path: root/libcody/configure.ac
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-16 06:20:20 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-16 06:20:20 -0800
commit4be6c4e2a4df5229ec4545e7244dfcdbf1f5bca1 (patch)
tree3f03bdd3774bf9f0155c1d387e6e1b843b423407 /libcody/configure.ac
parent6d972f5183d8d476cfb008b85e224aa9b90e628d (diff)
libcody: fix --enable-checking=... [PR 98311]
The -enable-checking configure code in libcody didn't play well with us. This just uses libcpp's configurey for that piece. libcody/ * configure.ac: Use libcpp's enable-checking code. * configure: Rebuilt.
Diffstat (limited to 'libcody/configure.ac')
-rw-r--r--libcody/configure.ac42
1 files changed, 41 insertions, 1 deletions
diff --git a/libcody/configure.ac b/libcody/configure.ac
index 31f041e6679..c3db5534f1f 100644
--- a/libcody/configure.ac
+++ b/libcody/configure.ac
@@ -24,7 +24,47 @@ NMS_LINK_OPT([-Wl,--no-undefined])
NMS_CONFIG_FILES([gdbinit dox.cfg])
NMS_BUGURL
-NMS_ENABLE_CHECKING
+dnl NMS_ENABLE_CHECKING
+dnl cloned from ../libcpp/configure.ac
+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_assert_checking=1 ; ac_valgrind_checking= ;;
+ no|none) ac_checking= ; ac_assert_checking= ; ac_valgrind_checking= ;;
+ release) ac_checking= ; ac_assert_checking=1 ; ac_valgrind_checking= ;;
+ # these enable particular checks
+ assert) ac_assert_checking=1 ;;
+ 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(NMS_CHECKING, 1,
+[Define to 1 if you want more run-time sanity checks.])
+else
+ AC_DEFINE(NMS_CHECKING, 0)
+fi
+
+
NMS_ENABLE_EXCEPTIONS
AC_CONFIG_HEADERS([config.h])