From 2cb7e0aaedad73b076ea18c6900b0e86c5760d79 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 15:00:47 +0200 Subject: Adding upstream version 247.3. Signed-off-by: Daniel Baumann --- tools/meson-apply-m4.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tools/meson-apply-m4.sh (limited to 'tools/meson-apply-m4.sh') diff --git a/tools/meson-apply-m4.sh b/tools/meson-apply-m4.sh new file mode 100755 index 0000000..5fad8cd --- /dev/null +++ b/tools/meson-apply-m4.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +CONFIG=$1 +TARGET=$2 + +if [ $# -ne 2 ]; then + echo 'Invalid number of arguments.' + exit 1 +fi + +if [ ! -f $CONFIG ]; then + echo "$CONFIG not found." + exit 2 +fi + +if [ ! -f $TARGET ]; then + echo "$TARGET not found." + exit 3 +fi + +DEFINES=$(awk '$1 == "#define" && $3 == "1" { printf "-D%s ", $2 }' $CONFIG) + +m4 -P $DEFINES $TARGET -- cgit v1.2.3