]> git.proxmox.com Git - mirror_zfs.git/blame - config/Substfiles.am
etc/init.d: decide which variant to use at build time.
[mirror_zfs.git] / config / Substfiles.am
CommitLineData
38e2e9ce 1subst_sed_cmd = \
50d2c9e4 2 -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
38e2e9ce 3 -e 's|@bindir[@]|$(bindir)|g' \
38e2e9ce 4 -e 's|@datadir[@]|$(datadir)|g' \
38e2e9ce
AS
5 -e 's|@initconfdir[@]|$(initconfdir)|g' \
6 -e 's|@initdir[@]|$(initdir)|g' \
7 -e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \
ea04cc4a
AZ
8 -e 's|@pammoduledir[@]|$(pammoduledir)|g' \
9 -e 's|@runstatedir[@]|$(runstatedir)|g' \
10 -e 's|@sbindir[@]|$(sbindir)|g' \
11 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
38e2e9ce
AS
12 -e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \
13 -e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \
14 -e 's|@udevdir[@]|$(udevdir)|g' \
15 -e 's|@udevruledir[@]|$(udevruledir)|g' \
16 -e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \
ea04cc4a
AZ
17 \
18 -e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \
38e2e9ce 19 -e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
37086897 20 -e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \
162cc80b 21 -e 's|@IS_SYSV_RC[@]|$(IS_SYSV_RC)|g' \
37086897 22 -e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \
63652e15 23 -e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \
ea04cc4a
AZ
24 -e 's|@PYTHON[@]|$(PYTHON)|g' \
25 -e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \
26 -e 's|@UBSAN_ENABLED[@]|$(UBSAN_ENABLED)|g' \
27 -e 's|@VERSION[@]|$(VERSION)|g'
38e2e9ce 28
5cdca5b1
AZ
29define SUBST
30$(1) : $(2)$(1).in Makefile;
31 $$(AM_V_GEN)set -e; \
32 $$(MKDIR_P) $$(@D); \
33 $$(RM) $$@~; \
34 $$(SED) $$(subst_sed_cmd) $$< >$$@~; \
35 if grep -E '@[a-zA-Z0-9_]+@' $$@~ >&2; then \
38e2e9ce
AS
36 echo "Undefined substitution" >&2; \
37 exit 1; \
5cdca5b1
AZ
38 fi; \
39 [ -x $$< ] && chmod +x $$@~; \
40 mv -f $$@~ $$@
41endef
42
43SUBSTFILES =
44CLEANFILES += $(SUBSTFILES)
d98a67a5 45dist_noinst_DATA += $(SUBSTFILES:=.in)
5cdca5b1
AZ
46
47$(call SUBST,%,)