From: Bruno Haible Date: Mon, 13 Dec 2021 01:43:21 +0000 (+0100) Subject: gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests. X-Git-Tag: v1.0~2532 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4e7b4cc6fb3e3b659c98baf6db26d8a06099fbee;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index d370165cb3..0e20dcb585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2021-12-12 Bruno Haible + + 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 bootstrap: refactor for GNU tar diff --git a/gnulib-tool b/gnulib-tool index eb10436b11..878b9588f2 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -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" diff --git a/m4/non-recursive-gnulib-prefix-hack.m4 b/m4/non-recursive-gnulib-prefix-hack.m4 index bd3bb52627..2eea84c4b9 100644 --- a/m4/non-recursive-gnulib-prefix-hack.m4 +++ b/m4/non-recursive-gnulib-prefix-hack.m4 @@ -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"