77
82
pidfiledir=$with_pidfile_dir)
79
84
AC_ARG_WITH(module-dir,
80
[ --with-module-dir=path Use path as the list of directories looked up when searching for modules],
85
[ --with-module-dir=path Use path as the directory to install modules into],
81
86
moduledir=$with_module_dir)
88
AC_ARG_WITH(module-path,
89
[ --with-module-path=path Use path as the list of ':' separated directories looked up when searching for modules],
90
module_path=$with_module_path)
83
92
AC_ARG_WITH(timezone-dir,
84
93
[ --with-timezone-dir=path Use path as the directory to get the timezone files],
85
94
timezonedir=$with_timezone_dir)
96
AC_ARG_WITH(default-modules,
97
[ --with-default-modules="mod1,mod2,mod3" Use these as the list of automatically loaded modules],
98
default_modules=$with_default_modules, default_modules="auto")
87
100
AC_ARG_WITH(ld-library-path,
88
101
[ --with-ld-library-path=path Set LD_LIBRARY_PATH during runtime to the value given],
89
102
env_ld_library_path=$with_ld_library_path)
104
AC_ARG_WITH([systemdsystemunitdir],
105
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]))
91
107
AC_ARG_ENABLE(debug,
92
108
[ --enable-debug Enable debugging code.],, enable_debug="no")
143
159
[ --enable-gcov Enable coverage profiling (default: no)]
144
160
,,enable_gcov="no")
162
AC_ARG_ENABLE(mongodb,
163
[ --enable-mongodb Enable mongodb destination (default: auto)]
164
,,enable_mongodb="auto")
166
AC_ARG_WITH(libmongo-client,
167
[ --with-libmongo-client=[system/internal]
168
Link against the system supplied or the builting libmongo-client library.]
169
,,with_libmongo_client="internal")
172
[ --with-ivykis=[system/internal]
173
Link against the system supplied or the builting ivykis library.]
174
,,with_ivykis="internal")
177
[ --with-json=[json-c/json-glib/auto]
178
Use the JSON implementation specified]
182
[ --enable-json Enable support for JSON template formatting (default: auto)]
183
,,enable_json="auto")
146
185
AC_ARG_ENABLE(systemd,
147
186
[ --enable-systemd Enable systemd support (default: auto)]
148
187
,,enable_systemd="auto")
189
AC_ARG_WITH(compile-date,
190
[ --without-compile-date Do not include the compile date in the binary]
191
,wcmp_date="${withval}", wcmp_date="yes")
193
if test "x$wcmp_date" != "xno"; then
203
while test "x$OLD" != "x$NEW"
151
211
dnl ***************************************************************************
152
212
dnl Checks for programs.
533
603
dnl ***************************************************************************
604
dnl json headers/libraries
605
dnl ***************************************************************************
606
PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION,, JSON_C_LIBS="")
607
PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON_GLIB_MIN_VERSION,, JSON_GLIB_LIBS="")
609
dnl ***************************************************************************
534
610
dnl pcre headers/libraries
535
611
dnl ***************************************************************************
655
731
dnl ***************************************************************************
732
dnl ivykis headers/libraries
733
dnl ***************************************************************************
735
if test "x$with_ivykis" = "xinternal"; then
736
if test -f "$srcdir/lib/ivykis/lib/iv_main.c"; then
737
AC_CONFIG_SUBDIRS([lib/ivykis])
739
# these can only be used in lib as it assumes
740
# the current directory just one below ivykis
742
IVYKIS_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/lib -livykis -L\$(top_builddir)/lib/ivykis/modules -livykis-modules -Wl,--no-whole-archive"
743
IVYKIS_CFLAGS="-I\$(top_srcdir)/lib/ivykis/lib/include -I\$(top_builddir)/lib/ivykis/lib/include -I\$(top_srcdir)/lib/ivykis/modules/include"
744
IVYKIS_SUBDIRS=ivykis
746
# LIBS to use when libtool is not applicable (when linking the main syslog-ng executable in mixed linking mode)
747
IVYKIS_NO_LIBTOOL_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/lib/.libs -livykis -L\$(top_builddir)/lib/ivykis/modules/.libs -livykis-modules -Wl,--no-whole-archive"
749
AC_MSG_ERROR([Internal ivykis sources not found in lib/ivykis. This is a hard dependency, unable to build syslog-ng without them.])
753
PKG_CHECK_MODULES(IVYKIS, ivykis >= $IVYKIS_MIN_VERSION ivykis-modules,,)
755
# in case we're using a system installed ivykis, we can link against
756
# it even without libtool and without extra linker arguments (as
757
# we're linking dynamically)
759
IVYKIS_NO_LIBTOOL_LIBS="$IVYKIS_LIBS"
762
dnl ***************************************************************************
763
dnl libmongo headers/libraries
764
dnl ***************************************************************************
766
if test "x$with_libmongo_client" = "xinternal"; then
767
if test -f "$srcdir/modules/afmongodb/libmongo-client/src/mongo.h"; then
768
AC_CONFIG_SUBDIRS([modules/afmongodb/libmongo-client])
770
# these can only be used in modules/mongodb as it assumes
771
# the current directory just one below libmongo-client
773
LIBMONGO_LIBS="-L\$(builddir)/libmongo-client/src -lmongo-client"
774
LIBMONGO_CFLAGS="-I\$(srcdir)/libmongo-client/src"
775
LIBMONGO_SUBDIRS="libmongo-client"
777
AC_MSG_WARN([Internal libmongo-client sources not found in modules/afmongodb/libmongo-client])
778
with_libmongo_client="no"
780
elif test "x$with_libmongo_client" = "xsystem"; then
781
PKG_CHECK_MODULES(LIBMONGO, libmongo-client >= $LMC_MIN_VERSION,,with_libmongo_client="no")
784
if test "x$with_libmongo_client" = "xno"; then
788
dnl ***************************************************************************
656
789
dnl misc features to be enabled
657
790
dnl ***************************************************************************
705
838
AC_MSG_RESULT([$enable_linux_caps])
841
if test "x$enable_mongodb" = "xauto"; then
842
AC_MSG_CHECKING(whether to enable mongodb destination support)
843
if test "x$with_mongo_client" != "no"; then
848
AC_MSG_RESULT([$enable_mongodb])
851
if test "x$with_json" != "xjson-glib" -a "x$with_json" != "xjson-c" -a "x$with_json" != "xauto"; then
852
# unknown --with-json argument
854
AC_MSG_ERROR([Unknown JSON implementation ($with_json) specified, only json-glib, json-c and auto is known])
855
elif test \( "x$with_json" = "xauto" -o "x$with_json" = "xjson-c" \) -a -n "$JSON_C_LIBS" ; then
856
# json-c found and user requested json-c or auto
858
JSON_LIBS=$JSON_C_LIBS
859
JSON_CFLAGS=$JSON_C_CFLAGS
860
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [Have json-c])
862
elif test \( "x$with_json" = "xauto" -o "x$with_json" = "xjson-glib" \) -a -n "$JSON_GLIB_LIBS"; then
863
# json-glib found and user requested json-glib or auto
865
JSON_LIBS=$JSON_GLIB_LIBS
866
JSON_CFLAGS=$JSON_GLIB_CFLAGS
867
AC_DEFINE_UNQUOTED(HAVE_JSON_GLIB, 1, [Have json-glib])
868
with_json="json-glib"
870
elif test "x$with_json" = "xauto"; then
871
# nothing found, but autodetect was selected
876
elif test "x$with_json" = "xjson-glib"; then
877
AC_MSG_ERROR([Cannot find json-glib-1.0 >= $JSON_GLIB_MIN_VERSION: is pkg-config in path?])
878
elif test "x$with_json" = "xjson-c"; then
879
AC_MSG_ERROR([Cannot find json-c version >= $JSON_C_MIN_VERSION: is pkg-config in path?])
882
if test "x$enable_json" = "xauto"; then
883
if test "x$with_json" = "xno"; then
888
elif test "x$enable_json" = "xyes" -a "x$with_json" = "xno"; then
889
AC_MSG_ERROR([Cannot find json-c version >= $JSON_C_MIN_VERSION or json-glib-1.0 >= $JSON_GLIB_MIN_VERSION: is pkg-config in path?])
708
892
if test "x$enable_systemd" = "xauto"; then
709
893
if test "$ostype" = "Linux" -a "$blb_cv_c_so_acceptconn" = "yes"; then
710
894
enable_systemd=yes
712
896
enable_systemd=no
716
CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $EVTLOG_CFLAGS $PCRE_CFLAGS $OPENSSL_CFLAGS $LIBNET_CFLAGS $LIBDBI_CFLAGS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
901
if test "x$enable_systemd" = "xyes"; then
902
PKG_CHECK_MODULES(libsystemd_daemon, libsystemd-daemon >= 31,with_libsystemd="yes",with_libsystemd="no")
903
if test "x$with_systemdsystemunitdir" = "xyes"; then
904
# no arguments, just --with-systemdsystemunitdir
905
systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd);
906
if test "$systemdsystemunitdir" = ""; then
907
AC_MSG_ERROR([Error autodetecting systemdsystemunitdir, systemd pkg-config file not found?])
909
elif test "$systemdsystemunitdir" = "no"; then
910
# --without-systemdsystemunitdir was specified
911
systemdsystemunitdir=""
913
systemdsystemunitdir="$with_systemdsystemunitdir"
917
dnl ***************************************************************************
918
dnl default modules to be loaded
919
dnl ***************************************************************************
921
### The default set of modules are those that provide functionality that
922
### were provided in syslog-ng 3.2 and prior, unless explicitly overridden
925
### New plugins can be loaded by explicit "@module foo" lines in the
926
### configuration file, that's the preferred form.
928
if test "x$default_modules" = "xauto"; then
929
default_modules="affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat"
930
if test "x$enable_sql" = "xyes"; then
931
default_modules="$default_modules,afsql"
933
if test "x$enable_sun_streams" = "xyes"; then
934
default_modules="$default_modules,afstreams"
938
if test "x$module_path" = "x"; then
939
module_path="`patheval $moduledir`"
942
CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $EVTLOG_CFLAGS $PCRE_CFLAGS $OPENSSL_CFLAGS $LIBNET_CFLAGS $LIBDBI_CFLAGS $IVYKIS_CFLAGS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
718
944
########################################################
719
945
## NOTES: on how syslog-ng is linked
763
989
if test "x$linking_mode" = "xdynamic"; then
764
990
SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $DL_LIBS"
765
TOOL_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS"
766
CORE_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS"
992
if test "x$with_ivykis" = "xinternal"; then
993
# when using the internal ivykis, we're linking it statically into libsyslog-ng.so
995
TOOL_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS"
996
CORE_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS $IVYKIS_LIBS"
998
# otherwise everything needs to link against libivykis.so
1000
SYSLOGNG_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS $IVYKIS_LIBS"
1002
TOOL_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS"
1003
CORE_DEPS_LIBS="$SYSLOGNG_DEPS_LIBS"
768
1006
# syslog-ng binary is linked with the default link command (e.g. libtool)
769
1007
SYSLOGNG_LINK='$(LINK)'
771
SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $LD_START_STATIC -Wl,--whole-archive $GLIB_LIBS $EVTLOG_LIBS $PCRE_LIBS $REGEX_LIBS -Wl,--no-whole-archive $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS "
772
TOOL_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $DL_LIBS"
1009
SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $LD_START_STATIC -Wl,--whole-archive $GLIB_LIBS $EVTLOG_LIBS $PCRE_LIBS $REGEX_LIBS -Wl,--no-whole-archive $IVYKIS_NO_LIBTOOL_LIBS $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS "
1010
TOOL_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $IVYKIS_LIBS $DL_LIBS"
773
1011
CORE_DEPS_LIBS=""
775
1013
# bypass libtool in case we want to do mixed linking because it
808
1035
AC_DEFINE_UNQUOTED(PATH_SYSCONFDIR, "`patheval $sysconfdir`", [sysconfdir])
809
1036
AC_DEFINE_UNQUOTED(PATH_LOCALSTATEDIR, "`patheval $localstatedir`", [local state directory])
810
1037
AC_DEFINE_UNQUOTED(PATH_PIDFILEDIR, "`patheval $pidfiledir`", [local state directory])
811
AC_DEFINE_UNQUOTED(PATH_MODULEDIR, "`patheval $moduledir`", [module directory])
812
1038
AC_DEFINE_UNQUOTED(PATH_DATAROOTDIR, "`patheval $datarootdir`", [data root directory])
813
1039
AC_DEFINE_UNQUOTED(PATH_DATADIR, "`patheval $datadir`", [data directory])
814
1040
AC_DEFINE_UNQUOTED(PATH_LIBEXECDIR, "`patheval $libexecdir`", [libexec directory])
818
1044
if test -n "$env_ld_library_path"; then
819
1045
AC_DEFINE_UNQUOTED(ENV_LD_LIBRARY_PATH, "$env_ld_library_path", [set LD_LIBRARY_PATH to this value])
822
if test "x$enable_sql" = "xyes"; then
828
AC_DEFINE_UNQUOTED(ENABLE_THREADS, `enable_value $enable_threads`, [whether to enable threads support in the syslog-ng core])
1047
AC_DEFINE_UNQUOTED(MODULE_PATH, "$module_path", [module search path])
1048
AC_DEFINE_UNQUOTED(DEFAULT_MODULES, "$default_modules", [The default set of modules loaded if an old config version is used or autoload-compiled-modules is 1])
1050
AC_DEFINE_UNQUOTED(WITH_COMPILE_DATE, $wcmp_date, [Include the compile date in the binary])
829
1051
AC_DEFINE_UNQUOTED(ENABLE_DEBUG, `enable_value $enable_debug`, [Enable debugging])
1052
AC_DEFINE_UNQUOTED(ENABLE_SSL, `enable_value $enable_ssl`, [Enable SSL support])
830
1053
AC_DEFINE_UNQUOTED(ENABLE_GPROF, `enable_value $enable_gprof`, [Enable gcc profiling])
831
1054
AC_DEFINE_UNQUOTED(ENABLE_MEMTRACE, `enable_value $enable_memtrace`, [Enable memtrace])
832
1055
AC_DEFINE_UNQUOTED(ENABLE_SPOOF_SOURCE, `enable_value $enable_spoof_source`, [Enable spoof source support])
836
1059
AC_DEFINE_UNQUOTED(ENABLE_PCRE, `enable_value $enable_pcre`, [Enable PCRE support])
837
1060
AC_DEFINE_UNQUOTED(ENABLE_ENV_WRAPPER, `enable_value $enable_env_wrapper`, [Enable environment wrapper support])
838
1061
AC_DEFINE_UNQUOTED(ENABLE_SYSTEMD, `enable_value $enable_systemd`, [Enable systemd support])
840
AC_DEFINE_UNQUOTED(ENABLE_SSL_MODULE, `enable_value $enable_ssl`, [SSL was detected and compiled in the afsocket module])
841
AC_DEFINE_UNQUOTED(ENABLE_SQL_MODULE, `enable_value $enable_sql`, [SQL was compiled as a module])
842
AC_DEFINE_UNQUOTED(ENABLE_SUN_STREAMS_MODULE, `enable_value $enable_sun_streams`, [SUN STREAMS device support was compiled as a module])
843
AC_DEFINE_UNQUOTED(ENABLE_PACCT_MODULE, `enable_value $enable_pacct`, [Process accounting format (pacct) was compiled as a module])
1062
AC_DEFINE_UNQUOTED(WITH_LIBSYSTEMD, `enable_value $with_libsystemd`, [Compile with libsystemd-daemon])
845
1064
AM_CONDITIONAL(ENABLE_ENV_WRAPPER, [test "$enable_env_wrapper" = "yes"])
846
1065
AM_CONDITIONAL(ENABLE_SYSTEMD, [test "$enable_systemd" = "yes"])
1066
AM_CONDITIONAL(ENABLE_SYSTEMD_UNIT_INSTALL, [test "$systemdsystemunitdir" != ""])
847
1067
AM_CONDITIONAL(ENABLE_SSL, [test "$enable_ssl" = "yes"])
848
1068
AM_CONDITIONAL(ENABLE_SQL, [test "$enable_sql" = "yes"])
849
1069
AM_CONDITIONAL(ENABLE_SUN_STREAMS, [test "$enable_sun_streams" = "yes"])
850
1070
AM_CONDITIONAL(ENABLE_PACCT, [test "$enable_pacct" = "yes"])
1071
AM_CONDITIONAL(ENABLE_MONGODB, [test "$enable_mongodb" = "yes"])
1072
AM_CONDITIONAL(ENABLE_JSON, [test "$enable_json" = "yes"])
1073
AM_CONDITIONAL(WITH_LIBSYSTEMD, [test "$with_libsystemd" = "yes"])
852
1075
# substitution into manual pages
853
1076
expanded_sysconfdir=[`patheval $sysconfdir | sed -e 's/-/\\\\-/g'`]
1077
expanded_moduledir=[`patheval $moduledir`]
855
1079
AC_SUBST(timezonedir)
856
1080
AC_SUBST(pidfiledir)
857
1081
AC_SUBST(moduledir)
858
1082
AC_SUBST(expanded_sysconfdir)
1083
AC_SUBST(expanded_moduledir)
1084
AC_SUBST(systemdsystemunitdir)
859
1085
AC_SUBST(SYSLOGNG_LINK)
860
1086
AC_SUBST(SYSLOGNG_DEPS_LIBS)
861
1087
AC_SUBST(TOOL_DEPS_LIBS)
927
1157
echo " linker flags : $LDFLAGS $LIBS"
928
1158
echo " prefix : $prefix"
929
1159
echo " linking mode : $linking_mode"
1160
echo " __thread keyword : ${ac_cv_have_tls:=no}"
1162
echo " ivykis : $with_ivykis"
1163
echo " libmongo-client : $with_libmongo_client"
930
1164
echo " Features:"
931
echo " Sun STREAMS support (module): ${enable_sun_streams:=no}"
932
1165
echo " Debug symbols : ${enable_debug:=no}"
933
1166
echo " GCC profiling : ${enable_gprof:=no}"
934
1167
echo " Memtrace : ${enable_memtrace:=no}"
935
1168
echo " IPV6 support : ${enable_ipv6:=no}"
936
1169
echo " spoof-source support : ${enable_spoof_source:=no}"
937
1170
echo " tcp-wrapper support : ${enable_tcp_wrapper:=no}"
938
echo " SSL support (module) : ${enable_ssl:=no}"
939
echo " SQL support (module) : ${enable_sql:=no}"
940
1171
echo " Linux capability support : ${enable_linux_caps:=no}"
941
1172
echo " PCRE support : ${enable_pcre:=no}"
942
1173
echo " Env wrapper support : ${enable_env_wrapper:=no}"
943
echo " systemd support : ${enable_systemd:=no}"
1174
echo " systemd support : ${enable_systemd:=no} (unit dir: ${systemdsystemunitdir:=none})"
1176
echo " Module search path : ${module_path}"
1177
echo " Default module list : ${default_modules}"
1178
echo " Sun STREAMS support (module): ${enable_sun_streams:=no}"
1179
echo " SSL support (module) : ${enable_ssl:=no}"
1180
echo " SQL support (module) : ${enable_sql:=no}"
944
1181
echo " PACCT module (EXPERIMENTAL) : ${enable_pacct:=no}"
1182
echo " MongoDB destination (module): ${enable_mongodb:=no}"
1183
echo " JSON support (module) : ${enable_json:=no} (using ${with_json})"