X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2FGCCProxy%2Fgccproxy.sh;fp=Tools%2FGCCProxy%2Fgccproxy.sh;h=213b54fe0040dd84f1a2e47122e902900d38348f;hb=55aa7f51e361b33f7b56c9cb0263b11626e4be61;hp=11dd9e40dbb017a9662b248c944d81f6ad825266;hpb=6516331968f11dd9e5c495572f27cc69fa3d4c48;p=tpg%2Facess2.git diff --git a/Tools/GCCProxy/gccproxy.sh b/Tools/GCCProxy/gccproxy.sh index 11dd9e40..213b54fe 100755 --- a/Tools/GCCProxy/gccproxy.sh +++ b/Tools/GCCProxy/gccproxy.sh @@ -24,6 +24,9 @@ _compile=0 while [[ $# -gt 0 ]]; do case "$1" in + -E) + _preproc=1 + ;; -c) _compile=1 ;; @@ -48,7 +51,7 @@ while [[ $# -gt 0 ]]; do shift _libs=$_libs" -l$1" ;; - -l*) + -l*|-L*) _libs=$_libs" $1" ;; *) @@ -58,15 +61,26 @@ while [[ $# -gt 0 ]]; do shift done +run() { +# echo $* + $* +} + +if [[ $_preproc -eq 1 ]]; then + run $_CC -E $CFLAGS $_cflags $_outfile + exit $? +fi if [[ $_compile -eq 1 ]]; then -# echo $_CC $CFLAGS $* - $_CC $CFLAGS $_miscargs -c $_outfile -else if echo " $_miscargs" | grep '\.c' >/dev/null; then + run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile + exit $? +fi + +if echo " $_miscargs" | grep '\.c' >/dev/null; then tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir` - $_CC $CFLAGS $_miscargs -c -o $tmpout - $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile + run $_CC $CFLAGS $_miscargs -c -o $tmpout + run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile rm $tmpout else - $_LD $LDFLAGS $_ldflags $_miscargs $_outfile $LIBGCC_PATH -fi; fi + run $_LD $LDFLAGS $_ldflags $_miscargs $_outfile $LIBGCC_PATH +fi