]> git.ipfire.org Git - thirdparty/systemd.git/blob - tools/meson-apply-m4.sh
core,journald: use quoted commandlines
[thirdparty/systemd.git] / tools / meson-apply-m4.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eu
4
5 CONFIG=$1
6 TARGET=$2
7
8 if [ $# -ne 2 ]; then
9 echo 'Invalid number of arguments.'
10 exit 1
11 fi
12
13 if [ ! -f $CONFIG ]; then
14 echo "$CONFIG not found."
15 exit 2
16 fi
17
18 if [ ! -f $TARGET ]; then
19 echo "$TARGET not found."
20 exit 3
21 fi
22
23 DEFINES=$(awk '$1 == "#define" && $3 == "1" { printf "-D%s ", $2 }' $CONFIG)
24
25 m4 -P $DEFINES $TARGET