如何交叉編譯curl?
如何交叉編譯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
*博客內容為網友個人發(fā)布,僅代表博主個人觀點,如有侵權請聯系工作人員刪除。
DIY機械鍵盤相關社區(qū):機械鍵盤DIY