summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--top/maint.mk21
2 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a25be21d2f..8a4763aad7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-06-22 Akim Demaille <akim@lrde.epita.fr>
+
+ maintainer-makefile: restore portability to non-GNU awks
+ Reported by Tim Rühsen.
+ * top/maint.mk (AWK): New variable. Use it.
+ (sc_prohibit_gnu_make_extensions): Skip if $(AWK) is not gawk.
+
2019-06-23 Paul Eggert <eggert@cs.ucla.edu>
Document setvbuf _IOLBF problem
diff --git a/top/maint.mk b/top/maint.mk
index 3dbe9c3788..16e936022c 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -24,6 +24,7 @@ ME := maint.mk
# These variables ought to be defined through the configure.ac section
# of the module description. But some packages import this file directly,
# ignoring the module description.
+AWK ?= awk
GREP ?= grep
SED ?= sed
@@ -190,7 +191,7 @@ $(sc_z_rules_): %.z: %
@end=$$(date +%s.%N); \
start=$$(cat .sc-start-$*); \
rm -f .sc-start-$*; \
- awk -v s=$$start -v e=$$end \
+ $(AWK) -v s=$$start -v e=$$end \
'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
@@ -435,13 +436,15 @@ sc_prohibit_gnu_make_extensions_awk_ = \
exit status; \
}
sc_prohibit_gnu_make_extensions:
- (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') | \
- tr ' ' '\n' | \
- $(SED) -ne '/Makefile/{s/\.in$$//;p;}' | \
- while read m; do \
- $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null | \
- awk -v file=$$m -e '$($@_awk_)' || exit 1; \
- done
+ @if $(AWK) --version | grep GNU >/dev/null 2>&1; then \
+ (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') | \
+ tr ' ' '\n' | \
+ $(SED) -ne '/Makefile/{s/\.in$$//;p;}' | \
+ while read m; do \
+ $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null | \
+ $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1; \
+ done; \
+ fi
# Using EXIT_SUCCESS as the first argument to error is misleading,
# since when that parameter is 0, error does not exit. Use '0' instead.
@@ -1383,7 +1386,7 @@ gpg_key_ID ?= \
$$(cd $(srcdir) \
&& git cat-file tag v$(VERSION) \
| $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null \
- | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+ | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
translation_project_ ?= coordinator@translationproject.org