2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([rsyslog],[3.16.1],[rsyslog@lists.adiscon.com])
7 AC_CONFIG_SRCDIR([syslogd.c])
8 AC_CONFIG_HEADERS([config.h])
12 # Checks for programs.
15 if test "$GCC" = "yes"
16 then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
25 *-*-*darwin*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*)
26 AC_DEFINE([BSD], [1], [Description])
30 AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable])
32 # Checks for libraries.
35 AC_SEARCH_LIBS(clock_gettime, rt)
38 AC_SEARCH_LIBS(dlopen, dl)
45 # Checks for header files.
49 AC_CHECK_HEADERS([arpa/inet.h libgen.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 syslog.h unistd.h utmp.h])
51 # Checks for typedefs, structures, and compiler characteristics.
68 # include <sys/socket.h>
71 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[$sa_includes])
73 # Checks for library functions.
76 AC_PROG_GCC_TRADITIONAL
78 AC_FUNC_SELECT_ARGTYPES
83 AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r])
87 AC_ARG_ENABLE(largefile,
88 [AS_HELP_STRING([--enable-largefile],[Enable large file support @<:@default=yes@:>@])],
89 [case "${enableval}" in
90 yes) enable_largefile="yes" ;;
91 no) enable_largefile="no" ;;
92 *) AC_MSG_ERROR(bad value ${enableval} for --enable-largefile) ;;
94 [enable_largefile="yes"]
96 if test "$enable_largefile" = "no"; then
97 AC_DEFINE(NOLARGEFILE, 1, [Defined when large file support is disabled.])
100 # Regular expressions
101 AC_ARG_ENABLE(regexp,
102 [AS_HELP_STRING([--enable-regexp],[Enable regular expressions support @<:@default=yes@:>@])],
103 [case "${enableval}" in
104 yes) enable_regexp="yes" ;;
105 no) enable_regexp="no" ;;
106 *) AC_MSG_ERROR(bad value ${enableval} for --enable-regexp) ;;
110 AM_CONDITIONAL(ENABLE_REGEXP, test x$enable_regexp = xyes)
111 if test "$enable_regexp" = "yes"; then
112 AC_DEFINE(FEATURE_REGEXP, 1, [Regular expressions support enabled.])
117 [AS_HELP_STRING([--enable-zlib],[Enable zlib compression support @<:@default=yes@:>@])],
118 [case "${enableval}" in
119 yes) enable_zlib="yes" ;;
120 no) enable_zlib="no" ;;
121 *) AC_MSG_ERROR(bad value ${enableval} for --enable-zlib) ;;
125 if test "$enable_zlib" = "yes"; then
126 AC_CHECK_HEADER(zlib.h, [zlib_header="yes"], [zlib_header="no" enable_zlib="false"])
127 if test "$zlib_header" = "yes"; then
128 AC_CHECK_LIB(z, deflate,
129 [AC_DEFINE(USE_NETZIP, 1, [Define if you want to enable zlib support])
131 AC_SUBST(zlib_libs)], enable_zlib="false")
136 AC_ARG_ENABLE(gssapi_krb5,
137 [AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])],
138 [case "${enableval}" in
139 yes) want_gssapi_krb5="yes" ;;
140 no) want_gssapi_krb5="no" ;;
141 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gssapi-krb5) ;;
143 [want_gssapi_krb5=no]
145 if test $want_gssapi_krb5 = yes; then
146 AC_CHECK_LIB(gssapi_krb5, gss_acquire_cred, [
147 AC_CHECK_HEADER(gssapi/gssapi.h, [
148 AC_DEFINE(USE_GSSAPI,,
149 Define if you want to use GSSAPI)
150 gss_libs="-lgssapi_krb5"
155 AM_CONDITIONAL(ENABLE_GSSAPI, test x$want_gssapi_krb5 = xyes)
157 # multithreading via pthreads
158 AC_ARG_ENABLE(pthreads,
159 [AS_HELP_STRING([--enable-pthreads],[Enable multithreading via pthreads @<:@default=yes@:>@])],
160 [case "${enableval}" in
161 yes) enable_pthreads="yes" ;;
162 no) enable_pthreads="no" ;;
163 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pthreads) ;;
165 [enable_pthreads=yes]
168 if test "x$enable_pthreads" = "xno"; then
169 AC_MSG_ERROR(rsyslog v3 does no longer support single threading mode -- use a previous version for that);
172 if test "x$enable_pthreads" != "xno"; then
180 AC_DEFINE([USE_PTHREADS], [1], [Multithreading support enabled.])
181 pthreads_libs="-lpthread"
182 pthreads_cflags="-pthread"
183 AC_SUBST(pthreads_libs)
184 AC_SUBST(pthreads_cflags)
186 [AC_MSG_FAILURE([pthread is missing])],
190 [AC_MSG_FAILURE([pthread is missing])]
196 [AS_HELP_STRING([--enable-klog],[Integrated klog functionality @<:@default=yes@:>@])],
197 [case "${enableval}" in
198 yes) enable_klog="yes" ;;
199 no) enable_klog="no" ;;
200 *) AC_MSG_ERROR(bad value ${enableval} for --enable-klog) ;;
204 AM_CONDITIONAL(ENABLE_IMKLOGD, test x$enable_klog = xyes)
209 AC_MSG_CHECKING(for SYSLOG_UNIXAF support)
210 AC_ARG_ENABLE([unix],
211 [AS_HELP_STRING([--disable-unix], [Disable support for unix])],
213 if test "x${enableval}" = "xyes"; then
215 AC_DEFINE([SYSLOG_UNIXAF], [1], [Description])
223 AC_DEFINE([SYSLOG_UNIXAF], [1], [Description])
228 [AS_HELP_STRING([--enable-inet],[Enable networking support @<:@default=yes@:>@])],
229 [case "${enableval}" in
230 yes) enable_inet="yes" ;;
231 no) enable_inet="no" ;;
232 *) AC_MSG_ERROR(bad value ${enableval} for --enable-inet) ;;
236 AM_CONDITIONAL(ENABLE_INET, test x$enable_inet = xyes)
237 if test "$enable_inet" = "yes"; then
238 AC_DEFINE(SYSLOG_INET, 1, [network support is integrated.])
242 # The following define determines whether the package adheres to the
243 # file system standard.
245 AC_MSG_CHECKING(for FSSTND support)
246 AC_ARG_ENABLE([fsstnd],
247 [AS_HELP_STRING([--disable-fsstnd], [Disable support for FSSTND])],
249 if test "x${enableval}" = "xyes"; then
251 AC_DEFINE([FSSTND], [1], [Description])
259 AC_DEFINE([FSSTND], [1], [Description])
264 [AS_HELP_STRING([--enable-debug],[Enable debug mode @<:@default=no@:>@])],
265 [case "${enableval}" in
266 yes) enable_debug="yes" ;;
267 no) enable_debug="no" ;;
268 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
272 if test "$enable_debug" = "yes"; then
273 AC_DEFINE(DEBUG, 1, [Defined if debug mode is enabled (its easier to check).])
275 if test "$enable_debug" = "no"; then
276 AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
279 # runtime instrumentation
280 AC_ARG_ENABLE(rtinst,
281 [AS_HELP_STRING([--enable-rtinst],[Enable runtime instrumentation mode @<:@default=no@:>@])],
282 [case "${enableval}" in
283 yes) enable_rtinst="yes" ;;
284 no) enable_rtinst="no" ;;
285 *) AC_MSG_ERROR(bad value ${enableval} for --enable-rtinst) ;;
289 if test "$enable_rtinst" = "yes"; then
290 AC_DEFINE(RTINST, 1, [Defined if runtime instrumentation mode is enabled.])
294 AC_ARG_ENABLE(valgrind,
295 [AS_HELP_STRING([--enable-valgrind],[Enable valgrind support settings @<:@default=no@:>@])],
296 [case "${enableval}" in
297 yes) enable_valgrind="yes" ;;
298 no) enable_valgrind="no" ;;
299 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
301 [enable_valgrind="no"]
303 if test "$enable_valgrind" = "yes"; then
304 AC_DEFINE(VALGRIND, 1, [Defined if valgrind support settings are to be enabled (e.g. prevents dlclose()).])
311 [AS_HELP_STRING([--enable-mysql],[Enable MySql database support @<:@default=no@:>@])],
312 [case "${enableval}" in
313 yes) enable_mysql="yes" ;;
314 no) enable_mysql="no" ;;
315 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql) ;;
319 if test "x$enable_mysql" = "xyes"; then
322 [AC_MSG_FAILURE([MySQL is missing])]
329 if test "x${HAVE_MYSQL_CONFIG}" != "xyes"; then
330 AC_MSG_FAILURE([mysql_config not found in PATH])
335 [mysql_cflags=`mysql_config --cflags`
336 mysql_libs=`mysql_config --libs`
338 [AC_MSG_FAILURE([MySQL library is missing])],
339 [`mysql_config --libs`]
342 AM_CONDITIONAL(ENABLE_MYSQL, test x$enable_mysql = xyes)
343 AC_SUBST(mysql_cflags)
349 [AS_HELP_STRING([--enable-pgsql],[Enable PostgreSQL database support @<:@default=no@:>@])],
350 [case "${enableval}" in
351 yes) enable_pgsql="yes" ;;
352 no) enable_pgsql="no" ;;
353 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pgsql) ;;
357 if test "x$enable_pgsql" = "xyes"; then
363 if test "x${HAVE_PGSQL_CONFIG}" != "xyes"; then
364 AC_MSG_FAILURE([pg_config not found in PATH])
369 [pgsql_cflags="-I`pg_config --includedir`"
370 pgsql_libs="-L`pg_config --libdir` -lpq"
372 [AC_MSG_FAILURE([PgSQL library is missing])],
373 [-L`pg_config --libdir`]
376 AM_CONDITIONAL(ENABLE_PGSQL, test x$enable_pgsql = xyes)
377 AC_SUBST(pgsql_cflags)
382 AC_ARG_ENABLE(libdbi,
383 [AS_HELP_STRING([--enable-libdbi],[Enable libdbi database support @<:@default=no@:>@])],
384 [case "${enableval}" in
385 yes) enable_libdbi="yes" ;;
386 no) enable_libdbi="no" ;;
387 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libdbi) ;;
391 if test "x$enable_libdbi" = "xyes"; then
394 [AC_MSG_FAILURE([libdbi is missing])]
402 [AC_MSG_FAILURE([libdbi library is missing])]
407 [AC_DEFINE([HAVE_DBI_R], [1], [Define to 1 if libdbi supports the new plugin-safe interface])]
410 AM_CONDITIONAL(ENABLE_OMLIBDBI, test x$enable_libdbi = xyes)
411 AC_SUBST(libdbi_cflags)
412 AC_SUBST(libdbi_libs)
417 [AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])],
418 [case "${enableval}" in
419 yes) enable_snmp="yes" ;;
420 no) enable_snmp="no" ;;
421 *) AC_MSG_ERROR(bad value ${enableval} for --enable-snmp) ;;
425 if test "x$enable_snmp" = "xyes"; then
427 [net-snmp/net-snmp-config.h],,
428 [AC_MSG_FAILURE([Net-SNMP is missing])]
434 snmp_libs="-lnetsnmp"
436 [AC_MSG_FAILURE([Net-SNMP library is missing])]
439 AM_CONDITIONAL(ENABLE_SNMP, test x$enable_snmp = xyes)
440 AC_SUBST(snmp_cflags)
444 # support for NOT building rsyslogd (useful for source-based packaging systems)
445 AC_ARG_ENABLE(rsyslogd,
446 [AS_HELP_STRING([--enable-rsyslogd],[Build rsyslogd @<:@default=yes@:>@])],
447 [case "${enableval}" in
448 yes) enable_rsyslogd="yes" ;;
449 no) enable_rsyslogd="no" ;;
450 *) AC_MSG_ERROR(bad value ${enableval} for --enable-rsyslogd) ;;
452 [enable_rsyslogd=yes]
454 AM_CONDITIONAL(ENABLE_RSYSLOGD, test x$enable_rsyslogd = xyes)
459 [AS_HELP_STRING([--enable-relp],[Enable RELP support @<:@default=no@:>@])],
460 [case "${enableval}" in
461 yes) enable_relp="yes" ;;
462 no) enable_relp="no" ;;
463 *) AC_MSG_ERROR(bad value ${enableval} for --enable-relp) ;;
467 if test "x$enable_relp" = "xyes"; then
468 PKG_CHECK_MODULES(RELP, relp)
470 AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes)
471 AC_SUBST(RELP_CFLAGS)
475 # WARNING: THIS IS NOT REALLY PRESENT YET - needs to be build manually!
476 AC_ARG_ENABLE(rfc3195,
477 [AS_HELP_STRING([--enable-rfc3195],[Enable RFC3195 support @<:@default=no@:>@])],
478 [case "${enableval}" in
479 yes) enable_rfc3195="yes" ;;
480 no) enable_rfc3195="no" ;;
481 *) AC_MSG_ERROR(bad value ${enableval} for --enable-rfc3195) ;;
485 if test "x$enable_rfc3195" = "xyes"; then
488 [AC_MSG_FAILURE([RFC3195 library is missing (no headers)])]
490 # I don't know how to tell that librfc3195 needs -lrt, so I disable
491 # this check for now - the header check should work well enough...
492 # rgerhards, 2008-03-25
495 # [rfc3195EngineGetVersion],
497 rfc3195_libs="-lrfc3195"
499 # [AC_MSG_FAILURE([RFC3195 library is missing])]
502 AM_CONDITIONAL(ENABLE_RFC3195, test x$enable_rfc3195 = xyes)
503 AC_SUBST(rfc3195_cflags)
504 AC_SUBST(rfc3195_libs)
507 # settings for the template input module; copy and modify this code
508 # if you intend to add your own module. Be sure to replace imtemplate
509 # by the actual name of your module.
510 AC_ARG_ENABLE(imfile,
511 [AS_HELP_STRING([--enable-imfile],[file input module enabled @<:@default=no@:>@])],
512 [case "${enableval}" in
513 yes) enable_imfile="yes" ;;
514 no) enable_imfile="no" ;;
515 *) AC_MSG_ERROR(bad value ${enableval} for --enable-imfile) ;;
520 # you may want to do some library checks here - see snmp, mysql, pgsql modules
523 AM_CONDITIONAL(ENABLE_IMFILE, test x$enable_imfile = xyes)
525 AM_CONDITIONAL(ENABLE_IMTEMPLATE, test x$enable_imtemplate = xyes)
526 # end of copy template - be sure to serach for imtemplate to find everything!
527 # settings for the template input module; copy and modify this code
528 # if you intend to add your own module. Be sure to replace imtemplate
529 # by the actual name of your module.
530 AC_ARG_ENABLE(imtemplate,
531 [AS_HELP_STRING([--enable-imtemplate],[Compiles imtemplate template module @<:@default=no@:>@])],
532 [case "${enableval}" in
533 yes) enable_imtemplate="yes" ;;
534 no) enable_imtemplate="no" ;;
535 *) AC_MSG_ERROR(bad value ${enableval} for --enable-imtemplate) ;;
537 [enable_imtemplate=no]
540 # you may want to do some library checks here - see snmp, mysql, pgsql modules
543 AM_CONDITIONAL(ENABLE_IMTEMPLATE, test x$enable_imtemplate = xyes)
544 # end of copy template - be sure to serach for imtemplate to find everything!
547 AC_CONFIG_FILES([Makefile \
549 plugins/imudp/Makefile \
550 plugins/imtcp/Makefile \
551 plugins/imgssapi/Makefile \
552 plugins/imuxsock/Makefile \
553 plugins/immark/Makefile \
554 plugins/imklog/Makefile \
555 plugins/imtemplate/Makefile \
556 plugins/imfile/Makefile \
557 plugins/imrelp/Makefile \
558 plugins/omtesting/Makefile \
559 plugins/omgssapi/Makefile \
560 plugins/ommysql/Makefile \
561 plugins/ompgsql/Makefile \
562 plugins/omrelp/Makefile \
563 plugins/omlibdbi/Makefile \
564 plugins/omsnmp/Makefile])
567 echo "****************************************************"
568 echo "rsyslog will be compiled with the following settings:"
570 echo "Multithreading support enabled: $enable_pthreads"
571 echo "Klog functionality enabled: $enable_klog"
572 echo "Regular expressions support enabled: $enable_regexp"
573 echo "Zlib compression support enabled: $enable_zlib"
574 echo "MySql support enabled: $enable_mysql"
575 echo "libdbi support enabled: $enable_libdbi"
576 echo "PostgreSQL support enabled: $enable_pgsql"
577 echo "SNMP support enabled: $enable_snmp"
578 echo "RELP support enabled: $enable_relp"
579 echo "file input module enabled: $enable_imfile"
580 echo "input template module will be compiled: $enable_imtemplate"
581 echo "Large file support enabled: $enable_largefile"
582 echo "Networking support enabled: $enable_inet"
583 echo "Enable GSSAPI Kerberos 5 support: $want_gssapi_krb5"
584 echo "Debug mode enabled: $enable_debug"
585 echo "Runtime Instrumentation enabled: $enable_rtinst"
586 echo "valgrind support settings enabled: $enable_valgrind"
587 echo "rsyslogd will be built: $enable_rsyslogd"