Define NDEBUG via config.h instead of CFLAGS;
authorIvan Maidanski <ivmai@mail.ru>
Mon, 12 Dec 2011 14:57:23 +0000 (18:57 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 12 Dec 2011 14:57:23 +0000 (18:57 +0400)
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").

configure.ac

index 763ec56..4a9fb7e 100644 (file)
@@ -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)