bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] gnulib-tool: improve GNU Make debugging


From: Paul Eggert
Subject: [PATCH] gnulib-tool: improve GNU Make debugging
Date: Mon, 15 May 2017 07:43:23 -0700

* gnulib-tool (func_emit_lib_Makefile_am): Omit unnecessary echo.
Report autoconf diagnostics when it fails, in the output makefile.
---
 ChangeLog   |  6 ++++++
 gnulib-tool | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cab8f63..481a0f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-14  Paul Eggert  <address@hidden>
+
+       gnulib-tool: improve GNU Make debugging
+       * gnulib-tool (func_emit_lib_Makefile_am): Omit unnecessary echo.
+       Report autoconf diagnostics when it fails, in the output makefile.
+
 2017-05-14  Bruno Haible  <address@hidden>
 
        stat-time tests: Improve comment.
diff --git a/gnulib-tool b/gnulib-tool
index d5c2902..5dd77f7 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3571,9 +3571,18 @@ func_emit_lib_Makefile_am ()
   fi
   if $gnu_make; then
     echo "# Start of GNU Make output."
-    echo 'gl_EARLY;gl_INIT' \
-      | ${AUTOCONF} -t 'AC_SUBST:$1 = @$1@' "$configure_ac" \
-      | LC_ALL=C sort -u
+
+    # Put autoconf output into a temporary file, so that its exit status
+    # can be checked from the shell.  Signal any error by putting a
+    # syntax error into the output makefile.
+    ${AUTOCONF} -t 'AC_SUBST:$1 = @$1@' "$configure_ac" \
+                >"$tmp"/makeout 2>"$tmp"/makeout2 &&
+      LC_ALL=C sort -u "$tmp"/makeout || {
+        echo "== gnulib-tool GNU Make output failed as follows =="
+        sed 's/^/# stderr: /' "$tmp"/makeout2
+      }
+    rm -f "$tmp"/makeout "$tmp"/makeout2
+
     echo "# End of GNU Make output."
   else
     echo "# No GNU Make output."
-- 
2.9.3




reply via email to

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