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}"
53 -Wall|-Werror|-Wextra)\
70 _ldflags=$_ldflags" -lpthread"
78 _miscargs=$_miscargs" $1"
82 _miscargs=$_miscargs" $1"
85 _miscargs=$_miscargs" $1"
92 if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then
99 _ldflags="-lposix -lpsocket "$_ldflags
100 _cflags=$_cflags" -fno-omit-frame-pointer"
103 make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile
107 #echo "_compile = $_compile, _preproc = $_preproc"
109 if [[ "x$_verarg" != "x" ]]; then
110 if [[ "x$_actas" == "xld" ]]; then
111 run $_LD $_miscargs $_verarg
113 run $_CC $_miscargs $_verarg
118 if [[ "x$_actas" == "xld" ]]; then
119 if echo "$_miscargs" | grep '\.o\|\.a'; then
120 run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs
122 run $_LD $_miscargs $_verarg
127 if [[ $_preproc -eq 1 ]]; then
128 run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile
129 elif [[ $_makedep -eq 1 ]]; then
130 run $_CC -M $CFLAGS $_cflags $_miscargs $_outfile
131 elif [[ $_compile -eq 1 ]]; then
132 run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile
133 elif echo " $_miscargs" | grep '\.c' >/dev/null; then
134 tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir`
135 run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout
136 run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile $_libs $LIBGCC_PATH
141 run $_LD $_ldflags $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH