-
Notifications
You must be signed in to change notification settings - Fork 4
/
build
executable file
·55 lines (44 loc) · 1.33 KB
/
build
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
#!/bin/bash
function set_script_dir() {
local ORIG_DIR="$(pwd)" || return 1
local REL_SCRIPT_DIR="$(dirname ${BASH_SOURCE[0]})" || return 1
cd "${REL_SCRIPT_DIR}" || return 1
SCRIPT_DIR="$(pwd)" || return 1
cd "${ORIG_DIR}" || return 1
}
function build_library() {
local ORIG_DIR="$(pwd)" || return 1
cd "${SCRIPT_DIR}" || return 1
local URI='https://github.com/jeffdaily/parasail.git'
local VERSION='v2.6.2'
git clone "${URI}" || return 1
cd parasail || return 1
git checkout "${VERSION}" || return 1
mkdir build || return 1
cd build || return 1
cmake .. || return 1
make || return 1
cd "${ORIG_DIR}" || return 1
}
function build_module() {
local ORIG_DIR="$(pwd)" || return 1
cd "${SCRIPT_DIR}" || return 1
local PARASAIL_BUILD_SO_PATH="./parasail/build/libparasail.so"
local PARASAIL_HEADER="./parasail/parasail.h"
cp "${PARASAIL_BUILD_SO_PATH}" ./ || return 1
cp "${PARASAIL_HEADER}" ./ || return 1
perl Makefile.PL || return 1
make || return 1
cp libparasail.so ./blib/lib/ || return 1
make test || return 1
cp ./blib/lib/Parasail.pm ../ || return 1
cp ./blib/arch/auto/Parasail/Parasail.so ../ || return 1
cp ./libparasail.so ../ || return 1
cd "${ORIG_DIR}" || return 1
}
function main() {
set_script_dir || return 1
build_library || return 1
build_module || return 1
}
main "$@"