CentOS 7.3编译Rsyslog 8.1903.0
源码下载:
1 | # wget https://github.com/rsyslog/rsyslog/archive/v8.1903.0.tar.gz |
创建构建环境:
1 | # autoreconf -fvi |
创建过程中出现以下错误:
1 | configure.ac:46: error: possibly undefined macro: AC_DISABLE_STATIC |
原因是缺少libtool,执行以下命令安装:
1 | # yum install libtool |
执行配置,可以自定义选项,我是因为要编译omhttp模块,所以使用以下命令:
1 | # ./configure --enable-omhttp |
执行过程汇总出现以下错误:
1 | checking for LIBESTR... no |
使用以下命令检查:
1 | # rpm -q libestr |
安装开发包后解决:
1 | # yum install libestr-devel |
再次执行配置出现以下错误:
1 | checking for LIBFASTJSON... no |
检查系统安装的包:
1 | # rpm -q libfastjson |
安装新版本。源码下载:http://download.rsyslog.com/libfastjson/。下载libfastjson-0.99.8.tar.gz
。
1 | # wget http://download.rsyslog.com/libfastjson/libfastjson-0.99.8.tar.gz |
再次执行配置出现以下错误:
1 | checking for LIBUUID... no |
安装libuuid:
1 | # yum install libuuid libuuid-devel |
再次执行配置出现以下错误:
1 | configure: error: in `/data/rsyslog/rsyslog-8.1903.0': |
安装libgcrypt模块:
1 | # yum install libgcrypt libgcrypt-devel |
再次执行配置成功。^_^
执行编译:
1 | # make |
编译过程出现以下错误:
1 | make[2]: 进入目录“/data/rsyslog/rsyslog-8.1903.0/grammar” |
安装byacc:
1 | # yum install byacc |
再次编译出现以下错误:
1 | make all-am |
这是因为在make前需要执行:
1 | # sh autogen.sh |
编译omhttp模块:
1 | # contrib/omhttp |
执行完成后再次make,生成的omhttp.so
文件在contrib/omhttp/.libs
目录下。
至此,大功告成!!O(∩_∩)O哈哈~