wrappers: rename cc to cross-cc to clarify it's used only in cross mode.
This commit is contained in:
parent
1b0a232b20
commit
bd165ccdf6
2 changed files with 2 additions and 2 deletions
37
common/wrappers/cross-cc
Normal file
37
common/wrappers/cross-cc
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
# compiler wrapper to get rid of -I/usr/include and -L/usr/lib, that fucks up
|
||||
# cross compilation badly.
|
||||
declare -a MYARGS
|
||||
|
||||
ARGS=("$@")
|
||||
i=0
|
||||
while [ $i -lt ${#ARGS[@]} ]; do
|
||||
arg="${ARGS[$i]}"
|
||||
if [ "$incpath" ]; then
|
||||
if [ "$arg" = "/usr/include" ]; then
|
||||
echo "[cc-wrapper] ignoring -I $arg"
|
||||
unset incpath
|
||||
else
|
||||
MYARGS+=("-I${arg}")
|
||||
fi
|
||||
elif [ "$libpath" ]; then
|
||||
if [ "$arg" = "/usr/lib" ]; then
|
||||
echo "[cc-wrapper] ignoring -L $arg"
|
||||
unset libpath
|
||||
else
|
||||
MYARGS+=("-L${arg}")
|
||||
fi
|
||||
elif [ "$arg" = "-I" ]; then
|
||||
incpath=1
|
||||
elif [ "$arg" = "-L" ]; then
|
||||
libpath=1
|
||||
elif [ "$arg" = "-I/usr/include" -o "$arg" = "-L/usr/lib" ]; then
|
||||
echo "[cc-wrapper] ignoring $arg"
|
||||
else
|
||||
MYARGS+=("${arg}")
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
#echo "[cc-wrapper] @BIN@ ${MYARGS[@]}"
|
||||
exec @BIN@ "${MYARGS[@]}"
|
Loading…
Add table
Add a link
Reference in a new issue