[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: obstacks.h
From: |
Akim Demaille |
Subject: |
Re: obstacks.h |
Date: |
07 Aug 2001 12:27:18 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor) |
>>>>> "Akim" == Akim Demaille <address@hidden> writes:
Akim> I first thought creating m4/obstack.h as a mere #include
Akim> <obstack.h> was fine, but it is not: then you need
Akim> #include_next, which I don't think is portable.
Akim> Currently, I see no simple idea to have it work for both the
Akim> being built m4, and the installed headers.
As a tmp hack, I proceed as if #include_next was supported, the basic
reasoning being `native obstack are present, hence we run a good
system, hence #inlcude_next is supported'. And I really need to have
this work, for otherwise distcheck == alwaysfail.
Index: ChangeLog
from Akim Demaille <address@hidden>
* config/gnu-obstacks.m4: New.
2001-08-07 Akim Demaille <address@hidden>
Index: configure.in
===================================================================
RCS file: /cvs/m4/configure.in,v
retrieving revision 1.8
diff -u -u -r1.8 configure.in
--- configure.in 2001/08/07 10:02:25 1.8
+++ configure.in 2001/08/07 10:23:25
@@ -83,30 +83,7 @@
$LN_S ./gnu-getopt.h $m4_getopt])
AC_SUBST(M4OBJS)
-
-# Use the libc supplied version of obstacks if available
-AC_CHECK_HEADER(obstack.h)
-AC_CACHE_CHECK([for obstack in libc], m4_cv_func_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)])
-OBSTACK_H=
-m4_obstack=m4/obstack.h
-rm -f $m4_obstack
-if test $m4_cv_func_obstack = yes; then
- AC_DEFINE(HAVE_OBSTACK, 1, [Define if libc includes obstacks])
-else
- LIBOBJS="$LIBOBJS obstack.$ac_objext"
- echo linking src/gnu-obstack.h to $m4_obstack
- $LN_S ./gnu-obstack.h $m4_obstack
-
- if test x"$ac_cv_header_obstack_h" != xyes; then
- OBSTACK_H=obstack.h
- fi
-fi
-AC_SUBST(OBSTACK_H)
-
+M4_AC_FUNC_OBSTACK
jm_PREREQ_ERROR
Index: config/Makefile.am
===================================================================
RCS file: /cvs/m4/config/Makefile.am,v
retrieving revision 1.1
diff -u -u -r1.1 Makefile.am
--- config/Makefile.am 2001/08/07 10:02:25 1.1
+++ config/Makefile.am 2001/08/07 10:23:25
@@ -22,4 +22,5 @@
EXTRA_DIST = \
debug.m4 \
gmp.m4 \
+gnu-obstacks.m4 \
stackovf.m4
Index: config/gnu-obstack.m4
===================================================================
RCS file: gnu-obstack.m4
diff -N gnu-obstack.m4
--- /dev/null Sat Apr 14 17:46:23 2001
+++ config/gnu-obstack.m4 Tue Aug 7 03:23:25 2001
@@ -0,0 +1,56 @@
+# -*- Autoconf -*-
+# gnu-obstacks.m4 -- the libc supplied version of obstacks if available
+#
+# Copyright 2000, 2001 Gary V. Vaughan <address@hidden>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+#serial 2
+
+# FIXME: This is not portable I guess. There is no reason for all
+# the CPP in the world to support #include_next. So? Copy the
+# actual content of obstack.h if CPP does not support 'include_next'?
+
+# M4_AC_FUNC_OBSTACK
+# ------------------
+# Use the libc supplied version of obstacks if available.
+AC_DEFUN([M4_AC_FUNC_OBSTACK],
+[AC_CHECK_HEADER(obstack.h)
+AC_CACHE_CHECK([for obstack in libc], m4_cv_func_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)])
+OBSTACK_H=
+m4_obstack=m4/obstack.h
+rm -f $m4_obstack
+if test $m4_cv_func_obstack = yes; then
+ AC_DEFINE(HAVE_OBSTACK, 1, [Define if libc includes obstacks.])
+ cat >$m4_obstack <<EOF
+/* The native header works properly. */
+#include_next <obstack.h>
+EOF
+else
+ LIBOBJS="$LIBOBJS obstack.$ac_objext"
+ echo linking src/gnu-obstack.h to $m4_obstack
+ $LN_S ./gnu-obstack.h $m4_obstack
+
+ if test x"$ac_cv_header_obstack_h" != xyes; then
+ OBSTACK_H=obstack.h
+ fi
+fi
+AC_SUBST(OBSTACK_H)
+])# M4_AC_FUNC_OBSTACK
- Re: M4, Akim Demaille, 2001/08/07
- Re: obstacks.h,
Akim Demaille <=
- Re: M4, Gary V . Vaughan, 2001/08/07
- Re: M4, Gary V . Vaughan, 2001/08/07