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
8dnl based on code from Eleftherios Gkioulekas
9dnl Autoconf 2.60 provides AC_HEADER_ASSERT for the same purpose, but
10dnl it has broken semantics for --enable-assert until 2.64.
11AC_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