-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sh
executable file
·76 lines (65 loc) · 1.68 KB
/
build.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
#!/usr/bin/env bash
#abort if any command fails
set -e
mkdir -p build/autoconf
builddir=$(readlink -f build)
usage () {
echo "circ-obfuscation build script"
echo ""
echo "Commands:"
echo " <default> Build everything"
echo " debug Build in debug mode"
echo " clean Remove build"
echo " help Print this info and exit"
}
if [ x"$1" == x"" ]; then
debug=''
elif [ x"$1" == x"debug" ]; then
debug='--enable-debug'
elif [ x"$1" == x"clean" ]; then
rm -rf build libaesrand clt13 libmmap libacirc libthreadpool
exit 0
elif [ x"$1" == x"help" ]; then
usage
exit 0
else
echo "error: unknown command '$1'"
usage
exit 1
fi
export CPPFLAGS=-I$builddir/include
export CFLAGS=-I$builddir/include
export LDFLAGS=-L$builddir/lib
build () {
path=$1
url=$2
branch=$3
flags=$debug
if [ $path = "libmmap" ]; then
flags+=" --without-gghlite"
fi
echo
echo "building $path ($url $branch) [flags=$flags]"
echo
if [ ! -d $path ]; then
git clone $url $path;
fi
pushd $path
git pull origin $branch
mkdir -p build/autoconf
autoreconf -i
./configure --prefix=$builddir $flags
make
make check
make install
popd
}
echo builddir = $builddir
build libaesrand https://github.com/5GenCrypto/libaesrand master
build clt13 https://github.com/5GenCrypto/clt13 master
build libmmap https://github.com/5GenCrypto/libmmap master
build libacirc https://github.com/5GenCrypto/libacirc master
build libthreadpool https://github.com/5GenCrypto/libthreadpool master
autoreconf -i
./configure --prefix=$builddir $debug
make