vp-build/common/wrappers/cc
Juan RP ff80ee06e6 common/wrapper/cc: make this work with args containing whitespaces in quoted strings.
like -DFOO="foo blah". This fixes cross compilation in libsodium, tk and
others.
2015-10-25 10:11:40 +01:00

20 lines
414 B
Bash

#!/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[@]}"