bug-gnulib
[Top][All Lists]
Advanced

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

Re: Accommodate non-recursive Automake in a less hacky way


From: Bruno Haible
Subject: Re: Accommodate non-recursive Automake in a less hacky way
Date: Sat, 18 Dec 2021 14:32:34 +0100

The first patch handled option --gnu-make in lib/Makefile.in
but not in tests/Makefile.in. Fixed as follows:


2021-12-18  Bruno Haible  <bruno@clisp.org>

        Fix support for --gnu-make in tests (regression 2021-12-15).
        * gnulib-tool (func_emit_tests_Makefile_am): When producing output for
        GNU make, eliminate %reldir% tokens.

diff --git a/gnulib-tool b/gnulib-tool
index 0d2b7e635..d15c79513 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4156,9 +4156,9 @@ func_emit_tests_Makefile_am ()
           { echo "## begin gnulib module $module"
             if $gnu_make; then
               echo "ifeq (,\$(OMIT_GNULIB_MODULE_$module))"
-              convert_to_gnu_make='s/^if \(.*\)/ifneq (,$(\1))/'
-            else
-              convert_to_gnu_make=
+              convert_to_gnu_make_1='s/^if \(.*\)/ifneq (,$(\1))/'
+              convert_to_gnu_make_2='s|%reldir%/||g'
+              convert_to_gnu_make_3='s|%reldir%|.|g'
             fi
             echo
             if test "$cond_dependencies" = true; then
@@ -4171,13 +4171,27 @@ func_emit_tests_Makefile_am ()
                 fi
               fi
             fi
-            sed "$convert_to_gnu_make" "$tmp"/amsnippet1
+            if $gnu_make; then
+              sed -e "$convert_to_gnu_make_1" \
+                  -e "$convert_to_gnu_make_2" \
+                  -e "$convert_to_gnu_make_3" \
+                  "$tmp"/amsnippet1
+            else
+              cat "$tmp"/amsnippet1
+            fi
             if test "$cond_dependencies" = true; then
               if func_cond_module_p "$module"; then
                 echo "endif"
               fi
             fi
-            sed "$convert_to_gnu_make" "$tmp"/amsnippet2
+            if $gnu_make; then
+              sed -e "$convert_to_gnu_make_1" \
+                  -e "$convert_to_gnu_make_2" \
+                  -e "$convert_to_gnu_make_3" \
+                  "$tmp"/amsnippet2
+            else
+              cat "$tmp"/amsnippet2
+            fi
             if $gnu_make; then
               echo "endif"
             fi






reply via email to

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