forked from CAIDA/libbgpstream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
303 lines (251 loc) · 9.75 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
301
302
303
#
# Copyright (C) 2014 The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
AC_PREREQ([2.68])
# bgpstream package version
m4_define([PKG_MAJOR_VERSION], [2])
m4_define([PKG_MID_VERSION], [0])
m4_define([PKG_MINOR_VERSION], [0])
AC_INIT([libbgpstream], PKG_MAJOR_VERSION.PKG_MID_VERSION.PKG_MINOR_VERSION, [[email protected]])
# libbgpstream shared library version
# (no relation to pkg version)
# see https://www.gnu.org/software/libtool/manual/html_node/Versioning.html
# If changes break ABI compatability: CURRENT++, REVISION=0, AGE=0
# elseif changes only add to ABI: CURRENT++, REVISION=0, AGE++
# else changes do not affect ABI: REVISION++
LIBBGPSTREAM_SHLIB_CURRENT=3
LIBBGPSTREAM_SHLIB_REVISION=0
LIBBGPSTREAM_SHLIB_AGE=0
######################################################################
AM_INIT_AUTOMAKE([foreign])
LT_INIT
# Check if we should disable rpath.
#
# For advanced users: In certain configurations (e.g. when one of BGPStream's
# dependencies is located in a directory which also holds an old
# libbgpstream.so), the rpath attributes added by libtool cause problems with
# make check (or indeed with any non-installed binaries) as rpath will be
# preferred over LD_LIBRARY_PATH. This does not seem to be a problem with
# clang. When using --disable-rpath you will likely need to set LD_LIBRARY_PATH
# if you are using libraries in non-system locations. YMMV.
#
DISABLE_RPATH
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([lib/bgpstream.c])
AC_CONFIG_HEADERS([config.h])
# 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])
# 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])
fi
# Checks for typedefs, structures, and compiler characteristics.
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
# 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])
# Checks for mandatory libraries
# this code is needed to get the right threading library on a mac
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"
# check that wandio is installed and HTTP support is enabled
AC_CHECK_LIB([wandio], [http_open_hdrs], [],
[AC_MSG_ERROR(
[libwandio 4.2.0 or higher required (http://research.wand.net.nz/software/libwandio.php)]
)])
# build our bundled version of libparsebgp
AC_CONFIG_SUBDIRS([lib/formats/libparsebgp])
# Checks for doxygen
AC_CHECK_PROG([bgpstream_doxygen_avail], [doxygen], [yes], [no])
AC_MSG_CHECKING([whether to compile the docs])
AC_ARG_WITH([doxygen],
[AS_HELP_STRING([--without-doxygen],
[do not compile the doxygen generated docs])],
[bgpstream_doxygen=no],
[if test "x$bgpstream_doxygen_avail" == xyes; then
bgpstream_doxygen=yes
else
bgpstream_doxygen=no
fi
])
AC_MSG_RESULT([$bgpstream_doxygen])
AM_CONDITIONAL(HAS_DOXYGEN, [test x"$bgpstream_doxygen" = xyes])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([---- BGPStream configuration ----])
AC_MSG_NOTICE([checking format modules...])
# allow libparsebgp warnings to be silenced
AC_MSG_CHECKING([whether to enable libparsebgp warnings])
AC_ARG_ENABLE([parser-warnings],
[AS_HELP_STRING([--enable-parser-warnings],
[disable BGP parse warnings (def=no)])],
[enable_parser_warnings="$enableval"],
[enable_parser_warnings=no])
if test x"$enable_parser_warnings" == x"no"; then
AC_DEFINE([PARSEBGP_SILENCE_WARNING],[],[Disable parsebgp warnings])
fi
AC_MSG_RESULT([$enable_parser_warnings])
AC_MSG_NOTICE([checking transport modules...])
# shall we build with support for kafka-based resources?
AC_MSG_CHECKING([whether to build kafka support])
AC_ARG_WITH([kafka],
[AS_HELP_STRING([--without-kafka],
[do not compile support for kafka-based resources])],
[],
[with_kafka=yes])
AC_MSG_RESULT([$with_kafka])
AM_CONDITIONAL([WITH_KAFKA], [test "x$with_kafka" != xno])
if test x"$with_kafka" = xyes; then
# kafka support is requested, check for dependencies
CHECK_LIBRDKAFA_VERSION([0.11.0], [0x000b00ff])
AC_DEFINE([WITH_KAFKA],[1],[Building kafka support])
fi
AC_MSG_NOTICE([])
AC_MSG_NOTICE([checking data interfaces...])
BS_WITH_DI([bgpstream_broker],[broker],[BROKER],[yes])
BS_WITH_DI([bgpstream_singlefile],[singlefile],[SINGLEFILE],[yes])
BS_WITH_DI([bgpstream_kafka],[kafka],[KAFKA],[$with_kafka])
BS_WITH_DI([bgpstream_csvfile],[csvfile],[CSVFILE],[yes])
BS_WITH_DI([bgpstream_sqlite],[sqlite],[SQLITE],[no])
if test "x$bs_di_valid" != xyes; then
AC_MSG_ERROR([At least one data interface must be enabled])
fi
# check for data interface dependencies
AC_MSG_NOTICE([checking data interface dependencies...])
if test "x$with_di_broker" == xyes; then
CHECK_WANDIO_HTTP("https://broker.bgpstream.caida.org/v2/meta/projects")
fi
if test "x$with_di_kafka" == xyes; then
if test x"$with_kafka" != xyes; then
AC_MSG_ERROR([Kafka data interface requires Kafka support (--without-kafka to disable)])
fi
fi
if test "x$with_di_sqlite" == xyes; then
# check for sqlite library
AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], ,
[AC_MSG_ERROR( [libsqlite3 required for sqlite data interface])])
fi
# configure enabled data interfaces
AC_MSG_NOTICE([configuring data interface parameters...])
# broker options
if test "x$with_di_broker" == xyes; then
BS_DI_OPT(broker-url, BROKER_URL, Broker URL, https://broker.bgpstream.caida.org/v2)
AC_MSG_CHECKING([whether to enable broker debugging output])
AC_ARG_ENABLE([broker-debug],
[AS_HELP_STRING([--enable-broker-debug],
[enable broker debug info (def=no)])],
[broker_debug="$enableval"],
[broker_debug=no])
AC_MSG_RESULT([$broker_debug])
if test x"$broker_debug" = x"yes"; then
AC_DEFINE([BROKER_DEBUG],[],[Broker Debugging])
fi
fi
# singlefile options
if test "x$with_di_singlefile" == xyes; then
BS_DI_OPT(singlefile-rib-file, SINGLEFILE_RIB_FILE, RIB MRT file to read, not-set)
BS_DI_OPT(singlefile-upd-file, SINGLEFILE_UPDATE_FILE, Updates MRT to read, not-set)
fi
# sqlite options
if test "x$with_di_sqlite" == xyes; then
BS_DI_OPT(sqlite-db-file, SQLITE_DB_FILE, SQLite database, not-set)
fi
# csvfile options
if test "x$with_di_csvfile" == xyes; then
BS_DI_OPT(csvfile-csv-file, CSVFILE_CSV_FILE, CSV file listing the MRT data to read, not-set)
fi
# RPKI configuration (ROAFetchLib)
AC_MSG_NOTICE([])
AC_MSG_NOTICE([---- RPKI support configuration ----])
AC_ARG_WITH([rpki],
[AS_HELP_STRING([--with-rpki],
[bulding with rpki support])],
[],
[with_rpki=no])
AM_CONDITIONAL([WITH_RPKI], [test "x$with_rpki" != xno])
if test x"$with_rpki" = xyes; then
AC_CHECK_LIB([roafetch], [rpki_set_config],,
[AC_MSG_ERROR(
[ROAFetchlib is required (--without-rpki to disable)]
)])
AC_DEFINE([WITH_RPKI],[1],[Building with RPKI support])
AC_DEFINE([RPKI_BROKER],["https://roa-broker.imp.fu-berlin.de"],[RPKI broker])
else
AC_MSG_CHECKING([whether to build with RPKI support])
AC_MSG_RESULT([no])
fi
AC_HEADER_ASSERT
AC_SUBST([BGPSTREAM_MAJOR_VERSION], PKG_MAJOR_VERSION)
AC_SUBST([BGPSTREAM_MID_VERSION], PKG_MID_VERSION)
AC_SUBST([BGPSTREAM_MINOR_VERSION], PKG_MINOR_VERSION)
AC_SUBST([LIBBGPSTREAM_SHLIB_CURRENT])
AC_SUBST([LIBBGPSTREAM_SHLIB_REVISION])
AC_SUBST([LIBBGPSTREAM_SHLIB_AGE])
AC_CONFIG_FILES([Makefile
common/Makefile
common/libpatricia/Makefile
common/libinterval3/Makefile
common/libinterval3/rb_tree/Makefile
common/libcsv/Makefile
common/libjsmn/Makefile
docs/Makefile
docs/bgpstream.doxygen
lib/Makefile
lib/bgpstream.h
lib/datainterfaces/Makefile
lib/transports/Makefile
lib/formats/Makefile
lib/utils/Makefile
tools/Makefile
test/Makefile])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_OUTPUT