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存在于你指定的安装路径中

相关推荐
λqaq75 分钟前
Docker 容器入门基础:Cloud Studio 在线 Linux 环境上手
linux·运维·docker
en.en..7 分钟前
LVGL 普通函数指针与结构体函数指针原理
linux·windows·microsoft
byte轻骑兵9 分钟前
【BlueZ 】Adapter 模块:蓝牙适配器(主设备)的初始化与核心逻辑
linux·人工智能·bluez·电脑蓝牙·嵌入式蓝牙
流浪00118 分钟前
Linux系统篇27——通信(四):System V 消息队列 + 信号量:管道之后,Linux 还藏了哪两样 IPC
linux·运维
山岚的运维笔记19 分钟前
mysql 专业笔记 -- 第 14 章:GROUP BY
运维·数据库·笔记·后端·学习·mysql·dba
Java后端的Ai之路37 分钟前
23、Python - 策略模式
linux·python·策略模式
ZYJCSZKJ3 小时前
基于地理位置围栏的短视频POI团购系统:LBS空间索引与流量分发实践
java·服务器·数据库
名字还没想好☜9 小时前
用 systemd 托管后台服务:Restart 策略、日志接管、资源限制与开机自启全踩一遍
运维·docker·kubernetes
乌恩大侠10 小时前
GH200 新增 NVMe SSD 分区、格式化与挂载完整流程
运维·服务器·前端
tangwangbi10 小时前
Linux 系统配置文件:/etc/profile、~/.bashrc 和 ~/.bash_profile 三者之间的区别与作用
linux·运维·bash