记录libevent编译openssl

发布于:2024-06-29 ⋅ 阅读:(51) ⋅ 点赞:(0)

libevent交叉编译

第一次编译过程中发现找不到openssl错误

下载源码

http://libevent.org/

// 第三方编译
1、openssl
wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz

tar xzvf openssl-1.0.2u.tar.gz

mkdir /home/csc/share/sshd/openssl-1.0.2u/install -p

cd /home/csc/share/sshd/openssl-1.0.2u
./config --prefix=/data/MyProject/thirdParty/openssl-1.1.1s/buildarm
--cross-compile-prefix=aarch64-linux-gnu- no-asm

直接make编译出错如下
aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-m64'
aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-m64'
aarch64-none-linux-gnu-gcc: error: unrecognized command-line option '-m64'

修改Makefile解决如上问题
删掉带  m64  字样

执行脚本

需要配置环境变量设置成你自己编译安装的位置

export CFLAGS=-I/data/c++/openssl-1.1.1u/build/include
export LDFLAGS=-L/data/c++/openssl-1.1.1u/build/lib
export PKG_CONFIG_PATH=/data/c++/openssl-1.1.1u/build/lib/pkgconfig
./configure --prefix=/data/MyProject/TGZN/Sn_Fire_iot/buildSn/libevent-2.1.12-stable/build --host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++

参考 https://segmentfault.com/q/1010000015949611/a-1020000015956368


网站公告

今日签到

点亮在社区的每一天
去签到