1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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').
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-05-16 15:20:46 +02:00 committed by Yu Watanabe
parent 02fa218b24
commit 44ff8df777
10 changed files with 2 additions and 31 deletions

View File

@ -35,7 +35,6 @@ BuildPackages=
libxkbcommon
libxslt
lz4
m4
meson
pam
pkgconfig

View File

@ -46,7 +46,6 @@ BuildPackages=
libtss2-dev
libxkbcommon-dev
libzstd-dev
m4
meson
pkg-config
python3

View File

@ -45,7 +45,6 @@ BuildPackages=
libzstd-devel
lz4
lz4-devel
m4
meson
ninja-build
openssl-devel

View File

@ -30,7 +30,6 @@ BuildPackages=
libseccomp-devel
libselinux-devel
libxslt-tools
m4
meson
pam-devel
pciutils-devel

View File

@ -49,7 +49,6 @@ BuildPackages=
libxkbcommon-dev
libxtables-dev
libzstd-dev
m4
meson
pkg-config
python3

2
README
View File

@ -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)

View 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')

View File

@ -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/...
)

View File

@ -52,7 +52,6 @@ BuildPackages=
libxslt
lz4
lz4-devel
m4
meson
ninja-build
pam-devel

View File

@ -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"