]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
authorBruno Haible <bruno@clisp.org>
Mon, 13 Dec 2021 01:43:21 +0000 (02:43 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Dec 2021 01:51:09 +0000 (02:51 +0100)
* gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
invocation.
* m4/non-recursive-gnulib-prefix-hack.m4
(gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke
AC_CONFIG_LIBOBJ_DIR.

ChangeLog
gnulib-tool
m4/non-recursive-gnulib-prefix-hack.m4

index d370165cb33ea6890f8f3e43881962d8b06048f8..0e20dcb58596d4c3e6a37ef62b5510732d906d08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-12-12  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
+       * gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
+       invocation.
+       * m4/non-recursive-gnulib-prefix-hack.m4
+       (gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke
+       AC_CONFIG_LIBOBJ_DIR.
+
 2021-12-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        bootstrap: refactor for GNU tar
index eb10436b112b57d24691c2d49338e9e899eaba4d..878b9588f26b01709f89eba708c88da57bf5ccfa 100755 (executable)
@@ -5837,6 +5837,22 @@ s,//*$,/,'
     echo "# \"Check for header files, types and library functions\"."
     echo "AC_DEFUN([${macro_prefix}_INIT],"
     echo "["
+    # This AC_CONFIG_LIBOBJ_DIR invocation silences an error from the automake
+    # front end:
+    #   error: required file './alloca.c' not found
+    # It is needed because of the last remaining use of AC_LIBSOURCES in
+    # _AC_LIBOBJ_ALLOCA, invoked from AC_FUNC_ALLOCA.
+    # All the m4_pushdef/m4_popdef logic in func_emit_initmacro_start/_end
+    # does not help to avoid this error.
+    if grep '  lib/alloca\.c$' "$tmp"/new-files; then
+      # alloca.c will be present in $sourcebase.
+      echo "  AC_CONFIG_LIBOBJ_DIR([$sourcebase])"
+    else
+      if grep '        tests=lib/alloca\.c$' "$tmp"/new-files; then
+        # alloca.c will be present in $testsbase.
+        echo "  AC_CONFIG_LIBOBJ_DIR([$testsbase])"
+      fi
+    fi
     if test "$libtool" = true; then
       echo "  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])"
       echo "  gl_cond_libtool=true"
index bd3bb52627b42def3522b82ac36fd9ec73f3da7f..2eea84c4b96ce9301910fc8e9b0a1d461cbfd301 100644 (file)
@@ -9,9 +9,6 @@ dnl with a value ending in ".h" to reflect that these files are located
 dnl in the directory specified by LIB_DIR.
 AC_DEFUN([gl_NON_RECURSIVE_GNULIB_PREFIX_HACK],
 [
-  # Tell AC_LIBSOURCES where to find source files like alloca.c.
-  AC_CONFIG_LIBOBJ_DIR([$1])
-
   # This hack originated in bison.  It is required when using non-recursive
   # automake rules to build from gnulib-provided lib/ sources.  Hence, LIB_DIR
   # is usually simply "lib".  Those rules use the list of names like "fchdir.o"