summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2023-01-09 21:40:45 +0100
committerLevente Polyak <anthraxx@archlinux.org>2023-05-20 00:08:11 +0200
commitf1673c60adff196d9b1c7c97797c5775b3bdb56a (patch)
treedb3ddfd858d41397f9fbfbb57935218bb6efd931
parente0307c7925168f58c3ec5077ea9915db81d4f62a (diff)
downloaddevtools-f1673c60adff196d9b1c7c97797c5775b3bdb56a.tar.xz
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>
-rw-r--r--Makefile6
-rw-r--r--src/lib/common.sh2
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 96a76f5..faac812 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/src/lib/common.sh b/src/lib/common.sh
index 1fe396c..51ab2fd 100644
--- a/src/lib/common.sh
+++ b/src/lib/common.sh
@@ -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