summaryrefslogtreecommitdiff
path: root/libcpp/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/configure.ac')
-rw-r--r--libcpp/configure.ac26
1 files changed, 24 insertions, 2 deletions
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 0005c589fc..d0a59dc3e0 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -152,9 +152,11 @@ 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= ;;
+ 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
@@ -170,6 +172,11 @@ else
AC_DEFINE(CHECKING_P, 0)
fi
+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
+
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
@@ -200,6 +207,21 @@ AC_ARG_ENABLE(host-shared,
[PICFLAG=-fPIC], [PICFLAG=])
AC_SUBST(PICFLAG)
+AC_ARG_ENABLE(valgrind-annotations,
+[AS_HELP_STRING([--enable-valgrind-annotations],
+ [enable valgrind runtime interaction])], [],
+[enable_valgrind_annotations=no])
+if test x$enable_valgrind_annotations != xno \
+ || test x$ac_valgrind_checking != x; then
+ if (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ AC_MSG_ERROR([*** Can't find valgrind/memcheck.h, memcheck.h or valgrind.h])
+ fi
+ AC_DEFINE(ENABLE_VALGRIND_ANNOTATIONS, 1,
+[Define to get calls to the valgrind runtime enabled.])
+fi
+
# Output.
AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])