编译环境
操作系统: Red Hat Enterprise Linux Server release 5.4 64-bit
编译工具: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)

1.    下载zlib库
以zlib-1.2.7.tar.gz包为例,将zlib-1.2.7.tar.gz上传至/home目录下

2.    编译安装zlib库
$ cd /home
$ tar -zxvf zlib-1.2.7.tar.gz
$ cd zlib-1.2.7
$ ./configure --prefix=/usr/local
$ make && make install && make clean

3.    下载OpenSSL
地址:http://www.openssl.org/source/
以openssl-1.0.1c.tar.gz包为例,将openssl-1.0.1c.tar.gz上传至/home目录下

4.     解压OpenSSL
$ cd /home
$ tar -zxvf openssl-1.0.1c.tar.gz
$ cd openssl-1.0.1c

5.    编译并安装
编译
$ ./config enable-shared --prefix=/usr/local/openssl/ --openssldir=/usr/local/ssl/zlib
$ make && make test && make install
清理编译时的中间文件
$ make clean

6.    使用
在/usr/local/openssl/lib中存放的生成的openssl库libcrypto.a和libssl.a,可以直接用来参与静态编译




相关文章:

  • 2022-01-12
  • 2022-01-17
  • 2021-12-29
  • 2022-03-07
  • 2021-07-15
  • 2021-06-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-04-18
相关资源
相似解决方案