http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
[m4/ericb.git] / acm4 / m4-obstack.m4
blob640288b5a4d9c1687325ce4af07d3fbb84b5e1b9
1 #                                                            -*- Autoconf -*-
2 # m4-obstack.m4 -- the libc supplied version of obstacks if available.
4 # Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc
5 # Written by Gary V. Vaughan <gary@gnu.org>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; see the file COPYING.  If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
22 # serial 9
24 # m4_OBSTACK
25 # ----------
26 # Use the libc supplied version of obstacks if available.
27 AC_DEFUN([m4_OBSTACK],
28 [AC_PREREQ(2.56)dnl We use the compiler based header checking in 2.56
29 AC_BEFORE([gl_OBSTACK], [m4_OBSTACK])
30 AC_ARG_WITH([included-obstack],
31     [AC_HELP_STRING([--with-included-obstack],
32                     [use the obstack implementation included here])])
34 AC_CHECK_HEADERS(obstack.h, [], [], [AC_INCLUDES_DEFAULT])
36 if test "x${with_included_obstack-no}" != xno; then
37   ac_cv_func_obstack=no
40 OBSTACK_H=
41 if test $ac_cv_func_obstack = yes; then
42   INCLUDE_OBSTACK_H='#include <obstack.h>'
43 else
44   INCLUDE_OBSTACK_H='#include <gnu/obstack.h>'
45   OBSTACK_H=obstack.h
47 AC_SUBST(OBSTACK_H)
48 AC_SUBST(INCLUDE_OBSTACK_H)
49 ])# m4_FUNC_OBSTACK