Discussion:
[PATCH] maint.mk: ensure gnulib_dir is defined before use in shell
(too old to reply)
Eric Blake
2016-12-31 02:42:14 UTC
Permalink
Raw Message
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 <***@redhat.com>
---

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 <***@redhat.com>
+
+ maint.mk: ensure gnulib_dir is defined before use in shell
+ * top/maint.mk (gnulib_dir): Hoist earlier.
+
2016-12-30 Jim Meyering <***@fb.com>

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
--
2.9.3
Jim Meyering
2016-12-31 09:33:34 UTC
Permalink
Raw Message
Post by Eric Blake
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.
---
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 @@
+
+ maint.mk: ensure gnulib_dir is defined before use in shell
+ * top/maint.mk (gnulib_dir): Hoist earlier.
+
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 =
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:
Eric Blake
2016-12-31 13:10:58 UTC
Permalink
Raw Message
Post by Jim Meyering
Post by Eric Blake
Appears to work for me, but I'll wait until tomorrow or a review
before pushing.
Thank you. That is a fine patch.
Thanks. Given your patch, I reworded things slightly; here's what I'm
pushing.

From 68bfd6607ddf034889257e1effa89b688f3d3f2b Mon Sep 17 00:00:00 2001
From: Eric Blake <***@redhat.com>
Date: Fri, 30 Dec 2016 20:37:10 -0600
Subject: [PATCH] maint.mk: hoist gnulib_dir definition earlier

Commit 1894933 introduced a temporary warning during all uses of 'make':

Can't open /lib/intprops.h: No such file or directory.

due to an early evaluation of $(shell) prior to the default definition
of $(gnulib_dir). While that has been fixed in commit ffff79d, hoisting
the definition to the top will prevent further edits from inadvertently
reintroducing the problem.

* top/maint.mk (gnulib_dir): Move near top of file.

Signed-off-by: Eric Blake <***@redhat.com>
---
ChangeLog | 5 +++++
top/maint.mk | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d9604f0..5682403 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-31 Eric Blake <***@redhat.com>
+
+ maint.mk: hoist gnulib_dir definition earlier
+ * top/maint.mk (gnulib_dir): Move near top of file.
+
2016-12-31 Jim Meyering <***@fb.com>

maint.mk: do not always evaluate intprops-related shell
diff --git a/top/maint.mk b/top/maint.mk
index 64db9ee..46aea9b 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -55,6 +55,10 @@ VC = $(GIT)

VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)

+# You can override this variable in cfg.mk if your gnulib submodule lives
+# in a different location.
+gnulib_dir ?= $(srcdir)/gnulib
+
# You can override this variable in cfg.mk to set your own regexp
# matching files to ignore.
VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
@@ -1288,7 +1292,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
--
2.9.3
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Jim Meyering
2016-12-31 14:11:03 UTC
Permalink
Raw Message
On Sat, Dec 31, 2016 at 2:10 PM, Eric Blake <***@redhat.com> wrote:
...
Post by Eric Blake
Thanks. Given your patch, I reworded things slightly; here's what I'm
pushing.
...
Post by Eric Blake
+# You can override this variable in cfg.mk if your gnulib submodule lives
+# in a different location.
+gnulib_dir ?= $(srcdir)/gnulib
Thanks for the added comment, too.

Loading...