Linux 下编译openssl

Linux 下编译openssl

下载源码

openssl/releases

编译环境

bash 复制代码
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.
bash 复制代码
sudo apt update #更新索引包
sudo apt upgrade gcc # 更新

编译

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

bash 复制代码
# 配置项目,并指定安装目录
./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)      ***
***                                                                ***
**********************************************************************
bash 复制代码
# -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
...
...
bash 复制代码
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存在于你指定的安装路径中

相关推荐
weixin_4481199412 分钟前
Datawhale 用Markdown语法轻松开发AI应用202512 第1次作业
运维·服务器
知识分享小能手15 分钟前
CentOS Stream 9入门学习教程,从入门到精通,Linux日志分析工具及应用 —语法详解与实战案例(17)
linux·学习·centos
ZXF_H28 分钟前
Linux tcpdump抓包实践(以http为例)
linux·http·wireshark·tcpdump
悄悄敲敲敲30 分钟前
Linux:信号(二)
linux·操作系统·信号
Felven1 小时前
飞腾D2000 GPIO中断调试
linux·gpio·中断·d2000
西格电力科技1 小时前
面向工业用户的绿电直连架构适配技术:高可靠与高弹性的双重设计
大数据·服务器·人工智能·架构·能源
CodeCraft Studio1 小时前
用“录制宏”轻松实现文档自动化:ONLYOFFICE 宏功能实践解析
运维·自动化·onlyoffice·录制宏·创建宏·文档自动化·文档协同
喵了meme1 小时前
Linux学习日记21:读写锁
linux·c语言·学习
广东大榕树信息科技有限公司2 小时前
当运维管理面临挑战时,如何借助动环监控系统提升响应能力?
运维·网络·物联网·国产动环监控系统·动环监控系统
The star"'2 小时前
02-Ansible 基本使用
运维·云计算·ansible