3 # Get invocation path (which could be a symlink in $PATH)
10 fullpath=`readlink -f "$fullpath"`
13 BASEDIR=`dirname "$fullpath"`
17 _linktype=Applications
19 echo [GCCProxy] $* >&2
21 while [[ $# -gt 0 ]]; do
37 _ldflags=$_ldflags" -shared -lc -lgcc"
41 _cflags=$_cflags" $1 $2"
51 _ldflags=$_ldflags" ${arg}"
72 _miscargs=$_miscargs" $1"
76 _miscargs=$_miscargs" $1"
79 _miscargs=$_miscargs" $1"
86 if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then
93 _ldflags="-lposix -lpsocket "$_ldflags
94 _cflags=$_cflags" -fno-omit-frame-pointer"
97 make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile
101 #echo "_compile = $_compile, _preproc = $_preproc"
103 if [[ "x$_verarg" != "x" ]]; then
104 if [[ "x$_actas" == "xld" ]]; then
105 run $_LD $_miscargs $_verarg
107 run $_CC $_miscargs $_verarg
112 if [[ "x$_actas" == "xld" ]]; then
113 if echo "$_miscargs" | grep '\.o\|\.a'; then
114 run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs
116 run $_LD $_miscargs $_verarg
121 if [[ $_preproc -eq 1 ]]; then
122 run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile
123 elif [[ $_makedep -eq 1 ]]; then
124 run $_CC -M $CFLAGS $_cflags $_miscargs $_outfile
125 elif [[ $_compile -eq 1 ]]; then
126 run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile
127 elif echo " $_miscargs" | grep '\.c' >/dev/null; then
128 tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir`
129 run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout
130 run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile $_libs $LIBGCC_PATH
135 run $_LD $_ldflags $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH