准备工作

编译

#从官网下载合适的版本并解压
smartdns_version=28
wget -O- "https://github.com/pymumu/smartdns/archive/Release$smartdns_version.tar.gz" | tar xz

#进入编译目录
cd smartdns-Release$smartdns_version

#编译,下面的 LDFLAGS 和 CFLAGS 需要设置成 OpenSSL 的路径
LDFLAGS="-L/root/x64/lib" CFLAGS="-I/root/x64/include" bash package/build-pkg.sh --platform linux --arch x86_64 --static

#处理编译好的二进制文件
mv src/smartdns ../smartdns_x64
cd ..
strip smartdns_x64

编译完之后,就可以删除源文件了

rm -rf smartdns-Release$smartdns_version

下载

编译好的文件