-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_pbc.sh
executable file
·55 lines (49 loc) · 1.14 KB
/
install_pbc.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
set -e
set -x
######### parsing arguments #############
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-a|--asan)
USE_ASAN=1
shift # past argument
;;
-t|--tsan)
USE_TSAN=1
shift # past argument
;;
--gcov)
COVERAGE=1
shift
;;
--pbc-integration-test)
PBC_INTEGRATION_TEST=1
shift
;;
*) # unknown option POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
##########################################
HEADER_PATH="/usr/local/include/pbc"
LIB_PATH="/usr/local/lib/pbc"
if [ ! -z "$USE_ASAN" ]; then
BUILD_DIR="build_asan"
elif [ ! -z "$USE_TSAN" ]; then
BUILD_DIR="build_tsan"
elif [ ! -z "$COVERAGE" ]; then
BUILD_DIR="build_cov"
else
BUILD_DIR="build"
fi
mkdir -p $HEADER_PATH
mkdir -p $LIB_PATH
install -D src/compress-c.h $HEADER_PATH
install -D ${BUILD_DIR}/src/libpbc.a ${BUILD_DIR}/src/deps/fse/libpbc_fse.a ${BUILD_DIR}/src/deps/fsst/libpbc_fsst.a $LIB_PATH
install -D third-party/install/lib/libzstd.a third-party/install/lib/libhs.a $LIB_PATH
set +x
set +e