]> Savannah Git Hosting - gnulib.git/commitdiff
obstack: Move AC_LIBOBJ invocation to the module description.
authorBruno Haible <bruno@clisp.org>
Sun, 9 Jan 2022 14:40:22 +0000 (15:40 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Jan 2022 14:40:22 +0000 (15:40 +0100)
* m4/obstack.m4 (gl_FUNC_OBSTACK): Renamed from AC_FUNC_OBSTACK. Don't
invoke AC_LIBSOURCES nor AC_LIBOBJ.
* modules/obstack (configure.ac): Update. Invoke AC_LIBOBJ here.

ChangeLog
m4/obstack.m4
modules/obstack

index 2397dd79b6739c0e81e1e36d7a32b4bf751d8d16..3db6389801faa63b353ca9cde656c094ebac652c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-01-09  Bruno Haible  <bruno@clisp.org>
+
+       obstack: Move AC_LIBOBJ invocation to the module description.
+       * m4/obstack.m4 (gl_FUNC_OBSTACK): Renamed from AC_FUNC_OBSTACK. Don't
+       invoke AC_LIBSOURCES nor AC_LIBOBJ.
+       * modules/obstack (configure.ac): Update. Invoke AC_LIBOBJ here.
+
 2022-01-09  Bruno Haible  <bruno@clisp.org>
 
        stdio: Move AC_LIBOBJ invocations to the module description.
index 007b2f0281a6481d4798e06104c080d04c1a0960..3a26cba4b9adfd76df8b614edff6203872d298d3 100644 (file)
@@ -5,31 +5,29 @@ dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl This replaces Autoconf's AC_FUNC_OBSTACK.
-dnl The Autoconf version should be marked obsolete at some point.
+dnl Autoconf's AC_FUNC_OBSTACK is marked obsolete since version 2.70.
+dnl We provide our own macro here.
 
-AC_DEFUN([AC_FUNC_OBSTACK],
-  [AC_LIBSOURCES([obstack.h, obstack.c])dnl
-   AC_CACHE_CHECK([for obstacks that work with any size object],
-     [ac_cv_func_obstack],
-     [AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM(
-           [[#include "obstack.h"
-             void *obstack_chunk_alloc (size_t n) { return 0; }
-             void obstack_chunk_free (void *p) { }
-             /* Check that an internal function returns size_t, not int.  */
-             size_t _obstack_memory_used (struct obstack *);
-            ]],
-           [[struct obstack mem;
-             obstack_init (&mem);
-             obstack_free (&mem, 0);
-           ]])],
-        [ac_cv_func_obstack=yes],
-        [ac_cv_func_obstack=no])])
-   if test "$ac_cv_func_obstack" = yes; then
-     AC_DEFINE([HAVE_OBSTACK], 1,
-       [Define to 1 if the system has obstacks that work with any size object.])
-   else
-     AC_LIBOBJ([obstack])
-   fi
+AC_DEFUN([gl_FUNC_OBSTACK],
+[
+  AC_CACHE_CHECK([for obstacks that work with any size object],
+    [gl_cv_func_obstack],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include "obstack.h"
+            void *obstack_chunk_alloc (size_t n) { return 0; }
+            void obstack_chunk_free (void *p) { }
+            /* Check that an internal function returns size_t, not int.  */
+            size_t _obstack_memory_used (struct obstack *);
+           ]],
+          [[struct obstack mem;
+            obstack_init (&mem);
+            obstack_free (&mem, 0);
+          ]])],
+       [gl_cv_func_obstack=yes],
+       [gl_cv_func_obstack=no])])
+  if test "$gl_cv_func_obstack" = yes; then
+    AC_DEFINE([HAVE_OBSTACK], 1,
+      [Define to 1 if the system has obstacks that work with any size object.])
+  fi
 ])
index e0b528e418811e94ce9d7ee0d22720f186eb386e..c8bb548a7744b093637c908334a18ed9b55ef2e6 100644 (file)
@@ -14,8 +14,10 @@ stdint
 stdlib
 
 configure.ac:
-AC_FUNC_OBSTACK
-dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
+gl_FUNC_OBSTACK
+if test "$gl_cv_func_obstack" != yes; then
+  AC_LIBOBJ([obstack])
+fi
 
 Makefile.am: