]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Drop dependency on m4
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 16 May 2021 13:20:46 +0000 (15:20 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 19 May 2021 01:24:43 +0000 (10:24 +0900)
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
.mkosi/mkosi.debian
.mkosi/mkosi.fedora
.mkosi/mkosi.opensuse
.mkosi/mkosi.ubuntu
README
meson.build
test/TEST-06-SELINUX/test.sh
test/mkosi.default.networkd-test
tools/meson-apply-m4.sh [deleted file]

index e0cd6f483409c27e8eaf1646eddf4bc2e861aa31..9782a7d872bd977ccbafa7772a0eab0bcaee59e5 100644 (file)
@@ -35,7 +35,6 @@ BuildPackages=
         libxkbcommon
         libxslt
         lz4
-        m4
         meson
         pam
         pkgconfig
index cf3f3364b525061ac81439e3355d5b844151dab5..0d37937aea700f72d9cce3d754e283b120aea816 100644 (file)
@@ -46,7 +46,6 @@ BuildPackages=
         libtss2-dev
         libxkbcommon-dev
         libzstd-dev
-        m4
         meson
         pkg-config
         python3
index efce52e1e8b069009eac95a39f333a39336c235c..540c85c0261bc6c99c208aa840b8dc083c6fba47 100644 (file)
@@ -45,7 +45,6 @@ BuildPackages=
         libzstd-devel
         lz4
         lz4-devel
-        m4
         meson
         ninja-build
         openssl-devel
index 387f0af70c0f1d2587336c40702b0741af97a631..bf05f8dd72281912be76d21a181f181a3727b346 100644 (file)
@@ -30,7 +30,6 @@ BuildPackages=
         libseccomp-devel
         libselinux-devel
         libxslt-tools
-        m4
         meson
         pam-devel
         pciutils-devel
index 29df6ee238628d82dbb48e709453cd2155e89627..32447c8b384c18090a7bd72e0926bb40d73a24b0 100644 (file)
@@ -49,7 +49,6 @@ BuildPackages=
         libxkbcommon-dev
         libxtables-dev
         libzstd-dev
-        m4
         meson
         pkg-config
         python3
diff --git a/README b/README
index 88057d2d95d0e1ad07e8ddd2d0207d18453054e5..a2b19d656d7b191a428970d6445fdf5a5da4c55d 100644 (file)
--- 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)
 
index c98c4c1e7d3aaa6dd67bee83011138282ab4ddb7..f43e9a775c3331a2aaad886e96630e4a1ecc0d91 100644 (file)
@@ -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')
index 978c930b71ac00872fec3a9a36f4d18c40f124e4..421e1fe52db19feea45db08bfd6d260947469e81 100755 (executable)
@@ -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/...
     )
index e728e16aa575b6d13f1fd079ee5a1478573c2126..fc9a5d3134bf3deefa74b7a26dd5359b4aee4026 100644 (file)
@@ -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 (executable)
index 6c5726a..0000000
+++ /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"