gattrib: Fix global variable definitions
[geda-gaf.git] / m4 / geda-assert.m4
blob972fe077e1c144b5c4e22656b3b6b6f6feb04645
1 # geda-assert.m4                                        -*-Autoconf-*-
2 # serial 1.0
4 dnl Optionally disable assertions
5 dnl Copyright (C) 2009  Peter Brett <peter@peter-b.co.uk>
6 dnl
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.
11 dnl
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.
16 dnl
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],
24   AC_PREREQ([2.60])dnl
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
33     AC_MSG_RESULT([yes])
34   else
35     AC_MSG_RESULT([no])
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.])
38   fi
39 ])dnl AX_OPTION_ASSERT