aarch64交叉编译openvpn

OpenSSL

  1. Download the source: wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
  2. Extract it and change the working directory: tar -xvf openssl-1.0.2j.tar.gz && cd openssl-1.0.2j
  3. Configure it: ./Configure gcc -static -no-shared --prefix=/home/user/vpn_compile --cross-compile-prefix=arm-linux-gnueabi-
  4. Compile: make
  5. Install: make install

LZO

  1. Download the source: wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz
  2. Extract it and change the working directory: tar -xvf lzo-2.09.tar.gz && cd lzo-2.09
  3. Configure it: ./configure --prefix=/home/user/vpn_compile --enable-static --target=arm-linux-gnueabi --host=arm-linux-gnueabi --disable-debug
  4. Compile: make
  5. Install: make install

OpenVPN

  1. Download the source: wget https://swupdate.openvpn.org/community/releases/openvpn-2.3.12.tar.gz
  2. Extract it and change the working directory: tar -xvf openvpn-2.3.12.tar.gz && cd openvpn-2.3.12
  3. Configure it: ./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --prefix=/home/user/vpn_compile --disable-server --enable-static --disable-shared --disable-debug --disable-plugins OPENSSL_SSL_LIBS="-L/home/user/vpn_compile/lib -lssl" OPENSSL_SSL_CFLAGS="-I/home/user/vpn_compile/include" OPENSSL_CRYPTO_LIBS="-L/home/user/vpn_compile/lib -lcrypto" OPENSSL_CRYPTO_CFLAGS="-I/home/user/vpn_compile/include" LZO_CFLAGS="-I/home/user/vpn_compile/include" LZO_LIBS="-L/home/user/vpn_compile/lib -llzo2"
  4. Compile: make LIBS="-all-static"
  5. Install: make install

编译指令:

        ./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu --prefix=/home/victor/openvpn/openvpn-2.3.12/INSTALLDIR --enable-static --disable-debug OPENSSL_SSL_LIBS="-L/home/victor/openvpn/openssl

./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu --prefix=/home/victor/espVpn/openvpn-2.6.0/INSTALLDIR --enable-iproute2 --disable-debug --enable-static OPENSSL_CFLAGS="-I/home/victor/espVpn/openssl-3.1.0/INSTALLDIR/include" OPENSSL_LIBS="-L/home/victor/espVpn/openssl-3.1.0/INSTALLDIR/lib -lssl -lcrypto" LZO_CFLAGS="-I/home/victor/espVpn/lzo-2.10/INSTALLDIR/include" LZO_LIBS="-L/home/victor/espVpn/lzo-2.10/INSTALLDIR/lib -llzo2" LDFLAGS="-ldl" GCC=aarch64-linux-gnu-gcc LD=aarch64-linux-gnu-ld LZ4_CFLAGS="-I/home/victor/espVpn/lz4-1.9.4/INSTALLDIR/usr/local/include -I/home/victor/espVpn/libcap-ng-0.8.3/INSTALLDIR/include" LZ4_LIBS="-L/home/victor/espVpn/lz4-1.9.4/INSTALLDIR/usr/local/lib -L/home/victor/espVpn/libcap-ng-0.8.3/INSTALLDIR/lib -lcap-ng -llz4" LIBPAM_CFLAGS="-I/home/victor/espVpn/linux-pam-1.5.2/INSTALLDIR/include" LIBPAM_LIBS="-L/home/victor/espVpn/linux-pam-1.5.2/INSTALLDIR/lib -lpam"

另参考:2022年交叉编译openvpn_老王-嵌入式linux的博客-CSDN博客

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值