-
Notifications
You must be signed in to change notification settings - Fork 28
/
configure.ac
300 lines (240 loc) · 10.5 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
dnl Process this file with autoconf to produce a configure script.
dnl
AC_PREREQ([2.68])
AC_INIT([syslog-ng-incubator], [0.6.2], [sasa@ubainba.hu])
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([config.h])
dnl ***************************************************************************
dnl definitions
moduledir='${exec_prefix}/lib/syslog-ng'
enable_value()
{
if test "x$1" = "xyes" ; then
echo 1
else
echo 0
fi
}
dnl ***************************************************************************
dnl dependencies
GLIB_MIN_VERSION="2.14"
SYSLOG_NG_MIN_VERSION="3.12.0"
IVYKIS_MIN_VERSION="0.30.0"
LMC_MIN_VERSION="0.1.2"
LRC_MIN_VERSION="1.0.0"
LUA_MIN_VERSION="5.1.4"
ZMQ_MIN_VERSION="3.1.1"
dnl ***************************************************************************
dnl Initial setup
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging code.],, enable_debug="no")
AC_ARG_WITH(module-dir,
[ --with-module-dir=path Use path as the list of directories looked up when searching for modules],
moduledir=$with_module_dir,moduledir="auto")
AC_ARG_WITH(ivykis,
[ --without-ivykis Build without explicitly linking to ivykis])
AC_ARG_ENABLE(luajit,
[ --enable-luajit Use luajit instead of standard liblua for Lua support],
enable_luajit="yes",)
AC_ARG_ENABLE(lua,
[ --disable-lua Disable lua based modules (lua-dest, monitoring source)],
,enable_lua="auto")
AC_ARG_ENABLE(perl,
[ --disable-perl Disable perl based modules (perl-dest)],
,enable_perl="auto")
AC_ARG_ENABLE(logmongource,
[ --disable-logmongource Disable logmongource tool],
,enable_logmongource="auto")
AC_ARG_ENABLE(kafka,
[ --disable-kafka Disable Kafka support (default: auto)]
,,enable_kafka="auto")
AC_ARG_WITH(librdkafka,
AC_HELP_STRING([--with-librdkafka=DIR],
[use librdkafka library from (prefix) directory DIR])
,,with_librdkafka="no")
AC_ARG_ENABLE(grok,
[ --disable-grok Disable Grok Parser support (default: auto)]
,,enable_grok="auto")
AC_ARG_WITH(libgrok,
AC_HELP_STRING([--with-libgrok=DIR],
[use libgrok library from (prefix) directory DIR])
,,with_libgrok="no")
AC_ARG_ENABLE(zmq,
[ --enable-zmq Enable zmq destination ],
,enable_zmq="auto")
dnl ***************************************************************************
dnl Checks for programs.
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CC_C99
AC_C_INLINE
LT_INIT([shared dlopen])
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
dnl ***************************************************************************
dnl Miscellanneous headers
dnl ***************************************************************************
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_FUNCS([floor memrchr memset strdup strtoll])
dnl ***************************************************************************
dnl Header checks
dnl ***************************************************************************
dnl ***************************************************************************
dnl Checks for libraries
dnl ***************************************************************************
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_MIN_VERSION)
dnl ***************************************************************************
dnl syslog-ng headers/libraries
dnl ***************************************************************************
PKG_CHECK_MODULES(SYSLOG_NG, syslog-ng >= $SYSLOG_NG_MIN_VERSION)
syslog_ng_ivykis=[`pkg-config syslog-ng --variable ivykis`]
if test "x$with_ivykis" != "xno" && test "x$syslog_ng_ivykis" != "xinternal"; then
PKG_CHECK_MODULES(IVYKIS, ivykis >= $IVYKIS_MIN_VERSION,,true)
fi
syslog_ng_tools=[`pkg-config syslog-ng --variable toolsdir`]
if test "x$moduledir" = "xauto"; then
moduledir=[`pkg-config syslog-ng --variable moduledir`]
fi
dnl ***************************************************************************
dnl libmongo-client headers/libraries
dnl ***************************************************************************
INCUBATOR_CHECK_DEP(logmongource,[PKG_CHECK_MODULES(LIBMONGO, libmongo-client >= $LMC_MIN_VERSION,,logmongource_found="no")])
dnl ***************************************************************************
dnl lua headers/libraries
dnl ***************************************************************************
dnl if test "x$enable_lua" != "xno"; then
INCUBATOR_CHECK_DEP(lua,[
if test "x$enable_luajit" == "xyes"; then
PKG_CHECK_EXISTS(luajit, [lua_mod="luajit"; LUA_MIN_VERSION="2.0"])
fi
if test "x$lua_mod" != "xluajit"; then
PKG_CHECK_EXISTS(lua, lua_mod="lua",
PKG_CHECK_EXISTS(lua5.2, lua_mod="lua5.2",
PKG_CHECK_EXISTS(lua-5.2, lua_mod="lua-5.2",
PKG_CHECK_EXISTS(lua5.1, lua_mod="lua5.1",
PKG_CHECK_EXISTS(lua-5.1, lua_mod="lua-5.1")))))
fi
PKG_CHECK_MODULES(LUA, $lua_mod >= $LUA_MIN_VERSION,,lua_found="no")])
dnl ***************************************************************************
dnl Perl checks
dnl ***************************************************************************
INCUBATOR_CHECK_DEP(perl,[
AC_CHECK_PROG(PERL, perl, perl)
if test "x$PERL" != "x"; then
AC_MSG_CHECKING(for perl module ExtUtils::Embed)
$PERL -e "use ExtUtils::Embed; exit" >/dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT(no)
perl_found="no"
else
AC_MSG_RESULT(ok)
fi
else
perl_found="no"
fi
if test "x$perl_found" != "xno"; then
LDFLAGS_SAVE="$LDFLAGS"
LDFLAGS="$LDFLAGS `$PERL -MExtUtils::Embed -e ldopts`"
AC_CHECK_LIB(perl, perl_construct, [true], perl_found="no")
LDFLAGS="$LDFLAGS_SAVE"
fi])
dnl ***************************************************************************
dnl grok headers/libraries
dnl ***************************************************************************
if test "x$enable_grok" != "xno"; then
grok="no"
if test "x$with_libgrok" != "xno"; then
GROK_LIBS="-L$with_libgrok"
GROK_CFLAGS="-I$with_libgrok"
grok="yes"
else
PKG_CHECK_MODULES(GROK, libgrok libtokyocabinet, grok="yes",
AC_CHECK_LIB(grok, grok_new, [grok="yes"; GROK_LIBS="-lgrok"], [grok="no"]))
fi
if test "x$enable_grok" = "xyes" && test "x$grok" = "xno"; then
AC_MSG_ERROR(libgrok not found)
fi
enable_grok=$grok
fi
dnl ***************************************************************************
dnl librdkafka headers/libraries
dnl ***************************************************************************
if test "x$enable_kafka" != "xno"; then
rdkafka="yes"
if test "x$with_librdkafka" != "xno"; then
CFLAGS_SAVE="$CFLAGS"
LDFLAGS_SAVE="$LDFLAGS"
CFLAGS="$CFLAGS -I$with_librdkafka/include"
LDFLAGS="$LDFLAGS -L$with_librdkafka/lib"
AC_CHECK_HEADER(librdkafka/rdkafka.h, [RDKAFKA_CFLAGS="-I$with_librdkafka/include"
RDKAFKA_LIBS="-L$with_librdkafka/lib -lrdkafka"], [rdkafka=no])
CFLAGS="$CFLAGS_SAVE"
LDFLAGS="$LDFLAGS_SAVE"
else
AC_CHECK_HEADER(librdkafka/rdkafka.h, [RDKAFKA_LIBS="-lrdkafka"], [rdkafka=no])
fi
if test "x$enable_kafka" = "xyes" && test "x$rdkafka" = "xno"; then
AC_MSG_ERROR(librdkafka not found)
fi
AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
if test "x$with_librdkafka_log_cb" = "xyes"; then
AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log_cb facility is present and usable.])
fi
if test "x$with_librdkafka_logger" = "xyes"; then
AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka logger facility is present and usable.])
fi
enable_kafka=$rdkafka
fi
dnl ***************************************************************************
dnl zmq headers/libraries
dnl ***************************************************************************
INCUBATOR_CHECK_DEP(zmq,[PKG_CHECK_MODULES(ZMQ_CLIENT, libzmq >= $ZMQ_MIN_VERSION, zmq_found="yes", zmq_found="no")])
dnl ***************************************************************************
dnl create common cflags/libs for incubator modules.
dnl ***************************************************************************
SYSLOG_NG_LIBDIR="`$PKG_CONFIG --variable=libdir syslog-ng`"
INCUBATOR_CFLAGS="$SYSLOG_NG_CFLAGS $IVYKIS_CFLAGS $GLIB_CFLAGS"
INCUBATOR_LIBS="$SYSLOG_NG_LIBS $IVYKIS_LIBS $GLIB_LIBS"
INCUBATOR_TEST_LDADD="$SYSLOG_NG_LIBDIR/syslog-ng/libtest/libsyslog-ng-test.a -rpath $SYSLOG_NG_LIBDIR"
dnl ***************************************************************************
dnl misc features to be enabled
dnl ***************************************************************************
AC_SUBST(syslog_ng_tools)
AC_SUBST(moduledir)
AC_SUBST(GROK_LIBS)
AC_SUBST(INCUBATOR_CFLAGS)
AC_SUBST(INCUBATOR_LIBS)
AC_SUBST(RDKAFKA_CFLAGS)
AC_SUBST(RDKAFKA_LIBS)
AC_SUBST(INCUBATOR_TEST_LDADD)
AC_SUBST(SYSLOG_NG_LIBDIR)
AC_DEFINE_UNQUOTED(ENABLE_DEBUG, `enable_value $enable_debug`, [Enable debugging])
AM_CONDITIONAL(ENABLE_LOGMONGOURCE, [test "$enable_logmongource" != "no"])
AM_CONDITIONAL(ENABLE_LUA, [test "$enable_lua" != "no"])
AM_CONDITIONAL(ENABLE_PERL, [test "$enable_perl" != "no"])
AM_CONDITIONAL(ENABLE_KAFKA, [test "x$enable_kafka" = "xyes"])
AM_CONDITIONAL(ENABLE_ZMQ, [test "$enable_zmq" != "no"])
AM_CONDITIONAL(ENABLE_GROK, [test "$enable_grok" != "no"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo
echo "syslog-ng Incubator $VERSION configured"
echo "syslog-ng Incubator $VERSION configured" | sed -e "s/./-/g"
echo " Debugging: ${enable_debug:=no}"
echo " Modules:"
echo " basicfuncs-plus yes"
echo " kafka ${enable_kafka:=no}"
echo " logmongource: ${enable_logmongource:-yes}"
echo " lua: ${enable_lua:-yes} ${lua_mod:+($lua_mod)}"
echo " monitor-source: ${enable_lua:-yes} ${lua_mod:+($lua_mod)}"
echo " perl: ${enable_perl:-yes}"
echo " rss yes"
echo " trigger-source yes"
echo " zmq ${enable_zmq:=no}"
echo " grok-parser ${enable_grok}"
echo