赞
踩
交叉编译openvpn&snmp
一.Openvpn编译步骤
依赖库lzo编译:
1.下载lzo-2.09.tar.gz
2.解压tar -xvf lzo-2.09.tar.gz
./configure CC=/home/ngos/toolchain/1809/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu --prefix=/home/ngos/lzo --enable-shared --disable-static
3.make ; make install
依赖库pam编译
1.下载linux-pam-1.5.3.tar.gz
2.解压tar -xvf linux-pam-1.5.3.tar.gz
3.编译pam库:
./configure CC=/home/ngos/toolchain/1809/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu --prefix=/home/ngos/pam
4.make ; make install
依赖库openssl编译:
1.下载openssl-1.0.0.tar.gz
2.解压tar -xvf openssl-1.0.0.tar.gz
3…/config --prefix=$(pwd)/output -shared no-asm --cross-compile-prefix=/home/ngos/toolchain/1809/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
4.执行配置后最后一行Configured for linux-x86_64 修改Makefile PLATFORM=linux-aarch64 CONFIGURE_ARGS=linux-aarch64
5.修改Makefile 删除掉-m64
6.make 编译生成的库和头文件在当前目录的output下
编译openvpn
1.下载openvpn-2.3.18.tar.gz
2.tar -xvf openvpn-2.3.18.tar.gz
3…/configure CC=/home/ngos/toolchain/1809/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc --host=aarch64-linux-gnu LZO_CFLAGS=-I/home/ngos/lzo/include LZO_LIBS=-L/home/ngos/lzo/lib LIBPAM_CFLAGS=-I/home/ngos/pam/include LIBPAM_LIBS=-L/home/ngos/pam/lib OPENSSL_SSL_LIBS=-L/home/ngos/wei/openssl-1.0.0g/output/lib OPENSSL_SSL_CFLAGS=-I/home/ngos/wei/openssl-1.0.0g/output/include OPENSSL_CRYPTO_LIBS=-L/home/ngos/wei/openssl-1.0.0g/output/lib OPENSSL_CRYPTO_CFLAGS=-I/home/ngos/wei/openssl-1.0.0g/output/include --prefix=/home/ngos/openvpn --enable-shared
4.make
5.Error:openvpn-2.3.18/src/openvpn/crypto_openssl.c:300: undefined reference to `EVP_CIPHER_nid’ 修改config.status
S[“LDFLAGS”]=“-L/home/ngos/lzo/lib -L/home/ngos/pam/lib -L/home/ngos/wei/openssl-1.0.0g/output/lib "
S[“LIBS”]=”-lssl -lcrypto -llzo2 -ldl"
6.fatal error: security/pam_appl.h: No such file or directory
把文件位置调整一下 原本的路径是
/home/ngos/pam/include/pam_appl.h
#新建一个文件夹
cd /home/ngos/pam/include/
mkdir security
把原来的include下的头文件全部移动到security
7.编译成功后到设备验证时报错,还需把交叉编译好的
liblzo2.so liblzo2.so.2 liblzo2.so.2.0.0移到设备/tos/lib
二.编译snmp
1.下载net-snmp-5.7.3.tar.gz
2.解压tar -xvf net-snmp-5.7.3.tar.gz
3…/configure --host=arm-linux --target=arm-linux --build=i686-linux --with-cc=aarch64-linux-gnu-gcc --with-ar=aarch64-linux-gnu-ar --prefix=/home/ngos/snmp --disable-shared --disable-scripts --with-endianness=little -enable-mini-agent --disable-ipv6 --disable-manuals --disable-ucd-snmp-compatibility --enable-as-needed
执行配置后会有配置让选择直接回车即可
4.make ; make install
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。