From efc4b2d61a1b41fce27f667ac31042a092ac36ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 12 Oct 2023 19:42:10 +0700 Subject: [PATCH] wrappers/cross-cc: drop -isystem /usr/include, too --- common/wrappers/cross-cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/wrappers/cross-cc b/common/wrappers/cross-cc index 0e08bc91d0fc2..ab5e01ad5655a 100644 --- a/common/wrappers/cross-cc +++ b/common/wrappers/cross-cc @@ -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}")