mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
Centralize variable substitution
A bunch of places need to edit files to incorporate the configured paths i.e. bindir, sbindir etc. Move this logic into a common file. Create arc_summary by copying arc_summary[23] as appropriate at build time instead of install time. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Closes #10559
This commit is contained in:
committed by
Brian Behlendorf
parent
bdb518c13a
commit
38e2e9ce83
@@ -0,0 +1,34 @@
|
||||
subst_sed_cmd = \
|
||||
-e 's|@bindir[@]|$(bindir)|g' \
|
||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
-e 's|@datadir[@]|$(datadir)|g' \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@runstatedir[@]|$(runstatedir)|g' \
|
||||
-e 's|@initconfdir[@]|$(initconfdir)|g' \
|
||||
-e 's|@initdir[@]|$(initdir)|g' \
|
||||
-e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \
|
||||
-e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \
|
||||
-e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \
|
||||
-e 's|@udevdir[@]|$(udevdir)|g' \
|
||||
-e 's|@udevruledir[@]|$(udevruledir)|g' \
|
||||
-e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \
|
||||
-e 's|@PYTHON[@]|$(PYTHON)|g' \
|
||||
-e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \
|
||||
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
|
||||
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g'
|
||||
|
||||
SUBSTFILES =
|
||||
CLEANFILES = $(SUBSTFILES)
|
||||
EXTRA_DIST = $(SUBSTFILES:=.in)
|
||||
|
||||
$(SUBSTFILES):%:%.in Makefile
|
||||
$(AM_V_GEN)set -e; \
|
||||
$(MKDIR_P) $$(dirname $@); \
|
||||
$(RM) $@~; \
|
||||
$(SED) $(subst_sed_cmd) $< >$@~; \
|
||||
if grep -E '@[a-zA-Z0-9_]+@' $@~ >&2; then \
|
||||
echo "Undefined substitution" >&2; \
|
||||
exit 1; \
|
||||
else test $$? -eq 1; fi; \
|
||||
test -x $< && chmod +x $@~; \
|
||||
mv -f $@~ $@
|
||||
Reference in New Issue
Block a user