由于项目编译需要使用curl做http请求,所以需要交叉编译curl与openssl;openssl编译看我主页有相关操作;
用的是版本curl-7.79.1,openSSL版本openssl-1.0.2u;
1.下载好curl-7.79.1源码后解压
2.cd curl-7.79.1
3.配置configure 注意这个 --with-openssl路径需要精确到openssl编译好的根目录
./configure --host=aarch64-linux-gnu --prefix=/home/sun/Desktop/VScode/path --with-ssl=/home/sun/Desktop/VScode/openssl/path CPPFLAGS="-I/home/sun/Desktop/VScode/openssl/path/include" LDFLAGS="-L/home/sun/Desktop/VScode/openssl/path/lib" LIBS="-lssl -lcrypto"
4.make
5.make install
步骤三出现以下内容说明配置正确
configure: Configured to build curl/libcurl:
Host setup: aarch64-unknown-linux-gnu
Install prefix: /home/sun/Desktop/VScode/path
Compiler: aarch64-linux-gnu-gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread
CPPFLAGS: -isystem /home/sun/Desktop/VScode/openssl/path/include -isystem /usr/local/include
LDFLAGS: -L/home/sun/Desktop/VScode/openssl/path/lib -L/usr/local/lib
LIBS: -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto
curl version: 7.79.1
SSL: enabled (OpenSSL)
SSH: no (--with-{libssh,libssh2})
zlib: no (--with-zlib)
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: enabled
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path: no
ca fallback: no
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: no (libpsl not found)
Alt-svc: enabled (--disable-alt-svc)
HSTS: enabled (--disable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2, --with-hyper)
HTTP3: no (--with-ngtcp2, --with-quiche)
ECH: no (--enable-ech)
Protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Features: AsynchDNS HSTS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets alt-svc
然后再执行make和make install