-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc
executable file
·33 lines (28 loc) · 903 Bytes
/
c
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
32
33
#!/usr/bin/env bash
# if Clink is installed, run that
if command -v clink &>/dev/null; then
# on macOS, assume Clink may be dynamically linked against a
# Macports-installed libclang that it will need some help locating
if [ "$(uname -s)" = "Darwin" ]; then
for v in 11 10 9 8 7 6; do
if [ -e "/opt/local/libexec/llvm-${v}.0" ]; then
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}/opt/local/libexec/llvm-${v}.0/lib
break
elif [ -e "/opt/local/libexec/llvm-${v}" ]; then
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}/opt/local/libexec/llvm-${v}/lib
break
fi
done
fi
exec clink "$@"
fi
# if we have cscope, use that
if command -v cscope &>/dev/null; then
if [ $# -eq 0 ]; then
exec cscope -R
else
exec cscope "$@"
fi
fi
printf 'neither Clink nor Cscope found\n' >&2
exit 1