下载 openssl源码
Ubuntu网站下载
链接: lopenssl-1.1.1f
官网下载
链接: lopenssl
这里使用的是Ubuntu下载的
1.解压
$ tar xvf openssl_1.1.1f.orig.tar.gz
2.配置configure 用脚本文件myconfigure.sh配置
$ vi myconfigure.s
配置如下
CC=arm-linux-gcc \
./config \
no-asm \
shared \
no-async \
--prefix=$(pwd)/target_bin
参数说明
CC=arm-linux-gcc 指定需要使用的编译器
no-asm: 在交叉编译过程中不使用汇编代码代码加速编译过程;
shared: 生成动态连接库。
no-async: 交叉编译工具链没有提供GNU C的ucontext库
–prefix=: 安装路径$(pwd)是当前路径
执行脚本
$ ./myconfigure.s
3.make的时候出现以下错误 打开Makefile文件删除-m64然后再make
arm-linux-gcc: error: unrecognized command line option '-m64
4.没有错误就执行make install 执行make install后target_bin目录如下
bin include lib share ssl