From c32b3caff4182601f52ca84af00c7a9b5ba4f22e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 8 Dec 2008 22:12:20 +0100 Subject: [PATCH] Fix AC_HEADER_ASSERT not to treat --enable-assert and --disable-assert the same. * lib/autoconf/headers.m4 (AC_HEADER_ASSERT): Check value of $enableval. --- ChangeLog | 6 ++++++ lib/autoconf/headers.m4 | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a250ee21..8a18ebfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-06 William Pursell (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 (tiny change) Fix some typos and grammatical errors in documentation. diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 index f4a45282..7b3b9d31 100644 --- a/lib/autoconf/headers.m4 +++ b/lib/autoconf/headers.m4 @@ -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]) ]) -- 2.11.4.GIT