From 44ff8df77748124eb5c5f257eb585e9da26225d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 16 May 2021 15:20:46 +0200 Subject: [PATCH] Drop dependency on m4 m4 was hugely popular in the past, because autotools, automake, flex, bison and many other things used it. But nowadays it much less popular, and might not even be installed in the buildroot. (m4 is small, so it doesn't make a big difference.) (FWIW, Fedora dropped make from the buildroot now, https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot. I think it's reasonable to assume that m4 will be dropped at some point too.) The main reason to drop m4 is that the syntax is not very nice, and we should minimize the number of different syntaxes that we use. We still have two (configure_file() with @FOO@ and jinja2 templates with {{foo}} and the pythonesque conditional expressions), but at least we don't need m4 (with m4_dnl and `quotes'). --- .mkosi/mkosi.arch | 1 - .mkosi/mkosi.debian | 1 - .mkosi/mkosi.fedora | 1 - .mkosi/mkosi.opensuse | 1 - .mkosi/mkosi.ubuntu | 1 - README | 2 +- meson.build | 2 -- test/TEST-06-SELINUX/test.sh | 2 +- test/mkosi.default.networkd-test | 1 - tools/meson-apply-m4.sh | 21 --------------------- 10 files changed, 2 insertions(+), 31 deletions(-) delete mode 100755 tools/meson-apply-m4.sh diff --git a/.mkosi/mkosi.arch b/.mkosi/mkosi.arch index e0cd6f4834..9782a7d872 100644 --- a/.mkosi/mkosi.arch +++ b/.mkosi/mkosi.arch @@ -35,7 +35,6 @@ BuildPackages= libxkbcommon libxslt lz4 - m4 meson pam pkgconfig diff --git a/.mkosi/mkosi.debian b/.mkosi/mkosi.debian index cf3f3364b5..0d37937aea 100644 --- a/.mkosi/mkosi.debian +++ b/.mkosi/mkosi.debian @@ -46,7 +46,6 @@ BuildPackages= libtss2-dev libxkbcommon-dev libzstd-dev - m4 meson pkg-config python3 diff --git a/.mkosi/mkosi.fedora b/.mkosi/mkosi.fedora index efce52e1e8..540c85c026 100644 --- a/.mkosi/mkosi.fedora +++ b/.mkosi/mkosi.fedora @@ -45,7 +45,6 @@ BuildPackages= libzstd-devel lz4 lz4-devel - m4 meson ninja-build openssl-devel diff --git a/.mkosi/mkosi.opensuse b/.mkosi/mkosi.opensuse index 387f0af70c..bf05f8dd72 100644 --- a/.mkosi/mkosi.opensuse +++ b/.mkosi/mkosi.opensuse @@ -30,7 +30,6 @@ BuildPackages= libseccomp-devel libselinux-devel libxslt-tools - m4 meson pam-devel pciutils-devel diff --git a/.mkosi/mkosi.ubuntu b/.mkosi/mkosi.ubuntu index 29df6ee238..32447c8b38 100644 --- a/.mkosi/mkosi.ubuntu +++ b/.mkosi/mkosi.ubuntu @@ -49,7 +49,6 @@ BuildPackages= libxkbcommon-dev libxtables-dev libzstd-dev - m4 meson pkg-config python3 diff --git a/README b/README index 88057d2d95..a2b19d656d 100644 --- a/README +++ b/README @@ -195,7 +195,7 @@ REQUIREMENTS: python >= 3.5 meson >= 0.46 (>= 0.49 is required to build position-independent executables) ninja - gcc, awk, sed, grep, m4, and similar tools + gcc, awk, sed, grep, and similar tools clang >= 10.0, llvm >= 10.0 (optional, required to build BPF programs from source code in C) diff --git a/meson.build b/meson.build index c98c4c1e7d..f43e9a775c 100644 --- a/meson.build +++ b/meson.build @@ -606,7 +606,6 @@ echo = find_program('echo') test = find_program('test') sed = find_program('sed') awk = find_program('awk') -m4 = find_program('m4') stat = find_program('stat') ln = find_program('ln') git = find_program('git', required : false) @@ -1650,7 +1649,6 @@ generate_gperfs = find_program('tools/generate-gperfs.py') make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py') make_directive_index_py = find_program('tools/make-directive-index.py') make_man_index_py = find_program('tools/make-man-index.py') -meson_apply_m4 = find_program('tools/meson-apply-m4.sh') meson_render_jinja2 = find_program('tools/meson-render-jinja2.py') update_dbus_docs_py = find_program('tools/update-dbus-docs.py') update_hwdb_sh = find_program('tools/update-hwdb.sh') diff --git a/test/TEST-06-SELINUX/test.sh b/test/TEST-06-SELINUX/test.sh index 978c930b71..421e1fe52d 100755 --- a/test/TEST-06-SELINUX/test.sh +++ b/test/TEST-06-SELINUX/test.sh @@ -48,7 +48,7 @@ test_append_files() { cp systemd_test.fc "$workspace/systemd-test-module" dracut_install -o sesearch dracut_install runcon - dracut_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile + dracut_install checkmodule semodule semodule_package make load_policy sefcontext_compile dracut_install -o /usr/libexec/selinux/hll/pp # Fedora/RHEL/... dracut_install -o /usr/lib/selinux/hll/pp # Debian/Ubuntu/... ) diff --git a/test/mkosi.default.networkd-test b/test/mkosi.default.networkd-test index e728e16aa5..fc9a5d3134 100644 --- a/test/mkosi.default.networkd-test +++ b/test/mkosi.default.networkd-test @@ -52,7 +52,6 @@ BuildPackages= libxslt lz4 lz4-devel - m4 meson ninja-build pam-devel diff --git a/tools/meson-apply-m4.sh b/tools/meson-apply-m4.sh deleted file mode 100755 index 6c5726a7d5..0000000000 --- a/tools/meson-apply-m4.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -eu - -CONFIG="${1:?Missing path to config.h}" -TARGET="${2:?Missing target m4 file}" - -if [ ! -f "$CONFIG" ]; then - echo "$CONFIG not found." - exit 2 -fi - -if [ ! -f "$TARGET" ]; then - echo "$TARGET not found." - exit 3 -fi - -DEFINES=() -mapfile -t DEFINES < <(awk '$1 == "#define" && $3 == "1" { printf "-D%s\n", $2 }' "$CONFIG") - -m4 -P "${DEFINES[@]}" "$TARGET"