autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix AC_FUNC_OBSTACK


From: Ralf Wildenhues
Subject: fix AC_FUNC_OBSTACK
Date: Thu, 12 Oct 2006 20:03:37 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

In one of the recent post-2.60 macro cleanups [1], we changed the test
in AC_FUNC_OBSTACK to be more like the real usage.  Unfortunately, the
new test is worse (output from CVS coreutils):

| configure:35937: checking for obstacks
| configure:35965: gcc -std=gnu99 -o conftest -g -O2   -Wl,--as-needed 
conftest.c  >&5
| conftest.c: In function 'main':
| conftest.c:315: error: 'obstack_chunk_alloc' undeclared (first use in this 
function)
| conftest.c:315: error: (Each undeclared identifier is reported only once
| conftest.c:315: error: for each function it appears in.)
| conftest.c:315: error: 'obstack_chunk_free' undeclared (first use in this 
function)

And indeed '(libc.info.gz)Preparing for Obstacks' documents this quite
clearly.  I apologize for not being careful enough there (luckily this
did not end up in a released Autoconf).

OK to apply?

Cheers,
Ralf

[1] http://lists.gnu.org/archive/html/autoconf-patches/2006-09/msg00077.html

2006-10-12  Ralf Wildenhues  <address@hidden>

        * lib/autoconf/functions.m4 (AC_FUNC_OBSTACK): In the test,
        include the default headers, and redefine obstack_chunk_alloc
        and obstack_chunk_free.  Fixes false failure with glibc.

Index: lib/autoconf/functions.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.111
diff -u -r1.111 functions.m4
--- lib/autoconf/functions.m4   26 Sep 2006 20:57:16 -0000      1.111
+++ lib/autoconf/functions.m4   12 Oct 2006 18:03:12 -0000
@@ -1335,8 +1335,11 @@
 [AC_LIBSOURCES([obstack.h, obstack.c])dnl
 AC_CACHE_CHECK([for obstacks], ac_cv_func_obstack,
 [AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM(address@hidden:@include "obstack.h"]],
+    [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+                     address@hidden:@include "obstack.h"]],
                     [[struct obstack mem;
+                      @%:@define obstack_chunk_alloc malloc
+                      @%:@define obstack_chunk_free free
                       obstack_init (&mem);
                       obstack_free (&mem, 0);]])],
                [ac_cv_func_obstack=yes],




reply via email to

[Prev in Thread] Current Thread [Next in Thread]