Skip to content

Instantly share code, notes, and snippets.

@davidtavarez
Created January 16, 2021 11:51
Show Gist options
  • Save davidtavarez/602cd65b558d485b95dcf02792819500 to your computer and use it in GitHub Desktop.
Save davidtavarez/602cd65b558d485b95dcf02792819500 to your computer and use it in GitHub Desktop.
Static Tor compilation
#!/usr/bin/env bash
curl -fsSL "https://zlib.net/zlib-1.2.11.tar.gz" | tar zxvf -
cd zlib-1.2.11
./configure --prefix=$PWD/install
make -j$(nproc)
make install
cd ..
curl -fsSL "https://www.openssl.org/source/old/1.0.1/openssl-1.0.1u.tar.gz" | tar zxvf -
cd openssl-1.0.1u
./config --prefix=$PWD/install no-shared no-dso
make -j$(nproc)
make install
cd ..
curl -fsSL "https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz" | tar zxvf -
cd libevent-2.1.12-stable
PKG_CONFIG_PATH=$PWD/../openssl-1.0.1u/install/lib/pkgconfig/ ./configure --prefix=$PWD/install \
--disable-shared \
--enable-static \
--with-pic
make -j$(nproc)
make install
curl -fsSL "https://dist.torproject.org/tor-0.4.4.6.tar.gz" | tar zxvf -
cd tor-0.4.4.6
./configure --prefix=$PWD/install \
--disable-module-relay --disable-module-dirauth \
--disable-system-torrc \
--disable-asciidoc --disable-manpage --disable-html-manual \
--enable-static-tor \
--disable-systemd \
--with-libevent-dir=$PWD/../libevent-2.1.12-stable/install \
--with-openssl-dir=$PWD/../openssl-1.0.1u/install \
--with-zlib-dir=$PWD/../zlib-1.2.11/install
make -j$(nproc)
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment