参照书籍深入浅出lib event

libevent版本:libevent-2.1.12-stable.tar.gz

操作系统:ubuntu18.04 / macOS big sur 11.2.1

依赖环境:openssl1.1

对应依赖关系

libevent openssl
2.1.x 1.1
2.0.x 1.0

遇到问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/china/Desktop/libevent-2.1.12-stable/build-aux/missing aclocal-1.16 -I m4
/home/china/Desktop/libevent-2.1.12-stable/build-aux/missing: 行 81: aclocal-1.16: 未找到命令
WARNING: 'aclocal-1.16' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<https://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<https://www.gnu.org/software/autoconf>
<https://www.gnu.org/software/m4/>
<https://www.perl.org/>
Makefile:1421: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127

解决方式

1
autoreconf -ivf

起因

在linux中通过拷贝文件安装软件,执行make 操作时出现如下问题

Makefile:372: recipe for target ‘aclocal.m4’ failed

解决办法:在linux终端下执行 :autoreconf -vfi

通过拷贝来的源码,在配置文件中保留原来的配置,所以需要使用autoreconf来更新已经生成的配置文件

必要参数
-d 不删除临时文件
-f 认为所有的文件都是过期的文件/强制执行
-i 复制辅助文件
-s 创建符号链接,而不是复制
-m 当可用时,重新运行命令./configure 和 make
-W 报告语法错误信息

库基本情况测试

开启sample文件中的helloworld

新终端使用

1
netcat ip 9995 

如果收到回应helloworld则库完整性基本测试通过