wrappers/cross-cc: drop -isystem /usr/include, too

This commit is contained in:
Đoàn Trần Công Danh 2023-10-12 19:42:10 +07:00 committed by Đoàn Trần Công Danh
parent 1d4364852d
commit 740858ad91
1 changed files with 7 additions and 7 deletions

View File

@ -8,11 +8,11 @@ ARGS=("$@")
i=0
while [ $i -lt ${#ARGS[@]} ]; do
arg="${ARGS[$i]}"
if [ "$incpath" ]; then
if [ -n "$incpath" ]; then
if [ "$arg" = "/usr/include" ]; then
echo "[cc-wrapper] ignoring -I $arg"
echo "[cc-wrapper] ignoring ${incpath} $arg"
else
MYARGS+=("-I${arg}")
MYARGS+=("${incpath}${arg}")
fi
unset incpath
elif [ "$libpath" ]; then
@ -23,13 +23,13 @@ while [ $i -lt ${#ARGS[@]} ]; do
MYARGS+=("-L${arg}")
fi
unset libpath
elif [ "$arg" = "-I" ]; then
incpath=1
elif [ "$arg" = "-I" -o "$arg" = "-isystem" ]; then
incpath="$arg"
elif [ "$arg" = "-L" ]; then
libpath=1
elif [ "$arg" = "-I/usr/include" -o "$arg" = "-L/usr/lib" \
elif [ "$arg" = "-I/usr/include" -o "$arg" = "-isystem/usr/include" \
-o "$arg" = "-L/usr/lib32" -o "$arg" = "-L/usr/lib64" \
-o "$arg" = "-L/lib" ]; then
-o "$arg" = "-L/usr/lib" -o "$arg" = "-L/lib" ]; then
echo "[cc-wrapper] ignoring $arg"
else
MYARGS+=("${arg}")