Skip to content

Instantly share code, notes, and snippets.

@bigtan
Last active November 10, 2023 15:31
Show Gist options
  • Save bigtan/9196c10a849b1cd27360b18636c65d77 to your computer and use it in GitHub Desktop.
Save bigtan/9196c10a849b1cd27360b18636c65d77 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.16.3
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 WINDOWS_BUILD=1 make -j`nproc` install
cd ..
ver=8.43
wget https://ftp.pcre.org/pub/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 -j`nproc` && make install
cd ..
ver=1.0.18
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 -j`nproc` && make install
cd ..
wget -O libev.tar.gz https://github.com/shadowsocks/libev/archive/mingw.zip
tar zxf libev.tar.gz
cd libev-mingw
./configure --prefix=/projects/dists/libev --disable-shared
make -j`nproc` && make install
cd ..
ver=1.15.0
wget https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-$ver.tar.gz
tar zxf c-ares-$ver.tar.gz
cd c-ares-$ver
./buildconf
autoconf configure.ac
./configure --prefix=/projects/dists/cares --disable-shared
make -j`nproc` && 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 -j`nproc` && 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-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 -j`nproc` && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment