当前位置: 首页 > article >正文

CentOS 7.3编译Rsyslog 8.1903.0

个人博客地址:CentOS 7.3编译Rsyslog 8.1903.0 | 一张假钞的真实世界

本篇是个人很早之前的一篇博文,迁移到这里作为备份记录。

源码下载:

# wget https://github.com/rsyslog/rsyslog/archive/v8.1903.0.tar.gz
# tar xzvf v8.1903.0.tar.gz

创建构建环境:

# autoreconf -fvi

创建过程中出现以下错误:

configure.ac:46: error: possibly undefined macro: AC_DISABLE_STATIC
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:49: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.ac:52: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1

原因是缺少libtool,执行以下命令安装:

# yum install libtool

执行配置,可以自定义选项,我是因为要编译omhttp模块,所以使用以下命令:

# ./configure --enable-omhttp

执行过程汇总出现以下错误:

checking for LIBESTR... no
configure: error: Package requirements (libestr >= 0.1.9) were not met:

No package 'libestr' found

使用以下命令检查:

# rpm -q libestr
libestr-0.1.9-2.el7.x86_64

安装开发包后解决:

# yum install libestr-devel

再次执行配置出现以下错误:

checking for LIBFASTJSON... no
configure: error: Package requirements (libfastjson >= 0.99.8) were not met:

No package 'libfastjson' found

检查系统安装的包:

# rpm -q libfastjson
libfastjson-0.99.4-3.el7.x86_64

安装新版本。源码下载:Index of /libfastjson。下载libfastjson-0.99.8.tar.gz

# wget http://download.rsyslog.com/libfastjson/libfastjson-0.99.8.tar.gz
# tar xzvf libfastjson-0.99.8.tar.gz
# cd libfastjson-0.99.8/
# ./configure --prefix=/usr CC="gcc -m64" PKG_CONFIG_PATH="/usr/lib64/pkgconfig" --libdir=/usr/lib64
# make
# make install

再次执行配置出现以下错误:

checking for LIBUUID... no
configure: error: Package requirements (uuid) were not met:

No package 'uuid' found

安装libuuid:

# yum install libuuid libuuid-devel

再次执行配置出现以下错误:

configure: error: in `/data/rsyslog/rsyslog-8.1903.0':
configure: error: libgcrypt-config not found in PATH

安装libgcrypt模块:

# yum install libgcrypt libgcrypt-devel

再次执行配置成功。^_^

执行编译:

# make

编译过程出现以下错误:

make[2]: 进入目录“/data/rsyslog/rsyslog-8.1903.0/grammar”
  YACC     grammar.c
../ylwrap:行178: yacc: 未找到命令
make[2]: *** [grammar.c] 错误 127
make[2]: 离开目录“/data/rsyslog/rsyslog-8.1903.0/grammar”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/data/rsyslog/rsyslog-8.1903.0”
make: *** [all] 错误 2

安装byacc:

# yum install byacc

再次编译出现以下错误:

make  all-am
make[3]: 进入目录“/data/rsyslog/rsyslog-8.1903.0/grammar”
  CC       libgrammar_la-grammar.lo
  LEX      lexer.c
  CC       libgrammar_la-lexer.lo
gcc: error: ./lexer.c: No such file or directory
gcc: fatal error: no input files

这是因为在make前需要执行:

# sh autogen.sh

编译omhttp模块:

# contrib/omhttp
# make
    CC       omhttp_la-omhttp.lo
    CCLD     omhttp.la

执行完成后再次make,生成的omhttp.so文件在contrib/omhttp/.libs目录下。

至此,大功告成!!O(∩_∩)O哈哈~


http://www.kler.cn/a/534763.html

相关文章:

  • HTML学习笔记(6)
  • bat脚本实现自动化漏洞挖掘
  • Java 大视界 -- Java 大数据在智能教育中的应用与个性化学习(75)
  • Ubuntu 下 nginx-1.24.0 源码分析 - ngx_sprintf_num 函数
  • 大语言模型的个性化综述 ——《Personalization of Large Language Models: A Survey》
  • 哪些专业跟FPGA有关?
  • 机器学习9-卷积和卷积核2
  • Android_P_Audio_系统(1) — Auido 系统简介
  • 【FPGA】 MIPS 12条整数指令 【3】
  • UE_C++ —— Properties
  • 高手之间的较量,是“想过”和“想透”之间的较量
  • 深入理解小波变换:信号处理的强大工具
  • python代码
  • HELLOCTF反序列化靶场全解
  • langchain教程-2.prompt
  • DeepSeek写的lammps反应势断键动态显示程序
  • 使用requestAnimationFrame减少浏览器重绘
  • 事件驱动架构(EDA)
  • 电路研究9.2.10——合宙Air780EP中文件系统读写命令使用方法研究
  • 达梦利用老备份集和新归档日志进行异机恢复
  • 单硬盘槽笔记本更换硬盘
  • 2025年南软考研复试,进!
  • 【机器学习与数据挖掘实战】案例12:基于决策树算法的水色图像的水质评价
  • 如何使用Webpack构建前端应用?
  • 剑指 Offer II 014. 字符串中的变位词
  • 快速搭建GPU环境 | docker、k8s中使用gpu