On Sat, Dec 31, 2016 at 3:42 AM, Eric Blake <[email protected]> wrote: > Otherwise, we get warnings about: > > Can't open /lib/intprops.h: No such file or directory. > > in projects that don't define a $(gnulib_dir) override in cfg.mk. > > * top/maint.mk (gnulib_dir): Hoist earlier. > > Signed-off-by: Eric Blake <[email protected]> > --- > > Appears to work for me, but I'll wait until tomorrow or a review > before pushing. > > ChangeLog | 5 +++++ > top/maint.mk | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/ChangeLog b/ChangeLog > index eb5867f..e69ce32 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2016-12-30 Eric Blake <[email protected]> > + > + maint.mk: ensure gnulib_dir is defined before use in shell > + * top/maint.mk (gnulib_dir): Hoist earlier. > + > 2016-12-30 Jim Meyering <[email protected]> > > maint.mk: improve sc_prohibit_intprops_without_use > diff --git a/top/maint.mk b/top/maint.mk > index 6eb9361..d009cdf 100644 > --- a/top/maint.mk > +++ b/top/maint.mk > @@ -20,6 +20,7 @@ > # This is reported not to work with make-3.79.1 > # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) > ME := maint.mk > +gnulib_dir ?= $(srcdir)/gnulib > > # Helper variables. > _empty = > @@ -1288,7 +1289,6 @@ vc-diff-check: > > rel-files = $(DIST_ARCHIVES) > > -gnulib_dir ?= $(srcdir)/gnulib > gnulib-version = $$(cd $(gnulib_dir) \ > && { git describe || git rev-parse --short=10 HEAD; } ) > bootstrap-tools ?= autoconf,automake,gnulib > --
Thank you. That is a fine patch. I have also pushed this:
From ffff79dad7f396cf0bfe7b72d212da72245a6f01 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Sat, 31 Dec 2016 01:31:59 -0800 Subject: [PATCH] maint.mk: do not always evaluate intprops-related shell * top/maint.mk (_intprops_names): Change := to just "=" to avoid using gnulib_dir undefined (gnulib_dir is defined later in the file, which will be fixed separately), and besides, there is no need to incur the cost of this shell invocation for every single use of this .mk file. Reported by Eric Blake in https://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00137.html --- ChangeLog | 10 ++++++++++ top/maint.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eb5867f..d9604f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2016-12-31 Jim Meyering <[email protected]> + + maint.mk: do not always evaluate intprops-related shell + * top/maint.mk (_intprops_names): Change := to just "=" to avoid + using gnulib_dir undefined (gnulib_dir is defined later in the + file, which will be fixed separately), and besides, there is no + need to incur the cost of this shell invocation for every single + use of this .mk file. Reported by Eric Blake in + https://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00137.html + 2016-12-30 Jim Meyering <[email protected]> maint.mk: improve sc_prohibit_intprops_without_use diff --git a/top/maint.mk b/top/maint.mk index 6eb9361..64db9ee 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -661,7 +661,7 @@ sc_prohibit_strings_without_use: gl_extract_define_simple = \ /^\# *define ([A-Z]\w+)\(/ and print $$1 # Filter out duplicates and convert to a space-separated list: -_intprops_names := \ +_intprops_names = \ $(shell f=$(gnulib_dir)/lib/intprops.h; \ perl -lne '$(gl_extract_define_simple)' $$f | sort -u | tr '\n' ' ') # Remove trailing space and convert to a regular expression: -- 2.9.3
