linux将curl编译为32位,Linux平台编译curl7.37.1(32位、64位)

一、代码准备

gunzip curl-7.37.1.tar.gz——解压

tar xvf curl-7.37.1.tar——解包

二、编译

32位编译

1)configure

2)make

至少在我的平台上没出现什么问题

在lib/.libs目录下找到libcurl.a和libcurl.so.4,如果需要,再拷贝libcurl.so.4到libcurl.so即可

在include/curl目录下,获取必要的头文件。(注意一点,不同平台下,配置出来的curlbuild.h是不同的)

64位编译

1)configure过程失败如下,

checking run-time libs availability... failed

configure: error: one or more libs available at link-time are not available run-time. Libs used at link-time: -lidn -lssh2 -lssl -lcrypto -lssl -lcrypto -ldl -lz -lldap -lz -lrt

找了一下,这些库都分别在/usr/lib64和

/usr/local/lib

目录下(

libssh2.so在

/usr/local/lib

目录下,其他的在

/usr/lib64),

export LD_LIBRARY_PATH=/usr/local/lib:

/usr/lib64:

$LD_LIBRARY_PATH

再次configure,成功!显示各个模块的支持情况如下

curl version: 7.37.1

Host setup: x86_64-unknown-linux-gnu

Install prefix: /usr/local

Compiler: gcc

SSL support: enabled (OpenSSL)

SSH support: enabled (libSSH2)

zlib support: enabled

GSS-API support: no (--with-gssapi)

SPNEGO support: no (--with-spnego)

TLS-SRP support: no (--enable-tls-srp)

resolver: default (--enable-ares / --enable-threaded-resolver)

ipv6 support: enabled

IDN support: enabled

Build libcurl: Shared=yes, Static=yes

Built-in manual: enabled

--libcurl option: enabled (--disable-libcurl-option)

Verbose errors: enabled (--disable-verbose)

SSPI support: no (--enable-sspi)

ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt

ca cert path: no

LDAP support: enabled (OpenLDAP)

LDAPS support: enabled

RTSP support: enabled

RTMP support: no (--with-librtmp)

metalink support: no (--with-libmetalink)

HTTP2 support: disabled (--with-nghttp2)

Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SCP SFTP SMTP SMTPS TELNET TFTP

2)make

大功告成。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值