void-packages/common/wrappers/cc

20 lines
414 B
Plaintext
Raw Normal View History

#!/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 [ "$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] ${MYARGS[@]}"
exec @BIN@ "${MYARGS[@]}"