summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-12-12 18:57:23 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-12-12 18:57:23 +0400
commite8dde3446c1c92210414a73cb7198da6371485aa (patch)
treec4e92fb1542a3b8e2f4a63681ff9b24274d853d0 /configure.ac
parentb3bcb2156eaa1a17edbd6f6054044768b3d0a54c (diff)
downloadlibatomic_ops-e8dde3446c1c92210414a73cb7198da6371485aa.tar.gz
Define NDEBUG via config.h instead of CFLAGS;
do not define NDEBUG if '--enable-assertions' passed to configure * configure.ac (CFLAGS): Do not add "-DNDEBUG". * configure.ac (assertions): New AC argument. * configure.ac (NDEBUG): New AC macro (defined only if "assertions" AC argument is not set to "yes").
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 763ec56..4a9fb7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,13 @@ else
;;
esac
fi
-CFLAGS="-DNDEBUG $CFLAGS"
+
+AC_ARG_ENABLE(assertions,
+ [AC_HELP_STRING([--enable-assertions], [Assertion checking])])
+if test "$enable_assertions" != yes; then
+ AC_DEFINE([NDEBUG], 1, [Define to disable assertion checking.])
+fi
+
AC_SUBST(PICFLAG)
AC_SUBST(DEFS)