软件版本:openssl-0.9.8l, lzo-2.02, openvpn-2.1.1
1. 编译openssl
./config --prefix=/data/app/openssl no-shared no-dso && make && make install
2. 编译lzo
./configure --prefix=/data/app/lzo --enable-static && make && make install
3. 编译openvpn
./configure --with-ssl-header=/data/app/openssl/include --with-ssl-lib=/data/app/openssl/lib --with-lzo-header=/data/app/lzo/include --with-lzo-lib=/data/app/lzo/lib --disable-plugins --with-openssl=static
## 增加gcc静态编译参数:
sed -i '/^LIBS/s/LIBS = /LIBS = -static /g' Makefile
make
4. 编译出来的结果
X86-64 root@02:05:41 openvpn-2.1.1 >> ldd openvpn not a dynamic executable X86-64 root@02:05:46 openvpn-2.1.1 >> file openvpn openvpn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.9, not stripped








