-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild_deps.sh
executable file
·54 lines (44 loc) · 1.6 KB
/
build_deps.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
#!/bin/bash
if [[ ! -d "./third-party" ]]; then
mkdir ./third-party
fi
if [[ ! -d "./build/install" ]]; then
mkdir -p ./build/install
fi
cd ./third-party
CMAKE=$(which cmake)
# Install Hiredis
if ls ../build/install/lib/libhiredis.a 1>/dev/null 2>&1; then
echo "Hiredis has already been installed"
else
if [[ ! -d "./hiredis" ]]; then
git clone https://github.com/redis/hiredis.git hiredis --branch v1.0.2 --depth=1
echo "Hiredis downloaded"
fi
cd hiredis
LIBRARY_PATH=lib CC=gcc CXX=g++ make PREFIX="$(pwd)/../../build/install" USE_SSL=1 static -j 4
LIBRARY_PATH=lib CC=gcc CXX=g++ make PREFIX="$(pwd)/../../build/install" USE_SSL=1 install
cd ../
# delete shared libraries
rm ../build/install/lib/*.so
rm ../build/install/lib/*.dylib
echo "Finished installing Hiredis"
fi
#Install Redis-plus-plus
if ls ../build/install/lib/libredis++.a 1>/dev/null 2>&1; then
echo "Redis-plus-plus has already been installed"
else
if [[ ! -d "./redis-plus-plus" ]]; then
git clone https://github.com/sewenew/redis-plus-plus.git redis-plus-plus --branch 1.3.13 --depth=1
echo "Redis-plus-plus downloaded"
fi
cd redis-plus-plus
mkdir compile
cd compile
$CMAKE -DCMAKE_BUILD_TYPE=Release -DREDIS_PLUS_PLUS_BUILD_TEST=OFF -DREDIS_PLUS_PLUS_BUILD_SHARED=OFF -DCMAKE_PREFIX_PATH="$(pwd)../../../build/install/lib/" -DCMAKE_INSTALL_PREFIX="$(pwd)/../../../build/install" -DCMAKE_CXX_STANDARD=17 -DREDIS_PLUS_PLUS_USE_TLS=ON ..
CC=gcc CXX=g++ make -j 4
CC=gcc CXX=g++ make install
cd ../../
echo "Finished installing Redis-plus-plus"
fi
cd ../