forked from devsisters/goquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_libs.sh
executable file
·53 lines (42 loc) · 976 Bytes
/
build_libs.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
#!/usr/bin/env bash
set -e
ARCH_TYPE=$(uname -m)
OS_TYPE=$(uname -s)
if [ $ARCH_TYPE == "x86_64" ]; then
GOARCH="amd64"
elif [ $ARCH_TYPE == "x86" ]; then
GOARCH="386"
else
echo "Unkown architecture"
exit 1
fi
if [ $OS_TYPE == "Linux" ]; then
GOOS="linux"
elif [ $OS_TYPE == "Darwin" ]; then
GOOS="darwin"
else
echo "Unkown OS"
exit 1
fi
echo "GOARCH: $GOARCH"
echo "GOOS: $GOOS"
if [ ! -d libquic ]; then
#git clone https://github.com/devsisters/libquic.git
git clone [email protected]:devsisters/libquic.git
#cd libquic
#git checkout $REV
fi
cd libquic
rm -fr build
mkdir -p build
cd build
cmake -GNinja ..
ninja
cd ../..
TARGET_DIR=lib/${GOOS}_${GOARCH}/
mkdir -p $TARGET_DIR
cp libquic/build/boringssl/crypto/libcrypto.a libquic/build/boringssl/ssl/libssl.a libquic/build/libquic.a libquic/build/protobuf/libprotobuf.a $TARGET_DIR
rm -fr build libgoquic.a
make -j
mv libgoquic.a $TARGET_DIR
echo $TARGET_DIR updated