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