From 91cb76df7bb3bdba6d0b9637f26ae3a7d226c6da Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 14 Jun 2008 15:30:38 +0200 Subject: [PATCH] Allow passing CPP parameters right after the filenames. Signed-off-by: Michael Buesch --- assembler/b43-asm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/assembler/b43-asm b/assembler/b43-asm index 0f2476a..9585b1c 100755 --- a/assembler/b43-asm +++ b/assembler/b43-asm @@ -41,11 +41,25 @@ shift outfile="$1" shift +cpp_args= +if [ "$1" == "--cpp-args" ]; then + shift + while [ "$1" != "--" ]; do + if [ $# -eq 0 ]; then + echo "ERROR: --cpp-args must be terminated by --" + exit 4 + fi + cpp_args="$cpp_args $1" + shift + done + shift +fi + if [ "$infile" != "-" ]; then if ! [ -r "$infile" ]; then echo "ERROR: Can not read input file \"$infile\"" - exit 4 + exit 5 fi fi -$CPP -x c++ -traditional-cpp "$infile" | $B43_ASM "-" "$outfile" --__real_infile "$infile" $@ +$CPP -x c++ -traditional-cpp $cpp_args "$infile" | $B43_ASM "-" "$outfile" --__real_infile "$infile" $@ -- 2.31.1