Assertions are now disabled by default

This commit is contained in:
Darshit Shah
2014-11-20 19:55:51 +05:30
parent 09d47ead18
commit 841efb0108
4 changed files with 29 additions and 8 deletions

View File

@@ -57,12 +57,6 @@ AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
[Define to be the name of the operating system.])
dnl
dnl Add option to disable Assertions
dnl
dnl Adds a --disable-assert option to ./configure which can be used by distro
dnl maintainers to compile without assertions.
AC_HEADER_ASSERT
dnl
dnl Process External Libraries
@@ -148,6 +142,17 @@ AS_IF([test "x$ENABLE_VALGRIND" != xno], [
VALGRIND_INFO="Valgrind testing not enabled"
])
AC_ARG_ENABLE(assert,
[AS_HELP_STRING([--enable-assert], [enable assertions in code base])],
[ENABLE_ASSERTION=$enableval],
[ENABLE_ASSERTION=no]
)
AS_IF([test "x$ENABLE_ASSERTION" != xyes], [
CFLAGS="-DNDEBUG $CFLAGS"
],
[])
dnl
dnl Find the compiler
dnl
@@ -717,5 +722,6 @@ AC_MSG_NOTICE([Summary of build options:
NTLM: $ENABLE_NTLM
OPIE: $ENABLE_OPIE
Debugging: $ENABLE_DEBUG
Assertions: $ENABLE_ASSERTION
Valgrind: $VALGRIND_INFO
])