Skip to content

Instantly share code, notes, and snippets.

@askdaddy
Forked from bigtan/compile.sh
Created August 7, 2018 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save askdaddy/13493b78f69ca3f1e866023a3bf619d8 to your computer and use it in GitHub Desktop.
Save askdaddy/13493b78f69ca3f1e866023a3bf619d8 to your computer and use it in GitHub Desktop.
shadowsocks-libev static build
apt-get update && apt-get install build-essential automake autoconf libtool git clang -y && export CC=clang
ver=2.6.0
wget --no-check-certificate https://tls.mbed.org/download/mbedtls-$ver-gpl.tgz
tar zxf mbedtls-$ver-gpl.tgz
cd mbedtls-$ver
sed -i "s/DESTDIR=\/usr\/local/DESTDIR=\/projects\/dists\/mbedtls/g" Makefile
LDFLAGS=-static make install
cd ..
ver=8.41
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$ver.tar.gz
tar zxf pcre-$ver.tar.gz
cd pcre-$ver
./configure --prefix=/projects/dists/pcre --disable-shared --enable-utf8 --enable-unicode-properties
make && make install
cd ..
ver=1.0.13
wget --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-$ver.tar.gz
tar zxf libsodium-$ver.tar.gz
cd libsodium-$ver
./configure --prefix=/projects/dists/libsodium --disable-ssp --disable-shared
make && make install
cd ..
ver=4.24
wget http://dist.schmorp.de/libev/libev-$ver.tar.gz
tar zxf libev-$ver.tar.gz
cd libev-$ver
./configure --prefix=/projects/dists/libev --disable-shared
make && make install
cd ..
wget https://github.com/c-ares/c-ares/archive/cares-1_13_0.tar.gz
tar zxf cares-1_13_0.tar.gz
cd c-ares-cares-1_13_0
./buildconf
autoconf configure.ac
./configure --prefix=/projects/dists/cares --disable-shared
make && make install
cd ..
git clone https://github.com/shadowsocks/shadowsocks-libev
cd shadowsocks-libev
git submodule init && git submodule update
./autogen.sh
LIBS="-lpthread -lm" LDFLAGS="-Wl,-static -static -static-libgcc -L/projects/dists/libev/lib -L/projects/dists/cares/lib" CFLAGS="-I/projects/dists/libev/include -I/projects/dists/cares/include" ./configure --prefix=/projects/dists/shadowsocks-libev --disable-ssp --disable-documentation --with-mbedtls=/projects/dists/mbedtls --with-pcre=/projects/dists/pcre --with-cares=/projects/dists/cares --with-sodium=/projects/dists/libsodium
make && make install
cd ..
git clone https://github.com/shadowsocks/simple-obfs
cd simple-obfs
git submodule init && git submodule update
./autogen.sh
LIBS="-lpthread -lm" LDFLAGS="-Wl,-static -static -static-libgcc -L/projects/dists/libsodium/lib -L/projects/dists/libev/lib -L/projects/dists/cares/lib" CFLAGS="-I/projects/dists/libsodium/include -I/projects/dists/libev/include -I/projects/dists/cares/include" ./configure --prefix=/projects/dists/shadowsocks-libev --disable-ssp --disable-documentation
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment