bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] maintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.


From: Simon Josefsson
Subject: [PATCH] maintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.
Date: Tue, 26 Jan 2021 16:26:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi!  I've noticed in a couple of projects that use bootstrap, without a
gnulib git submodule, and where $GNULIB_SRCDIR is set during bootstrap,
that syntax-check will print some spurious errors like this:

prohibit_intprops_without_use
Can't open ./gnulib/lib/intprops.h: Filen eller katalogen finns inte.
0.06 prohibit_intprops_without_use

The reason is top/maint.mk has

 # You can override this variable in cfg.mk if your gnulib submodule lives
 # in a different location.
 gnulib_dir ?= $(srcdir)/gnulib

and that directory doesn't exist if bootstrap used $GNULIB_SRCDIR.

It is incorrect to use cfg.mk to set gnulib_dir in this scenario, since
the use of $GNULIB_SRCDIR is not a per-project setting but a local
customization.

I've pushed the patch below.  It doesn't perfectly match what bootstrap
is doing (which is complicated) but is one step closer to doing the same
thing.  Improvements appreciated, especially something that is less
fragile -- should bootstrap print the gnulib-srcdir to a .gl-srcdir file
or something?  Quite ugly though.

/Simon
From 87b45614e23838fe9cba9577107186789e4f8601 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon@josefsson.org>
Date: Tue, 26 Jan 2021 16:24:54 +0100
Subject: [PATCH] maintainer-makefile: Mimic bootstrap's gnulib-srcdir
 guessing.

* top/maint.mk (gnulib_dir): If $(srcdir)/gnulib doesn't exist,
fall back to $GNULIB_SRCDIR.
---
 ChangeLog    | 6 ++++++
 top/maint.mk | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c2bfead08..a06ac071b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-26  Simon Josefsson  <simon@josefsson.org>
+
+       maintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.
+       * top/maint.mk (gnulib_dir): If $(srcdir)/gnulib doesn't exist,
+       fall back to $GNULIB_SRCDIR.
+
 2021-01-25  Bruno Haible  <bruno@clisp.org>
 
        posix_spawn_file_actions_* tests: Fix module dependencies.
diff --git a/top/maint.mk b/top/maint.mk
index 934f23d56..ae3a8170a 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -64,7 +64,11 @@ 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
+gnulib_dir ?= $(shell if test -d $(srcdir)/gnulib; then \
+                       echo $(srcdir)/gnulib; \
+               else \
+                       echo ${GNULIB_SRCDIR}; \
+               fi)
 
 # You can override this variable in cfg.mk to set your own regexp
 # matching files to ignore.
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature


reply via email to

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