X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=assembler%2Fb43-asm;h=79d5e5a5f24c908c284f58e427210fd32b5625e2;hb=9f32ca3e0813a9a173636cb24152b3aed72a8859;hp=11e771901ec6285eb07d66d0affcbf2fb12cb611;hpb=ff7327cd416e9892b175af85c2641d425d256e70;p=b43-tools.git diff --git a/assembler/b43-asm b/assembler/b43-asm index 11e7719..79d5e5a 100755 --- a/assembler/b43-asm +++ b/assembler/b43-asm @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # # b43-asm preprocessing frontend # -# Copyright (c) 2007 Michael Buesch +# Copyright (c) 2010 Michael Buesch # Licensed under the GNU/GPL version 2. # @@ -10,7 +10,7 @@ # The b43-asm backend binary B43_ASM="b43-asm.bin" # The C preprocessor binary -CPP="cpp" +CPP="gcc -E" # This variable is changed by the installer scripts. @@ -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" $@