-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv.sh
executable file
·36 lines (29 loc) · 920 Bytes
/
env.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
if [[ $_ == $0 ]]; then
echo "This script is meant to be sourced:"
echo " source $0"
exit 0
fi
#
function pathadd() {
# TODO add check for empty path
# and what happens if $1 == $2
# Copy into temp variables
PATH_NAME=$1
PATH_VAL=${!1}
if [[ ":$PATH_VAL:" != *":$2:"* ]]; then
PATH_VAL="$2${PATH_VAL:+":$PATH_VAL"}"
echo "- $1 += $2"
# use eval to reset the target
eval "$PATH_NAME=$PATH_VAL"
fi
}
BASE_DIR=$( readlink -f $(dirname $BASH_SOURCE)/ )
#pathadd LD_LIBRARY_PATH "${BASE_DIR}/build/herd-library"
pathadd LD_LIBRARY_PATH "${BASE_DIR}/build"
pathadd LD_LIBRARY_PATH "${BASE_DIR}/lib"
pathadd LD_LIBRARY_PATH "/opt/BUTool/lib/"
# adding libherd_app.so
pathadd LD_LIBRARY_PATH "/usr/local/lib"
export LD_LIBRARY_PATH
#export SWATCH_LOG4CPLUS_CONFIG=${BASE_DIR}/herd-library/log4cplus.properties
export SWATCH_LOG4CPLUS_CONFIG=/usr/local/etc/herd/log4cplus.properties