Linux 下编译openssl

Linux 下编译openssl

下载源码

openssl/releases

编译环境

gcc --version # 查看版本

#输出
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sudo apt update #更新索引包
sudo apt upgrade gcc # 更新

编译

将下载的源码解压后进入其根目录,打开终端

# 配置项目,并指定安装目录
./config --prefix=/home/linux_onnx/下载/openssl3.5.3

#输出
Configuring OpenSSL version 3.5.3 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
# -j6编译线程数
make -j6

# 输出
/usr/bin/perl util/mkinstallvars.pl PREFIX=. BINDIR=apps APPLINKDIR=ms LIBDIR= INCLUDEDIR=include "INCLUDEDIR=./include" ENGINESDIR=engines MODULESDIR=providers "VERSION=3.5.3" "LDLIBS=-ldl -pthread " > builddata.pm
DEBUG: all keys: APPLINKDIR, BINDIR, CMAKECONFIGDIR, ENGINESDIR, INCLUDEDIR, LDLIBS, LIBDIR, MODULESDIR, PKGCONFIGDIR, PREFIX, VERSION, libdir
No value given for CMAKECONFIGDIR
No value given for PKGCONFIGDIR
No value given for libdir
...
...
make install

#输出
make" depend && "make" _build_libs
make[1]: Entering directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Leaving directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Entering directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Nothing to be done for '_build_libs'.
make[1]: Leaving directory '/home/liurui/下载/openssl-3.5.3'
created directory `/home/liurui/下载/openssl3.5.3/lib64'
*** Installing runtime libraries
install libcrypto.so.3 -> /home/liurui/下载/openssl3.5.3/lib64/libcrypto.so.3
install libssl.so.3 -> /home/liurui/下载/openssl3.5.3/lib64/libssl.so.3
*** Installing development files
...
...

由此,编译好的openssl存在于你指定的安装路径中

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值