-
Notifications
You must be signed in to change notification settings - Fork 6
/
setenv-for-clang-linux.sh
executable file
·63 lines (56 loc) · 1.4 KB
/
setenv-for-clang-linux.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
CLANG_ROOT=ABCXYZ
GCC_ROOT=DEFUVW
##- Handle PATH
##
if [ -z "$ORIGINAL_PATH" ]
then
if [ -z "$PATH" ]
then
export ORIGINAL_PATH="<undef>"
else
export ORIGINAL_PATH=$PATH
fi
fi
if [ "$ORIGINAL_PATH" == "<undef>" ]
then
BASIC_PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export PATH=$CLANG_ROOT/bin:$GCC_ROOT/bin:$BASIC_PATH:$HOME/.local/bin:$HOME/bin:.
else
export PATH=$CLANG_ROOT/bin:$GCC_ROOT/bin:$ORIGINAL_PATH
fi
##- Handle LD_LIBRARY_PATH
##
if [ -z "$ORIGINAL_LD_LIBRARY_PATH" ]
then
if [ -z "$LD_LIBRARY_PATH" ]
then
export ORIGINAL_LD_LIBRARY_PATH="<undef>"
else
export ORIGINAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
fi
fi
if [ "$ORIGINAL_LD_LIBRARY_PATH" == "<undef>" ]
then
export LD_LIBRARY_PATH=$CLANG_ROOT/lib:$GCC_ROOT/lib:$GCC_ROOT/lib64
else
export LD_LIBRARY_PATH=$CLANG_ROOT/lib:$GCC_ROOT/lib:$GCC_ROOT/lib64:$ORIGINAL_LD_LIBRARY_PATH
fi
##- Handle MANPATH
##
if [ -z "$ORIGINAL_MANPATH" ]
then
if [ -z "$MANPATH" ]
then
export ORIGINAL_MANPATH="<undef>"
export ORIGINAL_MANPATH_DEFAULT=`manpath -q`
else
export ORIGINAL_MANPATH=$MANPATH
fi
fi
if [ "$ORIGINAL_MANPATH" == "<undef>" ]
then
export MANPATH=$CLANG_ROOT/share/man:$GCC_ROOT/share/man:$ORIGINAL_MANPATH_DEFAULT
else
export MANPATH=$CLANG_ROOT/share/man:$GCC_ROOT/share/man:$MANPATH
fi