]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix AC_HEADER_ASSERT not to treat --enable-assert and --disable-assert the same.
authorPaolo Bonzini <bonzini@gnu.org>
Mon, 8 Dec 2008 21:12:20 +0000 (22:12 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Mon, 8 Dec 2008 21:13:25 +0000 (22:13 +0100)
* lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Check value of $enableval.

ChangeLog
lib/autoconf/headers.m4

index a250ee21e5dba4986db4bc3a73ace73c05b2e069..8a18ebfa98c62683d7fa9fb837f0d09f17d1a709 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-06  William Pursell  <bill.pursell@gmail.com>  (tiny change)
+
+       Fix AC_HEADER_ASSERT to honor --enable-assert, rather than
+       treat --enable-assert and --disable-assert equivalently.
+       * lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Check value of $enableval.
+
 2008-12-05  William Pursell  <bill.pursell@gmail.com>  (tiny change)
 
        Fix some typos and grammatical errors in documentation.
index f4a4528229e3419e211fc145b5b3e04ebfb8822a..7b3b9d318415bb4bc7ba1c0dc39abe02bf27a9a8 100644 (file)
@@ -435,10 +435,14 @@ AC_DEFUN([AC_HEADER_ASSERT],
 [
   AC_MSG_CHECKING([whether to enable assertions])
   AC_ARG_ENABLE([assert],
-    [  --disable-assert        turn off assertions],
-    [AC_MSG_RESULT([no])
-     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
-    [AC_MSG_RESULT(yes)])
+    [AS_HELP_STRING([--disable-assert], [turn off assertions])],
+    [AS_IF([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.])
+      [enable_assert=no]
+  ])])
+  AC_MSG_RESULT([$enable_assert])
 ])