summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..917aa4d
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+mkdir -p build
+PWD=`pwd`
+PREFIX="$PWD/build"
+
+build_zlib() {
+ cd zlib
+ ./configure --prefix="$PREFIX"
+ make -j4
+ make install
+ cd ..
+}
+
+build_openssl() {
+ cd openssl
+ ./config --prefix="$PREFIX" no-shared no-dso no-zlib
+ make build_libs
+ make install_dev
+ cd ..
+}
+
+build_libevent() {
+ cd libevent
+ ./autogen.sh
+ ./configure --prefix="$PREFIX" --disable-shared --enable-static --with-pic\
+ --disable-samples -disable-libevent-regress\
+ "CPPFLAGS=-I$PREFIX/include", "LDFLAGS=-L$PREFIX/lib"
+ make -j4
+ make install
+ cd ..
+}
+
+build_tor() {
+ cd tor
+ ./autogen.sh
+ # TODO: See if we can enable some more features (seccomp, rust, zstd, lzma, scrypt (what's that used for?))
+ ./configure --prefix="$PREFIX" --disable-asciidoc --disable-unittests\
+ --enable-static-libevent --with-libevent-dir="$PREFIX"\
+ --enable-static-openssl --with-openssl-dir="$PREFIX"\
+ --enable-static-zlib --with-zlib-dir="$PREFIX"\
+ --disable-systemd --disable-lzma --disable-zstd --disable-rust\
+ --disable-seccomp --disable-libscrypt\
+ "CPPFLAGS=-I$PREFIX/include" "LDFLAGS=-L$PREFIX/lib"
+ make -j4 V=1
+ make install
+ cd ..
+}
+
+build_zlib
+build_openssl
+build_libevent
+build_tor
+
+cp "$PREFIX/bin/tor" tor-static
+strip tor-static