Discussion:
[PATCH] gnulib-tool: improve GNU Make debugging
(too old to reply)
Paul Eggert
2017-05-15 14:43:23 UTC
Permalink
Raw Message
* 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 <***@cs.ucla.edu>
+
+ 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 <***@clisp.org>

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
Loading...