AC_HEADER_ASSERT: don't say assertions are disabled when they're not

* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Do not make configure
report "checking whether to enable assertions... no", when they are
in fact enabled.  This is solely a bug in the output of configure.
In spite of saying "no", NDEBUG was not defined in that case.
Also, as noted by Eric Blake, leave assertions enabled upon
--enable-assert=INVALID.
This commit is contained in:
Jim Meyering 2008-12-10 14:45:35 +01:00
parent 0aae415c0c
commit 9077bf12d8
2 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2008-12-10 Jim Meyering <meyering@redhat.com>
AC_HEADER_ASSERT: don't say assertions are disabled when they're not
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Do not make configure
report "checking whether to enable assertions... no", when they are
in fact enabled. This is solely a bug in the output of configure.
In spite of saying "no", NDEBUG was not defined in that case.
Also, as noted by Eric Blake, leave assertions enabled upon
--enable-assert=INVALID.
2008-12-09 Eric Blake <ebb9@byu.net>
Fix m4_location inside m4_wrap with m4 1.4.5.

View File

@ -437,13 +437,14 @@ AC_DEFUN([AC_HEADER_ASSERT],
AC_ARG_ENABLE([assert],
[AS_HELP_STRING([--disable-assert], [turn off assertions])],
[ac_enable_assert=$enableval
AS_IF([test "x$enableval" = xno],
[AC_DEFINE([NDEBUG], [1],
[Define to 1 if assertions should be disabled.])],
AS_IF(dnl
[test "x$enableval" = xno],
[AC_DEFINE([NDEBUG], [1],
[Define to 1 if assertions should be disabled.])],
[test "x$enableval" != xyes],
[AC_MSG_WARN([invalid argument supplied to --enable-assert])
ac_enable_assert=no])],
[ac_enable_assert=no])
[AC_MSG_WARN([invalid argument supplied to --enable-assert])
ac_enable_assert=yes])],
[ac_enable_assert=yes])
AC_MSG_RESULT([$ac_enable_assert])
])