作者: 使徒保罗
邮箱: 297329588@qq.com
声明: 欢迎交流学习,如有任何疑问,请通过邮箱联系本人
应用场景:海思嵌入式开发板使用静态libssh2版本库
开发环境:ubuntu 14.04 32位
功能: 编译hi3531a libssh2交叉编译库
版权声明:本文为CSDN博主「使徒保罗」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
1.静态交叉编译openssl版本
./Configure –prefix=/home/vast/opensource/openssl-0.9.8l/build_hisiv300
os/compiler:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/target/bin/arm-hisiv300-linux-gcc
no-shared
2.静态交叉编译zlib
export CC=arm-hisiv300-linux-gcc
./configure –prefix=/home/vast/opensource/zlib-1.2.11/lib_hi3531a
–static
3.静态交叉编译libssh2
.下载源码 GitHub – libssh2/libssh2: the SSH library
版本: libssh2-libssh2-1.10.0
.解压源码包,跳转到源码根目录执行:
./buildconf
生成configure文件
然后配置交叉编译选项,设置configure命令:
./configure –prefix=/home/vast/opensource/libssh2-libssh2-1.10.0/build_3531a
–host=arm-linux
CC=arm-hisiv300-linux-gcc
–enable-static=yes
–enable-shared=no
–with-libz-prefix= /home/vast/opensource/zlib-1.2.11/lib_hi3531a
–with-libssl-prefix=/home/vast/opensource/openssl-0.9.8l/build_hisiv300
4.静态交叉编译libcurl
./configure –prefix=/home/vast/opensource/curl-8.0.1/libcurl_3531a
–host=arm-hisiv300-linux
CC=arm-hisiv300-linux-gcc
–disable-shared
–with-zlib=”/home/vast/opensource/zlib-1.2.11/lib_hi3531a”
–with-ssl=”/home/vast/opensource/openssl-0.9.8l/build_hisiv300″
–with-libssh2=”/home/vast/opensource/libssh2-libssh2-1.10.0/build_3531a”
然后make && make install
5.检测是否安装成功
跳转到安装目录:/home/vast/opensource/curl-8.0.1/libcurl_3531a/bin
执行: ./curl-config
表明编译成功
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net