mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
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.
This commit is contained in:
parent
afbeba04d4
commit
ff80ee06e6
1 changed files with 12 additions and 7 deletions
|
@ -1,14 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
# compiler wrapper to get rid of -I/usr/include and -L/usr/lib, that fucks up
|
# compiler wrapper to get rid of -I/usr/include and -L/usr/lib, that fucks up
|
||||||
# cross compilation badly.
|
# cross compilation badly.
|
||||||
MYARGS=
|
declare -a MYARGS
|
||||||
|
|
||||||
for i in $@; do
|
ARGS=("$@")
|
||||||
if [ $i = "-L/usr/lib" -o $i = "-I/usr/include" ]; then
|
i=0
|
||||||
continue
|
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
|
else
|
||||||
MYARGS+="$i "
|
MYARGS+=("${arg}")
|
||||||
fi
|
fi
|
||||||
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
exec @BIN@ ${MYARGS}
|
#echo "[cc-wrapper] ${MYARGS[@]}"
|
||||||
|
exec @BIN@ "${MYARGS[@]}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue