X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Tools%2FGCCProxy%2Fgccproxy.sh;h=1624fe0e31c3e0bca0d44f045ffdb8a7ed4bcb2d;hb=4c78a1bdd506cda6cda27ee342165c7dfa7ecdc2;hp=a3183d347d4715b0daf7688ffa00943a665ce531;hpb=9896eac487650289d2946f2a2ec76ad747398449;p=tpg%2Facess2.git diff --git a/Tools/GCCProxy/gccproxy.sh b/Tools/GCCProxy/gccproxy.sh index a3183d34..1624fe0e 100755 --- a/Tools/GCCProxy/gccproxy.sh +++ b/Tools/GCCProxy/gccproxy.sh @@ -55,6 +55,16 @@ while [[ $# -gt 0 ]]; do -l*|-L*) _libs=$_libs" $1" ;; + -v|--version|-V) + _verarg=$_verarg" $1" + ;; + --inv=ld) + _actas=ld + ;; + -print-prog-name=ld) + echo $0 --inv=ld + exit 0 + ;; *) _miscargs=$_miscargs" $1" ;; @@ -63,11 +73,15 @@ while [[ $# -gt 0 ]]; do done run() { -# echo --- $* + if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then + echo --- $* + fi $* return $? } +_ldflags="-lposix -lpsocket "$_ldflags + cfgfile=`mktemp` make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile . $cfgfile @@ -75,6 +89,11 @@ rm $cfgfile #echo "_compile = $_compile, _preproc = $_preproc" +if [[ "x$_actas" == "xld" ]]; then + run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs + exit $? +fi + if [[ $_preproc -eq 1 ]]; then run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile elif [[ $_makedep -eq 1 ]]; then @@ -84,9 +103,11 @@ elif [[ $_compile -eq 1 ]]; then elif echo " $_miscargs" | grep '\.c' >/dev/null; then tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir` run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout - run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile -lgcc $_libs + run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile $_libs $LIBGCC_PATH + _rv=$? rm $tmpout + exit $_rv else - run $_LD$_ldflags $_miscargs $_outfile $LDFLAGS $_libs + run $_LD $_ldflags $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH fi