3 # Get invocation path (which could be a symlink in $PATH)
10 fullpath=`readlink -f "$fullpath"`
13 BASEDIR=`dirname "$fullpath"`
17 _linktype=Applications
19 while [[ $# -gt 0 ]]; do
35 _ldflags=$_ldflags" -shared -lc -lgcc"
39 _cflags=$_cflags" $1 $2"
49 _ldflags=$_ldflags" ${arg}"
69 _miscargs=$_miscargs" $1"
76 if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then
83 _ldflags="-lposix -lpsocket "$_ldflags
84 _cflags=$_cflags" -fno-omit-frame-pointer"
87 make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile
91 #echo "_compile = $_compile, _preproc = $_preproc"
93 if [[ "x$_verarg" != "x" ]]; then
94 if [[ "x$_actas" == "xld" ]]; then
95 run $_LD $_miscargs $_verarg
97 run $_CC $_miscargs $_verarg
102 if [[ "x$_actas" == "xld" ]]; then
103 if echo "$_miscargs" | grep '\.o\|\.a'; then
104 run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs
106 run $_LD $_miscargs $_verarg
111 if [[ $_preproc -eq 1 ]]; then
112 run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile
113 elif [[ $_makedep -eq 1 ]]; then
114 run $_CC -M $CFLAGS $_cflags $_miscargs $_outfile
115 elif [[ $_compile -eq 1 ]]; then
116 run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile
117 elif echo " $_miscargs" | grep '\.c' >/dev/null; then
118 tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir`
119 run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout
120 run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile $_libs $LIBGCC_PATH
125 run $_LD $_ldflags $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH