Ubuntu16.0.4交叉编译CURL支持https生成动态库

以本人用的编译器arm-linux-gcc为例

1.先编译openssl
1.1 解压openssl源码后,执行./config -fPIC no-asm no-shared --prefix=/usr/local/openssl --cross-compile-prefix=arm-linux-

参数意义:
–prefix是安装路径
–cross-compile-prefix是编译器

1.2 make

1.3make install

2.编译curl
2.1解压curl源码后执行CPPFLAGS="-I/usr/local/arm_ssl -I/usr/local/arm_ssl/include" LDFLAGS="-L/usr/local/openssl/lib" LIBS="-ldl -lssl -lcrypto" ./configure --prefix=/usr/local/libcurl CC=/usr/local/arm/arm-linux/bin/arm-linux-gcc --host=arm-linux --target=arm-linux --with-ssl=/usr/local/openssl --enable-static --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib

2.2make

2.3make install

ps.之前用了好几个版本都没编译成功,本次用的curl-7.64.0 和openssl-1.1.0.k,亲测可用

猜你喜欢

转载自blog.csdn.net/weixin_43815862/article/details/129521027
今日推荐