-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathconfigure.in
executable file
·751 lines (676 loc) · 20.4 KB
/
configure.in
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
AC_INIT([reconnoiter], [], [] [https://github.com/circonus-labs/reconnoiter])
AC_CONFIG_SRCDIR([src/noitd.c])
AC_CONFIG_AUX_DIR([.])
dedup_args() {
echo "$*" | tr '\n' ' ' | [gawk '!a[$$0]++' RS=' ' ORS=' '] | tr '\n' ' '
}
node=`hostname | cut -f1 -d '.' | tr '[A-Z]' '[a-z]'`
if test -f ".configure.$node"; then
echo "***********************************************************"
echo "* Loading node specific configure settings for $node."
echo "***********************************************************"
. ./.configure.$node
fi
AC_CANONICAL_HOST
AC_CONFIG_HEADER(src/noit_config.h)
AC_ARG_WITH([module-stomp],
AS_HELP_STRING([--without-module-stomp], [Do not build stomp]))
AC_ARG_ENABLE(strict,
[AC_HELP_STRING([--enable-strict],
[Compile with warnings treated as errors])],
enable_strict="$enableval",
enable_strict=no)
AC_ARG_ENABLE(lua,
[AC_HELP_STRING([--enable-lua],
[Choose a lua implementation: (no, lua52, LuaJIT)])],
enable_lua="$enableval",
enable_lua=LuaJIT)
if (test "$enable_lua" != "LuaJIT" && \
test "$enable_lua" != "lua52" && \
test "$enable_lua" != "no") ; then
AC_MSG_ERROR(Invalid value '$enable_lua' for --enable-lua)
fi
AC_PROG_CC
AX_CHECK_COMPILE_FLAG(-fexceptions, [ CFLAGS="$CFLAGS -fexceptions" ])
AC_PROG_CXX
AX_GCC_VERSION
GCC_VERSION_MAJOR=$(echo $GCC_VERSION | cut -d'.' -f1)
GCC_VERSION_MINOR=$(echo $GCC_VERSION | cut -d'.' -f2)
GCC_VERSION_PATCH=$(echo $GCC_VERSION | cut -d'.' -f3)
AC_C_INLINE
AC_C_BIGENDIAN
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(AR, ar)
AC_PATH_PROGS(PERL, perl)
AC_PATH_PROGS(XSLTPROC, xsltproc)
AC_PATH_PROGS(XMLLINT, xmllint)
AC_PATH_PROGS(JAVA, java)
AC_PATH_PROGS(JAVA, java, , $JAVA_HOME/bin)
AC_PATH_PROGS(JAVAC, javac)
AC_PATH_PROGS(JAVAC, javac, , $JAVA_HOME/bin)
AC_PATH_PROGS(JAR, jar)
AC_PATH_PROGS(JAR, jar, , $JAVA_HOME/bin)
AC_PATH_PROG(NROFF, nroff)
AC_PATH_PROG(CTFCONVERT, ctfconvert)
AC_PATH_PROG(CTFMERGE, ctfmerge)
AC_PATH_PROG(LUA, luajit)
AC_CHECK_PROG(FLATCC_CHECK,flatcc,yes)
if test x"$FLATCC_CHECK" != x"yes" ; then
AC_MSG_ERROR([*** flatcc is required for building. ***])
else
AC_PATH_PROG(FLATCC, flatcc)
fi
if test -z "$ac_cv_path_LUA"; then
AC_PATH_PROG(LUA, lua)
fi
ENABLE_LUA=$enable_lua
MAKE_CTESTS=1
MAPFLAGS=""
if test "x$GCC" = "xyes" ; then
DEPFLAGS="-MM"
else
DEPFLAGS="-xM1"
fi
if test "x$BUILD_ASAN" = "x" ; then
MTEV_CONFIG="mtev-config"
else
MTEV_CONFIG="mtev-config-asan"
fi
C99FLAG="-std=c99"
CFLAGS="$CFLAGS `$MTEV_CONFIG --cflags`"
WRONG_CFLAGS=$(echo $CFLAGS | [gawk '/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
CFLAGS=$(echo $CFLAGS | [gawk '!/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
CPPFLAGS="$CPPFLAGS $WRONG_CFLAGS `$MTEV_CONFIG --cppflags` -DOC_NEW_STYLE_INCLUDES -DOC_FACTOR_INTO_H_AND_CC"
MODULELD=`$MTEV_CONFIG --moduleld`
MODULECC=`$MTEV_CONFIG --cc`
MODULESHCFLAGS=`$MTEV_CONFIG --shcflags`
MODULESHCFLAGS="$MODULESHCFLAGS $CFLAGS"
MODULESHCFLAGS=$(echo $MODULESHCFLAGS | [gawk '!/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
MODULESHLDFLAGS=`$MTEV_CONFIG --shldflags`
MODULEEXT=`$MTEV_CONFIG --moduleext`
MODULES_DIR=`$MTEV_CONFIG --modules-dir`
NOIT_SYSCONFDIR=`$MTEV_CONFIG --sysconfdir`
SHLD=`$MTEV_CONFIG --shld`
SHCFLAGS=`$MTEV_CONFIG --shcflags`
SHCFLAGS="$SHCFLAGS $CFLAGS"
SHCFLAGS=$(echo $SHCFLAGS | [gawk '!/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
SHLDFLAGS="`$MTEV_CONFIG --shldflags` $LDFLAGS"
LD=`$MTEV_CONFIG --shld`
LDFLAGS="$LDFLAGS `$MTEV_CONFIG --ldflags`"
if test "x$MODULECXX" = "x" ; then
MODULECXX="$CXX"
else
MODULECXX="$MODULECXX"
fi
DTRACEHDR=dtrace_probes.h
DOTSO=.so
if test "x$BUILD_ASAN" = "x" ; then
LD_LIBNOIT_VERSION='-Wl,-soname,libnoit.so.$(LIBNOIT_VERSION)'
else
LD_LIBNOIT_VERSION='-Wl,-soname,libnoit-asan.so.$(LIBNOIT_VERSION)'
fi
MTEV_MODULES_DIR=`$MTEV_CONFIG --modules-dir 2>/dev/null`
if test "$?" -ne "0" ; then
AC_MSG_ERROR([*** $MTEV_CONFIG not found ***])
fi
MTEV_LIBDIR=`$MTEV_CONFIG --libdir 2>/dev/null`
if test "$?" -ne "0" ; then
AC_MSG_ERROR([*** $MTEV_CONFIG not found ***])
fi
MTEV_INCLUDEDIR=`$MTEV_CONFIG --includedir 2>/dev/null`
if test "$?" -ne "0" ; then
AC_MSG_ERROR([*** $MTEV_CONFIG not found ***])
fi
case $host in
*-*-darwin*)
CAP_PLATFORM="darwin"
DOTSO=
DOTDYLIB=dylib
DTRACE=/usr/sbin/dtrace
DTRACE_ENABLED=1
DOTDYLIB=.dylib
LD_LIBNOIT_VERSION='-current_version $(LIBNOIT_VERSION) -install_name $(libdir)/libnoit.$(LIBNOIT_VERSION).dylib'
;;
*-*-solaris*)
CAP_PLATFORM="illumos"
CAP_SUPPORTED=1
DTRACE=/usr/sbin/dtrace
DTRACE_ENABLED=1
DTRACEOBJ=dtrace_stub.o
DTRACEFLAGS=-64
MAPFLAGS="-Wl,-M -Wl,map64bit"
CLINKFLAGS="-shared-libgcc"
MDB_MODS=
MODULEEXT=so
WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
;;
*-*-linux*)
CAP_PLATFORM="linux"
;;
*-*-freebsd*)
CAP_PLATFORM="freebsd"
;;
*)
;;
esac
AC_DEFINE_UNQUOTED(CAP_PLATFORM, "$CAP_PLATFORM", [capabilities platform])
if test "x$CAP_SUPPORTED" = "x1" ; then
AC_DEFINE(CAP_SUPPORTED, [1], [capabilities supported])
fi
if test "x$DTRACE_ENABLED" = "x1" ; then
AC_DEFINE(DTRACE_ENABLED, [1], [DTrace enabled])
fi
AC_DEFINE_UNQUOTED(MODULEEXT, "$MODULEEXT", [module extension])
AC_MSG_CHECKING([enable build/install of the Jezebel bits])
LUA_MODULE=lua.$MODULEEXT
if test "$enable_lua" = "no"; then
LUA_MODULE=
fi
JEZEBEL_JAR_ENABLE="no"
if test -z "$ac_cv_path_JAVA" \
-o -z "$ac_cv_path_JAVAC" \
-o -z "$ac_cv_path_JAR" ; then
AC_MSG_RESULT([no])
else
if $ac_cv_path_JAVA -cp buildtools version 1.6 ; then
JAVAPARTS=java
AC_MSG_RESULT([yes])
JEZEBEL_JAR_ENABLE="yes"
else
JVERSION=`$ac_cv_path_JAVA -cp buildtools version 1.6`
AC_MSG_RESULT([too old: $JVERSION]);
fi
fi
# Checks for data types
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short int, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long int, 4)
AC_CHECK_SIZEOF(long long int, 8)
AC_CHECK_SIZEOF(void *, 1)
# Check for lua libraries
OLD_LIBS=$LIBS
LIBS=
if test "x$ENABLE_LUA" = "xLuaJIT"; then
AC_CHECK_LIB(luajit-5.1, luaL_newstate, [], [AC_MSG_ERROR(*** libluajit-5.1 required ***)])
elif test "x$ENABLE_LUA" = "xlua52"; then
AC_MSG_ERROR(*** liblua52 required ***)
fi
LUALIBS="$LUALIBS $LIBS"
LIBS=$OLD_LIBS
AC_CHECK_HEADER(mtev_config.h, [], [AC_MSG_ERROR(*** libmtev (headers) required ***)])
if test "x$BUILD_ASAN" = "x" ; then
AC_CHECK_LIB(mtev, mtev_main, , [AC_MSG_ERROR(*** libmtev is required ***)])
LMTEV="-lmtev"
else
AC_CHECK_LIB(mtev-asan, mtev_main, , [AC_MSG_ERROR(*** libmtev-asan is required ***)])
LMTEV="-lmtev-asan"
fi
AC_CHECK_LIB(circllhist, hist_alloc, , [AC_MSG_ERROR(*** libcircllhist is required ***)])
AC_CHECK_HEADER(ck_pr.h, [], [AC_MSG_ERROR(*** libck (headers) required ***)])
AC_CHECK_LIB(m, sqrt, , )
AC_CHECK_LIB(dl, dlsym, , )
AC_CHECK_LIB(ck, ck_ht_init, , [AC_MSG_ERROR(*** concurrencyckit (libck) is required ***)])
AC_CHECK_LIB(hwloc, hwloc_topology_init, , [AC_MSG_ERROR(*** libhwloc required ***)])
AC_CHECK_LIB(jlog, jlog_ctx_add_subscriber_copy_checkpoint, , [AC_MSG_ERROR(*** libjlog 2.0.2 or higher required github.com/omniti-labs/jlog ***)])
AC_CHECK_HEADER(udns.h, [], [AC_MSG_ERROR(*** udns.h required ***)])
AC_CHECK_LIB(udns, dns_new, [], [AC_MSG_ERROR(*** libudns required ***)])
AC_CHECK_LIB(umem, umem_cache_create, , )
AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, ,
[AC_MSG_ERROR(libprotobuf-c required)])
AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
AC_CHECK_LIB(m, sqrt, , )
AC_CHECK_LIB(rt, sem_init, , [
AC_CHECK_LIB(rt, clock_gettime, , )
])
AC_CHECK_LIB(posix4, sem_wait, , )
AC_CHECK_LIB(pthread, pthread_create, , )
AC_CHECK_LIB(flatccrt, flatcc_builder_init, , )
AC_CHECK_HEADER(curl/curl.h, [], [AC_MSG_ERROR(*** curl headers required ***)])
AC_CHECK_LIB(curl, curl_easy_init, , [AC_MSG_ERROR(*** curl is required ***)])
AC_CHECK_LIB(snappyc, snappy_uncompress, , [AC_MSG_ERROR(*** libsnappy is required ***)])
if test "x$BUILD_ASAN" = "x" ; then
AC_CHECK_LIB(lmdb, mdb_dbi_open, , [AC_MSG_ERROR(*** lmdb is required ***)])
else
AC_CHECK_LIB(lmdb-asan, mdb_dbi_open, , [AC_MSG_ERROR(*** lmdb-asan is required ***)])
fi
AC_CHECK_LIB(crypto, ERR_load_CRYPTO_strings, ,
[
AC_MSG_ERROR([libcrypto not found, but required])
]
)
CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
LIBS="$LIBS `pcre-config --libs`"
AC_CHECK_LIB(pcre, pcre_compile, ,
[
AC_MSG_ERROR([libpcre not found, but required])
]
)
AC_CHECK_LIB(circllhist, hist_alloc, ,
[
AC_MSG_ERROR([libcircllhist not found, but required])
]
)
AC_MSG_CHECKING([libxml2 cflags])
XML2CFLAGS=`xml2-config --cflags`
XML2CPPFLAGS=$(echo "$XML2CFLAGS" | [gawk '/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
XML2CFLAGS=$(echo "$XML2CFLAGS" | [gawk '!/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
CFLAGS=$(dedup_args "$CFLAGS $XML2CFLAGS")
CPPFLAGS=$(dedup_args "$CPPFLAGS $XML2CPPFLAGS")
AC_MSG_RESULT([$XML2CFLAGS])
AC_MSG_CHECKING([libxml2 cppflags])
AC_MSG_RESULT([$XML2CPPFLAGS])
AC_MSG_CHECKING([libxml2 libs])
XML2LIBS=`xml2-config --libs`
LIBS="$LIBS $XML2LIBS"
AC_MSG_RESULT([$XML2LIBS])
AC_CHECK_FUNC(xmlParseDocument, , [AC_MSG_ERROR(*** libxml2 is required ***)])
AC_MSG_CHECKING([libxslt cflags])
XSLTCFLAGS=`xslt-config --cflags`
XSLTCPPFLAGS=$(echo "$XSLTCFLAGS" | [gawk '/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
XSLTCFLAGS=$(echo "$XSLTCFLAGS" | [gawk '!/^-[ID]/' RS=' ' ORS=' '] | tr '\n' ' ')
CFLAGS=$(dedup_args "$CFLAGS $XSLTCFLAGS")
CPPFLAGS=$(dedup_args "$CPPFLAGS $XSLTCPPFLAGS")
AC_MSG_RESULT([$XSLTCFLAGS])
AC_MSG_CHECKING([libxslt cppflags])
AC_MSG_RESULT([$XSLTCPPFLAGS])
AC_MSG_CHECKING([libxslt libs])
XSLTLIBS=`xslt-config --libs`
LIBS="$LIBS $XSLTLIBS"
AC_MSG_RESULT([$XSLTLIBS])
AC_CHECK_FUNC(xsltParseStylesheetDoc, , [AC_MSG_ERROR(*** libxslt is required ***)])
old_LIBS="$LIBS"
LIBS=""
AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, ,
[AC_MSG_ERROR(libprotobuf-c required)])
AC_CHECK_LIB(z, compress2, , [AC_MSG_ERROR(*** zlib is required ***)])
LIBNOIT_LIBS=$LIBS
LIBS="$old_LIBS"
old_LIBS="$LIBS"
LIBS=
AC_CHECK_LIB(yajl, yajl_version,
[
YAJLLIBS="$LIBS -lyajl"
],
[ AC_MSG_ERROR([libyajl is required for collectd and httptrap modules]) ])
LIBS=$old_LIBS
old_LIBS="$LIBS"
old_CFLAGS="$CFLAGS"
AC_CHECK_LIB(pq, PQconnectdb,
[
LIBS="$LIBS -lpq"
PGLIBS="$LIBS"
AC_MSG_RESULT([yes])
],
[
AC_MSG_WARN([libpq is highly recommended and needed for the test suite])
]
)
AC_MSG_CHECKING([libpq includes])
PQICFLAGS=`pg_config --includedir`
if test -n "$PQICFLAGS" ; then
CFLAGS="$CFLAGS -I$PQICFLAGS"
fi
POSTGRES_INGESTOR_MODULE="no"
AC_TRY_LINK([
#include <libpq-fe.h>
],
[ PGconn *dbh = PQconnectdb(""); (void)dbh; ],
[
BUILD_SMODULES="$BUILD_SMODULES postgres_ingestor.$MODULEEXT"
POSTGRES_INGESTOR_MODULE="yes"
AC_MSG_RESULT([yes])
],
[
AC_MSG_WARN([Cannot compile/link against libpq])
]
)
PGCFLAGS=$CFLAGS
LIBS=$old_LIBS
CFLAGS=$old_CFLAGS
AC_LANG_PUSH([C++])
old_LIBS=$LIBS
AC_CHECK_LIB(resolv, inet_net_pton)
AC_CHECK_LIB(socket, getaddrinfo)
AC_MSG_CHECKING([can link pickletools])
LIBS="$LIBS -lptools"
AC_TRY_LINK([
#pragma GCC diagnostic push
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wmismatched-tags"
#pragma GCC diagnostic ignored "-Wdeprecated-register"
#endif
#if defined(__clang__) || __GNUC__ >= 6
#pragma GCC diagnostic ignored "-Wshift-negative-value"
#endif
#if defined(__clang__) || __GNUC__ >= 5
#pragma GCC diagnostic ignored "-Wlogical-not-parentheses"
#endif
#include "pickleloader.h"
#pragma GCC diagnostic pop
],
[
Val result;
PickleLoader pl("",0);
pl.loads(result);
],
[ AC_MSG_RESULT([works]) ],
[ AC_MSG_ERROR([failed]) ])
PTOOLSLIBS="$LIBS"
LIBS="$old_LIBS"
AC_LANG_POP([C++])
AC_CHECK_HEADERS(gcrypt.h)
AC_CHECK_HEADERS(mysql.h mysql/mysql.h)
########
#
# CHECK FOR VARIOUS MODULE CRITERIA
# We don't track the libs themselves, as we'll just explictly link
# against the in the makefile if we enable them to build (by adding
# them to the BUILD_MODULES list).
#
########
# Should we build snmp checks?
SNMP_MODULE="no"
HAS_NETSNMP="no"
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
if test "$ac_cv_header_net_snmp_net_snmp_config_h" = "yes" ; then
SAVELIBS="$LIBS"
AC_CHECK_LIB(netsnmp-c, snmp_sess_open_C1,
[
BUILD_MODULES="$BUILD_MODULES snmp.$MODULEEXT"
HAS_NETSNMP="yes"
SNMP_MODULE="yes"
LIBNETSNMP="netsnmp-c"
],
[
AC_CHECK_LIB(netsnmp, snmp_sess_open,
[
HAS_NETSNMP="yes"
SNMP_MODULE="no"
AC_MSG_WARN([*** snmp C implementation requires libnetsnmp-c ***])
LIBNETSNMP="netsnmp"
]
)
]
)
LIBS="$SAVELIBS"
fi
FQ_DRIVER_MODULE="no"
SAVELIBS="$LIBS"
HAS_LIBFQ="no"
AC_CHECK_LIB(fq, fq_client_init,
[
BUILD_SMODULES="$BUILD_SMODULES fq_driver.$MODULEEXT"
HAS_LIBFQ="yes"
FQ_DRIVER_MODULE="yes"
]
)
LIBS="$SAVELIBS"
if test "x$HAS_NETSNMP" = "xno"; then
AC_MSG_WARN([No libnetsnmp, skipping snmp module])
if test -n "$LUA_MODULE"; then
AC_MSG_WARN([*** lua specified, but no SNMP (things will get weird) ***])
fi
else
AC_DEFINE(HAVE_NETSNMP, [1], [libnetsnmp])
fi
STOMP_DRIVER_MODULE="no"
AS_IF([test "x$with_module_stomp" != "xno"],
[
AC_MSG_CHECKING([apr-1-config for needed for stomp support])
APRPREFIX=`apr-1-config --prefix`
if test $? -eq "0"; then
BUILD_SMODULES="$BUILD_SMODULES stomp_driver.$MODULEEXT"
STOMP_DRIVER_MODULE="yes"
fi
AC_MSG_RESULT([$APRPREFIX])
AC_MSG_CHECKING([libapr cflags])
APRCFLAGS="`apr-1-config --cflags`"
AC_MSG_RESULT([$APRCFLAGS])
AC_MSG_CHECKING([libapr cppflags])
APRCPPFLAGS="`apr-1-config --cppflags --includes`"
AC_MSG_RESULT([$APRCPPFLAGS])
AC_MSG_CHECKING([libapr libs])
APRLIBS="`apr-1-config --link-ld --ldflags --libs`"
AC_MSG_RESULT([$APRLIBS])
],
[STOMP_DRIVER_MODULE=no])
# gRPC support for OpenTelemetry module
HAS_GRPC="no"
GRPCLIB=""
AC_CHECK_LIB(grpc++, stat,
[
AC_MSG_CHECKING([if gRPC version >= 1.55.0])
AC_RUN_IFELSE(
[
AC_LANG_SOURCE([[
#include <stdlib.h>
#include <grpcpp/version_info.h>
int main() {
if (GRPC_CPP_VERSION_MAJOR >= 1 && GRPC_CPP_VERSION_MINOR >= 55) {
exit(0);
} else {
exit(1);
}
}
]])
],
[
HAS_GRPC="yes"
GRPCLIB="-lgrpc++"
AC_MSG_RESULT([$HAS_GRPC])
AC_DEFINE(HAVE_GRPC, [1], [grpc++])
],
[
AC_MSG_RESULT([$HAS_GRPC])
AC_MSG_WARN([gRPC found, but version is too old. OpenTelemetry gRPC support requires 1.55.0 or newer])
]
)
],
[
AC_MSG_WARN([gRPC not detected, OpenTelemetry support will be limited to HTTP transport])
]
)
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(ssetugid strlcpy openpty inet_pton inet_ntop getopt \
poll vasprintf strlcat)
BUILD_MODULES="$BUILD_MODULES $LUA_MODULE"
docdir="docs"
mansubdir="man"
SUBPREFIX="$prefix"
if test "x$prefix" = "xNONE"; then
SUBPREFIX="$ac_default_prefix"
fi
AC_MSG_CHECKING([Resolving libexec path...])
fullpath=$libexecdir
while test "x$temppath" != "x$fullpath" ; do
temppath=$fullpath
fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
AC_MSG_RESULT([$fullpath/noit])
AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit", [modules directory])
MODULES_DIR=${fullpath}/noit
AC_MSG_CHECKING([Resolving lib path...])
fullpath=$libdir
while test "x$temppath" != "x$fullpath" ; do
temppath=$fullpath
fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
AC_MSG_RESULT([$fullpath])
AC_DEFINE_UNQUOTED(LIB_DIR, "${fullpath}", [library directory])
JAVA_LIB_DIR="$prefix/java"
AC_ARG_WITH(java-libdir,
[--with-javalibdir=PFX prefix to install java libs (optional)],
[JAVA_LIB_DIR=$withval],)
AC_MSG_CHECKING([Resolving javalibdir path...])
fullpath=$JAVA_LIB_DIR
while test "x$temppath" != "x$fullpath" ; do
temppath=$fullpath
fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
JAVA_LIB_DIR=$fullpath
AC_MSG_RESULT([$fullpath])
AC_MSG_CHECKING([Resolving sysconfdir path...])
fullpath=$sysconfdir
while test "x$temppath" != "x$fullpath" ; do
temppath=$fullpath
fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$SUBPREFIX~"`
AC_MSG_RESULT([$fullpath])
AC_DEFINE_UNQUOTED(ETC_DIR, "${fullpath}", [config directory])
ETC_DIR=${fullpath}
if test -n "`$CC -V 2>&1 | grep 'Sun C'`"; then
if test "$enable_string" != "no"; then
CFLAGS="$CFLAGS -errwarn=%all"
fi
else
CFLAGS="$CFLAGS -Wall"
SHCFLAGS="$SHCFLAGS -Wall"
if test "$enable_strict" != "no"; then
CFLAGS="$CFLAGS -Werror"
SHCFLAGS="$SHCFLAGS -Werror"
fi
fi
CPPFLAGS=$(dedup_args "$CPPFLAGS")
CFLAGS=$(dedup_args "$CFLAGS")
AC_MSG_RESULT([SHCFLAGS $SHCFLAGS])
SHCFLAGS=$(dedup_args $SHCFLAGS)
AC_MSG_RESULT([SHCFLAGS $SHCFLAGS])
MODULESHCFLAGS=$(dedup_args $MODULESHCFLAGS)
FOO=$(echo $CFLAGS | [sed -e "s/ ${C99FLAG}//g" -e 's/ -[^mgIW][^ ]*/ /g'] | [gawk '!a[$$0]++' RS=' ' ORS=' '] | tr '\n' ' ')
CXXFLAGS="$CXXFLAGS $FOO -std=c++17"
CXXFLAGS=$(dedup_args $CXXFLAGS)
FOO=$(echo $SHCFLAGS | [sed -e "s/ ${C99FLAG}//g" -e 's/ -[^mgIW][^ ]*/ /g'] | [gawk '!a[$$0]++' RS=' ' ORS=' '] | tr '\n' ' ')
SHCXXFLAGS="$SHCXXFLAGS $FOO -std=c++17"
SHCXXFLAGS=$(dedup_args $SHCXXFLAGS)
FOO=$(echo $MODULESHCFLAGS | [sed -e "s/ ${C99FLAG}//g" -e 's/ -[^mgIW][^ ]*/ /g'] | [gawk '!a[$$0]++' RS=' ' ORS=' '] | tr '\n' ' ')
MODULESHCXXFLAGS="$MODULESHCXXFLAGS $FOO -std=c++17"
MODULESHCXXFLAGS=$(dedup_args $MODULESHCXXFLAGS)
LUACFLAGS=`echo $CFLAGS | sed -e "s#${C99FLAG}##g; s#-mt##g; s#-errwarn=%all##g;"`
if echo "$MODULECC" | grep -q '^gcc' ; then
MODULESHCFLAGS="$MODULESHCFLAGS -Wno-stringop-overflow -Wno-stringop-overread"
fi
if echo "$MODULECXX" | grep -q '^g\+\+' ; then
MODULESHCXXFLAGS="$MODULESHCXXFLAGS -Wno-stringop-overflow -Wno-stringop-overread"
fi
AC_SUBST(ENABLE_LUA)
AC_SUBST(MAKE_CTESTS)
AC_SUBST(MTEV_MODULES_DIR)
AC_SUBST(MTEV_LIBDIR)
AC_SUBST(MTEV_INCLUDEDIR)
AC_SUBST(LMTEV)
AC_SUBST(DOTSO)
AC_SUBST(DOTDYLIB)
AC_SUBST(LD_LIBNOIT_VERSION)
AC_SUBST(MDB_MODS)
AC_SUBST(DTRACE)
AC_SUBST(DTRACE_ENABLED)
AC_SUBST(DTRACEOBJ)
AC_SUBST(DTRACEHDR)
AC_SUBST(DTRACEFLAGS)
AC_SUBST(CLINKFLAGS)
AC_SUBST(SHLD)
AC_SUBST(RLDFLAG)
AC_SUBST(DEPFLAGS)
AC_SUBST(MODULELD)
AC_SUBST(MODULECC)
AC_SUBST(MODULESHCFLAGS)
AC_SUBST(MODULECXX)
AC_SUBST(MODULEEXT)
AC_SUBST(WHOLE_ARCHIVE)
AC_SUBST(NOWHOLE_ARCHIVE)
AC_SUBST(MAPFLAGS)
AC_SUBST(JAVAPARTS)
AC_SUBST(LUALIBS)
AC_SUBST(LIBNOIT_LIBS)
AC_SUBST(YAJLLIBS)
AC_SUBST(PGLIBS)
AC_SUBST(PGCFLAGS)
AC_SUBST(PTOOLSLIBS)
AC_SUBST(MYCFLAGS)
AC_SUBST(MYLIBS)
AC_SUBST(LIBNETSNMP)
AC_SUBST(APRPREFIX)
AC_SUBST(APRCFLAGS)
AC_SUBST(APRCPPFLAGS)
AC_SUBST(APRLIBS)
AC_SUBST(BUILD_MODULES)
AC_SUBST(BUILD_SMODULES)
AC_SUBST(docdir)
AC_SUBST(mansubdir)
AC_SUBST(SHCFLAGS)
AC_SUBST(LD)
AC_SUBST(SHLDFLAGS)
AC_SUBST(MODULES_DIR)
AC_SUBST(JAVA_LIB_DIR)
AC_SUBST(ETC_DIR)
AC_SUBST(CXXFLAGS)
AC_SUBST(SHCXXFLAGS)
AC_SUBST(MODULESHCXXFLAGS)
AC_SUBST(LUACFLAGS)
AC_SUBST(PERL)
AC_SUBST(HAS_GRPC)
AC_SUBST(GRPCLIB)
UNAME_V=`uname -v`
UNAME_R=`uname -r`
UNAME_S=`uname -s`
UNAME_M=`uname -m`
UNAME_N=`uname -n`
UNAME_P=`uname -p`
AC_DEFINE_UNQUOTED(NOIT_UNAME_V, "$UNAME_V", [uname -v])
AC_DEFINE_UNQUOTED(NOIT_UNAME_R, "$UNAME_R", [uname -r])
AC_DEFINE_UNQUOTED(NOIT_UNAME_S, "$UNAME_S", [uname -s])
AC_DEFINE_UNQUOTED(NOIT_UNAME_M, "$UNAME_M", [uname -m])
AC_DEFINE_UNQUOTED(NOIT_UNAME_N, "$UNAME_N", [uname -n])
AC_DEFINE_UNQUOTED(NOIT_UNAME_P, "$UNAME_P", [uname -p])
AC_OUTPUT([
Makefile
src/Makefile
src/man/Makefile
src/modules/Makefile
src/modules-lua/Makefile
src/java/Makefile
src/java/jezebel
src/scripts/noit-config
sql/Makefile
test/Makefile
])
AC_MSG_RESULT([
=== Compile-time Configuration ===
Lua Implementation: $ENABLE_LUA
== Compilers ==
CC: $CC
CXX: $CXX
CPPFLAGS: $CPPFLAGS
CFLAGS: $CFLAGS
CXXFLAGS: $CXXFLAGS
LD: $LD
SHLD: $SHLD
CLINKFLAGS: $CLINKFLAGS
MAPFLAGS: $MAPFLAGS
LIBS: $LIBS
MODULECC: $MODULECC
MODULECXX: $MODULECXX
SHCFLAGS: $SHCFLAGS
MODULESHCFLAGS: $MODULESHCFLAGS
MODULESHCXXFLAGS: $MODULESHCXXFLAGS
MODULELD: $MODULELD
MODULESHLDFLAGS: $MODULESHLDFLAGS
== optional noit modules ==
SNMP module: $SNMP_MODULE
OpenTelemetry gRPC: $HAS_GRPC
== optional stratcon modules ==
Postgres ingestor: $POSTGRES_INGESTOR_MODULE
STOMP iep driver: $STOMP_DRIVER_MODULE
FQ iep driver: $FQ_DRIVER_MODULE
== Java bits ==
Jezebel: $JEZEBEL_JAR_ENABLE
])