-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtasks.sh
executable file
·98 lines (76 loc) · 1.58 KB
/
tasks.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/zsh
PROJ_ROOT=${PWD}
SRC_ROOT=${PROJ_ROOT}/src
DEPS_ROOT=${PROJ_ROOT}/deps
BUILD_ROOT=${PROJ_ROOT}/sysroot
TARGET_OPT=
# TARGET_OPT="-target apple-darwin-x86_64"
# TARGET_OPT="-target apple-darwin-arm64"
# DEBUG_OPT=--debug
# OPTIMIZE_OPT=-O0
DEBUG_OPT=
OPTIMIZE_OPT=-O3
export CFLAGS="${TARGET_OPT} ${DEBUG_OPT} ${OPTIMIZE_OPT} -fdiagnostics-absolute-paths"
export CXXFLAGS="${TARGET_OPT} ${DEBUG_OPT} ${OPTIMIZE_OPT} -std=c++17"
export CPPFLAGS="-I${BUILD_ROOT}/include"
export LDFLAGS="${TARGET_OPT} -L${BUILD_ROOT}/lib"
build_lifehash()
(
cd deps/bc-lifehash
./build.sh
make install
)
build_zlib()
(
cd deps/zlib
./configure --static --prefix=${BUILD_ROOT}
make clean
make install
)
build_libpng()
(
cd deps/libpng
export ZLIBLIB=${BUILD_ROOT}/lib
export ZLIBINC=${BUILD_ROOT}/include
export CPPFLAGS="${CPPFLAGS} -I$ZLIBINC"
export LDFLAGS="${LDFLAGS} -L$ZLIBLIB"
export LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH"
./autogen.sh
./configure --enable-shared=no --prefix=${BUILD_ROOT}
make clean
make install
echo ${PWD}
)
build_deps()
(
git submodule update --init --recursive
export PREFIX=${BUILD_ROOT}
build_lifehash
build_zlib
build_libpng
)
clean()
(
make clean
)
configure()
(
./configure
clean
)
build()
(
export CXXFLAGS="${CXXFLAGS}"
export CPPFLAGS="${CPPFLAGS} -I${BUILD_ROOT}/include"
export LDFLAGS="${LDFLAGS} -L${BUILD_ROOT}/lib -lstdc++"
make lifehash
#dsymutil src/lifehash
)
install()
(
make install
)
uninstall()
(
make uninstall
)