/[m4]/m4/config/m4-obstack.m4
ViewVC logotype

Diff of /m4/config/m4-obstack.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by gary, Tue Sep 9 11:48:50 2003 UTC revision 1.4 by gary, Tue Sep 9 14:08:26 2003 UTC
# Line 22  Line 22 
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
# Line 63  else Line 52  else
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)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26