git clone https://github.com/pexcn/ChinaDNS.git && pushd ChinaDNS
./autogen.sh
CFLAGS="-O3 -ffast-math" ./configure --enable-static
make
strip src/chinadns.exe
popd
# libev
./configure \
--prefix="/d/build/libev" \
--disable-shared \
--enable-static \
CFLAGS="-O3 -pipe"
# simple-obfs
./configure \
--prefix="/d/build/simple-obfs" \
--with-ev="/d/build/libev" \
--disable-documentation \
--disable-assert \
--enable-static \
LIBS="-lpthread -lm" \
CFLAGS="-O3 -pipe -Wno-char-subscripts" \
LDFLAGS="-static -static-libgcc"
apt-get install --no-install-recommends -y \
binutils-mingw-w64-x86-64 \
gcc-mingw-w64-x86-64
# reference:
# https://github.com/pexcn/static-build-ci/blob/c1b75aa1d95f194f11f2d677456665f7dd384c63/build.sh#L165-L182
git clone https://github.com/shadowsocks/simple-obfs.git && pushd simple-obfs
git submodule update --init --recursive
./autogen.sh
LIBS="-lev" LDFLAGS="-static -static-libgcc" CFLAGS="-O3 -ffast-math -Wno-attributes" ./configure --disable-documentation --disable-assert --disable-ssp --enable-static
make
strip src/obfs-server.exe src/obfs-local.exe
popd