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

相关推荐
博语小屋14 小时前
Linux进程信号(壹)_产生信号
linux·运维·服务器
元亓亓亓14 小时前
考研408--计算机网络--day1-概念&组成功能&三种交换技术&分类
服务器·计算机网络·考研
轻松Ai享生活14 小时前
【Linux】VFS 虚拟文件系统 详解
linux
LCG元14 小时前
Linux环境Python生态速建指南:包管理+虚拟隔离+深度调优
linux
大白的编程日记.14 小时前
【Linux学习笔记】线程同步与互斥之生产者消费者模型
linux·笔记·学习
Knight_AL14 小时前
Spring Boot 中使用自定义注解和 AOP 实现微服务日志记录(包含 URL、状态码和耗时信息)
linux·spring boot·微服务
养海绵宝宝的小蜗15 小时前
Linux 例行性工作任务(定时任务)知识点总结
linux·运维·服务器
乌萨奇也要立志学C++15 小时前
【Linux】基础IO(二)深入理解“一切皆文件” 与缓冲区机制:从原理到简易 libc 实现
linux·运维·服务器
这周也會开心15 小时前
通过ssh连接GitHub远程仓库
运维·ssh·github
Ronin30515 小时前
【Linux网络】封装Socket
linux·网络·socket·网络通信