build: replace m4 defines with sed scripts during build

There is no reason anymore to use m4 since we got rid of the includes by
using library files. Let's replace the last usage of m4 and completely
red rid of it.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2023-01-09 21:40:45 +01:00
parent e0307c7925
commit f1673c60ad
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
2 changed files with 5 additions and 3 deletions

View File

@ -68,7 +68,9 @@ ifneq ($(wildcard setarch-aliases.d/*),)
endif
edit = sed -e "s|@pkgdatadir[@]|$(DATADIR)|g"
edit = sed \
-e "s|@pkgdatadir[@]|$(DATADIR)|g" \
-e "s|@buildtoolver[@]|$(BUILDTOOLVER)|g"
GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)"
define buildInScript
@ -76,7 +78,7 @@ $(1)/%: $(2)%$(3)
$$(GEN_MSG)
@mkdir -p $$(dir $$@)
@$(RM) "$$@"
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
@cat $$< | $(edit) >$$@
@chmod $(4) "$$@"
@bash -O extglob -n "$$@"
endef

View File

@ -17,7 +17,7 @@ export LANG=C
# Set buildtool properties
export BUILDTOOL=devtools
export BUILDTOOLVER=m4_devtools_version
export BUILDTOOLVER=@buildtoolver@
# Set common properties
export PACMAN_KEYRING_DIR=/etc/pacman.d/gnupg