1 # geda-assert.m4 -*-Autoconf-*-
4 dnl Optionally disable assertions
5 dnl Copyright (C) 2009 Peter Brett <peter@peter-b.co.uk>
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 # Check if assertions should be disabled.
22 AC_DEFUN([AX_OPTION_ASSERT],
25 AC_PROVIDE([AC_HEADER_ASSERT])dnl
27 AC_MSG_CHECKING([whether to enable assertions])
28 AC_ARG_ENABLE([assert],
29 [AS_HELP_STRING([--disable-assert], [turn off assertions])],
30 [], [enable_assert="yes"])
32 if test "X$enable_assert" = "Xyes"; then
36 AC_DEFINE([NDEBUG], 1, [Define to 1 if assertions should be disabled.])
37 AC_DEFINE([G_DISABLE_ASSERT], 1, [Define to 1 if GLib assertions should be disabled.])
39 ])dnl AX_OPTION_ASSERT