OpenSSL库的编译与安装
http://blog.csdn.net/lizhoujian/article/details/2850239一. 下载OpenSSL源码包:
二.OpenSSL编译:
三.Openssl安 装:
linux 安装openssl-1.0.0d.tar.gz
1$
2$
(一般的linux系统用命令为:
3$
4$
5$
6$
7$
附加:
a:$
b:$
c:$
d:$
8$
9$
10$
11$
12$
13$
14$
15$
16$
17$
不进行make
如果config的时候,指定了prefix,那么就到你指定的目录去找,下面应该有个lib目录。
如果你的linux自带openssl的话,系统的lib目录下就有。libcrypto和libssl
一般源码的安装包里解压后都有个README,那个是最正确的。
养成个习惯,每次安装之前都去看看。
大部分的软件安装都是./configure
但总有不同的,甚至相同软件包的不同版本都有差异
查看该安装目录下的所有目录名:
------------------------------------------------------------------------------------------------------------------------------------------
解释的比较详细:
先安装zlib,见linux下安装zlib
安装openssl
- Package(Linux source) : openssl-0.9.8c.tar.gz
- 解 压文件
tar -zxvfopenssl-0.9.8c.tar.gz
Our Configuration
- Install to : 默认安装路径 /usr/local/ssl
- Module type : dynamically and staticly loaded modules, *.so*.a
Build Instructions
Configure
.../openssl-0.9.8c]# ./config--prefix=/usr/local/
--openssldir=/usr/local/openssl
-g3 shared zlib-dynamicenable-camellia
--prefix=/usr/local/--openssldir=/usr/local/openssl
[指定安装路 径; 默认是'/usr/local/ssl' -- which we willsymlink]shared
[in addition to the usual static libraries, create sharedlibraries]zlib-dynamic
[like "zlib", but has OpenSSL load the zlib librarydynamically when needed]enable-camellia
[enables the symmetric cipher 'Camellia' (128-bit, 192-bit,256-bit key versions), which is now available for royalty-freeuse]- 运行./config
--prefix=/usr/local/openssl (更多选项用./config --help来查看),可用的选项有:no-mdc2、no-cast SHA256和-DOPENSSL_NO_SHA512等。去掉不必要的内容可以减少生成库的大小。no-rc2、no-rc5、no-ripemd、no-rc4 no-des 、no-md2、no-md4、no-idea 、no-aes、no-bf、no-err、no-dsa、no-dh、no-ec、no-hw、no-asm、no-krb5、no-dso 、no-threads 、no-zlib、-DOPENSSL_NO_HASH_COMP、-DOPENSSL_NO_ERR、-DOPENSSL_NO_HW 、-DOPENSSL_NO_OCSP、-DOPENSSL_NO_ 若要生成debug版本的库和可执行程序加-g或者-g3(openssl中有很多宏,需要调试学习最好加上-g3)。
display guess on system made by './config'...
.../openssl-0.9.8c]# ./config -t
正 式安装,Build and Install
.../openssl-0.9.8c]# make depend
[step required since extra cipher wasenabled](时间很长) .../openssl-0.9.8c]# make(时间很长,慢慢等待)
.../openssl-0.9.8c]# make test.../openssl-0.9.8c]# make install