Home | History | Annotate | Download | only in m4
      1 #serial 7
      2 
      3 # Copyright (C) 1998-1999, 2001, 2004, 2008-2012 Free Software Foundation, Inc.
      4 # This file is free software; the Free Software Foundation
      5 # gives unlimited permission to copy and/or distribute it,
      6 # with or without modifications, as long as this notice is preserved.
      7 
      8 dnl based on code from Eleftherios Gkioulekas
      9 dnl Autoconf 2.60 provides AC_HEADER_ASSERT for the same purpose, but
     10 dnl it has broken semantics for --enable-assert until 2.64.
     11 AC_DEFUN([gl_ASSERT],
     12 [
     13   AC_MSG_CHECKING([whether to enable assertions])
     14   AC_ARG_ENABLE([assert],
     15     [AS_HELP_STRING([--disable-assert], [turn off assertions])],
     16     [AS_IF([test "x$enableval" = xno],
     17       [AC_DEFINE([NDEBUG], [1],
     18         [Define to 1 if assertions should be disabled.])],
     19       [test "x$enableval" != xyes],
     20       [AC_MSG_WARN([invalid argument supplied to --enable-assert])
     21       enable_assert=yes])],
     22     [enable_assert=yes])
     23   AC_MSG_RESULT([$enable_assert])
     24 ])
     25