新闻  |   论坛  |   博客  |   在线研讨会
如何交叉编译curl?
电子禅石 | 2020-01-16 19:24:02    阅读:11315   发布文章

如何交叉编译curl?

1. 先准备一下openssl库

  编译openssl库的方法在此

2. 获取curl源码

  wget https://curl.haxx.se/download/curl-7.65.3.tar.gz

2. 解压

  tar xvf curl-7.65.3.tar.gz -C ~/

  cd ~/curl-7.65.3

3. 配置

  CPPFLAGS="-I/home/jello/openssl/ -I/home/jello/openssl/include" LDFLAGS="-L/home/jello/openssl/lib" LIBS="-ldl" ./configure --host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++ --with-ssl --enable-shared --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 --prefix=/home/jello/curl

 

4. 编译

  make -j4

5. 安装

  make install

注意:configure  是由另一个buildconf 文件生成的。注意LIBS 要链接具体的三个库,否则链接时候会出错。

CPPFLAGS="-I/home/gerry01/imx6q/openssl -I/home/gerry01/imx6q/openssl/include" LDFLAGS="-L/home/gerry01/imx6q/openssl/lib" LIBS="-ldl -lssl -lcrypto" ./configure --host=arm-linux CC=/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CXX=/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --with-ssl --enable-shared --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 --prefix=/home/gerry01/imx6q/curl

10.png

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
电子禅石  2021-05-08 10:36:41 

sudo apt-get install automake autoconf libtool

电子禅石  2021-05-08 10:34:51 

configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.." 解决办法:版本升级的原因导致的。

电子禅石  2021-05-08 10:10:26 

root@linux-virtual-machine:/home/linux/curl-master# ./buildconf *** Do not use buildconf. Instead, just use: autoreconf -fi configure:7544: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure:7545: error: possibly undefined macro: AC_PROG_LIBTOOL autoreconf: /usr/bin/autoconf failed with exit status: 1

电子禅石  2021-05-08 10:08:57 

刚下载的源码中是没有configure 的,可以通过命令:autoreconf -vi 来生成对应的configure 命令。

属于自己的技术积累分享,成为嵌入式系统研发高手。
推荐文章
最近访客