-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompiler_wrapper-10.7.in
More file actions
executable file
·31 lines (31 loc) · 938 Bytes
/
compiler_wrapper-10.7.in
File metadata and controls
executable file
·31 lines (31 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
compiler=${0##*/}
save_IFS="$IFS"
IFS=:
newpath=
for dir in $PATH ; do
case $dir in
*var/lib/fink/path-prefix*) ;;
*) newpath="${newpath:+${newpath}:}$dir" ;;
esac
done
IFS="$save_IFS"
export PATH="$newpath"
if [ "$compiler" = "cc" -o "$compiler" = "gcc" ]; then
compiler="clang"
fi
if [ "$compiler" = "c++" -o "$compiler" = "g++" ]; then
compiler="clang++"
fi
# To avoid extra warning spew, don't add
# -Wno-error=unused-command-line-argument-hard-error-in-future
# when clang doesn't support it .
clang_version=`clang --version | head -n1 | cut -d- -f2 | cut -d'.' -f1`
if [[ ($clang_version -lt "503") || ($clang_version -ge "600") ]]; then
suppress_hard_error=""
else
suppress_hard_error="-Wno-error=unused-command-line-argument-hard-error-in-future"
fi
exec $compiler "$suppress_hard_error" "$@"
# strip path-prefix to avoid finding this wrapper again
# @PREFIX@/bin is needed to pick up ccache-default