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"
76 -print-multi-os-directory)
82 _miscargs=$_miscargs" $1"
86 _miscargs=$_miscargs" $1"
89 _miscargs=$_miscargs" $1"
96 if [[ "x$GCCPROXY_DEBUG" != "x" ]]; then
103 _ldflags="-lposix -lpsocket "$_ldflags
104 _cflags=$_cflags" -fno-omit-frame-pointer"
107 make --no-print-directory -f $BASEDIR/getconfig.mk ARCH=x86 TYPE=$_linktype > $cfgfile
111 #echo "_compile = $_compile, _preproc = $_preproc"
113 if [[ "x$_verarg" != "x" ]]; then
114 if [[ "x$_actas" == "xld" ]]; then
115 run $_LD $_miscargs $_verarg
117 run $_CC $_miscargs $_verarg
122 if [[ "x$_actas" == "xld" ]]; then
123 if echo "$_miscargs" | grep '\.o\|\.a'; then
124 run $_LD $LDFLAGS $_ldflags $_outfile $_miscargs $LIBGCC_PATH $_libs
126 run $_LD $_miscargs $_verarg
131 if [[ $_preproc -eq 1 ]]; then
132 run $_CC -E $CFLAGS $_cflags $_miscargs $_outfile
133 elif [[ $_makedep -eq 1 ]]; then
134 run $_CC -M $CFLAGS $_cflags $_miscargs $_outfile
135 elif [[ $_compile -eq 1 ]]; then
136 run $_CC $CFLAGS $_cflags $_miscargs -c $_outfile
137 elif echo " $_miscargs" | grep '\.c' >/dev/null; then
138 tmpout=`mktemp acess_gccproxy.XXXXXXXXXX.o --tmpdir`
139 run $_CC $CFLAGS $_cflags $_miscargs -c -o $tmpout
140 run $_LD $LDFLAGS $_ldflags $_libs $tmpout $_outfile $_libs $LIBGCC_PATH
145 run $_LD $_ldflags $_miscargs $_outfile $LDFLAGS $_libs $LIBGCC_PATH