XPost: linux.debian.bugs.dist
From:
[email protected]
Summary of inadvertently private mails:
mk-bsd-sed-quotation-mark.diff hopefully fixes the build on BSD.
Assuming this, and that I am not missing the point again, mk-unhardcode-datadir.diff can be applied again.
The attachment improves its readability.
* It replaces "ifndef ... := ... endif" with "?=".
The variable will be searched for $ on each expansion, but the
performance difference is probably quite small.
* It removes the comment explaining where dpkg_datadir might already
be defined.
Anyone working on this will know about default.mk.
* It replaces $(patsubst ...) with $(dir ...).
This was the original suggestion.
You once answered:
to avoid changing all pathname concatenation I changed dpkg_datadir to �$(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))�.
then I did suggest $(patsubst %/current.mk/,%,$(lastword $(MAKEFILE_LIST))),
but, thinking about it again, there seems to be no problem with a
double path component separator.
From 467d7aa41c95796f6d7ef43bb4c8fda925728791 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <
[email protected]>
Date: Tue, 2 Jul 2024 11:54:55 +0200
Subject: scripts/mk: Stop hard-coding dpkg_datadir
This path differ during tests and after installation. Instead of
rewriting the file with a hardcoded path, compute it within Make.
diff --git a/build-aux/subst.am b/build-aux/subst.am
index 7785e4af7..9c96e5ce0 100644
--- a/build-aux/subst.am
+++ b/build-aux/subst.am
@@ -45,11 +45,3 @@ SUFFIXES += .pl
@test -d `dirname $@` || $(MKDIR_P) `dirname $@`
$(AM_V_GEN) $(subst_perl_filter) <$< >$@
$(AM_V_at) chmod +x $@
-
-# Makefile support.
-
-subst_make_rules = "\
- s{dpkg_datadir\s*=\s*[^\s]*}{dpkg_datadir = $(pkgdatadir)}; \
- "
-
-subst_make_file = $(PERL) -i -p -e $(subst_make_rules)
diff --git a/scripts/mk/Makefile.am b/scripts/mk/Makefile.am
index be6076b2c..6e85e17b9 100644
--- a/scripts/mk/Makefile.am
+++ b/scripts/mk/Makefile.am
@@ -10,13 +10,3 @@ dist_pkgdata_DATA = \
pkg-info.mk \
vendor.mk \
# EOL
-
-SUFFIXES =
-
-include $(top_srcdir)/build-aux/subst.am
-
-install-data-hook:
- $(subst_make_file) $(DESTDIR)$(pkgdatadir)/default.mk
- $(subst_make_file) $(DESTDIR)$(pkgdatadir)/buildtools.mk
- $(subst_make_file) $(DESTDIR)$(pkgdatadir)/pkg-info.mk
- $(subst_make_file) $(DESTDIR)$(pkgdatadir)/vendor.mk
diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk
index 6ce