-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_3d.sh
executable file
·89 lines (71 loc) · 1.51 KB
/
build_3d.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
#!/bin/bash
if [ ! -d third_party/build ] ; then
mkdir third_party/build
fi
cd third_party
MYPWD=${PWD}/build
export CFLAGS=-I${MYPWD}/include
export CPPFLAGS=-I${MYPWD}/include
export LDFLAGS=-L${MYPWD}/lib
function get_from_git()
{
gitpath="";
echo "--- "${1}" ---";
case ${1} in
czmq) gitpath="https://github.com/zeromq/czmq.git"
;;
zeromq) gitpath="https://github.com/zeromq/zeromq4-x.git"
;;
libsodium) gitpath="https://github.com/jedisct1/libsodium.git"
;;
nanomsg) gitpath="https://github.com/nanomsg/nanomsg.git"
;;
msgpack) gitpath="https://github.com/msgpack/msgpack-c.git"
;;
*) echo "Not Valid path"
exit 1
;;
esac
if [ ! -d ${1} ] ; then
git clone ${gitpath} ${1}
else
cd ${1} && \
git pull && \
cd ..
fi
if [ $? -ne 0 ] ; then
echo "git error"
exit 1
fi
}
function compile()
{
echo "--- "${1}" ---";
cd ${1} && \
./autogen.sh || ./bootstrap && \
./configure --prefix=${MYPWD} && \
make -j5 && \
make install && \
cd ..
if [ $? -ne 0 ] ; then
echo "compile error"
exit 1
fi
}
echo "------------------ GIT ------------------";
if [ -z ${1} ] ; then #OffLine mode
get_from_git libsodium
get_from_git zeromq
get_from_git czmq
fi
echo "------------------ Compile ------------------";
compile libsodium
compile zeromq
compile czmq
echo "------------------ Mariadb Client ------------------";
mkdir build/mariadb_cmake
cd build/mariadb_cmake
cmake -DCMAKE_INSTALL_PREFIX=${MYPWD} ../../mariadb-native-client/
make -j5
make install
cd ../../..