-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
244 lines (198 loc) · 8.09 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
#
# corsaro
#
# Alistair King, CAIDA, UC San Diego
#
# Copyright (C) 2012 The Regents of the University of California.
#
# This file is part of corsaro.
#
# corsaro is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# corsaro is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with corsaro. If not, see <http://www.gnu.org/licenses/>.
#
AC_INIT([corsaro], [3.4.1], [[email protected]])
AM_INIT_AUTOMAKE([foreign subdir-objects])
# update before each release according to the rules defined at
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
CORSARO_LIBTOOL_CURRENT=4
CORSARO_LIBTOOL_REVISION=2
CORSARO_LIBTOOL_AGE=0
AC_DEFINE_UNQUOTED([CORSARO_LIBTOOL_CURRENT],$CORSARO_LIBTOOL_CURRENT,
[corsaro libtool current])
AC_DEFINE_UNQUOTED([CORSARO_LIBTOOL_REVISION],$CORSARO_LIBTOOL_REVISION,
[corsaro libtool revision])
AC_DEFINE_UNQUOTED([CORSARO_LIBTOOL_AGE],$CORSARO_LIBTOOL_AGE,
[corsaro libtool age])
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([libcorsaro/libcorsaro_trace.c])
AC_CONFIG_HEADERS([config.h])
# Check for -fvisibility
gl_VISIBILITY
gcc_PACKED
gcc_DEPRECATED
gcc_UNUSED
gcc_PURE
gcc_FORMAT
# Check for gcc style TLS (__thread)
gcc_TLS
# Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CC_C99
AC_SYS_LARGEFILE
AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif])
AC_CHECK_FUNCS([gettimeofday memset strdup strstr strsep strlcpy vasprintf])
# OSX Mavericks has replaced strlcpy with a macro that is not found by
# AC_CHECK_FUNCS
AC_CHECK_DECLS([strlcpy])
# should we dump debug output to stderr and not optmize the build?
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])
if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AX_LIB_SOCKET_NSL
# figure out how to get pthreads linked correctly
STASH_CFLAGS="$CFLAGS"
CFLAGS=
AX_PTHREAD(, [AC_MSG_ERROR([pthreads required])])
CFLAGS="$STASH_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AC_ARG_ENABLE([tagger], AS_HELP_STRING([--disable-tagger],
[Disable building the corsarotagger application]))
# Checks for libraries.
AC_CHECK_LIB([trace], [libtrace_message_queue_put], ,[AC_MSG_ERROR(
[libtrace >= 4.0.6 required])])
AC_SEARCH_LIBS([yaml_parser_initialize], [yaml], ,[AC_MSG_ERROR(
[libyaml required]
)])
AC_SEARCH_LIBS([avro_generic_value_new], [avro], ,[AC_MSG_ERROR(
[libavro required]
)])
AC_SEARCH_LIBS([ipmeta_lookup_addr], [ipmeta], , [AC_MSG_ERROR([libipmeta 3.0.0 required])])
AC_SEARCH_LIBS([zmq_socket], [zmq], , [AC_MSG_ERROR([libzmq required])])
AC_SEARCH_LIBS([rd_kafka_new], [rdkafka], ,[AC_MSG_ERROR([librdkafka required])])
if test "x$enable_tagger" != "xno"; then
AC_SEARCH_LIBS([ndag_close_multicaster_socket], [ndagserver], ,[AC_MSG_ERROR([libndagserver required])])
fi
AC_SEARCH_LIBS([aio_return], [rt], ,[AC_MSG_ERROR([librt required])])
AC_SEARCH_LIBS([lrint], [m], ,[AC_MSG_ERROR([libm required])])
# TODO libtimeseries is not strictly required, so make this optional
AC_SEARCH_LIBS([timeseries_kp_flush], [timeseries], , [AC_MSG_ERROR([libtimeseries required])])
AC_CHECK_LIB([Judy], [JudyLGet],, [AC_MSG_ERROR([libJudy required])])
AC_SEARCH_LIBS([tc_version], [tcmalloc tcmalloc_minimal],
havetcmalloc=true, havetcmalloc=false)
if test "x$havetcmalloc" == xtrue; then
AC_DEFINE_UNQUOTED([HAVE_TCMALLOC], [1],
[tcmalloc is used for memory allocations])
TCMALLOC_FLAGS="-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
else
TCMALLOC_FLAGS=""
fi
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h inttypes.h limits.h math.h stdlib.h string.h \
time.h sys/time.h])
AC_CHECK_HEADERS(uthash.h, [uthash_h=true])
# monitor name
AC_MSG_CHECKING([for the monitor name to use])
AC_ARG_WITH([monitorname],
[AS_HELP_STRING([--with-monitorname=NAME],
[explicitly define the monitor name (defaults to system hostname)])],
[if test "x$withval" == xyes || test "x$withval" == ""; then
with_monitorname=`hostname`
else
with_monitorname=$withval
fi],
[with_monitorname=`hostname`])
AC_MSG_RESULT([$with_monitorname])
AC_DEFINE_UNQUOTED([CORSARO_MONITOR_NAME],[$with_monitorname],[Monitor Name])
################################################################################
# Plugin Configuration Macros #
# --------------------------- #
# #
# Each ED_WITH_PLUGIN macro defines a plugin which can be compiled into #
# Corsaro. #
# #
# The order in which these plugins are listed is the _default_ order in which #
# they will be run. #
################################################################################
ED_WITH_PLUGIN([corsaro_flowtuple],[flowtuple],[SIXT],[yes])
ED_WITH_PLUGIN([corsaro_dos],[dos],[DOS],[yes])
ED_WITH_PLUGIN([corsaro_report],[report],[REPORT],[yes])
ED_WITH_PLUGIN([corsaro_null],[null],[NULL],[yes])
# this MUST go after all the ED_WITH_PLUGIN macro calls
AC_DEFINE_UNQUOTED([ED_PLUGIN_INIT_ALL_ENABLED], $ED_PLUGIN_INIT_ALL_ENABLED,
[plugins to call the init macro for in corsaro_plugin.c])
#------------------------------------------------------------------------------#
# Extra tests or config needed for plugins should go below here #
#------------------------------------------------------------------------------#
if test "x$with_plugin_report" == xyes &&
test "x$uthash_h" != "xtrue"; then
AC_MSG_ERROR([corsaro_report plugin requires uthash headers])
fi
# the report plugin requires libtimeseries
# TODO: enable this when report plugin actually uses libtimeseries
#if test "x$with_plugin_report" == xyes; then
# AC_CHECK_LIB([timeseries], [timeseries_init], , [
# AC_MSG_ERROR([libtimeseries is required])
# ])
#fi
################################################################################
# END PLUGIN CONFIGURATION #
################################################################################
AC_HEADER_ASSERT
AC_SUBST([CORSARO_LIBTOOL_CURRENT])
AC_SUBST([CORSARO_LIBTOOL_REVISION])
AC_SUBST([CORSARO_LIBTOOL_AGE])
AC_SUBST([TCMALLOC_FLAGS])
AC_HEADER_ASSERT
AM_CONDITIONAL([BUILD_TAGGER], [test "x$enable_tagger" != "xno"])
AC_CONFIG_FILES([Makefile
libcorsaro/Makefile
libcorsaro/plugins/Makefile
libcorsaro/libcorsaro.h
corsarotrace/Makefile
corsarotagger/Makefile
corsarowdcap/Makefile
corsaroftmerge/Makefile
common/Makefile
common/libpatricia/Makefile
common/libinterval3/Makefile
common/libinterval3/rb_tree/Makefile
common/libcsv/Makefile
common/libjsmn/Makefile])
AC_OUTPUT