22 |
|
|
23 |
# serial 7 |
# serial 7 |
24 |
|
|
25 |
# m4_FUNC_OBSTACK |
# m4_OBSTACK |
26 |
# --------------- |
# ---------- |
27 |
# Use the libc supplied version of obstacks if available. |
# Use the libc supplied version of obstacks if available. |
28 |
AC_DEFUN([m4_FUNC_OBSTACK], |
AC_DEFUN([m4_OBSTACK], |
29 |
[AC_PREREQ(2.56)dnl We use the new compiler based header checking in 2.56 |
[AC_PREREQ(2.56)dnl We use the new compiler based header checking in 2.56 |
|
AC_REQUIRE([gl_OBSTACK]) |
|
|
m4_pattern_allow([^m4_cv_func_obstack$])dnl |
|
|
|
|
|
AC_CHECK_HEADERS(obstack.h, [], [], [AC_INCLUDES_DEFAULT]) |
|
|
|
|
30 |
AC_ARG_WITH([included-obstack], |
AC_ARG_WITH([included-obstack], |
31 |
[AC_HELP_STRING([--with-included-obstack], |
[AC_HELP_STRING([--with-included-obstack], |
32 |
[use the obstack implementation included here])]) |
[use the obstack implementation included here])]) |
33 |
|
|
34 |
|
AC_CHECK_HEADERS(obstack.h, [], [], [AC_INCLUDES_DEFAULT]) |
35 |
|
|
36 |
if test "x${with_included_obstack-no}" = xno; then |
if test "x${with_included_obstack-no}" = xno; then |
37 |
AC_CACHE_CHECK([for obstack in libc], m4_cv_func_obstack, |
gl_OBSTACK |
|
[AC_TRY_LINK([#include "obstack.h"], |
|
|
[struct obstack *mem;obstack_free(mem,(char *) 0)], |
|
|
[m4_cv_func_obstack=yes], |
|
|
[m4_cv_func_obstack=no])]) |
|
38 |
else |
else |
39 |
m4_cv_func_obstack=no |
ac_cv_func_obstack=no |
40 |
fi |
fi |
41 |
|
|
42 |
OBSTACK_H= |
OBSTACK_H= |
43 |
if test $m4_cv_func_obstack = yes; then |
if test $ac_cv_func_obstack = yes; then |
|
|
|
44 |
# The system provides obstack.h, `#include <obstack.h>' will work |
# The system provides obstack.h, `#include <obstack.h>' will work |
45 |
INCLUDE_OBSTACK_H='#include <obstack.h>' |
INCLUDE_OBSTACK_H='#include <obstack.h>' |
|
AC_DEFINE(HAVE_OBSTACK, 1, [Define if libc includes obstacks.]) |
|
|
|
|
46 |
else |
else |
|
|
|
47 |
# The system does not provide obstack.h, or the user has specified |
# The system does not provide obstack.h, or the user has specified |
48 |
# to build without it. Unfortunately we can't leave an obstack.h |
# to build without it. Unfortunately we can't leave an obstack.h |
49 |
# file around anywhere in the include path if the system also |
# file around anywhere in the include path if the system also |
52 |
# supplied version). Hence, `#include <m4/obstack.h>' will work. |
# supplied version). Hence, `#include <m4/obstack.h>' will work. |
53 |
INCLUDE_OBSTACK_H='#include <m4/obstack.h>' |
INCLUDE_OBSTACK_H='#include <m4/obstack.h>' |
54 |
OBSTACK_H=obstack.h |
OBSTACK_H=obstack.h |
|
|
|
|
# In the absence of a system implementation, we must compile our own: |
|
|
AC_LIBOBJ(obstack) |
|
|
|
|
55 |
fi |
fi |
56 |
AC_SUBST(OBSTACK_H) |
AC_SUBST(OBSTACK_H) |
57 |
AC_SUBST(INCLUDE_OBSTACK_H) |
AC_SUBST(INCLUDE_OBSTACK_H) |