竹山一叶

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
编译环境
操作系统: Red Hat Enterprise Linux Server release 5.4 64-bit
编译工具: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
 
 
1.    下载libssh2库
 
将libssh2-1.4.2.tar.gz上传至/home目录下
 
 
2.    编译安装libssh2库
 
$ cd /home
$ tar -zxvf libssh2-1.4.2.tar.gz
$ cd libssh2-1.4.2
$ ./configure --with-libssl-prefix=/usr/local/openssl
$ make && make install && make clean
 
注:如果出现:configure: error: cannot find OpenSSL or Libgcrypt 错误
 
修改为:./configure --with-libssl-prefix=/usr/local/openssl CPPFLAGS="-I/usr/local/openssl/include" LDFLAGS="-L/usr/local/openssl/lib"
 
 
3.    下载LibCURL
 
地址:http://curl.haxx.se/download.html
以curl-7.27.0.tar.gz包为例,将curl-7.27.0.tar.gz上传至/home目录下
 
 
4.     解压LibCURL
 
$ cd /home
$ tar -zxvf curl-7.27.0.tar.gz
$ cd curl-7.27.0
 
 
5.    编译并安装
 
编译
$ ./configure --with-ssl=/usr/local/openssl --with-libssh2=/usr/local --with-zlib
$ make && make install
 
清理编译时的中间文件
$ make clean
 
 
6.    使用
 
在/usr/local/lib中存放的生成的LibCURL库libcurl.a,可以直接用来参与静态编译





posted on 2016-10-24 18:09  竹山一叶  阅读(2419)  评论(0编辑  收藏  举报