diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-10-08 03:52:55 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-10-08 03:52:55 +0200 |
commit | 6afe4ed5b6fe6b76e21e26d3736264788fa6f859 (patch) | |
tree | 45332a7ab5ecb12ec8520b3c0b21051e45172744 /mpn | |
parent | 9dcf34e7c9a14dbe7ea073699ec4b379249a8eda (diff) | |
download | gmp-6afe4ed5b6fe6b76e21e26d3736264788fa6f859.tar.gz |
Correction to:
* mpn/cpp-ccas: New file.
Pass -DPIC or whatever through to cpp.
This is the whole point of the script actually.
Diffstat (limited to 'mpn')
-rwxr-xr-x | mpn/cpp-ccas | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/mpn/cpp-ccas b/mpn/cpp-ccas index 3baea0e15..339fa5205 100755 --- a/mpn/cpp-ccas +++ b/mpn/cpp-ccas @@ -24,12 +24,12 @@ # Usage: cpp-cc --cpp=CPP CC ... file.S ... # -# Process file.S with the given CPP command, then assemble with the -# given CC plus all arguments. +# Process file.S with the given CPP command plus any -D options in the +# rest of the arguments, then assemble with the given CC plus all +# arguments. # # The CPP command must be in a single --cpp= argument, and will be -# split on whitespace. It should include any -D or -I options -# required. +# split on whitespace. It should include -I options required. # # When CC is invoked, file.S is replaced with a temporary .s file # which is the CPP output. @@ -43,6 +43,7 @@ # this script to. CPP= +CPPDEFS= CC= S= SEEN_O=no @@ -52,6 +53,10 @@ for i in "$@"; do --cpp=*) CPP=`echo "$i" | sed 's/^--cpp=//'` ;; + -D*) + CPPDEFS="$CPPDEFS $i" + CC="$CC $i" + ;; *.S) if test -n "$S"; then echo "Only one .S file permitted" @@ -91,8 +96,8 @@ if test $SEEN_O = no; then CC="$CC -o $BASENAME.o" fi -echo "$CPP $S >$TMP_I" -$CPP $S >$TMP_I || exit +echo "$CPP $CPPDEFS $S >$TMP_I" +$CPP $CPPDEFS $S >$TMP_I || exit echo "grep -v '^#' $TMP_I >$TMP_S" grep -v '^#' $TMP_I >$TMP_S |