├── src ├── tests │ ├── test.mmdb │ ├── testsuites │ │ └── mmdb.conf │ ├── mmdb.sh │ └── Makefile.am ├── contrib │ └── mmdblookup │ │ ├── Makefile.am │ │ └── mmdblookup.c ├── Makefile.am └── configure.ac ├── libfastjson.env ├── util ├── gen_mmdb.pl └── rsyslog.spec ├── LICENSE └── README.md /src/tests/test.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CNSRE/rsyslog-maxminddb/HEAD/src/tests/test.mmdb -------------------------------------------------------------------------------- /libfastjson.env: -------------------------------------------------------------------------------- 1 | export JSON_C_CFLAGS=-I/usr/local/include/libfastjson 2 | export JSON_C_LIBS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lfastjson" 3 | -------------------------------------------------------------------------------- /src/contrib/mmdblookup/Makefile.am: -------------------------------------------------------------------------------- 1 | pkglib_LTLIBRARIES = mmdblookup.la 2 | 3 | mmdblookup_la_SOURCES = mmdblookup.c 4 | mmdblookup_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) 5 | mmdblookup_la_LDFLAGS = -module -avoid-version -lmaxminddb 6 | mmdblookup_la_LIBADD = 7 | 8 | EXTRA_DIST = 9 | -------------------------------------------------------------------------------- /src/tests/testsuites/mmdb.conf: -------------------------------------------------------------------------------- 1 | $IncludeConfig diag-common.conf 2 | template(name="outfmt" type="string" string="%$!iplocation%\n") 3 | 4 | module(load="../contrib/mmdblookup/.libs/mmdblookup") 5 | module(load="../plugins/imptcp/.libs/imptcp") 6 | input(type="imptcp" port="13514") 7 | 8 | action(type="mmdblookup" mmdbfile="./test.mmdb" key="msg" fields="city" ) 9 | action(type="omfile" file="./rsyslog.out.log" template="outfmt") 10 | -------------------------------------------------------------------------------- /src/tests/mmdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # added 2014-11-17 by singh.janmejay 3 | # This file is part of the rsyslog project, released under ASL 2.0 4 | echo =============================================================================== 5 | echo \[mmdb.sh\]: test for mmdb 6 | . $srcdir/diag.sh init 7 | . $srcdir/diag.sh startup mmdb.conf 8 | . $srcdir/diag.sh tcpflood -m 1 -j '202.106.0.20' 9 | echo doing shutdown 10 | . $srcdir/diag.sh shutdown-when-empty 11 | echo wait on shutdown 12 | . $srcdir/diag.sh wait-shutdown 13 | . $srcdir/diag.sh content-check '"city" : "Beijing"' 14 | . $srcdir/diag.sh exit 15 | -------------------------------------------------------------------------------- /util/gen_mmdb.pl: -------------------------------------------------------------------------------- 1 | use MaxMind::DB::Writer::Tree; 2 | use Net::Works::Network; 3 | my $tree = MaxMind::DB::Writer::Tree->new( 4 | ip_version => 4, 5 | record_size => 24, 6 | database_type => 'MMDB', 7 | description => { 8 | en => 'My MaxMindDB', 9 | }, 10 | map_key_type_callback => sub { 'utf8_string' }, 11 | ); 12 | open my $rfh, "<", $ARGV[0]; 13 | while (<$rfh>) { 14 | chomp; 15 | my ( $start_ip, $end_ip, $country, $province, $city, $district, $isp, $desc ) = split /\t/, $_; 16 | my @subnets = Net::Works::Network->range_as_subnets($start_ip, $end_ip); 17 | for my $subnet (@subnets) { 18 | $tree->insert_network($subnet, { 19 | country => $country, 20 | province => $province, 21 | city => $city, 22 | district => $district, 23 | isp => $isp, 24 | desc => $desc, 25 | }); 26 | } 27 | } 28 | open my $fh, '>', "ipdata.mmdb"; 29 | $tree->write_tree($fh); 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 渣浪研发中心技术保障部移动端保障团队 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rsyslog-maxminddb 2 | 3 | 日志解析处理中,对 IP 归属地的解析是很常见的需求。在 ELKstack 中就可以通过 logstash-filter-geoip 插件解析 IP,kibana tilemap 做经纬度可视化。不过 GeoIP 库在国内准确率较低,一般认为不足 70%,且 logstash-filter-geoip 插件的效率也不高,在高流量场合达不到性能要求。 4 | 5 | MaxMindDB 是 MaxMind 公司继 GeoIP 之后推出的新一代 IP 地址库[格式](http://maxmind.github.io/MaxMind-DB/)。对应的公开版本地址库叫 GeoLite2。 6 | 7 | 和 GeoIP 相比,MaxMindDB 有两个重要优势: 8 | 9 | 1. 同为 C 接口,新格式的性能也提升了 4 到 6 倍; 10 | 2. MaxMindDB 提供了自己生成私有地址库的写入工具。 11 | 12 | 为完成高性能高精确度的 IP 归属地解析,选择在 Rsyslog 项目基础上,利用 C 语言版本的 libmaxminddb 接口开发了这个 Message Modification Module,目前已在新浪线上稳定运行数月。 13 | 14 | ## 编译 15 | 1. 下载并安装libfastjson ,版本大于0.99.3, https://github.com/rgerhards/libfastjson/commit/c437cad46af1998e3ad2dafa058c9e2c715df261 16 | ``` 17 | git clone https://github.com/rgerhards/libfastjson 18 | ``` 19 | 20 | 2. 下载 rsyslog 源码包: 21 | ``` 22 | git clone https://github.com/rsyslog/rsyslog.git 23 | ``` 24 | 3. 复制本仓库源码文件到 rsyslog 源码目录内: 25 | ``` 26 | cp -r src/contrib/mmdblookup ../rsyslog/contrib/ 27 | cp src/configure.ac ../rsyslog/ 28 | cp src/Makefile.am ../rsyslog/ 29 | cp src/libfastjson.env ../rsyslog/ 30 | # 可以包括测试用例一起 31 | # cp src/tests ../rsyslog/ 32 | ``` 33 | 4. 编译 rsyslog: 34 | ``` 35 | export PKG_CONFIG_PATH=/lib64/pkgconfig/ 36 | yum install -y libestr liblogging libmaxminddb-devel 37 | yum install -y git-core valgrind autoconf automake flex bison json-c-devel libuuid-devel libgcrypt-devel zlib-devel openssl-devel libcurl-devel gnutls-devel mysql-devel postgresql-devel libdbi-dbd-mysql libdbi-devel net-snmp-devel 38 | cd ../rsyslog 39 | source libfastjson.env 40 | autoconf 41 | ./configure --enable-mmdblookup --enable-elasticsearch --enable-mmjsonparse --***(其他你想加上的参数) 42 | ``` 43 | 44 | 或者通过 rpmbuild 方式打包: 45 | ``` 46 | git clone https://github.com/rsyslog/rsyslog-pkg-rhel-centos 47 | cp util/rsyslog.spec ./rsyslog-pkg-rhel-centos/rpmbuild/SPECS/v8-stable.spec 48 | rpmbuild -bb ./rsyslog-pkg-rhel-centos/rpmbuild/SPECS/v8-stable.spec 49 | ``` 50 | 51 | ## 部署使用 52 | 53 | ``` 54 | 可以直接使用之前编译所得的完整 rsyslog,也可以单独复制 mmdblookup.so 文件到 /lib64/rsyslog 目录下。 55 | 56 | ## 配置示例 57 | 58 | 59 | module( load="imfile" ) 60 | module( load="mmdblookup" ) 61 | module( load="mmjsonparse" ) 62 | 63 | input ( 64 | type="imfile" 65 | File="/tmp/access.log" 66 | addMetadata="off" 67 | Severity="info" 68 | Facility="user" 69 | tag="test" 70 | ruleset="test" 71 | ) 72 | 73 | template( type="string" string="{\"@timestamp\":\"%timereported:::date-rfc3339%\",\"host\":\"%hostname%\",\"geoip2\":%$!iplocation%,%msg:7:$%" name="clientlog" ) 74 | ruleset ( name="test"){ 75 | action( type="mmjsonparse" ) 76 | if ( $parsesuccess == "OK" ) then { 77 | action( type="mmdblookup" mmdbfile="/etc/rsyslog.d/GeoLite2-City.mmdb" fields=["!continent!code","!location"] key="!clientip" ) 78 | action(type="omfwd" Target="10.211.55.3" port="514" Protocol="tcp" template="clientlog") 79 | stop 80 | } 81 | 82 | } 83 | ``` 84 | 85 | ``` 86 | cat /root/a 87 | @cee:{"clientip":"202.106.0.2","os_ver":"ios8","weibo_ver":"5.4.0","uid":1234567890,"rtt":0.123456,"error_code":-10005,"error_msg":"你以为我会告诉你么"} 88 | cat /root/a > /tmp/access 89 | ``` 90 | 91 | ``` 92 | 生成的 logstash 记录示例如下: 93 | 94 | { 95 | "message" => "{\"@timestamp\":\"2016-07-23T10:35:21.572373+08:00\",\"host\":\"localhost\",\"geoip2\":{ \"continent\": { \"code\": \"AS\" }, \"location\": { \"accuracy_radius\": 50, \"latitude\": 34.772500, \"longitude\": 113.726600 } },\"clientip\":\"202.106.0.2\",\"os_ver\":\"ios8\",\"weibo_ver\":\"5.4.0\",\"uid\":1234567890,\"rtt\":0.123456,\"error_code\":-10005,\"error_msg\":\"你以为我会告诉你么\"}", 96 | "@version" => "1", 97 | "@timestamp" => "2016-07-23T02:35:21.586Z", 98 | "host" => "10.211.55.3", 99 | "port" => 58199 100 | } 101 | ``` 102 | 103 | ## MaxMindDB 文件生成 104 | 105 | 本仓库自带一个生成 MaxMindDB 地址库的示例程序。程序假设你有一个ipdata.csv文件,每行记录的是一个IP段的开始IP,结束IP,归属国家、省、市、街道、运营商、其他注释。 106 | 107 | 程序使用 MaxMind::DB::Writer 模块,请先通过 cpan 安装: 108 | 109 | ``` 110 | yum install -y perl-libs perl-corelist 111 | wget https://cpanmin.us -O /usr/sbin/cpanm 112 | chmod +x /usr/sbin/cpanm 113 | cpanm MaxMind::DB::Writer 114 | perl util/gen_mmdb.pl ipdata.csv 115 | ``` 116 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | sbin_PROGRAMS = 2 | pkglib_LTLIBRARIES = 3 | 4 | pkgconfigdir = $(libdir)/pkgconfig 5 | 6 | # 7 | # systemd support 8 | # 9 | if HAVE_SYSTEMD 10 | 11 | nodist_systemdsystemunit_DATA = \ 12 | rsyslog.service 13 | 14 | CLEANFILES = \ 15 | rsyslog.service 16 | 17 | %.service: %.service.in 18 | $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@ 19 | 20 | endif 21 | 22 | EXTRA_DIST = \ 23 | README.md \ 24 | platform/README \ 25 | platform/freebsd/rsyslogd \ 26 | platform/slackware/rc.rsyslogd \ 27 | platform/redhat/rsyslog.conf \ 28 | contrib/README \ 29 | CONTRIBUTING.md \ 30 | COPYING \ 31 | COPYING.LESSER \ 32 | COPYING.ASL20 \ 33 | contrib/gnutls/ca.pem \ 34 | contrib/gnutls/cert.pem \ 35 | contrib/gnutls/key.pem \ 36 | rsyslog.service.in 37 | 38 | SUBDIRS = compat runtime grammar . plugins/immark plugins/imuxsock plugins/imtcp plugins/imudp plugins/omtesting 39 | # external plugin driver is always enabled (core component) 40 | SUBDIRS += plugins/mmexternal 41 | 42 | if ENABLE_RSYSLOGD 43 | SUBDIRS += tools 44 | endif 45 | 46 | if ENABLE_IMKLOG 47 | SUBDIRS += plugins/imklog 48 | endif 49 | 50 | if ENABLE_IMKMSG 51 | SUBDIRS += contrib/imkmsg 52 | endif 53 | 54 | if ENABLE_IMPSTATS 55 | SUBDIRS += plugins/impstats 56 | endif 57 | 58 | if ENABLE_IMSOLARIS 59 | SUBDIRS += plugins/imsolaris 60 | endif 61 | 62 | if ENABLE_GSSAPI 63 | SUBDIRS += plugins/omgssapi plugins/imgssapi 64 | endif 65 | 66 | if ENABLE_RELP 67 | SUBDIRS += plugins/omrelp plugins/imrelp 68 | endif 69 | 70 | if ENABLE_MYSQL 71 | SUBDIRS += plugins/ommysql 72 | endif 73 | 74 | if ENABLE_OMLIBDBI 75 | SUBDIRS += plugins/omlibdbi 76 | endif 77 | 78 | if ENABLE_PGSQL 79 | SUBDIRS += plugins/ompgsql 80 | endif 81 | 82 | if ENABLE_SNMP 83 | SUBDIRS += plugins/omsnmp 84 | endif 85 | 86 | if ENABLE_OMSTDOUT 87 | SUBDIRS += plugins/omstdout 88 | endif 89 | 90 | if ENABLE_PMCISCONAMES 91 | SUBDIRS += contrib/pmcisconames 92 | endif 93 | 94 | if ENABLE_PMCISCOIOS 95 | SUBDIRS += plugins/pmciscoios 96 | endif 97 | 98 | if ENABLE_PMAIXFORWARDEDFROM 99 | SUBDIRS += contrib/pmaixforwardedfrom 100 | endif 101 | 102 | if ENABLE_PMSNARE 103 | SUBDIRS += contrib/pmsnare 104 | endif 105 | 106 | if ENABLE_PMPANNGFW 107 | SUBDIRS += contrib/pmpanngfw 108 | endif 109 | 110 | if ENABLE_PMLASTMSG 111 | SUBDIRS += plugins/pmlastmsg 112 | endif 113 | 114 | if ENABLE_OMRULESET 115 | SUBDIRS += plugins/omruleset 116 | endif 117 | 118 | if ENABLE_OMUDPSPOOF 119 | SUBDIRS += plugins/omudpspoof 120 | endif 121 | 122 | if ENABLE_OMMONGODB 123 | SUBDIRS += plugins/ommongodb 124 | endif 125 | 126 | if ENABLE_OMHIREDIS 127 | SUBDIRS += contrib/omhiredis 128 | endif 129 | 130 | if ENABLE_OMZMQ3 131 | SUBDIRS += contrib/omzmq3 132 | endif 133 | 134 | if ENABLE_OMCZMQ 135 | SUBDIRS += contrib/omczmq 136 | endif 137 | 138 | if ENABLE_OMRABBITMQ 139 | SUBDIRS += contrib/omrabbitmq 140 | endif 141 | 142 | if ENABLE_IMZMQ3 143 | SUBDIRS += contrib/imzmq3 144 | endif 145 | 146 | if ENABLE_IMCZMQ 147 | SUBDIRS += contrib/imczmq 148 | endif 149 | 150 | if ENABLE_OMUXSOCK 151 | SUBDIRS += plugins/omuxsock 152 | endif 153 | 154 | if ENABLE_OMHDFS 155 | SUBDIRS += plugins/omhdfs 156 | endif 157 | 158 | if ENABLE_OMJOURNAL 159 | SUBDIRS += plugins/omjournal 160 | endif 161 | 162 | if ENABLE_IMJOURNAL 163 | SUBDIRS += plugins/imjournal 164 | endif 165 | 166 | if ENABLE_ELASTICSEARCH 167 | SUBDIRS += plugins/omelasticsearch 168 | endif 169 | 170 | if ENABLE_MMSNMPTRAPD 171 | SUBDIRS += plugins/mmsnmptrapd 172 | endif 173 | 174 | if ENABLE_IMFILE 175 | SUBDIRS += plugins/imfile 176 | endif 177 | 178 | if ENABLE_IMPTCP 179 | SUBDIRS += plugins/imptcp 180 | endif 181 | 182 | if ENABLE_IMDIAG 183 | SUBDIRS += plugins/imdiag 184 | endif 185 | 186 | if ENABLE_MAIL 187 | SUBDIRS += plugins/ommail 188 | endif 189 | 190 | if ENABLE_OMKAFKA 191 | SUBDIRS += plugins/omkafka 192 | endif 193 | 194 | if ENABLE_OMPROG 195 | SUBDIRS += plugins/omprog 196 | endif 197 | 198 | if ENABLE_RFC3195 199 | SUBDIRS += plugins/im3195 200 | endif 201 | 202 | if ENABLE_MMNORMALIZE 203 | SUBDIRS += plugins/mmnormalize 204 | endif 205 | 206 | if ENABLE_MMJSONPARSE 207 | SUBDIRS += plugins/mmjsonparse 208 | endif 209 | 210 | if ENABLE_MMGROK 211 | SUBDIRS += contrib/mmgrok 212 | endif 213 | 214 | if ENABLE_MMAUDIT 215 | SUBDIRS += plugins/mmaudit 216 | endif 217 | 218 | if ENABLE_MMANON 219 | SUBDIRS += plugins/mmanon 220 | endif 221 | 222 | if ENABLE_MMUTF8FIX 223 | SUBDIRS += plugins/mmutf8fix 224 | endif 225 | 226 | if ENABLE_MMCOUNT 227 | SUBDIRS += contrib/mmcount 228 | endif 229 | 230 | if ENABLE_MMSEQUENCE 231 | SUBDIRS += contrib/mmsequence 232 | endif 233 | 234 | if ENABLE_MMDBLOOKUP 235 | SUBDIRS += contrib/mmdblookup 236 | endif 237 | 238 | 239 | if ENABLE_MMFIELDS 240 | SUBDIRS += plugins/mmfields 241 | endif 242 | 243 | if ENABLE_MMPSTRUCDATA 244 | SUBDIRS += plugins/mmpstrucdata 245 | endif 246 | 247 | if ENABLE_MMRFC5424ADDHMAC 248 | SUBDIRS += contrib/mmrfc5424addhmac 249 | endif 250 | 251 | # omhttpfs 252 | if ENABLE_OMHTTPFS 253 | SUBDIRS += contrib/omhttpfs 254 | endif 255 | 256 | # omamqp1 257 | if ENABLE_OMAMQP1 258 | SUBDIRS += contrib/omamqp1 259 | endif 260 | 261 | # tests are added as last element, because tests may need different 262 | # modules that need to be generated first 263 | SUBDIRS += tests 264 | 265 | 266 | 267 | # make sure "make distcheck" tries to build all modules. This means that 268 | # a developer must always have an environment where every supporting library 269 | # is available. If that is not the case, the respective configure option may 270 | # temporarily be removed below. The intent behind forcing everthing to compile 271 | # in a make distcheck is so that we detect code that accidently was not updated 272 | # when some global update happened. 273 | DISTCHECK_CONFIGURE_FLAGS= \ 274 | --disable-silent-rules \ 275 | --disable-testbench \ 276 | --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) 277 | 278 | THIS_IS_TEMPORARILY_DISABLED = \ 279 | --enable-distcheck-workaround \ 280 | --enable-testbench \ 281 | --enable-imdiag \ 282 | --enable-testbench \ 283 | --enable-imfile \ 284 | --enable-snmp \ 285 | --enable-libdbi \ 286 | --enable-mysql \ 287 | --enable-relp \ 288 | --enable-rsyslogd \ 289 | --enable-mail \ 290 | --enable-klog \ 291 | --enable-diagtools \ 292 | --enable-mmgrok \ 293 | --enable-gnutls \ 294 | --enable-omstdout \ 295 | --enable-pmlastmsg \ 296 | --enable-omruleset \ 297 | --enable-omprog \ 298 | --enable-imptcp \ 299 | --enable-omuxsock \ 300 | --enable-impstats \ 301 | --enable-memcheck \ 302 | --enable-pmaixforwardedfrom \ 303 | --enable-pmcisconames \ 304 | --enable-pmsnare \ 305 | --enable-elasticsearch \ 306 | --enable-valgrind \ 307 | --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) 308 | # temporarily disable these checks for make distcheck 2012-09-06 rgerhards 309 | # --enable-mmsnmptrapd \ 310 | # --enable-gssapi_krb5 \ 311 | # --enable-extended-tests \ 312 | # --enable-pgsql 313 | 314 | dist-hook: 315 | $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version 316 | 317 | ACLOCAL_AMFLAGS = -I m4 318 | -------------------------------------------------------------------------------- /src/contrib/mmdblookup/mmdblookup.c: -------------------------------------------------------------------------------- 1 | /* mmdblookup.c 2 | * Parse ipaddress field of the message into structured data using 3 | * MaxMindDB. 4 | * 5 | * Copyright 2013 Rao Chenlin. 6 | * 7 | * This file is part of rsyslog. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * -or- 15 | * see COPYING.ASL20 in the source distribution 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | #include "config.h" 24 | #include "rsyslog.h" 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include "conf.h" 35 | #include "syslogd-types.h" 36 | #include "srUtils.h" 37 | #include "template.h" 38 | #include "module-template.h" 39 | #include "errmsg.h" 40 | 41 | #include "maxminddb.h" 42 | 43 | #define JSON_IPLOOKUP_NAME "!iplocation" 44 | 45 | MODULE_TYPE_OUTPUT 46 | MODULE_TYPE_NOKEEP 47 | MODULE_CNFNAME("mmdblookup") 48 | 49 | 50 | DEFobjCurrIf(errmsg); 51 | DEF_OMOD_STATIC_DATA 52 | 53 | /* config variables */ 54 | 55 | typedef struct _instanceData { 56 | char *pszKey; 57 | char *pszMmdbFile; 58 | struct { 59 | int nmemb; 60 | uchar **name; 61 | } fieldList; 62 | } instanceData; 63 | 64 | typedef struct wrkrInstanceData { 65 | instanceData *pData; 66 | MMDB_s mmdb; 67 | } wrkrInstanceData_t; 68 | 69 | struct modConfData_s { 70 | rsconf_t *pConf; /* our overall config object */ 71 | }; 72 | static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ 73 | static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ 74 | 75 | 76 | /* tables for interfacing with the v6 config system */ 77 | /* action (instance) parameters */ 78 | static struct cnfparamdescr actpdescr[] = { 79 | { "key", eCmdHdlrGetWord, 0 }, 80 | { "mmdbfile", eCmdHdlrGetWord, 0 }, 81 | { "fields", eCmdHdlrArray, 0 }, 82 | }; 83 | static struct cnfparamblk actpblk = 84 | { CNFPARAMBLK_VERSION, 85 | sizeof(actpdescr)/sizeof(struct cnfparamdescr), 86 | actpdescr 87 | }; 88 | 89 | BEGINbeginCnfLoad 90 | CODESTARTbeginCnfLoad 91 | loadModConf = pModConf; 92 | pModConf->pConf = pConf; 93 | ENDbeginCnfLoad 94 | 95 | BEGINendCnfLoad 96 | CODESTARTendCnfLoad 97 | ENDendCnfLoad 98 | 99 | BEGINcheckCnf 100 | CODESTARTcheckCnf 101 | ENDcheckCnf 102 | 103 | BEGINactivateCnf 104 | CODESTARTactivateCnf 105 | runModConf = pModConf; 106 | ENDactivateCnf 107 | 108 | BEGINfreeCnf 109 | CODESTARTfreeCnf 110 | ENDfreeCnf 111 | 112 | 113 | BEGINcreateInstance 114 | CODESTARTcreateInstance 115 | ENDcreateInstance 116 | 117 | BEGINcreateWrkrInstance 118 | CODESTARTcreateWrkrInstance 119 | int status = MMDB_open(pData->pszMmdbFile, MMDB_MODE_MMAP, &pWrkrData->mmdb); 120 | if(MMDB_SUCCESS != status) { 121 | dbgprintf("Can't open %s - %s\n", pData->pszMmdbFile, MMDB_strerror(status)); 122 | if(MMDB_IO_ERROR == status) { 123 | dbgprintf(" IO error: %s\n", strerror(errno)); 124 | } 125 | errmsg.LogError(0, RS_RET_SUSPENDED, "can not initialize maxminddb"); 126 | // ABORT_FINALIZE(RS_RET_SUSPENDED); 127 | } 128 | ENDcreateWrkrInstance 129 | 130 | 131 | BEGINisCompatibleWithFeature 132 | CODESTARTisCompatibleWithFeature 133 | ENDisCompatibleWithFeature 134 | 135 | 136 | BEGINfreeInstance 137 | CODESTARTfreeInstance 138 | ENDfreeInstance 139 | 140 | 141 | BEGINfreeWrkrInstance 142 | CODESTARTfreeWrkrInstance 143 | MMDB_close(&pWrkrData->mmdb); 144 | ENDfreeWrkrInstance 145 | 146 | static inline void 147 | setInstParamDefaults(instanceData *pData) 148 | { 149 | pData->pszKey = NULL; 150 | pData->pszMmdbFile = NULL; 151 | pData->fieldList.nmemb = 0; 152 | } 153 | 154 | BEGINnewActInst 155 | struct cnfparamvals *pvals; 156 | int i; 157 | CODESTARTnewActInst 158 | dbgprintf("newActInst (mmdblookup)\n"); 159 | if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { 160 | ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); 161 | } 162 | 163 | CODE_STD_STRING_REQUESTnewActInst(1) 164 | CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); 165 | CHKiRet(createInstance(&pData)); 166 | setInstParamDefaults(pData); 167 | 168 | for(i = 0 ; i < actpblk.nParams ; ++i) { 169 | if(!pvals[i].bUsed) 170 | continue; 171 | if(!strcmp(actpblk.descr[i].name, "key")) { 172 | pData->pszKey = es_str2cstr(pvals[i].val.d.estr, NULL); 173 | continue; 174 | } 175 | if(!strcmp(actpblk.descr[i].name, "mmdbfile")) { 176 | pData->pszMmdbFile = es_str2cstr(pvals[i].val.d.estr, NULL); 177 | continue; 178 | } 179 | if(!strcmp(actpblk.descr[i].name, "fields")) { 180 | pData->fieldList.nmemb = pvals[i].val.d.ar->nmemb; 181 | CHKmalloc(pData->fieldList.name = malloc(sizeof(uchar*) * pData->fieldList.nmemb)); 182 | for(int j = 0 ; j < pvals[i].val.d.ar->nmemb ; ++j) { 183 | pData->fieldList.name[j] = (uchar*)es_str2cstr(pvals[i].val.d.ar->arr[j], NULL); 184 | } 185 | } 186 | dbgprintf("mmdblookup: program error, non-handled " 187 | "param '%s'\n", actpblk.descr[i].name); 188 | } 189 | 190 | if(pData->pszKey == NULL) { 191 | dbgprintf("mmdblookup: action requires a key"); 192 | ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); 193 | } 194 | 195 | if(pData->pszMmdbFile == NULL) { 196 | dbgprintf("mmdblookup: action requires a mmdbfile"); 197 | ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); 198 | } 199 | 200 | CODE_STD_FINALIZERnewActInst 201 | cnfparamvalsDestruct(pvals, &actpblk); 202 | ENDnewActInst 203 | 204 | 205 | BEGINdbgPrintInstInfo 206 | CODESTARTdbgPrintInstInfo 207 | ENDdbgPrintInstInfo 208 | 209 | 210 | BEGINtryResume 211 | CODESTARTtryResume 212 | ENDtryResume 213 | void str_split(char **membuf){ 214 | char *buf = *membuf; 215 | char tempbuf[strlen(buf)] ; 216 | memset(tempbuf, 0, strlen(buf)) ; 217 | 218 | while(*buf++ != '\0'){ 219 | if (*buf == '\n' || *buf == '\t' || *buf == ' '){ 220 | continue; 221 | } 222 | else { 223 | if (*buf == '<'){ 224 | char *p = strchr(buf, '>'); 225 | buf = buf + (int)(p - buf); 226 | strcat(tempbuf, ","); 227 | } 228 | else if( *buf == '}'){ 229 | strcat(tempbuf, "},"); 230 | } 231 | else{ 232 | strncat(tempbuf, buf, 1); 233 | } 234 | } 235 | } 236 | 237 | tempbuf[strlen(tempbuf) +1 ] = '\n'; 238 | memset(*membuf, 0, strlen(*membuf)) ; 239 | memcpy(*membuf, tempbuf, strlen(tempbuf)); 240 | } 241 | 242 | 243 | 244 | BEGINdoAction 245 | msg_t *pMsg; 246 | struct json_object *json = NULL; 247 | struct json_object *keyjson = NULL; 248 | char *pszValue; 249 | instanceData *const pData = pWrkrData->pData; 250 | CODESTARTdoAction 251 | pMsg = (msg_t*) ppString[0]; 252 | 253 | json = json_object_new_object(); 254 | 255 | /* key is given, so get the property json */ 256 | msgPropDescr_t pProp; 257 | msgPropDescrFill(&pProp, (uchar*)pData->pszKey, strlen(pData->pszKey)); 258 | rsRetVal localRet = msgGetJSONPropJSON(pMsg, &pProp, &keyjson); 259 | msgPropDescrDestruct(&pProp); 260 | 261 | if(localRet != RS_RET_OK) { 262 | /* key not found in the message. nothing to do */ 263 | ABORT_FINALIZE(RS_RET_OK); 264 | } 265 | /* key found, so get the value */ 266 | pszValue = (char*)json_object_get_string(keyjson); 267 | 268 | 269 | int gai_err, mmdb_err; 270 | MMDB_lookup_result_s result = MMDB_lookup_string(&pWrkrData->mmdb, pszValue, &gai_err, &mmdb_err); 271 | 272 | if(0 != gai_err) { 273 | dbgprintf("Error from call to getaddrinfo for %s - %s\n", pszValue, gai_strerror(gai_err)); 274 | dbgprintf("aaaaa\n"); 275 | ABORT_FINALIZE(RS_RET_OK); 276 | } 277 | if(MMDB_SUCCESS != mmdb_err) { 278 | dbgprintf("Got an error from the maxminddb library: %s\n", MMDB_strerror(mmdb_err)); 279 | dbgprintf("bbbbb\n"); 280 | ABORT_FINALIZE(RS_RET_OK); 281 | } 282 | 283 | MMDB_entry_data_list_s *entry_data_list = NULL; 284 | int status = MMDB_get_entry_data_list(&result.entry, &entry_data_list); 285 | 286 | if (MMDB_SUCCESS != status){ 287 | dbgprintf("Got an error looking up the entry data - %s\n", MMDB_strerror(status)); 288 | ABORT_FINALIZE(RS_RET_OK); 289 | } 290 | 291 | FILE *memstream; 292 | char *membuf; 293 | size_t memlen; 294 | memstream = open_memstream(&membuf, &memlen); 295 | 296 | if (entry_data_list != NULL && memstream != NULL){ 297 | MMDB_dump_entry_data_list(memstream, entry_data_list, 2); 298 | fflush(memstream); 299 | str_split(&membuf); 300 | } 301 | 302 | json_object *total_json = json_tokener_parse(membuf); 303 | fclose(memstream); 304 | 305 | if (pData->fieldList.nmemb < 1){ 306 | dbgprintf("fieldList.name is empty!...\n"); 307 | ABORT_FINALIZE(RS_RET_OK); 308 | } 309 | 310 | for (int i = 0 ; i < pData->fieldList.nmemb ; ++i){ 311 | char buf[(strlen((char *)(pData->fieldList.name[i])))+1]; 312 | memset(buf, 0, sizeof(buf)); 313 | strcpy(buf, (char *)pData->fieldList.name[i]); 314 | 315 | struct json_object *json1[5] = {NULL}; 316 | json_object *temp_json = total_json; 317 | int j = 0; 318 | char *path[10] = {NULL}; 319 | char *sep = "!"; 320 | 321 | char *s = strtok(buf, sep); 322 | for (; s != NULL; j++){ 323 | path[j] = s; 324 | s = strtok(NULL, sep); 325 | 326 | json_object *sub_obj = json_object_object_get(temp_json, path[j]); 327 | temp_json = sub_obj; 328 | } 329 | 330 | j--; 331 | for (;j >= 0 ;j--){ 332 | if (j > 0){ 333 | json1[j] = json_object_new_object(); 334 | json_object_object_add(json1[j], path[j], temp_json); 335 | temp_json = json1[j]; 336 | } 337 | 338 | else { 339 | json_object_object_add(json, path[j], temp_json); 340 | } 341 | } 342 | 343 | } 344 | 345 | finalize_it: 346 | 347 | if(json) { 348 | msgAddJSON(pMsg, (uchar *)JSON_IPLOOKUP_NAME, json, 0, 0); 349 | } 350 | ENDdoAction 351 | 352 | 353 | BEGINparseSelectorAct 354 | CODESTARTparseSelectorAct 355 | CODE_STD_STRING_REQUESTparseSelectorAct(1) 356 | if(strncmp((char*) p, ":mmdblookup:", sizeof(":mmdblookup:") - 1)) { 357 | errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, 358 | "mmdblookup supports only v6+ config format, use: " 359 | "action(type=\"mmdblookup\" ...)"); 360 | } 361 | ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); 362 | CODE_STD_FINALIZERparseSelectorAct 363 | ENDparseSelectorAct 364 | 365 | 366 | BEGINmodExit 367 | CODESTARTmodExit 368 | objRelease(errmsg, CORE_COMPONENT); 369 | ENDmodExit 370 | 371 | 372 | BEGINqueryEtryPt 373 | CODESTARTqueryEtryPt 374 | CODEqueryEtryPt_STD_OMOD_QUERIES 375 | CODEqueryEtryPt_STD_OMOD8_QUERIES 376 | CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES 377 | CODEqueryEtryPt_STD_CONF2_QUERIES 378 | ENDqueryEtryPt 379 | 380 | 381 | 382 | BEGINmodInit() 383 | CODESTARTmodInit 384 | *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ 385 | CODEmodInit_QueryRegCFSLineHdlr 386 | dbgprintf("mmdblookup: module compiled with rsyslog version %s.\n", VERSION); 387 | CHKiRet(objUse(errmsg, CORE_COMPONENT)); 388 | ENDmodInit 389 | 390 | -------------------------------------------------------------------------------- /util/rsyslog.spec: -------------------------------------------------------------------------------- 1 | %global _exec_prefix %{nil} 2 | %global _libdir %{_exec_prefix}/%{_lib} 3 | %define rsyslog_statedir %{_sharedstatedir}/rsyslog 4 | %define rsyslog_pkidir %{_sysconfdir}/pki/rsyslog 5 | 6 | # Set PIDFILE Variable! 7 | %if 0%{?rhel} >= 6 8 | %define Pidfile syslogd.pid 9 | %define rsysloginit rsyslog.init.epel6 10 | %define rsysloglog rsyslog.log.epel6 11 | %else 12 | %define Pidfile rsyslogd.pid 13 | %define rsysloginit rsyslog.init.epel5 14 | %define rsysloglog rsyslog.log.epel5 15 | %endif 16 | 17 | Summary: Enhanced system logging and kernel message trapping daemon 18 | Name: rsyslog 19 | Version: 8.12.0 20 | Release: 1%{?dist} 21 | License: (GPLv3+ and ASL 2.0) 22 | Group: System Environment/Daemons 23 | URL: http://www.rsyslog.com/ 24 | Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz 25 | Source1: %{rsysloginit} 26 | Source2: rsyslog_v7.conf 27 | Source3: rsyslog.sysconfig 28 | Source4: %{rsysloglog} 29 | Requires: libgt 30 | BuildRequires: libestr-devel 31 | BuildRequires: libee-devel 32 | BuildRequires: json-c-devel 33 | BuildRequires: curl-devel 34 | BuildRequires: libgt-devel 35 | BuildRequires: python-docutils 36 | BuildRequires: liblogging-devel 37 | %if 0%{?rhel} >= 6 38 | #Requires: libksi 39 | BuildRequires: libksi-devel 40 | %endif 41 | 42 | # json-c.i686 43 | # tweak the upstream service file to honour configuration from /etc/sysconfig/rsyslog 44 | # NOT NEEDED ANYMORE Patch0: Patch0: rsyslog-7.1.0-systemd.patch 45 | # already patched 46 | # Patch1: rsyslog-5.8.7-sysklogd-compat-1-template.patch 47 | # Patch2: rsyslog-5.8.7-sysklogd-compat-2-option.patch 48 | 49 | BuildRequires: zlib-devel 50 | Requires: logrotate >= 3.5.2 51 | Requires: bash >= 2.0 52 | Requires(post): /sbin/chkconfig coreutils 53 | Requires(preun): /sbin/chkconfig /sbin/service 54 | Requires(postun): /sbin/service 55 | Provides: syslog 56 | Obsoletes: sysklogd < 1.5-11 57 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 58 | 59 | # %package sysvinit 60 | # Summary: SysV init script for rsyslog 61 | # Group: System Environment/Daemons 62 | # Requires: %name = %version-%release 63 | # Requires(post): /sbin/chkconfig 64 | 65 | %package libdbi 66 | Summary: libdbi database support for rsyslog 67 | Group: System Environment/Daemons 68 | Requires: %name = %version-%release 69 | BuildRequires: libdbi-devel 70 | 71 | %package mysql 72 | Summary: MySQL support for rsyslog 73 | Group: System Environment/Daemons 74 | Requires: %name = %version-%release 75 | BuildRequires: mysql-devel >= 4.0 76 | 77 | %package pgsql 78 | Summary: PostgresSQL support for rsyslog 79 | Group: System Environment/Daemons 80 | Requires: %name = %version-%release 81 | BuildRequires: postgresql-devel 82 | 83 | # bugged 84 | #%package gssapi 85 | #Summary: GSSAPI authentication and encryption support for rsyslog 86 | #Group: System Environment/Daemons 87 | #Requires: %name = %version-%release 88 | #BuildRequires: krb5-devel 89 | 90 | %package relp 91 | Summary: RELP protocol support for rsyslog 92 | Group: System Environment/Daemons 93 | Requires: %name = %version-%release 94 | Requires: librelp >= 1.1.1 95 | BuildRequires: librelp-devel 96 | BuildRequires: libgcrypt-devel 97 | 98 | %package gnutls 99 | Summary: TLS protocol support for rsyslog 100 | Group: System Environment/Daemons 101 | Requires: %name = %version-%release 102 | BuildRequires: gnutls-devel 103 | BuildRequires: libgcrypt-devel 104 | 105 | %package snmp 106 | Summary: SNMP protocol support for rsyslog 107 | Group: System Environment/Daemons 108 | Requires: %name = %version-%release 109 | BuildRequires: net-snmp-devel 110 | 111 | %package udpspoof 112 | Summary: Provides the omudpspoof module 113 | Group: System Environment/Daemons 114 | Requires: %name = %version-%release 115 | BuildRequires: libnet-devel 116 | 117 | %package mmjsonparse 118 | Summary: mmjsonparse support 119 | Group: System Environment/Daemons 120 | Requires: %name = %version-%release 121 | BuildRequires: liblognorm1-devel 122 | 123 | %package mmdblookup 124 | Summary: mmdblookup support 125 | Group: System Environment/Daemons 126 | Requires: %name = %version-%release 127 | BuildRequires: libmaxminddb-devel 128 | 129 | %package mmnormalize 130 | Summary: mmnormalize support 131 | Group: System Environment/Daemons 132 | Requires: %name = %version-%release 133 | BuildRequires: liblognorm1-devel 134 | 135 | %package mmfields 136 | Summary: mmfields support 137 | Group: System Environment/Daemons 138 | Requires: %name = %version-%release 139 | BuildRequires: liblognorm1-devel 140 | 141 | %package pmaixforwardedfrom 142 | Summary: pmaixforwardedfrom support 143 | Group: System Environment/Daemons 144 | Requires: %name = %version-%release 145 | 146 | %package mmanon 147 | Summary: mmanon support 148 | Group: System Environment/Daemons 149 | Requires: %name = %version-%release 150 | 151 | %package mmutf8fix 152 | Summary: mmutf8fix support 153 | Group: System Environment/Daemons 154 | Requires: %name = %version-%release 155 | 156 | %package ommail 157 | Summary: Mail support 158 | Group: System Environment/Daemons 159 | Requires: %name = %version-%release 160 | 161 | %package pmciscoios 162 | Summary: pmciscoios support 163 | Group: System Environment/Daemons 164 | Requires: %name = %version-%release 165 | 166 | %if 0%{?rhel} >= 6 167 | %package elasticsearch 168 | Summary: Provides the omelasticsearch module 169 | Group: System Environment/Daemons 170 | Requires: %name = %version-%release 171 | BuildRequires: libuuid-devel 172 | BuildRequires: libcurl-devel 173 | 174 | # Package BUGGED! 175 | #%package zmq3 176 | #Summary: zmq3 support 177 | #Group: System Environment/Daemons 178 | #Requires: %name = %version-%release 179 | #BuildRequires: czmq-devel 180 | 181 | %package mongodb 182 | Summary: MongoDB output support 183 | Group: System Environment/Daemons 184 | Requires: %name = %version-%release 185 | BuildRequires: libmongo-client-devel 186 | 187 | %package kafka 188 | Summary: Kafka output support 189 | Group: System Environment/Daemons 190 | Requires: %name = %version-%release 191 | BuildRequires: adiscon-librdkafka-devel 192 | %endif 193 | 194 | %description 195 | Rsyslog is an enhanced, multi-threaded syslog daemon. It supports MySQL, 196 | syslog/TCP, RFC 3195, permitted sender lists, filtering on any message part, 197 | and fine grain output format control. It is compatible with stock sysklogd 198 | and can be used as a drop-in replacement. Rsyslog is simple to set up, with 199 | advanced features suitable for enterprise-class, encryption-protected syslog 200 | relay chains. 201 | 202 | #%description sysvinit 203 | #SysV style init script for rsyslog. It needs to be installed only if systemd 204 | #is not used as the system init process. 205 | 206 | %description libdbi 207 | This module supports a large number of database systems via 208 | libdbi. Libdbi abstracts the database layer and provides drivers for 209 | many systems. Drivers are available via the libdbi-drivers project. 210 | 211 | %description mysql 212 | The rsyslog-mysql package contains a dynamic shared object that will add 213 | MySQL database support to rsyslog. 214 | 215 | %description pgsql 216 | The rsyslog-pgsql package contains a dynamic shared object that will add 217 | PostgreSQL database support to rsyslog. 218 | 219 | # bugged 220 | #%description gssapi 221 | #The rsyslog-gssapi package contains the rsyslog plugins which support GSSAPI 222 | #authentication and secure connections. GSSAPI is commonly used for Kerberos 223 | #authentication. 224 | 225 | %description relp 226 | The rsyslog-relp package contains the rsyslog plugins that provide 227 | the ability to receive syslog messages via the reliable RELP 228 | protocol. 229 | 230 | %description gnutls 231 | The rsyslog-gnutls package contains the rsyslog plugins that provide the 232 | ability to receive syslog messages via upcoming syslog-transport-tls 233 | IETF standard protocol. 234 | 235 | %description snmp 236 | The rsyslog-snmp package contains the rsyslog plugin that provides the 237 | ability to send syslog messages as SNMPv1 and SNMPv2c traps. 238 | 239 | %description udpspoof 240 | This module is similar to the regular UDP forwarder, but permits to 241 | spoof the sender address. Also, it enables to circle through a number 242 | of source ports. 243 | 244 | %description mmjsonparse 245 | The rsyslog-mmjsonparse package provides mmjsonparse filter support. 246 | 247 | %description mmdblookup 248 | The rsyslog-mmdblookup package provides mmdblookup filter support. 249 | 250 | %description mmnormalize 251 | The rsyslog-mmnormalize package provides log normalization 252 | by using the liblognorm and it's Rulebase format. 253 | 254 | %description mmfields 255 | Parse all fields of the message into structured data inside the JSON tree. 256 | 257 | %description pmaixforwardedfrom 258 | This module cleans up messages forwarded from AIX. 259 | Instead of actually parsing the message, this modifies the message and then 260 | falls through to allow a later parser to handle the now modified message. 261 | 262 | %description mmanon 263 | IP Address Anonimization Module (mmanon). 264 | It is a message modification module that actually changes the IP address 265 | inside the message, so after calling mmanon, the original message can 266 | no longer be obtained. Note that anonymization will break digital 267 | signatures on the message, if they exist. 268 | 269 | %description mmutf8fix 270 | UTF-8 Fix support (mmutf8fix). 271 | The mmutf8fix module permits to fix invalid UTF-8 sequences. Most often, such invalid sequences result from syslog sources sending in non-UTF character sets, e.g. ISO 8859. As syslog does not have a way to convey the character set information, these sequences are not properly handled. 272 | 273 | %description pmciscoios 274 | Parser module which supports various Cisco IOS formats. 275 | 276 | %description ommail 277 | Mail Output Module. 278 | This module supports sending syslog messages via mail. Each syslog message 279 | is sent via its own mail. The ommail plugin is primarily meant for alerting users. 280 | As such, it is assume that mails will only be sent in an extremely 281 | limited number of cases. 282 | 283 | %if 0%{?rhel} >= 6 284 | %description elasticsearch 285 | The rsyslog-elasticsearch package provides omelasticsearch module support. 286 | 287 | #%description zmq3 288 | #zmq3 support for RSyslog. These plugins allows you to push data from 289 | #and into rsyslog from a zeromq socket. 290 | 291 | %description mongodb 292 | MongoDB output plugin for rsyslog. This plugin allows rsyslog to write 293 | the syslog messages to MongoDB, a scalable, high-performance, 294 | open source NoSQL database. 295 | 296 | %description kafka 297 | librdkafka is a C library implementation of the Apache Kafka protocol, 298 | containing both Producer and Consumer support. It was designed with message delivery 299 | reliability and high performance in mind, current figures exceed 800000 msgs/second 300 | for the producer and 3 million msgs/second for the consumer. 301 | %endif 302 | 303 | %prep 304 | %setup -q 305 | #%patch0 -p1 306 | #%patch1 -p1 307 | #%patch2 -p1 308 | 309 | %build 310 | %ifarch sparc64 311 | #sparc64 need big PIE 312 | export CFLAGS="$RPM_OPT_FLAGS -fPIE -DSYSLOGD_PIDNAME=\\\"%{Pidfile}\\\" -std=c99" 313 | export LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" 314 | %else 315 | export CFLAGS="$RPM_OPT_FLAGS -fpie -DSYSLOGD_PIDNAME=\\\"%{Pidfile}\\\" -std=c99" 316 | export LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" 317 | %endif 318 | # --enable-imzmq3 \ 319 | # --enable-omzmq3 \ 320 | # --enable-gssapi-krb5 \ # bugged 321 | %configure --disable-static \ 322 | --disable-testbench \ 323 | %if 0%{?rhel} >= 6 324 | --enable-uuid \ 325 | --enable-elasticsearch \ 326 | --enable-ommongodb \ 327 | --enable-omkafka \ 328 | --enable-usertools \ 329 | --enable-gt-ksi \ 330 | %else 331 | --disable-uuid \ 332 | --disable-generate-man-pages \ 333 | %endif 334 | --enable-gnutls \ 335 | --enable-imfile \ 336 | --enable-impstats \ 337 | --enable-imptcp \ 338 | --enable-libdbi \ 339 | --enable-mail \ 340 | --enable-mysql \ 341 | --enable-omprog \ 342 | --enable-omudpspoof \ 343 | --enable-omuxsock \ 344 | --enable-pgsql \ 345 | --enable-pmlastmsg \ 346 | --enable-relp \ 347 | --enable-snmp \ 348 | --enable-unlimited-select \ 349 | --enable-mmjsonparse \ 350 | --enable-mmdblookup \ 351 | --enable-mmnormalize \ 352 | --enable-mmanon \ 353 | --enable-mmutf8fix \ 354 | --enable-mail \ 355 | --enable-mmfields \ 356 | --enable-mmpstrucdata \ 357 | --enable-mmsequence \ 358 | --enable-pmaixforwardedfrom \ 359 | --enable-pmciscoios \ 360 | --enable-guardtime 361 | #--enable-jemalloc 362 | 363 | make 364 | 365 | %install 366 | rm -rf $RPM_BUILD_ROOT 367 | 368 | make install DESTDIR=$RPM_BUILD_ROOT 369 | 370 | install -d -m 755 $RPM_BUILD_ROOT%{_initrddir} 371 | install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig 372 | install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d 373 | install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/rsyslog.d 374 | install -d -m 700 $RPM_BUILD_ROOT%{rsyslog_statedir} 375 | install -d -m 700 $RPM_BUILD_ROOT%{rsyslog_pkidir} 376 | 377 | install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/rsyslog 378 | install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rsyslog 379 | install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/syslog 380 | install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rsyslog.conf 381 | 382 | #get rid of *.la 383 | rm $RPM_BUILD_ROOT/%{_libdir}/rsyslog/*.la 384 | 385 | %clean 386 | rm -rf $RPM_BUILD_ROOT 387 | 388 | %post 389 | /sbin/chkconfig --add rsyslog 390 | for n in /var/log/{messages,secure,maillog,spooler} 391 | do 392 | [ -f $n ] && continue 393 | umask 066 && touch $n 394 | done 395 | 396 | %preun 397 | if [ $1 = 0 ]; then 398 | service rsyslog stop >/dev/null 2>&1 ||: 399 | /sbin/chkconfig --del rsyslog 400 | fi 401 | 402 | %postun 403 | if [ "$1" -ge "1" ]; then 404 | service rsyslog condrestart > /dev/null 2>&1 ||: 405 | fi 406 | 407 | 408 | %triggerun -- rsyslog < 5.7.8-1 409 | ## Save the current service runlevel info 410 | ## User must manually run systemd-sysv-convert --apply rsyslog 411 | ## to migrate them to systemd targets 412 | #%{_bindir}/systemd-sysv-convert --save rsyslog >/dev/null 2>&1 || : 413 | #/bin/systemctl enable rsyslog.service >/dev/null 2>&1 || : 414 | #/sbin/chkconfig --del rsyslog >/dev/null 2>&1 || : 415 | #/bin/systemctl try-restart rsyslog.service >/dev/null 2>&1 || : 416 | # previous versions used a different lock file, which would break condrestart 417 | [ -f /var/lock/subsys/rsyslogd ] || exit 0 418 | mv /var/lock/subsys/rsyslogd /var/lock/subsys/rsyslog 419 | [ -f /var/run/rklogd.pid ] || exit 0 420 | /bin/kill `cat /var/run/rklogd.pid 2> /dev/null` > /dev/null 2>&1 ||: 421 | 422 | #%triggerpostun -n rsyslog-sysvinit -- rsyslog < 5.8.2-3 423 | #/sbin/chkconfig --add rsyslog >/dev/null 2>&1 || : 424 | 425 | %files 426 | %defattr(-,root,root,-) 427 | %doc AUTHORS COPYING* NEWS README ChangeLog 428 | # missing rsyslog-doc.tar.gz 429 | # old doc/*html 430 | %dir %{_libdir}/rsyslog 431 | %{_libdir}/rsyslog/imfile.so 432 | %{_libdir}/rsyslog/imklog.so 433 | %{_libdir}/rsyslog/immark.so 434 | %{_libdir}/rsyslog/impstats.so 435 | %{_libdir}/rsyslog/imptcp.so 436 | %{_libdir}/rsyslog/imtcp.so 437 | %{_libdir}/rsyslog/imudp.so 438 | %{_libdir}/rsyslog/imuxsock.so 439 | %{_libdir}/rsyslog/lmnet.so 440 | %{_libdir}/rsyslog/lmnetstrms.so 441 | %{_libdir}/rsyslog/lmnsd_ptcp.so 442 | %{_libdir}/rsyslog/lmregexp.so 443 | %{_libdir}/rsyslog/lmstrmsrv.so 444 | %{_libdir}/rsyslog/lmtcpclt.so 445 | %{_libdir}/rsyslog/lmtcpsrv.so 446 | %{_libdir}/rsyslog/lmzlibw.so 447 | %{_libdir}/rsyslog/omtesting.so 448 | %{_libdir}/rsyslog/ommail.so 449 | %{_libdir}/rsyslog/omprog.so 450 | # %{_libdir}/rsyslog/omruleset.so 451 | %{_libdir}/rsyslog/omuxsock.so 452 | %{_libdir}/rsyslog/pmlastmsg.so 453 | %{_libdir}/rsyslog/lmcry_gcry.so 454 | %{_libdir}/rsyslog/lmsig_gt.so 455 | %{_libdir}/rsyslog/mmpstrucdata.so 456 | %{_libdir}/rsyslog/mmsequence.so 457 | %{_libdir}/rsyslog/mmexternal.so 458 | %if 0%{?rhel} >= 6 459 | %{_libdir}/rsyslog/lmsig_ksi.so 460 | %{_bindir}/rscryutil 461 | %{_bindir}/rsgtutil 462 | %endif 463 | %config(noreplace) %{_sysconfdir}/rsyslog.conf 464 | %config(noreplace) %{_sysconfdir}/sysconfig/rsyslog 465 | %config(noreplace) %{_sysconfdir}/logrotate.d/syslog 466 | %dir %{_sysconfdir}/rsyslog.d 467 | %dir %{rsyslog_statedir} 468 | %dir %{rsyslog_pkidir} 469 | %{_initrddir}/rsyslog 470 | %{_sbindir}/rsyslogd 471 | %{_mandir}/*/* 472 | # removed since 7.3.9 473 | # %{_libdir}/rsyslog/compat.so 474 | %if 0%{?rhel} >= 7 475 | %{_unitdir}/rsyslog.service 476 | %endif 477 | 478 | #%files sysvinit 479 | #%attr(0755,root,root) %{_initrddir}/rsyslog 480 | 481 | %files libdbi 482 | %defattr(-,root,root) 483 | %{_libdir}/rsyslog/omlibdbi.so 484 | 485 | %files mysql 486 | %defattr(-,root,root) 487 | %doc plugins/ommysql/createDB.sql 488 | %{_libdir}/rsyslog/ommysql.so 489 | 490 | %files pgsql 491 | %defattr(-,root,root) 492 | %doc plugins/ompgsql/createDB.sql 493 | %{_libdir}/rsyslog/ompgsql.so 494 | 495 | # bugged 496 | #%files gssapi 497 | #%defattr(-,root,root) 498 | #%{_libdir}/rsyslog/lmgssutil.so 499 | #%{_libdir}/rsyslog/imgssapi.so 500 | #%{_libdir}/rsyslog/omgssapi.so 501 | 502 | %files relp 503 | %defattr(-,root,root) 504 | %{_libdir}/rsyslog/imrelp.so 505 | %{_libdir}/rsyslog/omrelp.so 506 | 507 | %files gnutls 508 | %defattr(-,root,root) 509 | %{_libdir}/rsyslog/lmnsd_gtls.so 510 | 511 | %files snmp 512 | %defattr(-,root,root) 513 | %{_libdir}/rsyslog/omsnmp.so 514 | 515 | %files udpspoof 516 | %defattr(-,root,root) 517 | %{_libdir}/rsyslog/omudpspoof.so 518 | 519 | %files mmjsonparse 520 | %defattr(-,root,root) 521 | %{_libdir}/rsyslog/mmjsonparse.so 522 | 523 | %files mmdblookup 524 | %defattr(-,root,root) 525 | %{_libdir}/rsyslog/mmdblookup.so 526 | 527 | %files mmnormalize 528 | %defattr(-,root,root) 529 | %{_libdir}/rsyslog/mmnormalize.so 530 | 531 | %files mmfields 532 | %defattr(-,root,root) 533 | %{_libdir}/rsyslog/mmfields.so 534 | 535 | %files pmaixforwardedfrom 536 | %defattr(-,root,root) 537 | %{_libdir}/rsyslog/pmaixforwardedfrom.so 538 | 539 | %files mmanon 540 | %defattr(-,root,root) 541 | %{_libdir}/rsyslog/mmanon.so 542 | 543 | %files pmciscoios 544 | %defattr(-,root,root) 545 | %{_libdir}/rsyslog/pmciscoios.so 546 | 547 | %files mmutf8fix 548 | %defattr(-,root,root) 549 | %{_libdir}/rsyslog/mmutf8fix.so 550 | 551 | %files ommail 552 | %defattr(-,root,root) 553 | %{_libdir}/rsyslog/ommail.so 554 | 555 | %if 0%{?rhel} >= 6 556 | %files elasticsearch 557 | %defattr(-,root,root) 558 | %{_libdir}/rsyslog/omelasticsearch.so 559 | 560 | #%files zmq3 561 | #%defattr(-,root,root) 562 | #%{_libdir}/rsyslog/imzmq3.so 563 | #%{_libdir}/rsyslog/omzmq3.so 564 | 565 | %files mongodb 566 | %defattr(-,root,root) 567 | %{_libdir}/rsyslog/ommongodb.so 568 | %if 0%{?rhel} >= 6 569 | %{_bindir}/logctl 570 | %endif 571 | 572 | %files kafka 573 | %defattr(-,root,root) 574 | %{_libdir}/rsyslog/omkafka.so 575 | %endif 576 | 577 | %changelog 578 | 579 | * Mon Aug 17 2015 Rao Chenlin 580 | - Updated RPM's for Rsyslog 8.12.0 to include mmdblookup 581 | 582 | * Tue Aug 11 2015 Florian Riedl 583 | - Updated RPM's for Rsyslog 8.12.0 584 | 585 | * Tue Jul 14 2015 Florian Riedl 586 | - Updated RPM's to use librdkafka 0.8.6 587 | 588 | * Tue Jun 30 2015 Florian Riedl 589 | - Updated RPM's for Rsyslog 8.11.0 590 | - Added GT KSI support 591 | 592 | * Tue Jun 09 2015 Florian Riedl 593 | - Updated RPM's for Rsyslog 8.10.0.ad1 594 | 595 | * Thu May 29 2015 Andre Lorbach 596 | - Created RPM's for Rsyslog 8.10.0.ad1 597 | 598 | * Tue May 19 2015 Florian Riedl 599 | - Created RPM's for Rsyslog 8.10.0 600 | 601 | * Thu Apr 23 2015 Florian Riedl 602 | - Created RPM's for Rsyslog 8.9.0.ad1 603 | 604 | * Thu Apr 09 2015 Florian Riedl 605 | - Created RPM's for Rsyslog 8.9.0 for RHEL5 606 | 607 | * Tue Apr 07 2015 Florian Riedl 608 | - Created RPM's for Rsyslog 8.9.0 609 | 610 | * Tue Mar 17 2015 Florian Riedl 611 | - Updated RPM's for Rsyslog 8.8.0.ad1 to include omkafka 612 | 613 | * Thu Mar 12 2015 Florian Riedl 614 | - Updated RPM's for Rsyslog 8.8.0.ad1 to support liblognorm 1.1.1 615 | 616 | * Thu Mar 05 2015 Florian Riedl 617 | - Created RPM's for Rsyslog 8.8.0.ad1 618 | 619 | * Wed Feb 25 2015 Andre Lorbach 620 | - Created RPM's for Rsyslog 8.8.0 621 | 622 | * Tue Jan 13 2015 Florian Riedl 623 | - Created RPM's for Rsyslog 8.7.0 624 | 625 | * Tue Dec 02 2014 Florian Riedl 626 | - re-release of 8.6.0 627 | 628 | * Mon Dec 01 2014 Florian Riedl 629 | - Created RPM's for RSyslog 8.6.0 630 | 631 | * Wed Nov 12 2014 Florian Riedl 632 | - Created RPM's for RSyslog 8.4.2.ad1 633 | 634 | * Tue Nov 04 2014 Andre Lorbach 635 | - Added pmaixforwardedfrom module 636 | 637 | * Thu Oct 02 2014 Andre Lorbach 638 | - Created RPM's for RSyslog 8.4.2 639 | 640 | * Wed Oct 01 2014 Florian Riedl 641 | - fixed GPG signing 642 | 643 | * Tue Sep 30 2014 Florian Riedl 644 | - Created RPM's for RSyslog 8.4.1 645 | 646 | * Mon Aug 18 2014 Andre Lorbach 647 | - Created RPM's for RSyslog 8.4.0 648 | 649 | * Thu Jun 26 2014 Andre Lorbach 650 | - Created RPM's for RSyslog 8.2.2 651 | 652 | * Tue Jun 14 2014 Mike Liebsch 653 | - Added mmutf8fix support 654 | - Updated to RSyslog 8.2.2 655 | 656 | * Wed Apr 22 2014 Andre Lorbach 657 | - Created RPM's for RSyslog 8.2.1 658 | 659 | * Wed Apr 02 2014 Andre Lorbach 660 | - Final Build for first V8-Stable release 661 | 662 | * Tue Apr 01 2014 Andre Lorbach 663 | - First Testbuild for RSyslog V8-Stable 664 | 665 | * Thu Mar 11 2014 Andre Lorbach 666 | - New build for librelp 667 | 668 | * Fri Mar 07 2014 Andre Lorbach 669 | - new build for CentOS 6 670 | 671 | * Thu Feb 20 2014 Andre Lorbach 672 | - Created RPM's for RSyslog 8.1.6 673 | 674 | * Fri Jan 24 2014 Andre Lorbach 675 | - Created RPM's for RSyslog 8.1.5 676 | 677 | * Fri Jan 10 2014 Andre Lorbach 678 | - Created RPM's for RSyslog 8.1.4 679 | 680 | * Fri Dec 06 2013 Andre Lorbach 681 | - Created RPM's for RSyslog 8.1.3 682 | 683 | * Thu Nov 28 2013 Andre Lorbach 684 | - Created RPM's for RSyslog 8.1.2 685 | Added jemalloc support 686 | 687 | * Tue Nov 19 2013 Andre Lorbach 688 | - Created RPM's for RSyslog 8.1.1 689 | 690 | * Fri Nov 15 2013 Andre Lorbach 691 | - Created RPM's for RSyslog 8.1.0 692 | 693 | * Thu Nov 07 2013 Andre Lorbach 694 | - Removed unused reload option 695 | from INIT script. 696 | 697 | * Wed Oct 30 2013 Andre Lorbach 698 | - Added mmsequence modul into base package 699 | 700 | * Tue Oct 29 2013 Andre Lorbach 701 | - Created RPM's for RSyslog 7.5.6 702 | 703 | * Wed Oct 15 2013 Andre Lorbach 704 | - Created RPM's for RSyslog 7.5.5 705 | 706 | * Mon Oct 07 2013 Andre Lorbach 707 | - Created RPM's for RSyslog 7.5.4 708 | 709 | * Wed Sep 11 2013 Andre Lorbach 710 | - Added RPM Package for mmfields 711 | - Created RPM's for RSyslog 7.5.3 712 | 713 | * Thu Jul 04 2013 Andre Lorbach 714 | - Created RPM's for RSyslog 7.5.2 715 | 716 | * Tue Jun 26 2013 Andre Lorbach 717 | - Created new RPMs for v7-devel 7.5.1 718 | 719 | * Tue Jun 11 2013 Andre Lorbach 720 | - Created new RPMs for v7-devel 7.5.0 721 | 722 | * Tue May 21 2013 Andre Lorbach 723 | - Added new module ommail 724 | 725 | * Wed May 15 2013 Andre Lorbach 726 | - Created new RPMs for v7-devel 7.3.15 727 | 728 | * Wed May 08 2013 Andre Lorbach 729 | - Created new RPMs for v7-devel 7.3.14 730 | 731 | * Thu Apr 25 2013 Andre Lorbach 732 | - Created new RPMs for v7-devel 7.3.12 733 | 734 | * Wed Apr 13 2013 Andre Lorbach 735 | - Created new RPMs for v7-devel 7.3.10 736 | 737 | * Thu Mar 28 2013 Andre Lorbach 738 | - Created new RPMs for v7-devel 7.3.9 739 | 740 | * Fri Mar 22 2013 Andre Lorbach 741 | - Testing RPMs for v7-devel 7.3.9 742 | 743 | * Mon Mar 18 2013 Andre Lorbach 744 | - Created new RPMs for v7-devel 7.3.8 745 | 746 | * Thu Mar 14 2013 Andre Lorbach 747 | - Added RPM Package for mmanon 748 | 749 | * Wed Mar 13 2013 Andre Lorbach 750 | - Created new RPMs for v7-devel 7.3.7 751 | 752 | * Tue Mar 12 2013 Andre Lorbach 753 | - Added RPM Package for mmnormalize 754 | 755 | * Fri Mar 08 2013 Andre Lorbach 756 | - Added RPM Package for MongoDB 757 | 758 | * Fri Feb 22 2013 Andre Lorbach 759 | - removed -c option from sysconfig file 760 | 761 | * Tue Jan 29 2013 Andre Lorbach 762 | - Added new default configuration which is only 763 | V7 compatible. 764 | - Created new RPMs for v7-devel 7.3.6 765 | 766 | * Tue Jan 17 2013 Andre Lorbach 767 | - Added Module for omelasticsearch , 768 | thanks to Radu Gheorghe. Support is only available on 769 | EHEL 6 and higher! 770 | - Added Module for mmjsonparse. 771 | 772 | * Wed Dec 19 2012 Andre Lorbach 773 | - Created new RPMs for v7-devel 7.3.5 774 | 775 | * Wed Nov 21 2012 Andre Lorbach 776 | - Changed PIDFile back to rsyslog.pid for EPEL5 dist 777 | - removed depencies for libuuid-devel package 778 | 779 | * Fri Nov 07 2012 Andre Lorbach 780 | - Created RPMs for v7-devel: 7.3.3 781 | 782 | * Fri Oct 19 2012 Andre Lorbach 783 | - Created Specfile and RPMs for v7-devel: 7.3.1 784 | 785 | * Wed Oct 17 2012 Andre Lorbach 786 | - created RPMs for RSyslog 7.1.11 787 | 788 | * Mon Oct 15 2012 Andre Lorbach 789 | - removed systemd-units dependency 790 | 791 | * Fri Sep 06 2012 Andre Lorbach 792 | - created RPMs for RSyslog 7.1.0 793 | 794 | * Fri Aug 24 2012 Andre Lorbach 795 | - Adapted RPM Specfile for RSyslog 6 and 7 796 | 797 | * Thu Aug 23 2012 Andre Lorbach 798 | - created RPMs for 5.8.13, no changes needed 799 | 800 | -------------------------------------------------------------------------------- /src/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | if ENABLE_TESTBENCH 2 | # TODO: reenable TESTRUNS = rt_init rscript 3 | check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq msleep randomgen diagtalker uxsockrcvr syslog_caller inputfilegen minitcpsrv 4 | TESTS = $(TESTRUNS) 5 | #TESTS = $(TESTRUNS) cfg.sh 6 | 7 | TESTS += \ 8 | stop-localvar.sh \ 9 | stop-msgvar.sh \ 10 | fac_authpriv.sh \ 11 | fac_local0.sh \ 12 | fac_local7.sh \ 13 | fac_mail.sh \ 14 | fac_news.sh \ 15 | fac_ftp.sh \ 16 | fac_ntp.sh \ 17 | fac_uucp.sh \ 18 | fac_invld1.sh \ 19 | fac_invld2.sh \ 20 | fac_invld3.sh \ 21 | fac_invld4_rfc5424.sh \ 22 | rfc5424parser.sh \ 23 | arrayqueue.sh \ 24 | global_vars.sh \ 25 | da-mainmsg-q.sh \ 26 | validation-run.sh \ 27 | empty-ruleset.sh \ 28 | imtcp-multiport.sh \ 29 | daqueue-persist.sh \ 30 | diskqueue.sh \ 31 | diskqueue-fsync.sh \ 32 | rulesetmultiqueue.sh \ 33 | rulesetmultiqueue-v6.sh \ 34 | manytcp.sh \ 35 | rsf_getenv.sh \ 36 | imtcp_conndrop_tls.sh \ 37 | imtcp_conndrop.sh \ 38 | imtcp_addtlframedelim.sh \ 39 | imtcp_no_octet_counted.sh \ 40 | imtcp_spframingfix.sh \ 41 | imptcp_spframingfix.sh \ 42 | sndrcv.sh \ 43 | sndrcv_failover.sh \ 44 | sndrcv_gzip.sh \ 45 | sndrcv_udp.sh \ 46 | sndrcv_udp_nonstdpt.sh \ 47 | sndrcv_udp_nonstdpt_v6.sh \ 48 | imudp_thread_hang.sh \ 49 | sndrcv_udp_nonstdpt_v6.sh \ 50 | asynwr_simple.sh \ 51 | asynwr_simple_2.sh \ 52 | asynwr_timeout.sh \ 53 | asynwr_timeout_2.sh \ 54 | asynwr_small.sh \ 55 | asynwr_tinybuf.sh \ 56 | wr_large_async.sh \ 57 | wr_large_sync.sh \ 58 | asynwr_deadlock.sh \ 59 | asynwr_deadlock_2.sh \ 60 | asynwr_deadlock2.sh \ 61 | asynwr_deadlock4.sh \ 62 | abort-uncleancfg-goodcfg.sh \ 63 | abort-uncleancfg-goodcfg-check.sh \ 64 | abort-uncleancfg-badcfg-check.sh \ 65 | abort-uncleancfg-badcfg-check_1.sh \ 66 | gzipwr_large.sh \ 67 | gzipwr_large_dynfile.sh \ 68 | dynfile_invld_async.sh \ 69 | dynfile_invld_sync.sh \ 70 | dynfile_invalid2.sh \ 71 | complex1.sh \ 72 | queue-persist.sh \ 73 | pipeaction.sh \ 74 | execonlyonce.sh \ 75 | execonlywhenprevsuspended.sh \ 76 | execonlywhenprevsuspended2.sh \ 77 | execonlywhenprevsuspended3.sh \ 78 | execonlywhenprevsuspended4.sh \ 79 | execonlywhenprevsuspended_multiwrkr.sh \ 80 | pipe_noreader.sh \ 81 | dircreate_dflt.sh \ 82 | dircreate_off.sh \ 83 | imuxsock_logger.sh \ 84 | imuxsock_logger_err.sh \ 85 | imuxsock_logger_parserchain.sh \ 86 | imuxsock_traillf.sh \ 87 | imuxsock_ccmiddle.sh \ 88 | imuxsock_logger_root.sh \ 89 | imuxsock_traillf_root.sh \ 90 | imuxsock_ccmiddle_root.sh \ 91 | discard-rptdmsg.sh \ 92 | discard-allmark.sh \ 93 | discard.sh \ 94 | stop.sh \ 95 | failover-async.sh \ 96 | failover-double.sh \ 97 | failover-basic.sh \ 98 | failover-rptd.sh \ 99 | failover-no-rptd.sh \ 100 | failover-no-basic.sh \ 101 | rcvr_fail_restore.sh \ 102 | rscript_contains.sh \ 103 | rscript_field.sh \ 104 | rscript_stop.sh \ 105 | rscript_stop2.sh \ 106 | rscript_prifilt.sh \ 107 | rscript_optimizer1.sh \ 108 | rscript_ruleset_call.sh \ 109 | rscript_set_modify.sh \ 110 | rscript_unaffected_reset.sh \ 111 | rs_optimizer_pri.sh \ 112 | cee_simple.sh \ 113 | cee_diskqueue.sh \ 114 | incltest.sh \ 115 | incltest_dir.sh \ 116 | incltest_dir_wildcard.sh \ 117 | incltest_dir_empty_wildcard.sh \ 118 | linkedlistqueue.sh 119 | 120 | if HAVE_VALGRIND 121 | TESTS += \ 122 | discard-rptdmsg-vg.sh \ 123 | discard-allmark-vg.sh \ 124 | failover-basic-vg.sh \ 125 | failover-rptd-vg.sh \ 126 | failover-no-basic-vg.sh \ 127 | failover-no-rptd-vg.sh \ 128 | udp-msgreduc-vg.sh \ 129 | udp-msgreduc-orgmsg-vg.sh \ 130 | tcp-msgreduc-vg.sh 131 | endif # HAVE_VALGRIND 132 | 133 | 134 | if ENABLE_MYSQL_TESTS 135 | TESTS += \ 136 | mysql-basic.sh \ 137 | mysql-basic-cnf6.sh \ 138 | mysql-asyn.sh \ 139 | mysql-actq-mt.sh \ 140 | mysql-actq-mt-withpause.sh 141 | if HAVE_VALGRIND 142 | TESTS += \ 143 | mysql-basic-vg.sh \ 144 | mysql-asyn-vg.sh \ 145 | mysql-actq-mt-withpause-vg.sh 146 | endif 147 | if ENABLE_OMLIBDBI 148 | TESTS += \ 149 | libdbi-basic.sh \ 150 | libdbi-asyn.sh 151 | if HAVE_VALGRIND 152 | TESTS += \ 153 | libdbi-basic-vg.sh 154 | endif 155 | endif 156 | endif 157 | 158 | if ENABLE_IMPTCP 159 | # note that some tests simply USE imptcp, but they also 160 | # need to be disabled if we do not have this module 161 | TESTS += \ 162 | manyptcp.sh \ 163 | imptcp_large.sh \ 164 | imptcp_addtlframedelim.sh \ 165 | imptcp_conndrop.sh \ 166 | imptcp_no_octet_counted.sh \ 167 | rscript_replace.sh \ 168 | rscript_replace_complex.sh \ 169 | rscript_wrap2.sh \ 170 | rscript_wrap3.sh 171 | if HAVE_VALGRIND 172 | TESTS += \ 173 | imptcp_conndrop-vg.sh 174 | endif 175 | endif 176 | 177 | if ENABLE_ELASTICSEARCH_TESTS 178 | TESTS += \ 179 | elasticsearch-basic.sh \ 180 | elasticsearch-basic-bulk.sh \ 181 | elasticsearch-basic-errorfile-empty.sh \ 182 | elasticsearch-basic-errorfile-populated.sh \ 183 | elasticsearch-bulk-errorfile-empty.sh \ 184 | elasticsearch-bulk-errorfile-populated.sh \ 185 | elasticsearch-bulk-errorfile-populated-default-format.sh \ 186 | elasticsearch-bulk-errorfile-populated-erroronly.sh \ 187 | elasticsearch-bulk-errorfile-populated-erroronly-interleaved.sh \ 188 | elasticsearch-bulk-errorfile-populated-default-interleaved.sh 189 | endif 190 | 191 | if ENABLE_MMPSTRUCDATA 192 | TESTS += \ 193 | mmpstrucdata.sh 194 | if HAVE_VALGRIND 195 | TESTS += \ 196 | mmpstrucdata-vg.sh \ 197 | mmpstrucdata-invalid-vg.sh 198 | endif 199 | endif 200 | 201 | if ENABLE_MMNORMALIZE 202 | TESTS += \ 203 | mmnormalize_variable.sh \ 204 | mmnormalize_tokenized.sh \ 205 | mmnormalize_regex_defaulted.sh \ 206 | mmnormalize_regex_disabled.sh 207 | 208 | if LOGNORM_REGEX_SUPPORTED 209 | TESTS += \ 210 | mmnormalize_regex.sh 211 | endif 212 | endif 213 | 214 | if ENABLE_MMJSONPARSE 215 | TESTS += \ 216 | mmjsonparse_simple.sh \ 217 | mmjsonparse_cim.sh \ 218 | json_array_subscripting.sh \ 219 | json_array_looping.sh \ 220 | json_nonarray_looping.sh 221 | endif 222 | 223 | if ENABLE_MMDBLOOKUP 224 | TESTS += \ 225 | mmdb.sh 226 | endif 227 | 228 | if ENABLE_GNUTLS 229 | # TODO: re-enable in newer version 230 | #TESTS += \ 231 | #sndrcv_tls_anon.sh \ 232 | #sndrcv_tls_anon_rebind.sh \ 233 | imtcp-tls-basic.sh 234 | if HAVE_VALGRIND 235 | TESTS += imtcp-tls-basic-vg.sh \ 236 | imtcp_conndrop_tls-vg.sh \ 237 | manytcp-too-few-tls-vg.sh 238 | endif 239 | endif 240 | 241 | if ENABLE_OMUXSOCK 242 | TESTS += uxsock_simple.sh 243 | endif 244 | 245 | if ENABLE_RELP 246 | TESTS += sndrcv_relp.sh 247 | endif 248 | 249 | if ENABLE_OMUDPSPOOF 250 | TESTS += sndrcv_omudpspoof.sh \ 251 | sndrcv_omudpspoof_nonstdpt.sh 252 | endif 253 | 254 | if ENABLE_OMSTDOUT 255 | TESTS += omod-if-array.sh \ 256 | threadingmq.sh \ 257 | threadingmqaq.sh \ 258 | badqi.sh 259 | if ENABLE_IMPTCP 260 | TESTS += \ 261 | tabescape_dflt.sh \ 262 | tabescape_off.sh \ 263 | timestamp.sh \ 264 | inputname.sh \ 265 | proprepltest.sh \ 266 | parsertest.sh \ 267 | fieldtest.sh 268 | endif 269 | endif 270 | 271 | if ENABLE_OMRULESET 272 | TESTS += omruleset.sh \ 273 | omruleset-queue.sh 274 | endif 275 | 276 | if ENABLE_EXTENDED_TESTS 277 | # random.sh is temporarily disabled as it needs some work 278 | # to rsyslog core to complete in reasonable time 279 | #TESTS += random.sh 280 | endif 281 | 282 | if ENABLE_IMFILE 283 | TESTS += imfile-basic.sh \ 284 | imfile-readmode2.sh \ 285 | imfile-readmode2-with-persists-data-during-stop.sh \ 286 | imfile-readmode2-with-persists.sh 287 | if HAVE_VALGRIND 288 | TESTS += imfile-basic-vg.sh 289 | endif 290 | endif 291 | 292 | endif # if ENABLE_TESTBENCH 293 | 294 | TESTS_ENVIRONMENT = RSYSLOG_MODDIR='$(abs_top_builddir)'/runtime/.libs/ 295 | DISTCLEANFILES=rsyslog.pid 296 | test_files = testbench.h runtime-dummy.c 297 | 298 | EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ 299 | validation-run.sh \ 300 | tls-certs/ca-key.pem \ 301 | tls-certs/ca.pem \ 302 | tls-certs/cert.pem \ 303 | tls-certs/key.pem \ 304 | testsuites/x.509/ca.pem \ 305 | testsuites/x.509/ca-key.pem \ 306 | testsuites/x.509/client-cert.pem \ 307 | testsuites/x.509/client-key.pem \ 308 | testsuites/x.509/machine-cert.pem \ 309 | testsuites/x.509/machine-key.pem \ 310 | testsuites/invalid.conf \ 311 | testsuites/valid.conf \ 312 | cfg.sh \ 313 | cfg1.cfgtest \ 314 | cfg1.testin \ 315 | cfg2.cfgtest \ 316 | cfg2.testin \ 317 | cfg3.cfgtest \ 318 | cfg3.testin \ 319 | cfg4.cfgtest \ 320 | cfg4.testin \ 321 | DevNull.cfgtest \ 322 | err1.rstest \ 323 | NoExistFile.cfgtest \ 324 | timestamp.sh \ 325 | testsuites/ts3164.conf \ 326 | testsuites/mon1digit.ts3164 \ 327 | testsuites/mon2digit.ts3164 \ 328 | testsuites/Jan.ts3164 \ 329 | testsuites/Feb.ts3164 \ 330 | testsuites/Mar.ts3164 \ 331 | testsuites/Apr.ts3164 \ 332 | testsuites/May.ts3164 \ 333 | testsuites/Jun.ts3164 \ 334 | testsuites/Jul.ts3164 \ 335 | testsuites/Aug.ts3164 \ 336 | testsuites/Sep.ts3164 \ 337 | testsuites/Oct.ts3164 \ 338 | testsuites/Nov.ts3164 \ 339 | testsuites/Dec.ts3164 \ 340 | testsuites/ts3339.conf \ 341 | testsuites/master.ts3339 \ 342 | testsuites/tsmysql.conf \ 343 | testsuites/master.tsmysql \ 344 | testsuites/tspgsql.conf \ 345 | testsuites/master.tspgsql \ 346 | testsuites/subsecond.conf \ 347 | testsuites/master.subsecond \ 348 | testsuites/parse_8bit_escape.conf \ 349 | testsuites/8bit.parse_8bit_escape \ 350 | testsuites/parse1.conf \ 351 | testsuites/field1.conf \ 352 | testsuites/1.parse1 \ 353 | testsuites/2.parse1 \ 354 | testsuites/3.parse1 \ 355 | testsuites/4.parse1 \ 356 | testsuites/mark.parse1 \ 357 | testsuites/8bit.parse1 \ 358 | testsuites/empty.parse1 \ 359 | testsuites/snare.parse1 \ 360 | testsuites/oversizeTag-1.parse1 \ 361 | testsuites/weird.parse1 \ 362 | testsuites/date1.parse1 \ 363 | testsuites/date2.parse1 \ 364 | testsuites/date3.parse1 \ 365 | testsuites/date4.parse1 \ 366 | testsuites/date5.parse1 \ 367 | testsuites/rfc3164.parse1 \ 368 | testsuites/rfc5424-1.parse1 \ 369 | testsuites/rfc5424-2.parse1 \ 370 | testsuites/rfc5424-3.parse1 \ 371 | testsuites/rfc5424-4.parse1 \ 372 | testsuites/malformed1.parse1 \ 373 | testsuites/reallife.parse1 \ 374 | testsuites/parse2.conf \ 375 | testsuites/reallife.parse2 \ 376 | testsuites/parse3.conf \ 377 | testsuites/reallife.parse3 \ 378 | testsuites/parse-nodate.conf \ 379 | testsuites/samples.parse-nodate \ 380 | testsuites/parse_invld_regex.conf \ 381 | testsuites/samples.parse_invld_regex \ 382 | testsuites/parse-3164-buggyday.conf \ 383 | testsuites/samples.parse-3164-buggyday \ 384 | testsuites/snare_ccoff_udp.conf \ 385 | testsuites/samples.snare_ccoff_udp \ 386 | testsuites/snare_ccoff_udp2.conf \ 387 | testsuites/samples.snare_ccoff_udp2 \ 388 | testsuites/omod-if-array.conf \ 389 | testsuites/1.omod-if-array \ 390 | testsuites/1.field1 \ 391 | killrsyslog.sh \ 392 | parsertest.sh \ 393 | fieldtest.sh \ 394 | rsf_getenv.sh \ 395 | testsuites/rsf_getenv.conf \ 396 | diskqueue.sh \ 397 | testsuites/diskqueue.conf \ 398 | arrayqueue.sh \ 399 | testsuites/arrayqueue.conf \ 400 | rscript_contains.sh \ 401 | testsuites/rscript_contains.conf \ 402 | rscript_field.sh \ 403 | testsuites/rscript_field.conf \ 404 | rscript_stop.sh \ 405 | testsuites/rscript_stop.conf \ 406 | rscript_stop2.sh \ 407 | testsuites/rscript_stop2.conf \ 408 | stop.sh \ 409 | testsuites/stop.conf \ 410 | rscript_le.sh \ 411 | testsuites/rscript_le.conf \ 412 | rscript_ge.sh \ 413 | testsuites/rscript_ge.conf \ 414 | rscript_lt.sh \ 415 | testsuites/rscript_lt.conf \ 416 | rscript_gt.sh \ 417 | testsuites/rscript_gt.conf \ 418 | rscript_ne.sh \ 419 | testsuites/rscript_ne.conf \ 420 | rscript_eq.sh \ 421 | testsuites/rscript_eq.conf \ 422 | rscript_set_modify.sh \ 423 | testsuites/rscript_set_modify.conf \ 424 | testsuites/rscript_unaffected_reset.conf \ 425 | stop-localvar.sh \ 426 | testsuites/stop-localvar.conf \ 427 | stop-msgvar.sh \ 428 | testsuites/stop-msgvar.conf \ 429 | global_vars.sh \ 430 | testsuites/global_vars.conf \ 431 | rfc5424parser.sh \ 432 | testsuites/rfc5424parser.conf \ 433 | fac_authpriv.sh \ 434 | testsuites/fac_authpriv.conf \ 435 | fac_local0.sh \ 436 | testsuites/fac_local0.conf \ 437 | fac_local7.sh \ 438 | testsuites/fac_local7.conf \ 439 | fac_mail.sh \ 440 | testsuites/fac_mail.conf \ 441 | fac_news.sh \ 442 | testsuites/fac_news.conf \ 443 | fac_ftp.sh \ 444 | testsuites/fac_ftp.conf \ 445 | fac_ntp.sh \ 446 | testsuites/fac_ntp.conf \ 447 | fac_uucp.sh \ 448 | testsuites/fac_uucp.conf \ 449 | fac_invld1.sh \ 450 | testsuites/fac_invld1.conf \ 451 | fac_invld2.sh \ 452 | testsuites/fac_invld2.conf \ 453 | fac_invld3.sh \ 454 | testsuites/fac_invld3.conf \ 455 | fac_invld4_rfc5424.sh \ 456 | testsuites/fac_invld4_rfc5424.conf \ 457 | rs_optimizer_pri.sh \ 458 | testsuites/rs_optimizer_pri.conf \ 459 | rscript_prifilt.sh \ 460 | testsuites/rscript_prifilt.conf \ 461 | rscript_optimizer1.sh \ 462 | testsuites/rscript_optimizer1.conf \ 463 | rscript_ruleset_call.sh \ 464 | testsuites/rscript_ruleset_call.conf \ 465 | cee_simple.sh \ 466 | testsuites/cee_simple.conf \ 467 | cee_diskqueue.sh \ 468 | testsuites/cee_diskqueue.conf \ 469 | mmjsonparse_simple.sh \ 470 | testsuites/mmjsonparse_simple.conf \ 471 | mmjsonparse_cim.sh \ 472 | testsuites/mmjsonparse_cim.conf \ 473 | mmdb.sh \ 474 | test.mmdb \ 475 | testsuites/mmdb.conf \ 476 | incltest.sh \ 477 | testsuites/incltest.conf \ 478 | incltest_dir.sh \ 479 | testsuites/incltest_dir.conf \ 480 | incltest_dir_empty_wildcard.sh \ 481 | testsuites/incltest_dir_empty_wildcard.conf \ 482 | incltest_dir_wildcard.sh \ 483 | testsuites/incltest_dir_wildcard.conf \ 484 | testsuites/incltest.d/include.conf \ 485 | elasticsearch-basic.sh \ 486 | testsuites/elasticsearch-basic.conf \ 487 | elasticsearch-basic-bulk.sh \ 488 | testsuites/elasticsearch-basic-bulk.conf \ 489 | elasticsearch-basic-errorfile-empty.sh \ 490 | testsuites/elasticsearch-basic-errorfile-empty.conf \ 491 | elasticsearch-basic-errorfile-populated.sh \ 492 | testsuites/elasticsearch-basic-errorfile-populated.conf \ 493 | elasticsearch-bulk-errorfile-empty.sh \ 494 | testsuites/elasticsearch-bulk-errorfile-empty.conf \ 495 | elasticsearch-bulk-errorfile-populated.sh \ 496 | testsuites/elasticsearch-bulk-errorfile-populated.conf \ 497 | elasticsearch-bulk-errorfile-populated-default-format.sh \ 498 | testsuites/elasticsearch-bulk-errorfile-populated-erroronly.conf \ 499 | elasticsearch-bulk-errorfile-populated-erroronly.sh \ 500 | testsuites/elasticsearch-bulk-errorfile-populated-default-format.conf \ 501 | elasticsearch-bulk-errorfile-populated-erroronly-interleaved.sh \ 502 | testsuites/elasticsearch-bulk-errorfile-populated-erroronly-interleaved.conf \ 503 | elasticsearch-bulk-errorfile-populated-default-interleaved.sh \ 504 | testsuites/elasticsearch-bulk-errorfile-populated-default-interleaved.conf \ 505 | linkedlistqueue.sh \ 506 | testsuites/linkedlistqueue.conf \ 507 | da-mainmsg-q.sh \ 508 | testsuites/da-mainmsg-q.conf \ 509 | diskqueue-fsync.sh \ 510 | testsuites/diskqueue-fsync.conf \ 511 | empty-ruleset.sh \ 512 | testsuites/empty-ruleset.conf \ 513 | imtcp-tls-basic.sh \ 514 | imtcp-tls-basic-vg.sh \ 515 | testsuites/imtcp-tls-basic.conf \ 516 | imtcp-multiport.sh \ 517 | testsuites/imtcp-multiport.conf \ 518 | udp-msgreduc-orgmsg-vg.sh \ 519 | testsuites/udp-msgreduc-orgmsg-vg.conf \ 520 | udp-msgreduc-vg.sh \ 521 | testsuites/udp-msgreduc-vg.conf \ 522 | manytcp-too-few-tls-vg.sh \ 523 | testsuites/manytcp-too-few-tls.conf \ 524 | manytcp.sh \ 525 | testsuites/manytcp.conf \ 526 | manyptcp.sh \ 527 | testsuites/manyptcp.conf \ 528 | imptcp_large.sh \ 529 | testsuites/imptcp_large.conf \ 530 | imptcp_addtlframedelim.sh \ 531 | testsuites/imptcp_addtlframedelim.conf \ 532 | imptcp_conndrop-vg.sh \ 533 | imptcp_conndrop.sh \ 534 | testsuites/imptcp_conndrop.conf \ 535 | imptcp_no_octet_counted.sh \ 536 | testsuites/imptcp_no_octet_counted.conf \ 537 | testsuites/no_octet_counted.testdata \ 538 | imtcp_no_octet_counted.sh \ 539 | testsuites/imtcp_no_octet_counted.conf \ 540 | testsuites/spframingfix.testdata \ 541 | imtcp_spframingfix.sh \ 542 | testsuites/imtcp_spframingfix.conf \ 543 | imptcp_spframingfix.sh \ 544 | testsuites/imptcp_spframingfix.conf \ 545 | imtcp_conndrop.sh \ 546 | testsuites/imtcp_conndrop.conf \ 547 | imtcp_conndrop_tls.sh \ 548 | imtcp_conndrop_tls-vg.sh \ 549 | testsuites/imtcp_conndrop.conf \ 550 | imtcp_addtlframedelim.sh \ 551 | testsuites/imtcp_addtlframedelim.conf \ 552 | tcp-msgreduc-vg.sh \ 553 | testsuites/./tcp-msgreduc-vg.conf \ 554 | inputname.sh \ 555 | testsuites/inputname_imtcp.conf \ 556 | testsuites/1.inputname_imtcp_12514 \ 557 | testsuites/1.inputname_imtcp_12515 \ 558 | testsuites/1.inputname_imtcp_12516 \ 559 | omod-if-array.sh \ 560 | discard.sh \ 561 | testsuites/discard.conf \ 562 | failover-no-rptd.sh \ 563 | failover-no-rptd-vg.sh \ 564 | testsuites/failover-no-rptd.conf \ 565 | failover-no-basic.sh \ 566 | failover-no-basic-vg.sh \ 567 | testsuites/failover-no-basic.conf \ 568 | failover-rptd.sh \ 569 | failover-rptd-vg.sh \ 570 | testsuites/failover-rptd.conf \ 571 | failover-basic.sh \ 572 | failover-basic-vg.sh \ 573 | testsuites/failover-basic.conf \ 574 | failover-async.sh \ 575 | testsuites/failover-async.conf \ 576 | failover-double.sh \ 577 | testsuites/failover-double.conf \ 578 | discard-rptdmsg.sh \ 579 | discard-rptdmsg-vg.sh \ 580 | testsuites/discard-rptdmsg.conf \ 581 | discard-allmark.sh \ 582 | discard-allmark-vg.sh \ 583 | testsuites/discard-allmark.conf \ 584 | diag.sh \ 585 | testsuites/diag-common.conf \ 586 | testsuites/diag-common2.conf \ 587 | rcvr_fail_restore.sh \ 588 | testsuites/rcvr_fail_restore_rcvr.conf \ 589 | testsuites/rcvr_fail_restore_sender.conf \ 590 | daqueue-persist.sh \ 591 | daqueue-persist-drvr.sh \ 592 | queue-persist.sh \ 593 | queue-persist-drvr.sh \ 594 | testsuites/queue-persist.conf \ 595 | threadingmq.sh \ 596 | testsuites/threadingmq.conf \ 597 | threadingmqaq.sh \ 598 | testsuites/threadingmqaq.conf \ 599 | sndrcv_drvr.sh \ 600 | sndrcv_drvr_noexit.sh \ 601 | sndrcv_failover.sh \ 602 | testsuites/sndrcv_failover_sender.conf \ 603 | testsuites/sndrcv_failover_rcvr.conf \ 604 | sndrcv.sh \ 605 | testsuites/sndrcv_sender.conf \ 606 | testsuites/sndrcv_rcvr.conf \ 607 | sndrcv_relp.sh \ 608 | testsuites/sndrcv_relp_sender.conf \ 609 | testsuites/sndrcv_relp_rcvr.conf \ 610 | sndrcv_udp.sh \ 611 | testsuites/sndrcv_udp_sender.conf \ 612 | testsuites/sndrcv_udp_rcvr.conf \ 613 | imudp_thread_hang.sh \ 614 | testsuites/imudp_thread_hang.conf \ 615 | sndrcv_udp_nonstdpt.sh \ 616 | testsuites/sndrcv_udp_nonstdpt_sender.conf \ 617 | testsuites/sndrcv_udp_nonstdpt_rcvr.conf \ 618 | sndrcv_udp_nonstdpt_v6.sh \ 619 | testsuites/sndrcv_udp_nonstdpt_v6_sender.conf \ 620 | testsuites/sndrcv_udp_nonstdpt_v6_rcvr.conf \ 621 | sndrcv_omudpspoof.sh \ 622 | testsuites/sndrcv_omudpspoof_sender.conf \ 623 | testsuites/sndrcv_omudpspoof_rcvr.conf \ 624 | sndrcv_omudpspoof_nonstdpt.sh \ 625 | testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf \ 626 | testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf \ 627 | sndrcv_gzip.sh \ 628 | testsuites/sndrcv_gzip_sender.conf \ 629 | testsuites/sndrcv_gzip_rcvr.conf \ 630 | pipeaction.sh \ 631 | testsuites/pipeaction.conf \ 632 | pipe_noreader.sh \ 633 | testsuites/pipe_noreader.conf \ 634 | uxsock_simple.sh \ 635 | testsuites/uxsock_simple.conf \ 636 | asynwr_simple.sh \ 637 | testsuites/asynwr_simple.conf \ 638 | asynwr_simple_2.sh \ 639 | testsuites/asynwr_simple_2.conf \ 640 | asynwr_timeout.sh \ 641 | testsuites/asynwr_timeout.conf \ 642 | asynwr_timeout_2.sh \ 643 | testsuites/asynwr_timeout_2.conf \ 644 | asynwr_small.sh \ 645 | testsuites/asynwr_small.conf \ 646 | asynwr_tinybuf.sh \ 647 | testsuites/asynwr_tinybuf.conf \ 648 | wr_large_async.sh \ 649 | wr_large_sync.sh \ 650 | wr_large.sh \ 651 | testsuites/wr_large.conf \ 652 | asynwr_deadlock.sh \ 653 | testsuites/asynwr_deadlock.conf \ 654 | asynwr_deadlock_2.sh \ 655 | testsuites/asynwr_deadlock_2.conf \ 656 | asynwr_deadlock2.sh \ 657 | testsuites/asynwr_deadlock2.conf \ 658 | asynwr_deadlock4.sh \ 659 | testsuites/asynwr_deadlock4.conf \ 660 | abort-uncleancfg-goodcfg.sh \ 661 | testsuites/abort-uncleancfg-goodcfg.conf \ 662 | abort-uncleancfg-goodcfg-check.sh \ 663 | testsuites/abort-uncleancfg-goodcfg.conf \ 664 | abort-uncleancfg-badcfg-check.sh \ 665 | testsuites/abort-uncleancfg-badcfg.conf 666 | abort-uncleancfg-badcfg-check_1.sh \ 667 | testsuites/abort-uncleancfg-badcfg_1.conf \ 668 | gzipwr_large.sh \ 669 | testsuites/gzipwr_large.conf \ 670 | gzipwr_large_dynfile.sh \ 671 | testsuites/gzipwr_large_dynfile.conf \ 672 | complex1.sh \ 673 | testsuites/complex1.conf \ 674 | random.sh \ 675 | testsuites/random.conf \ 676 | imfile-readmode2.sh \ 677 | imfile-readmode2-with-persists-data-during-stop.sh \ 678 | imfile-readmode2-with-persists.sh \ 679 | testsuites/imfile-readmode2.conf \ 680 | testsuites/imfile-readmode2-with-persists.conf \ 681 | testsuites/imfile-readmode2-with-persists-data-during-stop.conf \ 682 | imfile-basic.sh \ 683 | imfile-basic-vg.sh \ 684 | testsuites/imfile-basic.conf \ 685 | dynfile_invld_async.sh \ 686 | dynfile_invld_sync.sh \ 687 | dynfile_cachemiss.sh \ 688 | testsuites/dynfile_cachemiss.conf \ 689 | dynfile_invalid2.sh \ 690 | testsuites/dynfile_invalid2.conf \ 691 | proprepltest.sh \ 692 | testsuites/rfctag.conf \ 693 | testsuites/master.rfctag \ 694 | testsuites/nolimittag.conf \ 695 | testsuites/master.nolimittag \ 696 | rulesetmultiqueue.sh \ 697 | testsuites/rulesetmultiqueue.conf \ 698 | rulesetmultiqueue-v6.sh \ 699 | testsuites/rulesetmultiqueue-v6.conf \ 700 | omruleset.sh \ 701 | testsuites/omruleset.conf \ 702 | omruleset-queue.sh \ 703 | testsuites/omruleset-queue.conf \ 704 | badqi.sh \ 705 | testsuites/badqi.conf \ 706 | bad_qi/dbq.qi \ 707 | execonlyonce.sh \ 708 | testsuites/execonlyonce.conf \ 709 | testsuites/execonlyonce.data \ 710 | execonlywhenprevsuspended.sh \ 711 | testsuites/execonlywhenprevsuspended.conf \ 712 | execonlywhenprevsuspended2.sh \ 713 | testsuites/execonlywhenprevsuspended2.conf \ 714 | execonlywhenprevsuspended3.sh \ 715 | testsuites/execonlywhenprevsuspended3.conf \ 716 | execonlywhenprevsuspended4.sh \ 717 | testsuites/execonlywhenprevsuspended4.conf \ 718 | execonlywhenprevsuspended_multiwrkr.sh \ 719 | testsuites/execonlywhenprevsuspended_multiwrkr.conf \ 720 | tabescape_dflt.sh \ 721 | testsuites/tabescape_dflt.conf \ 722 | testsuites/1.tabescape_dflt \ 723 | tabescape_off.sh \ 724 | testsuites/tabescape_off.conf \ 725 | testsuites/1.tabescape_off \ 726 | dircreate_dflt.sh \ 727 | testsuites/dircreate_dflt.conf \ 728 | dircreate_off.sh \ 729 | testsuites/dircreate_off.conf \ 730 | imuxsock_logger_parserchain.sh \ 731 | testsuites/imuxsock_logger_parserchain.conf \ 732 | imuxsock_logger.sh \ 733 | testsuites/imuxsock_logger.conf \ 734 | imuxsock_logger_err.sh \ 735 | imuxsock_logger_root.sh \ 736 | testsuites/imuxsock_logger_root.conf \ 737 | resultdata/imuxsock_logger.log \ 738 | imuxsock_traillf.sh \ 739 | testsuites/imuxsock_traillf.conf \ 740 | imuxsock_traillf_root.sh \ 741 | testsuites/imuxsock_traillf_root.conf \ 742 | resultdata/imuxsock_traillf.log \ 743 | imuxsock_ccmiddle.sh \ 744 | testsuites/imuxsock_ccmiddle.conf \ 745 | imuxsock_ccmiddle_root.sh \ 746 | testsuites/imuxsock_ccmiddle_root.conf \ 747 | resultdata/imuxsock_ccmiddle.log \ 748 | imuxsock_hostname.sh \ 749 | testsuites/imuxsock_hostname.conf \ 750 | resultdata/imuxsock_hostname.log \ 751 | testsuites/mysql-truncate.sql \ 752 | testsuites/mysql-select-msg.sql \ 753 | libdbi-basic.sh \ 754 | testsuites/libdbi-basic.conf \ 755 | libdbi-asyn.sh \ 756 | testsuites/libdbi-asyn.conf \ 757 | mysql-basic.sh \ 758 | mysql-basic-cnf6.sh \ 759 | mysql-basic-vg.sh \ 760 | testsuites/mysql-basic.conf \ 761 | testsuites/mysql-basic-cnf6.conf \ 762 | mysql-asyn.sh \ 763 | mysql-asyn-vg.sh \ 764 | testsuites/mysql-asyn.conf \ 765 | mysql-actq-mt.sh \ 766 | mysql-actq-mt-withpause.sh \ 767 | mysql-actq-mt-withpause-vg.sh \ 768 | testsuites/mysql-actq-mt.conf \ 769 | mmpstrucdata.sh \ 770 | testsuites/mmpstrucdata.conf \ 771 | libdbi-basic-vg.sh \ 772 | mmnormalize_variable.sh \ 773 | mmnormalize_tokenized.sh \ 774 | testsuites/mmnormalize_variable.conf \ 775 | testsuites/mmnormalize_variable.rulebase \ 776 | testsuites/date_time_msg \ 777 | testsuites/mmnormalize_tokenized.conf \ 778 | testsuites/mmnormalize_tokenized.rulebase \ 779 | testsuites/tokenized_input \ 780 | rscript_replace.sh \ 781 | testsuites/rscript_replace.conf \ 782 | rscript_replace_complex.sh \ 783 | testsuites/rscript_replace_complex.conf \ 784 | testsuites/complex_replace_input \ 785 | rscript_unaffected_reset.sh \ 786 | rscript_wrap2.sh \ 787 | testsuites/rscript_wrap2.conf \ 788 | rscript_wrap3.sh \ 789 | testsuites/rscript_wrap3.conf \ 790 | testsuites/wrap3_input\ 791 | testsuites/gethostname.conf \ 792 | json_array_subscripting.sh \ 793 | testsuites/json_array_subscripting.conf \ 794 | testsuites/json_array_input \ 795 | testsuites/json_nonarray_input \ 796 | json_array_looping.sh \ 797 | json_nonarray_looping.sh \ 798 | testsuites/json_array_looping.conf \ 799 | mmnormalize_regex.sh \ 800 | testsuites/mmnormalize_regex.conf \ 801 | testsuites/mmnormalize_regex.rulebase \ 802 | testsuites/regex_input \ 803 | mmnormalize_regex_disabled.sh \ 804 | testsuites/mmnormalize_regex_disabled.conf \ 805 | mmnormalize_regex_defaulted.sh \ 806 | testsuites/mmnormalize_regex_defaulted.conf \ 807 | cfg.sh 808 | 809 | # TODO: re-enable 810 | #sndrcv_tls_anon_rebind.sh \ 811 | #testsuites/sndrcv_tls_anon_rebind_sender.conf \ 812 | #testsuites/sndrcv_tls_anon_rebind_rcvr.conf \ 813 | #sndrcv_tls_anon.sh \ 814 | #testsuites/sndrcv_tls_anon_sender.conf \ 815 | #testsuites/sndrcv_tls_anon_rcvr.conf \ 816 | # 817 | 818 | ourtail_SOURCES = ourtail.c 819 | msleep_SOURCES = msleep.c 820 | chkseq_SOURCES = chkseq.c 821 | 822 | uxsockrcvr_SOURCES = uxsockrcvr.c 823 | uxsockrcvr_LDADD = $(SOL_LIBS) 824 | 825 | tcpflood_SOURCES = tcpflood.c 826 | tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) $(GNUTLS_CFLAGS) 827 | tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) $(GNUTLS_LIBS) 828 | if ENABLE_GNUTLS 829 | tcpflood_LDADD += -lgcrypt 830 | endif 831 | 832 | minitcpsrv_SOURCES = minitcpsrvr.c 833 | minitcpsrv_LDADD = $(SOL_LIBS) 834 | 835 | syslog_caller_SOURCES = syslog_caller.c 836 | syslog_caller_CPPFLAGS = $(LIBLOGGING_STDLOG_CFLAGS) 837 | syslog_caller_LDADD = $(SOL_LIBS) $(LIBLOGGING_STDLOG_LIBS) 838 | 839 | diagtalker_SOURCES = diagtalker.c 840 | diagtalker_LDADD = $(SOL_LIBS) 841 | 842 | randomgen_SOURCES = randomgen.c 843 | randomgen_LDADD = $(SOL_LIBS) 844 | 845 | inputfilegen_SOURCES = inputfilegen.c 846 | inputfilegen_LDADD = $(SOL_LIBS) 847 | 848 | nettester_SOURCES = nettester.c getline.c 849 | nettester_LDADD = $(SOL_LIBS) 850 | 851 | # rtinit tests disabled for the moment - also questionable if they 852 | # really provide value (after all, everything fails if rtinit fails...) 853 | #rt_init_SOURCES = rt-init.c $(test_files) 854 | #rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) 855 | #rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) 856 | #rt_init_LDFLAGS = -export-dynamic 857 | 858 | # same for basic rscript tests 859 | #rscript_SOURCES = rscript.c getline.c $(test_files) 860 | #rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) 861 | #rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) 862 | #rscript_LDFLAGS = -export-dynamic 863 | -------------------------------------------------------------------------------- /src/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ(2.61) 5 | AC_INIT([rsyslog],[8.21.0.master],[rsyslog@lists.adiscon.com]) 6 | AM_INIT_AUTOMAKE([subdir-objects]) 7 | 8 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 9 | 10 | AC_CONFIG_SRCDIR([ChangeLog]) 11 | AC_CONFIG_MACRO_DIR([m4]) 12 | AC_CONFIG_HEADERS([config.h]) 13 | 14 | AC_USE_SYSTEM_EXTENSIONS 15 | 16 | # Checks for programs. 17 | AC_PROG_LEX 18 | AC_PROG_YACC 19 | AC_PROG_CC 20 | AC_PROG_CC_C99 21 | AC_DISABLE_STATIC 22 | AC_PROG_LIBTOOL 23 | AC_CANONICAL_HOST 24 | 25 | AX_COMPILER_FLAGS 26 | 27 | PKG_PROG_PKG_CONFIG 28 | 29 | # modules we require 30 | PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9) 31 | PKG_CHECK_MODULES([JSON_C], [libfastjson],,) 32 | 33 | AC_DEFINE_UNQUOTED([PLATFORM_ID], ["${host}"], [platform id for display purposes]) 34 | # we don't mind if we don't have the lsb_release utility. But if we have, it's 35 | # nice to have the extra information. 36 | AC_DEFINE_UNQUOTED([PLATFORM_ID_LSB], ["`lsb_release -d`"], [platform id for display purposes]) 37 | 38 | case "${host}" in 39 | *-*-linux*) 40 | AC_DEFINE([OS_LINUX], [1], [Indicator for a Linux OS]) 41 | os_type="linux" 42 | ;; 43 | *-*-*darwin*|*-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) 44 | AC_DEFINE([OS_BSD], [1], [Indicator for a BSD OS]) 45 | os_type="bsd" 46 | ;; 47 | *-*-kfreebsd*) 48 | # kernel is FreeBSD, but userspace is glibc - i.e. like linux 49 | # do not DEFINE OS_BSD 50 | os_type="bsd" 51 | ;; 52 | *-*-solaris*) 53 | os_type="solaris" 54 | AC_DEFINE([OS_SOLARIS], [1], [Indicator for a Solaris OS]) 55 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Use POSIX pthread semantics]) 56 | AC_DEFINE([_XOPEN_SOURCE], [600], [Use X/Open CAE Specification]) 57 | SOL_LIBS="-lsocket -lnsl" 58 | # Solaris libuuid does not ship with a pkgconfig file so override the appropriate 59 | # variables (but only if they have not been set by the user). 60 | LIBUUID_CFLAGS=${LIBUUID_CFLAGS:= } 61 | LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid} 62 | AC_SUBST(SOL_LIBS) 63 | ;; 64 | esac 65 | 66 | AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable]) 67 | 68 | # Checks for libraries. 69 | save_LIBS=$LIBS 70 | LIBS= 71 | AC_SEARCH_LIBS(clock_gettime, rt) 72 | RT_LIBS=$LIBS 73 | AC_SEARCH_LIBS(mq_getattr, rt) 74 | RT_LIBS="$RT_LIBS $LIBS" 75 | LIBS= 76 | AC_SEARCH_LIBS(dlopen, dl) 77 | DL_LIBS=$LIBS 78 | LIBS=$save_LIBS 79 | 80 | AC_SUBST(RT_LIBS) 81 | AC_SUBST(DL_LIBS) 82 | 83 | # Checks for header files. 84 | AC_HEADER_RESOLV 85 | AC_HEADER_STDC 86 | AC_HEADER_SYS_WAIT 87 | AC_CHECK_HEADERS([arpa/inet.h libgen.h malloc.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h sys/inotify.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h]) 88 | 89 | # Checks for typedefs, structures, and compiler characteristics. 90 | AC_C_CONST 91 | AC_C_INLINE 92 | AC_TYPE_OFF_T 93 | AC_TYPE_PID_T 94 | AC_TYPE_SIZE_T 95 | AC_TYPE_SSIZE_T 96 | AC_TYPE_MODE_T 97 | AC_TYPE_UID_T 98 | AC_TYPE_UINT8_T 99 | AC_HEADER_TIME 100 | AC_STRUCT_TM 101 | AC_C_VOLATILE 102 | 103 | sa_includes="\ 104 | $ac_includes_default 105 | #if HAVE_SYS_SOCKET_H 106 | # include 107 | #endif 108 | " 109 | AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[$sa_includes]) 110 | 111 | # Checks for library functions. 112 | AC_FUNC_CHOWN 113 | AC_FUNC_FORK 114 | AC_PROG_GCC_TRADITIONAL 115 | AC_FUNC_SELECT_ARGTYPES 116 | AC_TYPE_SIGNAL 117 | AC_FUNC_STAT 118 | AC_FUNC_STRERROR_R 119 | AC_FUNC_VPRINTF 120 | AC_CHECK_FUNCS([flock inotify_init recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64]) 121 | AC_CHECK_TYPES([off64_t]) 122 | 123 | # getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10) 124 | AC_SEARCH_LIBS([getifaddrs], [socket], [AC_DEFINE(HAVE_GETIFADDRS, [1], [set define])]) 125 | 126 | # the check below is probably ugly. If someone knows how to do it in a better way, please 127 | # let me know! -- rgerhards, 2010-10-06 128 | AC_CHECK_DECL([SCM_CREDENTIALS], [AC_DEFINE(HAVE_SCM_CREDENTIALS, [1], [set define])], [], [#include 129 | #include ]) 130 | AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [set define])], [], [#include 131 | #include ]) 132 | AC_CHECK_DECL([SYS_gettid], [AC_DEFINE(HAVE_SYS_gettid, [1], [set define])], [], [#include ]) 133 | AC_CHECK_MEMBER([struct sysinfo.uptime], [AC_DEFINE(HAVE_SYSINFO_UPTIME, [1], [set define])], [], [#include ]) 134 | AC_CHECK_DECL([GLOB_NOMAGIC], [AC_DEFINE(HAVE_GLOB_NOMAGIC, [1], [set define])], [], [#include ]) 135 | 136 | # Check for MAXHOSTNAMELEN 137 | AC_MSG_CHECKING(for MAXHOSTNAMELEN) 138 | AC_TRY_COMPILE([ 139 | #include 140 | #include 141 | ], [ 142 | return MAXHOSTNAMELEN; 143 | ] 144 | , 145 | AC_MSG_RESULT(yes) 146 | , 147 | # note: we use 1024 here, which should be far more than needed by any system. If that's too low, we simply 148 | # life with the need to change it. Most of the code doesn't need it anyways, but there are a few places 149 | # where it actually is needed and it makes no sense to change them. 150 | AC_DEFINE(MAXHOSTNAMELEN, 1024, [Define with a value if your does not define MAXHOSTNAMELEN]) 151 | AC_MSG_RESULT(no; defined as 64) 152 | ) 153 | 154 | # Check for __builtin_expect() 155 | AC_MSG_CHECKING([for __builtin_expect()]) 156 | AC_LINK_IFELSE([AC_LANG_PROGRAM(, return __builtin_expect(main != 0, 1))], 157 | [AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, 158 | Define to 1 if compiler supports __builtin_expect) 159 | AC_MSG_RESULT([yes])], 160 | [AC_MSG_RESULT([no])]) 161 | 162 | # check for availability of atomic operations 163 | RS_ATOMIC_OPERATIONS 164 | RS_ATOMIC_OPERATIONS_64BIT 165 | 166 | # fall back to POSIX sems for atomic operations (cpu expensive) 167 | AC_CHECK_HEADERS([semaphore.h sys/syscall.h]) 168 | 169 | 170 | # Additional module directories 171 | AC_ARG_WITH(moddirs, 172 | [AS_HELP_STRING([--with-moddirs=DIRS],[Additional module search paths appended to @<:@$libdir/rsyslog@:>@])], 173 | [_save_IFS=$IFS ; IFS=$PATH_SEPARATOR ; moddirs="" 174 | for w in ${with_moddirs} ; 175 | do 176 | case $w in 177 | "") continue ;; */) ;; *) w="${w}/" ;; 178 | esac 179 | for m in ${moddirs} ; 180 | do 181 | test "x$w" = "x${libdir}/${PACKAGE}/" || \ 182 | test "x$w" = "x$m" || test "x$w" = "x/" && \ 183 | continue 2 184 | done 185 | case $moddirs in 186 | "") moddirs="$w" ;; *) moddirs="${moddirs}:${w}" ;; 187 | esac 188 | done ; IFS=$_save_IFS],[moddirs=""] 189 | ) 190 | AM_CONDITIONAL(WITH_MODDIRS, test x$moddirs != x) 191 | AC_SUBST(moddirs) 192 | 193 | 194 | # Large file support 195 | # http://www.gnu.org/software/autoconf/manual/html_node/System-Services.html#index-AC_005fSYS_005fLARGEFILE-1028 196 | AC_SYS_LARGEFILE 197 | case "${enable_largefile}" in 198 | no) ;; 199 | *) enable_largefile="yes" ;; 200 | esac 201 | 202 | # Regular expressions 203 | AC_ARG_ENABLE(regexp, 204 | [AS_HELP_STRING([--enable-regexp],[Enable regular expressions support @<:@default=yes@:>@])], 205 | [case "${enableval}" in 206 | yes) enable_regexp="yes" ;; 207 | no) enable_regexp="no" ;; 208 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-regexp) ;; 209 | esac], 210 | [enable_regexp=yes] 211 | ) 212 | AM_CONDITIONAL(ENABLE_REGEXP, test x$enable_regexp = xyes) 213 | if test "$enable_regexp" = "yes"; then 214 | AC_DEFINE(FEATURE_REGEXP, 1, [Regular expressions support enabled.]) 215 | fi 216 | 217 | 218 | # zlib support 219 | PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no]) 220 | AS_IF([test "x$found_zlib" = "xno"], [ 221 | AC_SEARCH_LIBS([inflate], [z], [AC_CHECK_HEADER([zlib.h], [found_zlib=yes])]) 222 | if test "x$found_zlib" = "xno" ; then 223 | AC_MSG_ERROR([zlib library and headers not found]) 224 | fi 225 | ZLIB_LIBS="-lz" 226 | AC_SUBST(ZLIB_LIBS) 227 | ]) 228 | 229 | 230 | #gssapi 231 | AC_ARG_ENABLE(gssapi_krb5, 232 | [AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])], 233 | [case "${enableval}" in 234 | yes) enable_gssapi_krb5="yes" ;; 235 | no) enable_gssapi_krb5="no" ;; 236 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-gssapi-krb5) ;; 237 | esac], 238 | [enable_gssapi_krb5=no] 239 | ) 240 | 241 | case "${os_type}" in 242 | solaris) GSSLIB=gss ;; 243 | *) GSSLIB=gssapi_krb5 ;; 244 | esac 245 | 246 | if test $enable_gssapi_krb5 = yes; then 247 | AC_CHECK_LIB($GSSLIB, gss_acquire_cred, [ 248 | AC_CHECK_HEADER(gssapi/gssapi.h, [ 249 | AC_DEFINE(USE_GSSAPI,, 250 | Define if you want to use GSSAPI) 251 | GSS_LIBS="-l$GSSLIB" 252 | AC_SUBST(GSS_LIBS) 253 | ]) 254 | ]) 255 | fi 256 | AM_CONDITIONAL(ENABLE_GSSAPI, test x$enable_gssapi_krb5 = xyes) 257 | 258 | 259 | # multithreading via pthreads 260 | AC_CHECK_HEADERS( 261 | [pthread.h], 262 | [ 263 | AC_CHECK_LIB( 264 | [pthread], 265 | [pthread_create], 266 | [ 267 | AC_DEFINE([USE_PTHREADS], [1], [Multithreading support enabled.]) 268 | PTHREADS_LIBS="-lpthread" 269 | case "${os_type}" in 270 | solaris) PTHREADS_CFLAGS="-pthreads" ;; 271 | *) PTHREADS_CFLAGS="-pthread" ;; 272 | esac 273 | AC_SUBST(PTHREADS_LIBS) 274 | AC_SUBST(PTHREADS_CFLAGS) 275 | ], 276 | [AC_MSG_FAILURE([pthread is missing])], 277 | [-lpthread] 278 | ) 279 | ], 280 | [AC_MSG_FAILURE([pthread is missing])] 281 | ) 282 | 283 | AC_CHECK_LIB( 284 | [pthread], 285 | [pthread_rwlockattr_setkind_np], 286 | [AC_DEFINE( 287 | [HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP], 288 | [1], 289 | [Set-kind available for rwlock attr.])]) 290 | 291 | AC_CHECK_LIB( 292 | [pthread], 293 | [pthread_setname_np], 294 | [AC_DEFINE( 295 | [HAVE_PTHREAD_SETNAME_NP], 296 | [1], 297 | [Can set thread-name.])]) 298 | 299 | AC_CHECK_FUNCS( 300 | [pthread_setschedparam], 301 | [ 302 | rsyslog_have_pthread_setschedparam=yes 303 | ], 304 | [ 305 | rsyslog_have_pthread_setschedparam=no 306 | ] 307 | ) 308 | AC_CHECK_HEADERS( 309 | [sched.h], 310 | [ 311 | rsyslog_have_sched_h=yes 312 | ], 313 | [ 314 | rsyslog_have_sched_h=no 315 | ] 316 | ) 317 | if test "$rsyslog_have_pthread_setschedparam" = "yes" -a "$rsyslog_have_sched_h" = "yes"; then 318 | save_LIBS=$LIBS 319 | LIBS= 320 | AC_SEARCH_LIBS(sched_get_priority_max, rt) 321 | if test "x$ac_cv_search" != "xno"; then 322 | AC_CHECK_FUNCS(sched_get_priority_max) 323 | fi 324 | IMUDP_LIBS=$LIBS 325 | AC_SUBST(IMUDP_LIBS) 326 | LIBS=$save_LIBS 327 | fi 328 | 329 | 330 | # klog 331 | AC_ARG_ENABLE(klog, 332 | [AS_HELP_STRING([--enable-klog],[Integrated klog functionality @<:@default=yes@:>@])], 333 | [case "${enableval}" in 334 | yes) enable_klog="yes" ;; 335 | no) enable_klog="no" ;; 336 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-klog) ;; 337 | esac], 338 | [enable_klog="yes"] 339 | ) 340 | AM_CONDITIONAL(ENABLE_IMKLOG, test x$enable_klog = xyes) 341 | AM_CONDITIONAL(ENABLE_IMKLOG_BSD, test x$os_type = xbsd) 342 | AM_CONDITIONAL(ENABLE_IMKLOG_LINUX, test x$os_type = xlinux) 343 | AM_CONDITIONAL(ENABLE_IMKLOG_SOLARIS, test x$os_type = xsolaris) 344 | 345 | # kmsg 346 | AC_ARG_ENABLE(kmsg, 347 | [AS_HELP_STRING([--enable-kmsg],[Kmsg structured kernel logs functionality @<:@default=no@:>@])], 348 | [case "${enableval}" in 349 | yes) enable_kmsg="yes" ;; 350 | no) enable_kmsg="no" ;; 351 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-kmsg) ;; 352 | esac], 353 | [enable_kmsg="no"] 354 | ) 355 | AM_CONDITIONAL(ENABLE_IMKMSG, test x$enable_kmsg = xyes) 356 | 357 | # imjournal 358 | AC_ARG_ENABLE(imjournal, 359 | [AS_HELP_STRING([--enable-imjournal],[Systemd journal message import @<:@default=no@:>@])], 360 | [case "${enableval}" in 361 | yes) enable_imjournal="yes" ;; 362 | no) enable_imjournal="no" ;; 363 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imjournal) ;; 364 | esac], 365 | [enable_imjournal="no"] 366 | ) 367 | if test "x$enable_imjournal" = "xyes"; then 368 | PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd >= 209] ,, [ 369 | PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197]) 370 | ]) 371 | fi 372 | AM_CONDITIONAL(ENABLE_IMJOURNAL, test x$enable_imjournal = xyes) 373 | 374 | # inet 375 | AC_ARG_ENABLE(inet, 376 | [AS_HELP_STRING([--enable-inet],[Enable networking support @<:@default=yes@:>@])], 377 | [case "${enableval}" in 378 | yes) enable_inet="yes" ;; 379 | no) enable_inet="no" ;; 380 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-inet) ;; 381 | esac], 382 | [enable_inet="yes"] 383 | ) 384 | AM_CONDITIONAL(ENABLE_INET, test x$enable_inet = xyes) 385 | if test "$enable_inet" = "yes"; then 386 | AC_DEFINE(SYSLOG_INET, 1, [network support is integrated.]) 387 | fi 388 | 389 | # jemalloc 390 | AC_ARG_ENABLE(jemalloc, 391 | [AS_HELP_STRING([--enable-jemalloc],[Enable jemalloc support @<:@default=no@:>@])], 392 | [case "${enableval}" in 393 | yes) enable_jemalloc="yes" ;; 394 | no) enable_jemalloc="no" ;; 395 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-jemalloc) ;; 396 | esac], 397 | [enable_jemalloc="no"] 398 | ) 399 | AM_CONDITIONAL(ENABLE_JEMALLOC, test x$enable_jemalloc = xyes) 400 | if test "$enable_jemalloc" = "yes"; then 401 | AC_CHECK_LIB( 402 | [jemalloc], 403 | [malloc_stats_print], 404 | [RT_LIBS="$RT_LIBS -ljemalloc" 405 | AC_DEFINE(HAVE_JEMALLOC, 1, [jemalloc support is integrated.]) 406 | ], 407 | [AC_MSG_FAILURE([jemalloc library is missing])], 408 | [] 409 | ) 410 | fi 411 | 412 | 413 | # support for unlimited select() syscall 414 | AC_ARG_ENABLE(unlimited_select, 415 | [AS_HELP_STRING([--enable-unlimited-select],[Enable unlimited select() syscall @<:@default=no@:>@])], 416 | [case "${enableval}" in 417 | yes) enable_unlimited_select="yes" ;; 418 | no) enable_unlimited_select="no" ;; 419 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-unlimited-select) ;; 420 | esac], 421 | [enable_unlimited_select="no"] 422 | ) 423 | if test "$enable_unlimited_select" = "yes"; then 424 | AC_DEFINE(USE_UNLIMITED_SELECT, 1, [If defined, the select() syscall won't be limited to a particular number of file descriptors.]) 425 | fi 426 | 427 | 428 | # support for systemd unit files 429 | AC_ARG_WITH([systemdsystemunitdir], 430 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), 431 | [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) 432 | if test "x$with_systemdsystemunitdir" != xno; then 433 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) 434 | fi 435 | AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) 436 | 437 | 438 | # debug 439 | AC_ARG_ENABLE(debug, 440 | [AS_HELP_STRING([--enable-debug],[Enable debug mode @<:@default=no@:>@])], 441 | [case "${enableval}" in 442 | yes) enable_debug="yes" ;; 443 | no) enable_debug="no" ;; 444 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; 445 | esac], 446 | [enable_debug="no"] 447 | ) 448 | if test "$enable_debug" = "yes"; then 449 | AC_DEFINE(DEBUG, 1, [Defined if debug mode is enabled (its easier to check).]) 450 | fi 451 | if test "$enable_debug" = "no"; then 452 | AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.]) 453 | fi 454 | 455 | 456 | # debug-symbols 457 | AC_ARG_ENABLE(debug_symbols, 458 | [AS_HELP_STRING([--disable-debug-symbols],[Disable debugging symbols @<:@default=no@:>@])], 459 | [case "${enableval}" in 460 | yes) enable_debug_symbols="yes" ;; 461 | no) enable_debug_symbols="no" ;; 462 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-debug-symbols) ;; 463 | esac], 464 | [enable_debug_symbols="yes"] 465 | ) 466 | 467 | 468 | # runtime instrumentation 469 | AC_ARG_ENABLE(rtinst, 470 | [AS_HELP_STRING([--enable-rtinst],[Enable runtime instrumentation mode @<:@default=no@:>@])], 471 | [case "${enableval}" in 472 | yes) enable_rtinst="yes" ;; 473 | no) enable_rtinst="no" ;; 474 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rtinst) ;; 475 | esac], 476 | [enable_rtinst="no"] 477 | ) 478 | if test "$enable_rtinst" = "yes"; then 479 | AC_DEFINE(RTINST, 1, [Defined if runtime instrumentation mode is enabled.]) 480 | fi 481 | 482 | 483 | # total debugless: highest performance, but no way at all to enable debug 484 | # logging 485 | AC_ARG_ENABLE(debugless, 486 | [AS_HELP_STRING([--enable-debugless],[Enable runtime instrumentation mode @<:@default=no@:>@])], 487 | [case "${enableval}" in 488 | yes) enable_debugless="yes" ;; 489 | no) enable_debugless="no" ;; 490 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debugless) ;; 491 | esac], 492 | [enable_debugless="no"] 493 | ) 494 | if test "$enable_debugless" = "yes"; then 495 | AC_DEFINE(DEBUGLESS, 1, [Defined if debugless mode is enabled.]) 496 | fi 497 | 498 | 499 | # valgrind 500 | AC_ARG_ENABLE(valgrind, 501 | [AS_HELP_STRING([--enable-valgrind],[Enable somes special code that rsyslog core developers consider useful for testing. Do NOT use if you don't exactly know what you are doing, except if told so by rsyslog developers. NOT to be used by distro maintainers for building regular packages. @<:@default=no@:>@])], 502 | [case "${enableval}" in 503 | yes) enable_valgrind="yes" ;; 504 | no) enable_valgrind="no" ;; 505 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; 506 | esac], 507 | [enable_valgrind="no"] 508 | ) 509 | if test "$enable_valgrind" = "yes"; then 510 | AC_DEFINE(VALGRIND, 1, [Defined if valgrind support settings are to be enabled (e.g. prevents dlclose()).]) 511 | fi 512 | 513 | 514 | # memcheck 515 | AC_ARG_ENABLE(memcheck, 516 | [AS_HELP_STRING([--enable-memcheck],[Enable extended memory check support @<:@default=no@:>@])], 517 | [case "${enableval}" in 518 | yes) enable_memcheck="yes" ;; 519 | no) enable_memcheck="no" ;; 520 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-memcheck) ;; 521 | esac], 522 | [enable_memcheck="no"] 523 | ) 524 | if test "$enable_memcheck" = "yes"; then 525 | AC_DEFINE(MEMCHECK, 1, [Defined if memcheck support settings are to be enabled (e.g. prevents dlclose()).]) 526 | fi 527 | 528 | 529 | # compile diagnostic tools (small helpers usually not needed) 530 | AC_ARG_ENABLE(diagtools, 531 | [AS_HELP_STRING([--enable-diagtools],[Enable diagnostic tools @<:@default=no@:>@])], 532 | [case "${enableval}" in 533 | yes) enable_diagtools="yes" ;; 534 | no) enable_diagtools="no" ;; 535 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-diagtools) ;; 536 | esac], 537 | [enable_diagtools=no] 538 | ) 539 | AM_CONDITIONAL(ENABLE_DIAGTOOLS, test x$enable_diagtools = xyes) 540 | 541 | 542 | # compile end-user tools 543 | AC_ARG_ENABLE(usertools, 544 | [AS_HELP_STRING([--enable-usertools],[Enable end user tools @<:@default=no@:>@])], 545 | [case "${enableval}" in 546 | yes) enable_usertools="yes" ;; 547 | no) enable_usertools="no" ;; 548 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-usertools) ;; 549 | esac], 550 | [enable_usertools=no] 551 | ) 552 | AM_CONDITIONAL(ENABLE_USERTOOLS, test x$enable_usertools = xyes) 553 | 554 | 555 | # MySQL support 556 | AC_ARG_ENABLE(mysql, 557 | [AS_HELP_STRING([--enable-mysql],[Enable MySql database support @<:@default=no@:>@])], 558 | [case "${enableval}" in 559 | yes) enable_mysql="yes" ;; 560 | no) enable_mysql="no" ;; 561 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql) ;; 562 | esac], 563 | [enable_mysql=no] 564 | ) 565 | if test "x$enable_mysql" = "xyes"; then 566 | AC_CHECK_PROG( 567 | [MYSQL_CONFIG], 568 | [mysql_config], 569 | [mysql_config], 570 | [no],, 571 | ) 572 | if test "x${MYSQL_CONFIG}" = "xno"; then 573 | AC_MSG_FAILURE([mysql_config not found - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue]) 574 | fi 575 | AC_CHECK_LIB( 576 | [mysqlclient], 577 | [mysql_init], 578 | [MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags` 579 | MYSQL_LIBS=`$MYSQL_CONFIG --libs` 580 | ], 581 | [AC_MSG_FAILURE([MySQL library is missing])], 582 | [`$MYSQL_CONFIG --libs`] 583 | ) 584 | AC_MSG_CHECKING(if we have mysql_library_init) 585 | save_CFLAGS="$CFLAGS" 586 | CFLAGS="$CFLAGS $MYSQL_CFLAGS" 587 | save_LIBS="$LIBS" 588 | LIBS="$LIBS $MYSQL_LIBS" 589 | AC_TRY_LINK( 590 | [#include 591 | #include ], 592 | [mysql_library_init(0, NULL, NULL)], 593 | [have_mysql_library_init=yes], 594 | [have_mysql_library_init=no]) 595 | CFLAGS="$save_CFLAGS" 596 | LIBS="$save_LIBS" 597 | fi 598 | AM_CONDITIONAL(ENABLE_MYSQL, test x$enable_mysql = xyes) 599 | if test "$have_mysql_library_init" = "yes"; then 600 | AC_DEFINE([HAVE_MYSQL_LIBRARY_INIT], [1], [mysql_library_init available]) 601 | fi 602 | AC_SUBST(MYSQL_CFLAGS) 603 | AC_SUBST(MYSQL_LIBS) 604 | 605 | 606 | # PostgreSQL support 607 | AC_ARG_ENABLE(pgsql, 608 | [AS_HELP_STRING([--enable-pgsql],[Enable PostgreSQL database support @<:@default=no@:>@])], 609 | [case "${enableval}" in 610 | yes) enable_pgsql="yes" ;; 611 | no) enable_pgsql="no" ;; 612 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pgsql) ;; 613 | esac], 614 | [enable_pgsql=no] 615 | ) 616 | if test "x$enable_pgsql" = "xyes"; then 617 | AC_CHECK_PROG( 618 | [PG_CONFIG], 619 | [pg_config], 620 | [pg_config], 621 | [no],,, 622 | ) 623 | if test "x${PG_CONFIG}" = "xno"; then 624 | AC_MSG_FAILURE([pg_config not found]) 625 | fi 626 | AC_CHECK_LIB( 627 | [pq], 628 | [PQconnectdb], 629 | [PGSQL_CFLAGS="-I`$PG_CONFIG --includedir`" 630 | PGSQL_LIBS="-L`$PG_CONFIG --libdir` -lpq" 631 | ], 632 | [AC_MSG_FAILURE([PgSQL library is missing])], 633 | [-L`$PG_CONFIG --libdir`] 634 | ) 635 | fi 636 | AM_CONDITIONAL(ENABLE_PGSQL, test x$enable_pgsql = xyes) 637 | AC_SUBST(PGSQL_CFLAGS) 638 | AC_SUBST(PGSQL_LIBS) 639 | 640 | # libdbi support 641 | AC_ARG_ENABLE(libdbi, 642 | [AS_HELP_STRING([--enable-libdbi],[Enable libdbi database support @<:@default=no@:>@])], 643 | [case "${enableval}" in 644 | yes) enable_libdbi="yes" ;; 645 | no) enable_libdbi="no" ;; 646 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdbi) ;; 647 | esac], 648 | [enable_libdbi=no] 649 | ) 650 | if test "x$enable_libdbi" = "xyes"; then 651 | AC_CHECK_HEADERS( 652 | [dbi/dbi.h],, 653 | [AC_MSG_FAILURE([libdbi is missing])] 654 | ) 655 | AC_CHECK_LIB( 656 | [dbi], 657 | [dbi_initialize], 658 | [LIBDBI_CFLAGS="" 659 | LIBDBI_LIBS="-ldbi" 660 | ], 661 | [AC_MSG_FAILURE([libdbi library is missing])] 662 | ) 663 | AC_CHECK_LIB( 664 | [dbi], 665 | [dbi_initialize_r], 666 | [AC_DEFINE([HAVE_DBI_R], [1], [Define to 1 if libdbi supports the new plugin-safe interface])] 667 | ) 668 | AC_CHECK_LIB( 669 | [dbi], 670 | [dbi_conn_transaction_begin], 671 | [AC_DEFINE([HAVE_DBI_TXSUPP], [1], [Define to 1 if libdbi supports transactions])] 672 | ) 673 | fi 674 | AM_CONDITIONAL(ENABLE_OMLIBDBI, test x$enable_libdbi = xyes) 675 | AC_SUBST(LIBDBI_CFLAGS) 676 | AC_SUBST(LIBDBI_LIBS) 677 | 678 | # SNMP support 679 | AC_ARG_ENABLE(snmp, 680 | [AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])], 681 | [case "${enableval}" in 682 | yes) enable_snmp="yes" ;; 683 | no) enable_snmp="no" ;; 684 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-snmp) ;; 685 | esac], 686 | [enable_snmp=no] 687 | ) 688 | if test "x$enable_snmp" = "xyes"; then 689 | AC_CHECK_HEADERS( 690 | [net-snmp/net-snmp-config.h],, 691 | [AC_MSG_FAILURE([Net-SNMP is missing])] 692 | ) 693 | AC_CHECK_LIB( 694 | [netsnmp], 695 | [snmp_timeout], 696 | [SNMP_CFLAGS="" 697 | SNMP_LIBS="-lnetsnmp" 698 | ], 699 | [AC_MSG_FAILURE([Net-SNMP library is missing])] 700 | ) 701 | fi 702 | AM_CONDITIONAL(ENABLE_SNMP, test x$enable_snmp = xyes) 703 | AC_SUBST(SNMP_CFLAGS) 704 | AC_SUBST(SNMP_LIBS) 705 | 706 | 707 | # uuid support 708 | AC_ARG_ENABLE(uuid, 709 | [AS_HELP_STRING([--enable-uuid],[Enable support for uuid generation @<:@default=yes@:>@])], 710 | [case "${enableval}" in 711 | yes) enable_uuid="yes" ;; 712 | no) enable_uuid="no" ;; 713 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-uuid) ;; 714 | esac], 715 | [enable_uuid=yes] 716 | ) 717 | if test "x$enable_uuid" = "xyes"; then 718 | PKG_CHECK_MODULES([LIBUUID], [uuid]) 719 | AC_DEFINE(USE_LIBUUID, 1, [Define if you want to enable libuuid support]) 720 | fi 721 | AM_CONDITIONAL(ENABLE_UUID, test x$enable_uuid = xyes) 722 | 723 | 724 | # elasticsearch support 725 | AC_ARG_ENABLE(elasticsearch, 726 | [AS_HELP_STRING([--enable-elasticsearch],[Enable elasticsearch output module @<:@default=no@:>@])], 727 | [case "${enableval}" in 728 | yes) enable_elasticsearch="yes" ;; 729 | no) enable_elasticsearch="no" ;; 730 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-elasticsearch) ;; 731 | esac], 732 | [enable_elasticsearch=no] 733 | ) 734 | if test "x$enable_elasticsearch" = "xyes"; then 735 | PKG_CHECK_MODULES([CURL], [libcurl]) 736 | LT_LIB_M 737 | fi 738 | AM_CONDITIONAL(ENABLE_ELASTICSEARCH, test x$enable_elasticsearch = xyes) 739 | 740 | 741 | # capability to enable elasticsearch testbench tests. This requries that an ES test 742 | # environment is present on the local (127.0.0.1) machine. 743 | AC_ARG_ENABLE(elasticsearch_tests, 744 | [AS_HELP_STRING([--enable-elasticsearch-tests],[enable MySQL specific tests in testbench @<:@default=no@:>@])], 745 | [case "${enableval}" in 746 | yes) enable_elasticsearch_tests="yes" ;; 747 | no) enable_elasticsearch_tests="no" ;; 748 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-elasticsearch-tests) ;; 749 | esac], 750 | [enable_elasticsearch_tests=no] 751 | ) 752 | AM_CONDITIONAL(ENABLE_ELASTICSEARCH_TESTS, test x$enable_elasticsearch_tests = xyes) 753 | 754 | 755 | # GnuTLS support 756 | AC_ARG_ENABLE(gnutls, 757 | [AS_HELP_STRING([--enable-gnutls],[Enable GNU TLS support @<:@default=no@:>@])], 758 | [case "${enableval}" in 759 | yes) enable_gnutls="yes" ;; 760 | no) enable_gnutls="no" ;; 761 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-gnutls) ;; 762 | esac], 763 | [enable_gnutls=no] 764 | ) 765 | if test "x$enable_gnutls" = "xyes"; then 766 | PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0) 767 | AC_DEFINE([ENABLE_GNUTLS], [1], [Indicator that GnuTLS is present]) 768 | save_libs=$LIBS 769 | LIBS="$LIBS $GNUTLS_LIBS" 770 | AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,) 771 | AC_CHECK_FUNCS(gnutls_certificate_type_set_priority,,) 772 | LIBS=$save_libs 773 | fi 774 | 775 | AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes) 776 | 777 | # libgcrypt support 778 | AC_ARG_ENABLE(libgcrypt, 779 | [AS_HELP_STRING([--enable-libgcrypt],[Enable log file encryption support (libgcrypt) @<:@default=yes@:>@])], 780 | [case "${enableval}" in 781 | yes) enable_libgcrypt="yes" ;; 782 | no) enable_libgcrypt="no" ;; 783 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-libgcrypt) ;; 784 | esac], 785 | [enable_libgcrypt=yes] 786 | ) 787 | if test "x$enable_libgcrypt" = "xyes"; then 788 | AC_PATH_PROG([LIBGCRYPT_CONFIG],[libgcrypt-config],[no]) 789 | if test "x${LIBGCRYPT_CONFIG}" = "xno"; then 790 | AC_MSG_FAILURE([libgcrypt-config not found in PATH]) 791 | fi 792 | AC_CHECK_LIB( 793 | [gcrypt], 794 | [gcry_cipher_open], 795 | [LIBGCRYPT_CFLAGS="`${LIBGCRYPT_CONFIG} --cflags`" 796 | LIBGCRYPT_LIBS="`${LIBGCRYPT_CONFIG} --libs`" 797 | ], 798 | [AC_MSG_FAILURE([libgcrypt is missing])], 799 | [`${LIBGCRYPT_CONFIG} --libs --cflags`] 800 | ) 801 | AC_DEFINE([ENABLE_LIBGCRYPT], [1], [Indicator that LIBGCRYPT is present]) 802 | fi 803 | AM_CONDITIONAL(ENABLE_LIBGCRYPT, test x$enable_libgcrypt = xyes) 804 | AC_SUBST(LIBGCRYPT_CFLAGS) 805 | AC_SUBST(LIBGCRYPT_LIBS) 806 | 807 | 808 | # support for building the rsyslogd runtime 809 | AC_ARG_ENABLE(rsyslogrt, 810 | [AS_HELP_STRING([--enable-rsyslogrt],[Build rsyslogrt @<:@default=yes@:>@])], 811 | [case "${enableval}" in 812 | yes) enable_rsyslogrt="yes" ;; 813 | no) enable_rsyslogrt="no" ;; 814 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rsyslogrt) ;; 815 | esac], 816 | [enable_rsyslogrt=yes] 817 | ) 818 | if test "x$enable_rsyslogrt" = "xyes"; then 819 | RSRT_CFLAGS1="-I\$(top_srcdir)/runtime -I\$(top_srcdir) -I\$(top_srcdir)/grammar" 820 | RSRT_LIBS1="\$(top_builddir)/runtime/librsyslog.la" 821 | fi 822 | AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes) 823 | RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)" 824 | if test "$GCC" = "yes"; then 825 | RSRT_CFLAGS="$RSRT_CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute" 826 | if $CC -Werror=implicit-function-declaration -x c -c /dev/null -o /dev/null 2>/dev/null; then 827 | RSRT_CFLAGS="$RSRT_CFLAGS -Werror=implicit-function-declaration" 828 | elif $CC -Werror-implicit-function-declaration -x c -c /dev/null -o /dev/null 2>/dev/null; then 829 | RSRT_CFLAGS="$RSRT_CFLAGS -Werror-implicit-function-declaration" 830 | fi 831 | 832 | if test "x$enable_debug_symbols" = "xyes"; then 833 | RSRT_CFLAGS="$RSRT_CFLAGS -g" 834 | fi 835 | fi 836 | RSRT_CFLAGS="$RSRT_CFLAGS $WARN_CFLAGS" 837 | RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)" 838 | AC_SUBST(RSRT_CFLAGS1) 839 | AC_SUBST(RSRT_LIBS1) 840 | AC_SUBST(RSRT_CFLAGS) 841 | AC_SUBST(RSRT_LIBS) 842 | 843 | 844 | # support for NOT building rsyslogd (useful for source-based packaging systems) 845 | AC_ARG_ENABLE(rsyslogd, 846 | [AS_HELP_STRING([--enable-rsyslogd],[Build rsyslogd @<:@default=yes@:>@])], 847 | [case "${enableval}" in 848 | yes) enable_rsyslogd="yes" ;; 849 | no) enable_rsyslogd="no" ;; 850 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rsyslogd) ;; 851 | esac], 852 | [enable_rsyslogd=yes] 853 | ) 854 | AM_CONDITIONAL(ENABLE_RSYSLOGD, test x$enable_rsyslogd = xyes) 855 | 856 | 857 | # capability to enable an extended testbench. By default, this is off. The reason 858 | # for this switch is that some test simply take too long to execute them on a regular 859 | # basis. So we enable to skip them, while the majority of tests can still be used. The 860 | # idea is that at least "make distcheck" executes the extended testbench, and also 861 | # developers should explicitely enable it after important changes. -- rgerhards, 2010-04-12 862 | AC_ARG_ENABLE(extended_tests, 863 | [AS_HELP_STRING([--enable-extended-tests],[extended testbench @<:@default=no@:>@])], 864 | [case "${enableval}" in 865 | yes) enable_extended_tests="yes" ;; 866 | no) enable_extended_tests="no" ;; 867 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-extended-tests) ;; 868 | esac], 869 | [enable_extended_tests=no] 870 | ) 871 | AM_CONDITIONAL(ENABLE_EXTENDED_TESTS, test x$enable_extended_tests = xyes) 872 | 873 | 874 | # capability to enable MySQL testbench tests. This requries that a Syslog database 875 | # with the default schema has been created on the local (127.0.0.1) MySQL server and 876 | # a user "rsyslog" with password "testbench" exists, is able to login with default 877 | # parameters and has sufficient (read: all) privileges on that database. 878 | # rgerhards, 2011-03-09 879 | AC_ARG_ENABLE(mysql_tests, 880 | [AS_HELP_STRING([--enable-mysql-tests],[enable MySQL specific tests in testbench @<:@default=no@:>@])], 881 | [case "${enableval}" in 882 | yes) enable_mysql_tests="yes" ;; 883 | no) enable_mysql_tests="no" ;; 884 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql-tests) ;; 885 | esac], 886 | [enable_mysql_tests=no] 887 | ) 888 | AM_CONDITIONAL(ENABLE_MYSQL_TESTS, test x$enable_mysql_tests = xyes) 889 | 890 | 891 | # Mail support (so far we do not need a library, but we need to turn this on and off) 892 | AC_ARG_ENABLE(mail, 893 | [AS_HELP_STRING([--enable-mail],[Enable mail support @<:@default=no@:>@])], 894 | [case "${enableval}" in 895 | yes) enable_mail="yes" ;; 896 | no) enable_mail="no" ;; 897 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mail) ;; 898 | esac], 899 | [enable_mail=no] 900 | ) 901 | AM_CONDITIONAL(ENABLE_MAIL, test x$enable_mail = xyes) 902 | 903 | 904 | # imdiag support 905 | # This is a core testbench tool. You need to enable it if you want to 906 | # use not only a small subset of the testbench. 907 | AC_ARG_ENABLE(imdiag, 908 | [AS_HELP_STRING([--enable-imdiag],[Enable imdiag @<:@default=no@:>@])], 909 | [case "${enableval}" in 910 | yes) enable_imdiag="yes" ;; 911 | no) enable_imdiag="no" ;; 912 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imdiag) ;; 913 | esac], 914 | [enable_imdiag=no] 915 | ) 916 | if test "x$enable_imdiag" = "xyes"; then 917 | AC_DEFINE([ENABLE_IMDIAG], [1], [Indicator that IMDIAG is present]) 918 | fi 919 | AM_CONDITIONAL(ENABLE_IMDIAG, test x$enable_imdiag = xyes) 920 | 921 | 922 | # mmnormalize 923 | AC_ARG_ENABLE(mmnormalize, 924 | [AS_HELP_STRING([--enable-mmnormalize],[Enable building mmnormalize support @<:@default=no@:>@])], 925 | [case "${enableval}" in 926 | yes) enable_mmnormalize="yes" ;; 927 | no) enable_mmnormalize="no" ;; 928 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmnormalize) ;; 929 | esac], 930 | [enable_mmnormalize=no] 931 | ) 932 | if test "x$enable_mmnormalize" = "xyes"; then 933 | PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 1.1.2) 934 | 935 | save_CFLAGS="$CFLAGS" 936 | save_LIBS="$LIBS" 937 | 938 | CFLAGS="$CFLAGS $LIBLOGNORM_CFLAGS" 939 | LIBS="$LIBS $LIBLOGNORM_LIBS" 940 | 941 | AX_CHECK_DEFINED([[#include ]],LOGNORM_REGEX_SUPPORTED,[lognorm_regex_supported="yes"],) 942 | 943 | CFLAGS="$save_CFLAGS" 944 | LIBS="$save_LIBS" 945 | fi 946 | AM_CONDITIONAL(LOGNORM_REGEX_SUPPORTED, test x$lognorm_regex_supported = xyes) 947 | AM_CONDITIONAL(ENABLE_MMNORMALIZE, test x$enable_mmnormalize = xyes) 948 | 949 | # mmnjsonparse 950 | AC_ARG_ENABLE(mmjsonparse, 951 | [AS_HELP_STRING([--enable-mmjsonparse],[Enable building mmjsonparse support @<:@default=no@:>@])], 952 | [case "${enableval}" in 953 | yes) enable_mmjsonparse="yes" ;; 954 | no) enable_mmjsonparse="no" ;; 955 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmjsonparse) ;; 956 | esac], 957 | [enable_mmjsonparse=no] 958 | ) 959 | AM_CONDITIONAL(ENABLE_MMJSONPARSE, test x$enable_mmjsonparse = xyes) 960 | 961 | # mmgrok 962 | AC_ARG_ENABLE(mmgrok, 963 | [AS_HELP_STRING([--enable-mmgrok],[Enable building mmgrok support @<:@default=no@:>@])], 964 | [case "${enableval}" in 965 | yes) enable_mmgrok="yes" ;; 966 | no) enable_mmgrok="no" ;; 967 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmgrok) ;; 968 | esac], 969 | [enable_mmgrok=no] 970 | ) 971 | if test "x$enable_mmgrok" = "xyes"; then 972 | GLIB_CFLAGS="$(pkg-config --cflags glib-2.0)" 973 | GLIB_LIBS="$(pkg-config --libs glib-2.0)" 974 | fi 975 | AM_CONDITIONAL(ENABLE_MMGROK, test x$enable_mmgrok = xyes) 976 | AC_SUBST(GLIB_CFLAGS) 977 | AC_SUBST(GLIB_LIBS) 978 | 979 | # mmaudit 980 | AC_ARG_ENABLE(mmaudit, 981 | [AS_HELP_STRING([--enable-mmaudit],[Enable building mmaudit support @<:@default=no@:>@])], 982 | [case "${enableval}" in 983 | yes) enable_mmaudit="yes" ;; 984 | no) enable_mmaudit="no" ;; 985 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmaudit) ;; 986 | esac], 987 | [enable_mmaudit=no] 988 | ) 989 | AM_CONDITIONAL(ENABLE_MMAUDIT, test x$enable_mmaudit = xyes) 990 | 991 | 992 | # mmanon 993 | AC_ARG_ENABLE(mmanon, 994 | [AS_HELP_STRING([--enable-mmanon],[Enable building mmanon support @<:@default=no@:>@])], 995 | [case "${enableval}" in 996 | yes) enable_mmanon="yes" ;; 997 | no) enable_mmanon="no" ;; 998 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmanon) ;; 999 | esac], 1000 | [enable_mmanon=no] 1001 | ) 1002 | AM_CONDITIONAL(ENABLE_MMANON, test x$enable_mmanon = xyes) 1003 | 1004 | 1005 | # mmutf8fix 1006 | AC_ARG_ENABLE(mmutf8fix, 1007 | [AS_HELP_STRING([--enable-mmutf8fix],[Enable building mmutf8fix support @<:@default=no@:>@])], 1008 | [case "${enableval}" in 1009 | yes) enable_mmutf8fix="yes" ;; 1010 | no) enable_mmutf8fix="no" ;; 1011 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmutf8fix) ;; 1012 | esac], 1013 | [enable_mmutf8fix=no] 1014 | ) 1015 | AM_CONDITIONAL(ENABLE_MMUTF8FIX, test x$enable_mmutf8fix = xyes) 1016 | 1017 | 1018 | # mmcount 1019 | AC_ARG_ENABLE(mmcount, 1020 | [AS_HELP_STRING([--enable-mmcount],[Enable message counting @<:@default=no@:>@])], 1021 | [case "${enableval}" in 1022 | yes) enable_mmcount="yes" ;; 1023 | no) enable_mmcount="no" ;; 1024 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmcount) ;; 1025 | esac], 1026 | [enable_mmcount=no] 1027 | ) 1028 | AM_CONDITIONAL(ENABLE_MMCOUNT, test x$enable_mmcount = xyes) 1029 | 1030 | 1031 | # mmsequence 1032 | AC_ARG_ENABLE(mmsequence, 1033 | [AS_HELP_STRING([--enable-mmsequence],[Enable sequence generator @<:@default=no@:>@])], 1034 | [case "${enableval}" in 1035 | yes) enable_mmsequence="yes" ;; 1036 | no) enable_mmsequence="no" ;; 1037 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmsequence) ;; 1038 | esac], 1039 | [enable_mmsequence=no] 1040 | ) 1041 | AM_CONDITIONAL(ENABLE_MMSEQUENCE, test x$enable_mmsequence = xyes) 1042 | 1043 | 1044 | 1045 | # mmdblookup 1046 | AC_ARG_ENABLE(mmdblookup, 1047 | [AS_HELP_STRING([--enable-mmdblookup],[Enable mmdb lookup helper @<:@default=no@:>@])], 1048 | [case "${enableval}" in 1049 | yes) enable_mmdblookup="yes" ;; 1050 | no) enable_mmdblookup="no" ;; 1051 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmdblookup) ;; 1052 | esac], 1053 | [enable_mmdblookup=no] 1054 | ) 1055 | if test "x$enable_mmdblookup"; then 1056 | #PKG_CHECK_MODULES(LIBMAXMINDDB, libmaxminddb) 1057 | AC_CHECK_HEADERS([maxminddb.h]) 1058 | fi 1059 | AM_CONDITIONAL(ENABLE_MMDBLOOKUP, test x$enable_mmdblookup = xyes) 1060 | 1061 | 1062 | 1063 | # mmfields 1064 | AC_ARG_ENABLE(mmfields, 1065 | [AS_HELP_STRING([--enable-mmfields],[Enable building mmfields support @<:@default=no@:>@])], 1066 | [case "${enableval}" in 1067 | yes) enable_mmfields="yes" ;; 1068 | no) enable_mmfields="no" ;; 1069 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmfields) ;; 1070 | esac], 1071 | [enable_mmfields=no] 1072 | ) 1073 | AM_CONDITIONAL(ENABLE_MMFIELDS, test x$enable_mmfields = xyes) 1074 | 1075 | # mmpstrucdata 1076 | AC_ARG_ENABLE(mmpstrucdata, 1077 | [AS_HELP_STRING([--enable-mmpstrucdata],[Enable building mmpstrucdata support @<:@default=no@:>@])], 1078 | [case "${enableval}" in 1079 | yes) enable_mmpstrucdata="yes" ;; 1080 | no) enable_mmpstrucdata="no" ;; 1081 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmpstrucdata) ;; 1082 | esac], 1083 | [enable_mmpstrucdata=no] 1084 | ) 1085 | AM_CONDITIONAL(ENABLE_MMPSTRUCDATA, test x$enable_mmpstrucdata = xyes) 1086 | 1087 | 1088 | # mmrfc5424addhmac 1089 | AC_ARG_ENABLE(mmrfc5424addhmac, 1090 | [AS_HELP_STRING([--enable-mmrfc5424addhmac],[Enable building mmrfc5424addhmac support @<:@default=no@:>@])], 1091 | [case "${enableval}" in 1092 | yes) enable_mmrfc5424addhmac="yes" ;; 1093 | no) enable_mmrfc5424addhmac="no" ;; 1094 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmrfc5424addhmac) ;; 1095 | esac], 1096 | [enable_mmrfc5424addhmac=no] 1097 | ) 1098 | if test "x$enable_mmrfc5424addhmac" = "xyes"; then 1099 | PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7) 1100 | #AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data], [], [AC_MSG_ERROR([OpenSSL libraries required])]) 1101 | #AC_CHECK_LIB([ssl],[SSL_library_init], [], [AC_MSG_ERROR([OpenSSL libraries required])]) 1102 | #AC_CHECK_HEADERS([openssl/crypto.h openssl/x509.h openssl/pem.h openssl/ssl.h openssl/err.h],[],[AC_MSG_ERROR([OpenSSL headers required])]) 1103 | fi 1104 | AM_CONDITIONAL(ENABLE_MMRFC5424ADDHMAC, test x$enable_mmrfc5424addhmac = xyes) 1105 | 1106 | 1107 | # RELP support 1108 | AC_ARG_ENABLE(relp, 1109 | [AS_HELP_STRING([--enable-relp],[Enable RELP support @<:@default=no@:>@])], 1110 | [case "${enableval}" in 1111 | yes) enable_relp="yes" ;; 1112 | no) enable_relp="no" ;; 1113 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-relp) ;; 1114 | esac], 1115 | [enable_relp=no] 1116 | ) 1117 | if test "x$enable_relp" = "xyes"; then 1118 | PKG_CHECK_MODULES(RELP, relp >= 1.2.12) 1119 | AC_DEFINE([ENABLE_RELP], [1], [Indicator that RELP is present]) 1120 | fi 1121 | AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes) 1122 | 1123 | # RELP default port 1124 | AC_ARG_ENABLE(omrelp-default-port, 1125 | [AS_HELP_STRING([--enable-omrelp-default-port],[set omrelp default port @<:@default=514@:>@])], 1126 | [ AC_DEFINE_UNQUOTED(RELP_DFLT_PT, "${enableval}", [default port for omrelp]) ], 1127 | [ AC_DEFINE(RELP_DFLT_PT, "514", [default port for omrelp]) ] 1128 | ) 1129 | 1130 | 1131 | # GuardTime support 1132 | AC_ARG_ENABLE(guardtime, 1133 | [AS_HELP_STRING([--enable-guardtime],[Enable log file signing support (via GuardTime) @<:@default=no@:>@])], 1134 | [case "${enableval}" in 1135 | yes) enable_guardtime="yes" ;; 1136 | no) enable_guardtime="no" ;; 1137 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-guardtime) ;; 1138 | esac], 1139 | [enable_guardtime=no] 1140 | ) 1141 | if test "x$enable_guardtime" = "xyes"; then 1142 | PKG_CHECK_MODULES(GUARDTIME, libgt >= 0.3.1) 1143 | fi 1144 | AM_CONDITIONAL(ENABLE_GUARDTIME, test x$enable_guardtime = xyes) 1145 | 1146 | 1147 | # GuardTime KSI support 1148 | AC_ARG_ENABLE(gt-ksi, 1149 | [AS_HELP_STRING([--enable-gt-ksi],[Enable log file signing support via GuardTime KSI @<:@default=no@:>@])], 1150 | [case "${enableval}" in 1151 | yes) enable_gt_ksi="yes" ;; 1152 | no) enable_gt_ksi="no" ;; 1153 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-gt-ksi) ;; 1154 | esac], 1155 | [enable_gt_ksi=no] 1156 | ) 1157 | if test "x$enable_gt_ksi" = "xyes"; then 1158 | PKG_CHECK_MODULES(GT_KSI, libksi >= 3.4.0.2) 1159 | PKG_CHECK_MODULES(GT_KSI, libksi < 3.5.0.0) 1160 | fi 1161 | AM_CONDITIONAL(ENABLE_GT_KSI, test x$enable_gt_ksi = xyes) 1162 | 1163 | 1164 | # liblogging-stdlog support 1165 | AC_ARG_ENABLE(liblogging-stdlog, 1166 | [AS_HELP_STRING([--enable-liblogging-stdlog],[Enable liblogging-stdlog support @<:@default=yes@:>@])], 1167 | [case "${enableval}" in 1168 | yes) enable_liblogging_stdlog="yes" ;; 1169 | no) enable_liblogging_stdlog="no" ;; 1170 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-liblogging-stdlog) ;; 1171 | esac], 1172 | [enable_liblogging_stdlog=yes] 1173 | ) 1174 | if test "x$enable_liblogging_stdlog" = "xyes"; then 1175 | PKG_CHECK_MODULES(LIBLOGGING_STDLOG, liblogging-stdlog >= 1.0.3, 1176 | AC_DEFINE(HAVE_LIBLOGGING_STDLOG, 1, [Define to 1 if liblogging-stdlog is available.]) 1177 | ) 1178 | fi 1179 | AM_CONDITIONAL(ENABLE_LIBLOGGING_STDLOG, test x$enable_liblogging_stdlog = xyes) 1180 | 1181 | 1182 | # RFC 3195 support 1183 | AC_ARG_ENABLE(rfc3195, 1184 | [AS_HELP_STRING([--enable-rfc3195],[Enable RFC3195 support @<:@default=no@:>@])], 1185 | [case "${enableval}" in 1186 | yes) enable_rfc3195="yes" ;; 1187 | no) enable_rfc3195="no" ;; 1188 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rfc3195) ;; 1189 | esac], 1190 | [enable_rfc3195=no] 1191 | ) 1192 | if test "x$enable_rfc3195" = "xyes"; then 1193 | PKG_CHECK_MODULES(LIBLOGGING, liblogging-rfc3195 >= 1.0.1) 1194 | fi 1195 | AM_CONDITIONAL(ENABLE_RFC3195, test x$enable_rfc3195 = xyes) 1196 | 1197 | 1198 | # enable/disable the testbench (e.g. because some important parts 1199 | # are missing) 1200 | AC_ARG_ENABLE(testbench, 1201 | [AS_HELP_STRING([--enable-testbench],[testbench enabled @<:@default=no@:>@])], 1202 | [case "${enableval}" in 1203 | yes) enable_testbench="yes" ;; 1204 | no) enable_testbench="no" ;; 1205 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-testbench) ;; 1206 | esac], 1207 | [enable_testbench=no] 1208 | ) 1209 | AM_CONDITIONAL(ENABLE_TESTBENCH, test x$enable_testbench = xyes) 1210 | if test "x$enable_testbench" = "xyes"; then 1211 | if test "x$enable_imdiag" != "xyes"; then 1212 | AC_MSG_ERROR("--enable-testbench requires --enable-imdiag") 1213 | fi 1214 | fi 1215 | 1216 | 1217 | # valgrind-testbench 1218 | AC_ARG_WITH([valgrind_testbench], 1219 | [AS_HELP_STRING([--without-valgrind-testbench], [Don't use valgrind in testbench])] 1220 | ) 1221 | 1222 | if test "x$with_valgrind_testbench" != "xno"; then 1223 | AC_CHECK_PROG(VALGRIND, [valgrind], [valgrind], [no]) 1224 | 1225 | if test "x$enable_testbench" = "xyes" && test "x$VALGRIND" = "xno"; then 1226 | if test "x$with_valgrind_testbench" = "xyes"; then 1227 | AC_MSG_ERROR([valgrind is missing but forced with --with-valgrind-testbench. Either install valgrind or remove the option!]) 1228 | else 1229 | AC_MSG_WARN([valgrind is missing -- testbench won't use valgrind!]) 1230 | fi 1231 | else 1232 | AC_MSG_NOTICE([testbench will use valgrind]) 1233 | fi 1234 | else 1235 | AC_MSG_NOTICE([testbench won't use valgrind due to set --without-valgrind-testbench option]) 1236 | fi 1237 | AM_CONDITIONAL([HAVE_VALGRIND], [test "x$with_valgrind_testbench" != "xno" && test "x$VALGRIND" != "xno"]) 1238 | 1239 | 1240 | # settings for the file input module 1241 | AC_ARG_ENABLE(imfile, 1242 | [AS_HELP_STRING([--enable-imfile],[file input module enabled @<:@default=no@:>@])], 1243 | [case "${enableval}" in 1244 | yes) enable_imfile="yes" ;; 1245 | no) enable_imfile="no" ;; 1246 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imfile) ;; 1247 | esac], 1248 | [enable_imfile=no] 1249 | ) 1250 | AM_CONDITIONAL(ENABLE_IMFILE, test x$enable_imfile = xyes) 1251 | 1252 | 1253 | # settings for the door input module (under solaris, thus default off) 1254 | AC_ARG_ENABLE(imsolaris, 1255 | [AS_HELP_STRING([--enable-imsolaris],[solaris input module enabled @<:@default=no@:>@])], 1256 | [case "${enableval}" in 1257 | yes) enable_imsolaris="yes" ;; 1258 | no) enable_imsolaris="no" ;; 1259 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imsolaris) ;; 1260 | esac], 1261 | [enable_imsolaris=no] 1262 | ) 1263 | AM_CONDITIONAL(ENABLE_IMSOLARIS, test x$enable_imsolaris = xyes) 1264 | 1265 | # settings for the ptcp input module 1266 | AC_ARG_ENABLE(imptcp, 1267 | [AS_HELP_STRING([--enable-imptcp],[plain tcp input module enabled @<:@default=no@:>@])], 1268 | [case "${enableval}" in 1269 | yes) enable_imptcp="yes" ;; 1270 | no) enable_imptcp="no" ;; 1271 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imptcp) ;; 1272 | esac], 1273 | [enable_imptcp=no] 1274 | ) 1275 | AM_CONDITIONAL(ENABLE_IMPTCP, test x$enable_imptcp = xyes) 1276 | 1277 | 1278 | # settings for the pstats input module 1279 | AC_ARG_ENABLE(impstats, 1280 | [AS_HELP_STRING([--enable-impstats],[periodic statistics module enabled @<:@default=no@:>@])], 1281 | [case "${enableval}" in 1282 | yes) enable_impstats="yes" ;; 1283 | no) enable_impstats="no" ;; 1284 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-impstats) ;; 1285 | esac], 1286 | [enable_impstats=no] 1287 | ) 1288 | AM_CONDITIONAL(ENABLE_IMPSTATS, test x$enable_impstats = xyes) 1289 | 1290 | 1291 | # settings for the omprog output module 1292 | AC_ARG_ENABLE(omprog, 1293 | [AS_HELP_STRING([--enable-omprog],[Compiles omprog module @<:@default=no@:>@])], 1294 | [case "${enableval}" in 1295 | yes) enable_omprog="yes" ;; 1296 | no) enable_omprog="no" ;; 1297 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omprog) ;; 1298 | esac], 1299 | [enable_omprog=no] 1300 | ) 1301 | AM_CONDITIONAL(ENABLE_OMPROG, test x$enable_omprog = xyes) 1302 | 1303 | 1304 | # settings for omudpspoof 1305 | AC_ARG_ENABLE(omudpspoof, 1306 | [AS_HELP_STRING([--enable-omudpspoof],[Compiles omudpspoof module @<:@default=no@:>@])], 1307 | [case "${enableval}" in 1308 | yes) enable_omudpspoof="yes" ;; 1309 | no) enable_omudpspoof="no" ;; 1310 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omudpspoof) ;; 1311 | esac], 1312 | [enable_omudpspoof=no] 1313 | ) 1314 | 1315 | if test "x$enable_omudpspoof" = "xyes"; then 1316 | AC_CHECK_HEADERS( 1317 | [libnet.h],, 1318 | [AC_MSG_FAILURE([libnet is missing])] 1319 | ) 1320 | AC_CHECK_LIB( 1321 | [net], 1322 | [libnet_init], 1323 | [UDPSPOOF_CFLAGS="" 1324 | UDPSPOOF_LIBS="-lnet" 1325 | ], 1326 | [AC_MSG_FAILURE([libnet is missing])] 1327 | ) 1328 | fi 1329 | AM_CONDITIONAL(ENABLE_OMUDPSPOOF, test x$enable_omudpspoof = xyes) 1330 | AC_SUBST(UDPSPOOF_CFLAGS) 1331 | AC_SUBST(UDPSPOOF_LIBS) 1332 | 1333 | 1334 | # settings for omstdout 1335 | AC_ARG_ENABLE(omstdout, 1336 | [AS_HELP_STRING([--enable-omstdout],[Compiles stdout module @<:@default=no@:>@])], 1337 | [case "${enableval}" in 1338 | yes) enable_omstdout="yes" ;; 1339 | no) enable_omstdout="no" ;; 1340 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omstdout) ;; 1341 | esac], 1342 | [enable_omstdout=no] 1343 | ) 1344 | AM_CONDITIONAL(ENABLE_OMSTDOUT, test x$enable_omstdout = xyes) 1345 | 1346 | # settings for omjournal 1347 | AC_ARG_ENABLE(omjournal, 1348 | [AS_HELP_STRING([--enable-omjournal],[Compiles omjournal @<:@default=no@:>@])], 1349 | [case "${enableval}" in 1350 | yes) enable_omjournal="yes" ;; 1351 | no) enable_omjournal="no" ;; 1352 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omjournal) ;; 1353 | esac], 1354 | [enable_omjournal=no] 1355 | ) 1356 | if test "x$enable_omjournal" = "xyes"; then 1357 | PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd >= 209] ,, [ 1358 | PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197]) 1359 | ]) 1360 | fi 1361 | AM_CONDITIONAL(ENABLE_OMJOURNAL, test x$enable_omjournal = xyes) 1362 | 1363 | 1364 | # settings for pmlastmsg 1365 | AC_ARG_ENABLE(pmlastmsg, 1366 | [AS_HELP_STRING([--enable-pmlastmsg],[Compiles lastmsg parser module @<:@default=no@:>@])], 1367 | [case "${enableval}" in 1368 | yes) enable_pmlastmsg="yes" ;; 1369 | no) enable_pmlastmsg="no" ;; 1370 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmlastmsg) ;; 1371 | esac], 1372 | [enable_pmlastmsg=no] 1373 | ) 1374 | AM_CONDITIONAL(ENABLE_PMLASTMSG, test x$enable_pmlastmsg = xyes) 1375 | 1376 | 1377 | # settings for pmcisconames 1378 | AC_ARG_ENABLE(pmcisconames, 1379 | [AS_HELP_STRING([--enable-pmcisconames],[Compiles cisconames parser module @<:@default=no@:>@])], 1380 | [case "${enableval}" in 1381 | yes) enable_pmcisconames="yes" ;; 1382 | no) enable_pmcisconames="no" ;; 1383 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmcisconames) ;; 1384 | esac], 1385 | [enable_pmcisconames=no] 1386 | ) 1387 | AM_CONDITIONAL(ENABLE_PMCISCONAMES, test x$enable_pmcisconames = xyes) 1388 | 1389 | 1390 | # settings for pmciscoios 1391 | AC_ARG_ENABLE(pmciscoios, 1392 | [AS_HELP_STRING([--enable-pmciscoios],[Compiles ciscoios parser module @<:@default=no@:>@])], 1393 | [case "${enableval}" in 1394 | yes) enable_pmciscoios="yes" ;; 1395 | no) enable_pmciscoios="no" ;; 1396 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmciscoios) ;; 1397 | esac], 1398 | [enable_pmciscoios=no] 1399 | ) 1400 | AM_CONDITIONAL(ENABLE_PMCISCOIOS, test x$enable_pmciscoios = xyes) 1401 | 1402 | 1403 | # settings for pmaixforwardedfrom 1404 | AC_ARG_ENABLE(pmaixforwardedfrom, 1405 | [AS_HELP_STRING([--enable-pmaixforwardedfrom],[Compiles aixforwardedfrom parser module @<:@default=no@:>@])], 1406 | [case "${enableval}" in 1407 | yes) enable_pmaixforwardedfrom="yes" ;; 1408 | no) enable_pmaixforwardedfrom="no" ;; 1409 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmaixforwardedfrom) ;; 1410 | esac], 1411 | [enable_pmaixforwardedfrom=no] 1412 | ) 1413 | AM_CONDITIONAL(ENABLE_PMAIXFORWARDEDFROM, test x$enable_pmaixforwardedfrom = xyes) 1414 | 1415 | 1416 | # settings for pmsnare 1417 | AC_ARG_ENABLE(pmsnare, 1418 | [AS_HELP_STRING([--enable-pmsnare],[Compiles snare parser module @<:@default=no@:>@])], 1419 | [case "${enableval}" in 1420 | yes) enable_pmsnare="yes" ;; 1421 | no) enable_pmsnare="no" ;; 1422 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmsnare) ;; 1423 | esac], 1424 | [enable_pmsnare=no] 1425 | ) 1426 | AM_CONDITIONAL(ENABLE_PMSNARE, test x$enable_pmsnare = xyes) 1427 | 1428 | 1429 | # settings for pmpanngfw 1430 | AC_ARG_ENABLE(pmpanngfw, 1431 | [AS_HELP_STRING([--enable-pmpanngfw],[Compiles Palo Alto Networks parser module @<:@default=no@:>@])], 1432 | [case "${enableval}" in 1433 | yes) enable_pmpanngfw="yes" ;; 1434 | no) enable_pmpanngfw="no" ;; 1435 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-pmpanngfw) ;; 1436 | esac], 1437 | [enable_pmpanngfw=no] 1438 | ) 1439 | AM_CONDITIONAL(ENABLE_PMPANNGFW, test x$enable_pmpanngfw = xyes) 1440 | 1441 | 1442 | # settings for omruleset 1443 | AC_ARG_ENABLE(omruleset, 1444 | [AS_HELP_STRING([--enable-omruleset],[Compiles ruleset forwarding module @<:@default=no@:>@])], 1445 | [case "${enableval}" in 1446 | yes) enable_omruleset="yes" ;; 1447 | no) enable_omruleset="no" ;; 1448 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omruleset) ;; 1449 | esac], 1450 | [enable_omruleset=no] 1451 | ) 1452 | AM_CONDITIONAL(ENABLE_OMRULESET, test x$enable_omruleset = xyes) 1453 | 1454 | 1455 | # settings for omuxsock 1456 | AC_ARG_ENABLE(omuxsock, 1457 | [AS_HELP_STRING([--enable-omuxsock],[Compiles omuxsock module @<:@default=no@:>@])], 1458 | [case "${enableval}" in 1459 | yes) enable_omuxsock="yes" ;; 1460 | no) enable_omuxsock="no" ;; 1461 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omuxsock) ;; 1462 | esac], 1463 | [enable_omuxsock=no] 1464 | ) 1465 | AM_CONDITIONAL(ENABLE_OMUXSOCK, test x$enable_omuxsock = xyes) 1466 | 1467 | 1468 | # settings for mmsnmptrapd message modification module 1469 | AC_ARG_ENABLE(mmsnmptrapd, 1470 | [AS_HELP_STRING([--enable-mmsnmptrapd],[Compiles mmsnmptrapd module @<:@default=no@:>@])], 1471 | [case "${enableval}" in 1472 | yes) enable_mmsnmptrapd="yes" ;; 1473 | no) enable_mmsnmptrapd="no" ;; 1474 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmsnmptrapd) ;; 1475 | esac], 1476 | [enable_mmsnmptrapd=no] 1477 | ) 1478 | AM_CONDITIONAL(ENABLE_MMSNMPTRAPD, test x$enable_mmsnmptrapd = xyes) 1479 | 1480 | 1481 | # settings for the omhdfs; 1482 | AC_ARG_ENABLE(omhdfs, 1483 | [AS_HELP_STRING([--enable-omhdfs],[Compiles omhdfs module @<:@default=no@:>@])], 1484 | [case "${enableval}" in 1485 | yes) enable_omhdfs="yes" ;; 1486 | no) enable_omhdfs="no" ;; 1487 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omhdfs) ;; 1488 | esac], 1489 | [enable_omhdfs=no] 1490 | ) 1491 | if test "x$enable_omhdfs"; then 1492 | AC_CHECK_HEADERS([hdfs.h hadoop/hdfs.h]) 1493 | fi 1494 | AM_CONDITIONAL(ENABLE_OMHDFS, test x$enable_omhdfs = xyes) 1495 | 1496 | 1497 | # support for omkafka 1498 | AC_ARG_ENABLE(omkafka, 1499 | [AS_HELP_STRING([--enable-omkafka],[Compiles omkafka module @<:@default=no@:>@])], 1500 | [case "${enableval}" in 1501 | yes) enable_omkafka="yes" ;; 1502 | no) enable_omkafka="no" ;; 1503 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omkafka) ;; 1504 | esac], 1505 | [enable_omkafka=no] 1506 | ) 1507 | AC_ARG_ENABLE(kafka_tests, 1508 | [AS_HELP_STRING([--enable-kafka-tests],[Enable Kafka tests, needs Java @<:@default=no@:>@])], 1509 | [case "${enableval}" in 1510 | yes) enable_kafka_tests="yes" ;; 1511 | no) enable_kafka_tests="no" ;; 1512 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-kafka-tests) ;; 1513 | esac], 1514 | [enable_kafka_tests=no] 1515 | ) 1516 | AM_CONDITIONAL(ENABLE_KAFKA_TESTS, test x$enable_kafka_tests = xyes) 1517 | 1518 | if test "x$enable_omkafka" = "xyes"; then 1519 | if test "x$enable_kafka_tests" = "xyes"; then 1520 | AX_PROG_JAVAC #we don't need javac, but macro documentation says JAVAC *must* be checked before JAVA 1521 | AX_PROG_JAVA 1522 | AC_CHECK_PROG(WGET, [wget], [yes], [no]) 1523 | if test "x${WGET}" = "xno"; then 1524 | AC_MSG_FAILURE([wget, which is a kafka-tests dependency, not found]) 1525 | fi 1526 | AC_CHECK_PROG(READLINK, [readlink], [yes], [no]) 1527 | if test "x${READLINK}" = "xno"; then 1528 | AC_MSG_FAILURE([readlink, which is a kafka-tests dependency, not found]) 1529 | fi 1530 | fi 1531 | PKG_CHECK_MODULES([LIBRDKAFKA], [librdkafka],, [ 1532 | AC_CHECK_LIB([rdkafka], [rd_kafka_produce], [ 1533 | AC_MSG_WARN([librdkafka is missing but library present, using -lrdkafka]) 1534 | LIBRDKAFKA_LIBS=-lrdkafka 1535 | ], [ 1536 | AC_MSG_ERROR([could not find rdkafka library]) 1537 | ]) 1538 | ]) 1539 | AC_CHECK_HEADERS([librdkafka/rdkafka.h]) 1540 | else 1541 | if test "x$enable_kafka_tests" = "xyes"; then 1542 | AC_MSG_ERROR([kafka-tests can not be enabled while omkafka is disabled]) 1543 | fi 1544 | fi 1545 | AM_CONDITIONAL(ENABLE_OMKAFKA, test x$enable_omkafka = xyes) 1546 | 1547 | #MONGODB SUPPORT 1548 | 1549 | AC_ARG_ENABLE(ommongodb, 1550 | [AS_HELP_STRING([--enable-ommongodb],[Compiles ommongodb module @<:@default=no@:>@])], 1551 | [case "${enableval}" in 1552 | yes) enable_ommongodb="yes" ;; 1553 | no) enable_ommongodb="no" ;; 1554 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-ommongodb) ;; 1555 | esac], 1556 | [enable_ommongodb=no] 1557 | ) 1558 | if test "x$enable_ommongodb" = "xyes"; then 1559 | PKG_CHECK_MODULES(LIBMONGO_CLIENT, libmongo-client >= 0.1.4) 1560 | fi 1561 | AM_CONDITIONAL(ENABLE_OMMONGODB, test x$enable_ommongodb = xyes) 1562 | # end of mongodb code 1563 | 1564 | # BEGIN ZMQ3 INPUT SUPPORT 1565 | AC_ARG_ENABLE(imzmq3, 1566 | [AS_HELP_STRING([--enable-imzmq3],[Compiles imzmq3 output module @<:@default=no@:>@])], 1567 | [case "${enableval}" in 1568 | yes) enable_imzmq3="yes" ;; 1569 | no) enable_imzmq3="no" ;; 1570 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imzmq3) ;; 1571 | esac], 1572 | [enable_imzmq3=no] 1573 | ) 1574 | if test "x$enable_imzmq3" = "xyes"; then 1575 | PKG_CHECK_MODULES(CZMQ, libczmq >= 1.1.0) 1576 | fi 1577 | AM_CONDITIONAL(ENABLE_IMZMQ3, test x$enable_imzmq3 = xyes) 1578 | 1579 | # END ZMQ3 INPUT SUPPORT 1580 | 1581 | # BEGIN CZMQ INPUT SUPPORT 1582 | AC_ARG_ENABLE(imczmq, 1583 | [AS_HELP_STRING([--enable-imczmq],[Compiles imczmq output module @<:@default=no@:>@])], 1584 | [case "${enableval}" in 1585 | yes) enable_imczmq="yes" ;; 1586 | no) enable_imczmq="no" ;; 1587 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-imczmq) ;; 1588 | esac], 1589 | [enable_imczmq=no] 1590 | ) 1591 | if test "x$enable_imczmq" = "xyes"; then 1592 | PKG_CHECK_MODULES(CZMQ, libczmq >= 3.0.0) 1593 | fi 1594 | AM_CONDITIONAL(ENABLE_IMCZMQ, test x$enable_imczmq = xyes) 1595 | 1596 | # END CZMQ INPUT 1597 | 1598 | # BEGIN ZMQ3 OUTPUT SUPPORT 1599 | AC_ARG_ENABLE(omzmq3, 1600 | [AS_HELP_STRING([--enable-omzmq3],[Compiles omzmq3 output module @<:@default=no@:>@])], 1601 | [case "${enableval}" in 1602 | yes) enable_omzmq3="yes" ;; 1603 | no) enable_omzmq3="no" ;; 1604 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omzmq3) ;; 1605 | esac], 1606 | [enable_omzmq3=no] 1607 | ) 1608 | if test "x$enable_omzmq3" = "xyes"; then 1609 | PKG_CHECK_MODULES(CZMQ, libczmq >= 1.1.0) 1610 | fi 1611 | AM_CONDITIONAL(ENABLE_OMZMQ3, test x$enable_omzmq3 = xyes) 1612 | 1613 | # END ZMQ3 SUPPORT 1614 | 1615 | # BEGIN CZMQ OUTPUT SUPPORT 1616 | AC_ARG_ENABLE(omczmq, 1617 | [AS_HELP_STRING([--enable-omczmq],[Compiles omczmq output module @<:@default=no@:>@])], 1618 | [case "${enableval}" in 1619 | yes) enable_omczmq="yes" ;; 1620 | no) enable_omczmq="no" ;; 1621 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omzmq3) ;; 1622 | esac], 1623 | [enable_omczmq=no] 1624 | ) 1625 | if test "x$enable_omczmq" = "xyes"; then 1626 | PKG_CHECK_MODULES(CZMQ, libczmq >= 3.0.0) 1627 | fi 1628 | AM_CONDITIONAL(ENABLE_OMCZMQ, test x$enable_omczmq = xyes) 1629 | 1630 | # END CZMQ SUPPORT 1631 | 1632 | 1633 | # BEGIN RABBITMQ OUTPUT SUPPORT 1634 | 1635 | AC_ARG_ENABLE(omrabbitmq, 1636 | [AS_HELP_STRING([--enable-omrabbitmq],[Compiles omrabbitmq output module @<:@default=no@:>@])], 1637 | [case "${enableval}" in 1638 | yes) enable_omrabbitmq="yes" ;; 1639 | no) enable_omrabbitmq="no" ;; 1640 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omrabbitmq) ;; 1641 | esac], 1642 | [enable_omrabbitmq=no] 1643 | ) 1644 | if test "x$enable_omrabbitmq" = "xyes"; then 1645 | PKG_CHECK_MODULES(RABBITMQ, librabbitmq >= 0.2.0) 1646 | AC_SUBST(RABBITMQ_CFLAGS) 1647 | AC_SUBST(RABBITMQ_LIBS) 1648 | fi 1649 | AM_CONDITIONAL(ENABLE_OMRABBITMQ, test x$enable_omrabbitmq = xyes) 1650 | 1651 | # END RABBITMQ SUPPORT 1652 | 1653 | # HIREDIS SUPPORT 1654 | 1655 | AC_ARG_ENABLE(omhiredis, 1656 | [AS_HELP_STRING([--enable-omhiredis],[Compiles omhiredis template module @<:@default=no@:>@])], 1657 | [case "${enableval}" in 1658 | yes) enable_omhiredis="yes" ;; 1659 | no) enable_omhiredis="no" ;; 1660 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omhiredis) ;; 1661 | esac], 1662 | [enable_omhiredis=no] 1663 | ) 1664 | # 1665 | if test "x$enable_omhiredis" = "xyes"; then 1666 | PKG_CHECK_MODULES(HIREDIS, hiredis >= 0.10.1, [], 1667 | [AC_SEARCH_LIBS(redisConnectWithTimeout, hiredis, 1668 | [AC_COMPILE_IFELSE( 1669 | [AC_LANG_PROGRAM( 1670 | [[ #include ]], 1671 | [[ #define major 0 1672 | #define minor 10 1673 | #define patch 1 1674 | #if (( HIREDIS_MAJOR > major ) || \ 1675 | (( HIREDIS_MAJOR == major ) && ( HIREDIS_MINOR > minor )) || \ 1676 | (( HIREDIS_MAJOR == major ) && ( HIREDIS_MINOR == minor ) && ( HIREDIS_PATCH >= patch ))) \ 1677 | /* OK */ 1678 | #else 1679 | # error Hiredis version must be >= major.minor.path 1680 | #endif 1681 | ]] 1682 | )], 1683 | [], 1684 | [AC_MSG_ERROR([hiredis version must be >= 0.10.1])] 1685 | )], 1686 | [AC_MSG_ERROR([hiredis not found])] 1687 | )] 1688 | ) 1689 | fi 1690 | AM_CONDITIONAL(ENABLE_OMHIREDIS, test x$enable_omhiredis = xyes) 1691 | 1692 | # END HIREDIS SUPPORT 1693 | 1694 | 1695 | # HTTPFS SUPPORT 1696 | 1697 | AC_ARG_ENABLE(omhttpfs, 1698 | [AS_HELP_STRING([--enable-omhttpfs],[Compiles omhttpfs template module @<:@default=no@:>@])], 1699 | [case "${enableval}" in 1700 | yes) enable_omhttpfs="yes" ;; 1701 | no) enable_omhttpfs="no" ;; 1702 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omhttpfs) ;; 1703 | esac], 1704 | [enable_omhttpfs=no] 1705 | ) 1706 | 1707 | if test "x$enable_omhttpfs" = "xyes"; then 1708 | AC_CHECK_HEADERS([curl/curl.h]) 1709 | PKG_CHECK_MODULES([CURL], [libcurl]) 1710 | LT_LIB_M 1711 | #PKG_CHECK_MODULES(HTTPFS, curl >= 7.0.0) 1712 | fi 1713 | AM_CONDITIONAL(ENABLE_OMHTTPFS, test x$enable_omhttpfs = xyes) 1714 | 1715 | # END HTTPFS SUPPORT 1716 | 1717 | # AMQP 1.0 PROTOCOL SUPPORT 1718 | # uses the Proton protocol library 1719 | 1720 | AC_ARG_ENABLE(omamqp1, 1721 | [AS_HELP_STRING([--enable-omamqp1],[Compiles omamqp1 output module @<:@default=no@:>@])], 1722 | [case "${enableval}" in 1723 | yes) enable_omamqp1="yes" ;; 1724 | no) enable_omamqp1="no" ;; 1725 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-omamqp1) ;; 1726 | esac], 1727 | [enable_omamqp1=no] 1728 | ) 1729 | if test "x$enable_omamqp1" = "xyes"; then 1730 | PKG_CHECK_MODULES(PROTON, libqpid-proton >= 0.9) 1731 | AC_SUBST(PROTON_CFLAGS) 1732 | AC_SUBST(PROTON_LIBS) 1733 | fi 1734 | AM_CONDITIONAL(ENABLE_OMAMQP1, test x$enable_omamqp1 = xyes) 1735 | 1736 | # END AMQP 1.0 PROTOCOL SUPPORT 1737 | 1738 | # man pages 1739 | AC_CHECKING([if required man pages already exist]) 1740 | have_to_generate_man_pages="no" 1741 | AC_ARG_ENABLE(generate-man-pages, 1742 | [AS_HELP_STRING([--enable-generate-man-pages],[Generate man pages from source @<:@default=no@:>@])], 1743 | [case "${enableval}" in 1744 | yes) have_to_generate_man_pages="yes" ;; 1745 | no) have_to_generate_man_pages="no" ;; 1746 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-generate-man-pages) ;; 1747 | esac], 1748 | [have_to_generate_man_pages=no] 1749 | ) 1750 | 1751 | 1752 | # This provides a work-around to use "make distcheck" by disabling 1753 | # some tests that do have problems with the distcheck environment. 1754 | AC_ARG_ENABLE(distcheck-workaround, 1755 | [AS_HELP_STRING([--enable-distcheck-workaround],[enable to use make distcheck by disabling some tests that do not support the distcheck environment @<:@default=no@:>@])], 1756 | [case "${enableval}" in 1757 | yes) enable_distcheck_workaround="yes" ;; 1758 | no) enable_distcheck_workaround="no" ;; 1759 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-distcheck_workaround) ;; 1760 | esac], 1761 | [enable_distcheck_workaround="no"] 1762 | ) 1763 | AM_CONDITIONAL(ENABLE_DISTCHECK_WORKAROUND, test x$enable_distcheck_workaround = xyes) 1764 | 1765 | 1766 | # Running from git source? 1767 | in_git_src=no 1768 | AS_IF([test -d "$srcdir"/.git && ! test -f "$srcdir"/.tarball-version], [in_git_src=yes]) 1769 | 1770 | if test "x$in_git_src" = "xyes"; then 1771 | AC_MSG_NOTICE([Running from git source]) 1772 | 1773 | have_to_generate_man_pages=yes 1774 | 1775 | if test "x$LEX" != "xflex"; then 1776 | AC_MSG_ERROR([flex program is needed to build rsyslog, please install flex.]) 1777 | fi 1778 | 1779 | if test "x$YACC" = "xyacc"; then 1780 | # AC_PROG_YACC only checks for yacc replacements, not for yacc itself 1781 | AC_CHECK_PROG([YACC_FOUND], [yacc], [yes], [no]) 1782 | if test "x$YACC_FOUND" = "xno"; then 1783 | AC_MSG_ERROR([A yacc program is needed to build rsyslog, please install bison.]) 1784 | fi 1785 | fi 1786 | else 1787 | AC_MSG_NOTICE([Not running from git source]) 1788 | fi 1789 | 1790 | AM_CONDITIONAL(ENABLE_GENERATE_MAN_PAGES, test x$have_to_generate_man_pages = xyes) 1791 | 1792 | # rst2man 1793 | AC_CHECK_PROGS([RST2MAN], [rst2man rst2man.py], [false]) 1794 | if test "x$have_to_generate_man_pages" = "xyes" && test "x$RST2MAN" = "xfalse"; then 1795 | AC_MSG_ERROR([rst2man is required when building from git source or --enable-generate-man-pages option was set, please install python-docutils.]) 1796 | fi 1797 | 1798 | 1799 | AC_CONFIG_FILES([Makefile \ 1800 | runtime/Makefile \ 1801 | compat/Makefile \ 1802 | grammar/Makefile \ 1803 | tools/Makefile \ 1804 | plugins/imudp/Makefile \ 1805 | plugins/imtcp/Makefile \ 1806 | plugins/im3195/Makefile \ 1807 | plugins/imgssapi/Makefile \ 1808 | plugins/imuxsock/Makefile \ 1809 | plugins/imjournal/Makefile \ 1810 | plugins/immark/Makefile \ 1811 | plugins/imklog/Makefile \ 1812 | plugins/omhdfs/Makefile \ 1813 | plugins/omkafka/Makefile \ 1814 | plugins/omprog/Makefile \ 1815 | plugins/mmexternal/Makefile \ 1816 | plugins/omstdout/Makefile \ 1817 | plugins/omjournal/Makefile \ 1818 | plugins/pmciscoios/Makefile \ 1819 | plugins/omruleset/Makefile \ 1820 | plugins/omuxsock/Makefile \ 1821 | plugins/imfile/Makefile \ 1822 | plugins/imsolaris/Makefile \ 1823 | plugins/imptcp/Makefile \ 1824 | plugins/impstats/Makefile \ 1825 | plugins/imrelp/Makefile \ 1826 | plugins/imdiag/Makefile \ 1827 | plugins/omtesting/Makefile \ 1828 | plugins/omgssapi/Makefile \ 1829 | plugins/ommysql/Makefile \ 1830 | plugins/ompgsql/Makefile \ 1831 | plugins/omrelp/Makefile \ 1832 | plugins/omlibdbi/Makefile \ 1833 | plugins/ommail/Makefile \ 1834 | plugins/omsnmp/Makefile \ 1835 | plugins/omudpspoof/Makefile \ 1836 | plugins/ommongodb/Makefile \ 1837 | plugins/mmnormalize/Makefile \ 1838 | plugins/mmjsonparse/Makefile \ 1839 | plugins/mmaudit/Makefile \ 1840 | plugins/mmanon/Makefile \ 1841 | plugins/mmutf8fix/Makefile \ 1842 | plugins/mmfields/Makefile \ 1843 | plugins/mmpstrucdata/Makefile \ 1844 | plugins/omelasticsearch/Makefile \ 1845 | plugins/mmsnmptrapd/Makefile \ 1846 | plugins/pmlastmsg/Makefile \ 1847 | contrib/pmsnare/Makefile \ 1848 | contrib/pmpanngfw/Makefile \ 1849 | contrib/pmaixforwardedfrom/Makefile \ 1850 | contrib/omhiredis/Makefile \ 1851 | contrib/omrabbitmq/Makefile \ 1852 | contrib/imkmsg/Makefile \ 1853 | contrib/mmgrok/Makefile \ 1854 | contrib/mmcount/Makefile \ 1855 | contrib/omzmq3/Makefile \ 1856 | contrib/omczmq/Makefile \ 1857 | contrib/imzmq3/Makefile \ 1858 | contrib/imczmq/Makefile \ 1859 | contrib/mmsequence/Makefile \ 1860 | contrib/mmdblookup/Makefile \ 1861 | contrib/mmrfc5424addhmac/Makefile \ 1862 | contrib/pmcisconames/Makefile \ 1863 | contrib/omhttpfs/Makefile \ 1864 | contrib/omamqp1/Makefile \ 1865 | tests/Makefile]) 1866 | AC_OUTPUT 1867 | 1868 | echo "****************************************************" 1869 | echo "rsyslog will be compiled with the following settings:" 1870 | echo 1871 | echo " Large file support enabled: $enable_largefile" 1872 | echo " Networking support enabled: $enable_inet" 1873 | echo " Regular expressions support enabled: $enable_regexp" 1874 | echo " rsyslog runtime will be built: $enable_rsyslogrt" 1875 | echo " rsyslogd will be built: $enable_rsyslogd" 1876 | echo " have to generate man pages: $have_to_generate_man_pages" 1877 | echo " Unlimited select() support enabled: $enable_unlimited_select" 1878 | echo " uuid support enabled: $enable_uuid" 1879 | echo " Log file signing support: $enable_guardtime" 1880 | echo " Log file signing support via KSI: $enable_gt_ksi" 1881 | echo " Log file encryption support: $enable_libgcrypt" 1882 | echo " anonymization support enabled: $enable_mmanon" 1883 | echo " message counting support enabled: $enable_mmcount" 1884 | echo " mmfields enabled: $enable_mmfields" 1885 | echo " liblogging-stdlog support enabled: $enable_liblogging_stdlog" 1886 | echo 1887 | echo "---{ input plugins }---" 1888 | echo " Klog functionality enabled: $enable_klog ($os_type)" 1889 | echo " /dev/kmsg functionality enabled: $enable_kmsg" 1890 | echo " plain tcp input module enabled: $enable_imptcp" 1891 | echo " imdiag enabled: $enable_imdiag" 1892 | echo " file input module enabled: $enable_imfile" 1893 | echo " Solaris input module enabled: $enable_imsolaris" 1894 | echo " periodic statistics module enabled: $enable_impstats" 1895 | echo " imzmq3 input module enabled: $enable_imzmq3" 1896 | echo " imczmq input module enabled: $enable_imczmq" 1897 | echo " imjournal input module enabled: $enable_imjournal" 1898 | echo 1899 | echo "---{ output plugins }---" 1900 | echo " Mail support enabled: $enable_mail" 1901 | echo " omkafka module will be compiled: $enable_omkafka" 1902 | echo " omprog module will be compiled: $enable_omprog" 1903 | echo " omstdout module will be compiled: $enable_omstdout" 1904 | echo " omjournal module will be compiled: $enable_omjournal" 1905 | echo " omhdfs module will be compiled: $enable_omhdfs" 1906 | echo " omelasticsearch module will be compiled: $enable_elasticsearch" 1907 | echo " omruleset module will be compiled: $enable_omruleset" 1908 | echo " omudpspoof module will be compiled: $enable_omudpspoof" 1909 | echo " omuxsock module will be compiled: $enable_omuxsock" 1910 | echo " omzmq3 module will be compiled: $enable_omzmq3" 1911 | echo " omczmq module will be compiled: $enable_omczmq" 1912 | echo " omrabbitmq module will be compiled: $enable_omrabbitmq" 1913 | echo " omhttpfs module will be compiled: $enable_omhttpfs" 1914 | echo " omamqp1 module will be compiled: $enable_omamqp1" 1915 | echo 1916 | echo "---{ parser modules }---" 1917 | echo " pmlastmsg module will be compiled: $enable_pmlastmsg" 1918 | echo " pmcisconames module will be compiled: $enable_pmcisconames" 1919 | echo " pmciscoios module will be compiled: $enable_pmciscoios" 1920 | echo " pmaixforwardedfrom module w.be compiled: $enable_pmaixforwardedfrom" 1921 | echo " pmsnare module will be compiled: $enable_pmsnare" 1922 | echo " pmpanngfw module will be compiled: $enable_pmpanngfw" 1923 | echo 1924 | echo "---{ message modification modules }---" 1925 | echo " mmnormalize module will be compiled: $enable_mmnormalize" 1926 | echo " mmjsonparse module will be compiled: $enable_mmjsonparse" 1927 | echo " mmgrok module will be compiled: $enable_mmgrok" 1928 | echo " mmjaduit module will be compiled: $enable_mmaudit" 1929 | echo " mmsnmptrapd module will be compiled: $enable_mmsnmptrapd" 1930 | echo " mmutf8fix enabled: $enable_mmutf8fix" 1931 | echo " mmrfc5424addhmac enabled: $enable_mmrfc5424addhmac" 1932 | echo " mmpstrucdata enabled: $enable_mmpstrucdata" 1933 | echo " mmsequence enabled: $enable_mmsequence" 1934 | echo " mmdblookup enabled: $enable_mmdblookup" 1935 | echo 1936 | echo "---{ database support }---" 1937 | echo " MySql support enabled: $enable_mysql" 1938 | echo " libdbi support enabled: $enable_libdbi" 1939 | echo " PostgreSQL support enabled: $enable_pgsql" 1940 | echo " mongodb support enabled: $enable_ommongodb" 1941 | echo " hiredis support enabled: $enable_omhiredis" 1942 | echo 1943 | echo "---{ protocol support }---" 1944 | echo " GnuTLS network stream driver enabled: $enable_gnutls" 1945 | echo " GSSAPI Kerberos 5 support enabled: $enable_gssapi_krb5" 1946 | echo " RELP support enabled: $enable_relp" 1947 | echo " SNMP support enabled: $enable_snmp" 1948 | echo 1949 | echo "---{ debugging support }---" 1950 | echo " Testbench enabled: $enable_testbench" 1951 | echo " Extended Testbench enabled: $enable_extended_tests" 1952 | echo " MySQL Tests enabled: $enable_mysql_tests" 1953 | echo " Kafka Tests enabled: $enable_kafka_tests" 1954 | echo " Debug mode enabled: $enable_debug" 1955 | echo " Runtime Instrumentation enabled: $enable_rtinst" 1956 | echo " (total) debugless mode enabled: $enable_debugless" 1957 | echo " Diagnostic tools enabled: $enable_diagtools" 1958 | echo " End-User tools enabled: $enable_usertools" 1959 | echo " Enhanced memory checking enabled: $enable_memcheck" 1960 | echo " Valgrind support settings enabled: $enable_valgrind" 1961 | echo 1962 | --------------------------------------------------------------------------------