diff --git a/common/wrappers/cc b/common/wrappers/cc index d3d9a857ca..559257602c 100644 --- a/common/wrappers/cc +++ b/common/wrappers/cc @@ -1,14 +1,19 @@ -#!/bin/sh +#!/bin/bash # compiler wrapper to get rid of -I/usr/include and -L/usr/lib, that fucks up # cross compilation badly. -MYARGS= +declare -a MYARGS -for i in $@; do - if [ $i = "-L/usr/lib" -o $i = "-I/usr/include" ]; then - continue +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+="$i " + MYARGS+=("${arg}") fi + i=$((i+1)) done -exec @BIN@ ${MYARGS} +#echo "[cc-wrapper] ${MYARGS[@]}" +exec @BIN@ "${MYARGS[@]}"