5 # Get invocation path (which could be a symlink in $PATH)
12 fullpath=`readlink -f "$fullpath"`
15 BASEDIR=`dirname "$fullpath"`
19 _linktype=Applications
21 echo [GCCProxy] $toolname $* >&2
25 while [[ $# -gt 0 ]]; do
41 _ldflags=$_ldflags" -shared -lc -lgcc"
45 _cflags=$_cflags" $1 $2"
55 _ldflags=$_ldflags" ${arg}"
57 -Wall|-Werror|-Wextra)\
74 _ldflags=$_ldflags" -lpthread"
84 -print-multi-os-directory)
90 _miscargs=$_miscargs" $1"
94 _miscargs=$_miscargs" $1"
97 _miscargs=$_miscargs" $1"
104 if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then
111 _ldflags="-lposix -lpsocket "$_ldflags
112 _cflags=$_cflags" -fno-omit-frame-pointer"
115 make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile
119 #echo "_compile = $_compile, _preproc = $_preproc"
121 if [[ "$toolname" == "g++" ]]; then
124 elif [[ "$toolname" == "gcc" ]]; then
127 echo "ERROR: Unknown tool name $toolname" >&2
131 if [[ "x$_verarg" != "x" ]]; then
132 if [[ "x$_actas" == "xld" ]]; then
133 run $_LD $_miscargs $_verarg
135 run $_CC $_miscargs $_verarg
140 if [[ "x$_actas" == "xld" ]]; then
141 if echo "$_miscargs" | grep '\.o\|\.a'; then
142 run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs
144 run $_LD $_miscargs $_verarg
149 if [[ $_preproc -eq 1 ]]; then
150 run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile
151 elif [[ $_makedep -eq 1 ]]; then
152 run $_CC -M $CFLAGS $_cflags $_miscargs $_outfile
153 elif [[ $_compile -eq 1 ]]; then
154 run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile
155 elif echo " $_miscargs" | grep '\.c' >/dev/null; then
156 tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir`
157 run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout
158 run $_LD $LDFLAGS $_ldflags $CRTBEGIN $_libs $tmpout $_outfile $_libs $LIBGCC_PATH $CRTEND
163 run $_LD $_ldflags $CRTBEGIN $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH $CRTEND