forked from rsyslog/rsyslog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2970 lines (2663 loc) · 106 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
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
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([rsyslog],[8.2302.0.master],[[email protected]]) # UPDATE on release
AC_DEFINE(VERSION_YEAR, 23, [year part of real rsyslog version]) # UPDATE on release
AC_DEFINE(VERSION_MONTH, 2, [month part of real rsyslog version]) # UPDATE on release
AM_INIT_AUTOMAKE([subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
unamestr=$(uname)
if test "$unamestr" = "AIX"; then
AC_ARG_ENABLE(aix64bits,
[AS_HELP_STRING([--enable-aix64bits],[Enable compilation of rsyslog using 64 bits @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_aix64bits="yes" ;;
no) enable_aix64bits="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-aix64bits) ;;
esac],
[enable_aix64bits=no]
)
CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT"
LDFLAGS="-brtl"
if test "x$enable_aix64bits" == "xyes"; then
CFLAGS="$CFLAGS -q64"
LDFLAGS="$LDFLAGS -b64"
AR_CFLAGS="-X64 $AR_CFLAGS"
NM="$(which nm) -X64 rcu"
fi
fi
AC_CONFIG_SRCDIR([ChangeLog])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CC_C99
AC_DISABLE_STATIC
# AIXPORT START: enable dlopen
if test "$unamestr" = "AIX"; then
AC_LIBTOOL_DLOPEN
fi
# AIXPORT end
AC_PROG_LIBTOOL
AC_CANONICAL_HOST
if test "$GCC" = "yes"
then
m4_ifdef([AX_IS_RELEASE], [
AX_IS_RELEASE([git-directory])
m4_ifdef([AX_COMPILER_FLAGS], [
AX_COMPILER_FLAGS(,,,,[-Wunused-parameter -Wmissing-field-initializers])
# unfortunately, AX_COMPILER_FLAGS does not provide a way to override
# the default -Wno-error=warning" flags. So we do this via sed below.
# Note: we *really* want to have this error out during CI testing!
# rgerhards, 2018-05-09
WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Wno-error=/-W/g)"
], [
CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
AC_MSG_WARN([missing AX_COMPILER_FLAGS macro, not using it])
])
], [
CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
AC_MSG_WARN([missing AX_IS_RELEASE macro, not using AX_COMPILER_FLAGS macro because of this])
])
else
AC_MSG_WARN([compiler is not GCC or close compatible, not using ax_compiler_flags because of this (CC=$CC)])
fi
PKG_PROG_PKG_CONFIG
AC_ARG_VAR(CONF_FILE_PATH, Configuration file path (default : /etc/rsyslog.conf))
if test "$ac_cv_env_CONF_FILE_PATH_set" = "set"; then
AC_DEFINE_UNQUOTED(PATH_CONFFILE, "${ac_cv_env_CONF_FILE_PATH_value}", "Configuration file path (default : /etc/rsyslog.conf)")
fi
AC_ARG_VAR(PID_FILE_PATH, Pid file path (default : /var/run/rsyslogd.pid))
if test "$ac_cv_env_PID_FILE_PATH_set" = "set"; then
AC_DEFINE_UNQUOTED(PATH_PIDFILE, "${ac_cv_env_PID_FILE_PATH_value}", "Pid file path (default : /var/run/rsyslogd.pid)")
fi
# modules we require
PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9)
PKG_CHECK_MODULES([LIBFASTJSON], [libfastjson >= 0.99.8],,)
AC_DEFINE_UNQUOTED([PLATFORM_ID], ["${host}"], [platform id for display purposes])
# we don't mind if we don't have the lsb_release utility. But if we have, it's
# nice to have the extra information.
AC_DEFINE_UNQUOTED([PLATFORM_ID_LSB], ["`lsb_release -d`"], [platform id for display purposes])
echo HOST: ${host}
case "${host}" in
*-*-linux*)
AC_DEFINE([OS_LINUX], [1], [Indicator for a Linux OS])
os_type="linux"
;;
*-*-*darwin*|*-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*)
AC_DEFINE([OS_BSD], [1], [Indicator for a BSD OS])
os_type="bsd"
;;
*-apple-*)
AC_DEFINE([OS_APPLE], [1], [Indicator for APPLE OS])
os_type="apple"
;;
*-*-kfreebsd*)
# kernel is FreeBSD, but userspace is glibc - i.e. like linux
# do not DEFINE OS_BSD
os_type="bsd"
;;
*-*-solaris*)
os_type="solaris"
AC_DEFINE([OS_SOLARIS], [1], [Indicator for a Solaris OS])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Use POSIX pthread semantics])
AC_DEFINE([_XOPEN_SOURCE], [600], [Use X/Open CAE Specification])
CPPFLAGS="-std=c99 $CPPFLAGS"
CFLAGS="-std=c99 $CFLAGS"
SOL_LIBS="-lsocket -lnsl"
# Solaris libuuid does not ship with a pkgconfig file so override the appropriate
# variables (but only if they have not been set by the user).
LIBUUID_CFLAGS=${LIBUUID_CFLAGS:= }
LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid}
AC_SUBST(SOL_LIBS)
;;
*-*-aix*)
os_type="aix"
AC_DEFINE([OS_AIX], [1], [Indicator for a AIX OS])
;;
esac
AM_CONDITIONAL(OS_APPLE, test x$os_type == xapple)
AM_CONDITIONAL(OS_LINUX, test x$os_type == xlinux)
AM_CONDITIONAL(OS_AIX, test x$os_type == xaix)
AM_PATH_PYTHON(,, [:])
# Running from git source?
in_git_src=no
AS_IF([test -d "$srcdir"/.git && ! test -f "$srcdir"/.tarball-version], [in_git_src=yes])
AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable])
# Some Unix systems, like Gnu Hurd, don't define PATH_MAX
AC_MSG_CHECKING([for PATH_MAX])
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <limits.h>]],
[[char checker[PATH_MAX];]])],
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no, mocking PATH_MAX = 4096])
AC_DEFINE([PATH_MAX], 4096, [replacement for missing PATH_MAX])
AC_DEFINE([MAXPATHLEN], 4096, [replacement for missing PATH_MAX]) # we assume this does not exit
]
)
# Checks for libraries.
save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(clock_gettime, rt)
RT_LIBS=$LIBS
AC_SEARCH_LIBS(mq_getattr, rt)
RT_LIBS="$RT_LIBS $LIBS"
LIBS=
AC_SEARCH_LIBS(dlopen, dl)
DL_LIBS=$LIBS
LIBS=$save_LIBS
AC_SUBST(RT_LIBS)
AC_SUBST(DL_LIBS)
# Checks for header files.
AC_HEADER_RESOLV
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADER([arpa/inet.h],[],[],[
[#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
]
])
AC_CHECK_HEADERS([libgen.h],[],[],[
[#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif
]
])
AC_CHECK_HEADERS([malloc.h],[],[],[
[#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
]
])
AC_CHECK_HEADERS([fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h sys/select.h getopt.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_UINT8_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
sa_includes="\
$ac_includes_default
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
"
AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[$sa_includes])
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([flock recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64 asprintf])
AC_CHECK_FUNC([setns], [AC_DEFINE([HAVE_SETNS], [1], [Define if setns exists.])])
AC_CHECK_TYPES([off64_t])
AC_CHECK_HEADERS([sys/inotify.h], [rsyslog_sysinotify=yes])
AC_CHECK_FUNCS([inotify_init], [rsyslog_inotify_init=yes])
AM_CONDITIONAL(ENABLE_INOTIFY, test x$rsyslog_sysinotify = xyes -a x$rsyslog_inotify_init = xyes)
# getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10)
AC_SEARCH_LIBS([getifaddrs], [socket], [AC_DEFINE(HAVE_GETIFADDRS, [1], [set define])])
# the check below is probably ugly. If someone knows how to do it in a better way, please
# let me know! -- rgerhards, 2010-10-06
AC_CHECK_DECL([SCM_CREDENTIALS], [AC_DEFINE(HAVE_SCM_CREDENTIALS, [1], [set define])], [], [#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [set define])], [], [#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_DECL([SYS_gettid], [AC_DEFINE(HAVE_SYS_gettid, [1], [set define])], [], [#include <sys/syscall.h>])
AC_CHECK_MEMBER([struct sysinfo.uptime], [AC_DEFINE(HAVE_SYSINFO_UPTIME, [1], [set define])], [], [#include <sys/sysinfo.h>])
AC_CHECK_DECL([GLOB_NOMAGIC], [AC_DEFINE(HAVE_GLOB_NOMAGIC, [1], [set define])], [], [#include <glob.h>])
# Check for MAXHOSTNAMELEN
AC_MSG_CHECKING(for MAXHOSTNAMELEN)
AC_TRY_COMPILE([
#include <sys/param.h>
#include <netdb.h>
], [
return MAXHOSTNAMELEN;
]
,
AC_MSG_RESULT(yes)
,
# note: we use 1024 here, which should be far more than needed by any system. If that's too low, we simply
# life with the need to change it. Most of the code doesn't need it anyways, but there are a few places
# where it actually is needed and it makes no sense to change them.
AC_DEFINE(MAXHOSTNAMELEN, 1024, [Define with a value if your <sys/param.h> does not define MAXHOSTNAMELEN])
AC_MSG_RESULT(no; defined as 64)
)
# check if GNU's ld is used
# Check for __builtin_expect()
AC_MSG_CHECKING([for __builtin_expect()])
AC_LINK_IFELSE([AC_LANG_PROGRAM(, return __builtin_expect(main != 0, 1))],
[AC_DEFINE(HAVE_BUILTIN_EXPECT, 1,
Define to 1 if compiler supports __builtin_expect)
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
# check for availability of atomic operations
# Note: this switch is primarily for the testbench, so that we can try
# to build w/o automic operations on systems that actually support them.
# Usually, atomic operations should be used when available as this
# speeds up processig.
# note that when automic operations are enabled but not available, they
# will silently NOT be used!
AC_ARG_ENABLE(atomic-operations,
[AS_HELP_STRING([--enable-atomic-operations],[Enable atomic operation support @<:@default=yes@:>@])],
[case "${enableval}" in
yes) enable_atomic_operations="yes" ;;
no) enable_atomic_operations="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic-operations) ;;
esac],
[enable_atomic_operations=yes]
)
if test "$enable_atomic_operations" = "yes"; then
RS_ATOMIC_OPERATIONS
RS_ATOMIC_OPERATIONS_64BIT
fi
# fall back to POSIX sems for atomic operations (cpu expensive)
AC_CHECK_HEADERS([semaphore.h sys/syscall.h])
# Additional module directories
AC_ARG_WITH(moddirs,
[AS_HELP_STRING([--with-moddirs=DIRS],[Additional module search paths appended to @<:@$libdir/rsyslog@:>@])],
[_save_IFS=$IFS ; IFS=$PATH_SEPARATOR ; moddirs=""
for w in ${with_moddirs} ;
do
case $w in
"") continue ;; */) ;; *) w="${w}/" ;;
esac
for m in ${moddirs} ;
do
test "x$w" = "x${libdir}/${PACKAGE}/" || \
test "x$w" = "x$m" || test "x$w" = "x/" && \
continue 2
done
case $moddirs in
"") moddirs="$w" ;; *) moddirs="${moddirs}:${w}" ;;
esac
done ; IFS=$_save_IFS],[moddirs=""]
)
AM_CONDITIONAL(WITH_MODDIRS, test x$moddirs != x)
AC_SUBST(moddirs)
# Large file support
# http://www.gnu.org/software/autoconf/manual/html_node/System-Services.html#index-AC_005fSYS_005fLARGEFILE-1028
AC_SYS_LARGEFILE
case "${enable_largefile}" in
no) ;;
*) enable_largefile="yes" ;;
esac
# Regular expressions
AC_ARG_ENABLE(regexp,
[AS_HELP_STRING([--enable-regexp],[Enable regular expressions support @<:@default=yes@:>@])],
[case "${enableval}" in
yes) enable_regexp="yes" ;;
no) enable_regexp="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-regexp) ;;
esac],
[enable_regexp=yes]
)
AM_CONDITIONAL(ENABLE_REGEXP, test x$enable_regexp = xyes)
if test "$enable_regexp" = "yes"; then
AC_DEFINE(FEATURE_REGEXP, 1, [Regular expressions support enabled.])
fi
# zlib support
PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no])
AS_IF([test "x$found_zlib" = "xno"], [
AC_SEARCH_LIBS([inflate], [z], [AC_CHECK_HEADER([zlib.h], [found_zlib=yes])])
if test "x$found_zlib" = "xno" ; then
AC_MSG_ERROR([zlib library and headers not found])
fi
ZLIB_LIBS="-lz"
AC_SUBST(ZLIB_LIBS)
])
#hash implementations header checks
AC_ARG_ENABLE(fmhash,
[AS_HELP_STRING([--enable-fmhash],[Enable fmhash support @<:@default=yes@:>@])],
[case "${enableval}" in
yes) enable_fmhash="yes" ;;
no) enable_fmhash="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fmhash) ;;
esac],
[enable_fmhash=yes]
)
AC_ARG_ENABLE(libcap-ng,
[AS_HELP_STRING([--enable-libcap-ng],[Enable dropping capabilities to only the necessary set @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_libcapng="yes" ;;
no) enable_libcapng="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable_libcapng) ;;
esac],
[enable_libcapng=no]
)
if test "$enable_libcapng" = "yes"; then
PKG_CHECK_MODULES(
[LIBCAPNG],
[libcap-ng >= 0.8.2],
[AC_DEFINE([ENABLE_LIBCAPNG], [1], [Indicator that libcap-ng is present])],
[AC_MSG_ERROR(libcap-ng is not present.)]
)
CFLAGS="$CFLAGS $LIBCAPNG_CFLAGS"
LIBS="$LIBS $LIBCAPNG_LIBS"
fi
AC_ARG_ENABLE(fmhash-xxhash,
[AS_HELP_STRING([--enable-fmhash-xxhash],[Enable xxhash in fmhash support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_fmhash_xxhash="yes" ;;
no) enable_fmhash_xxhash="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fmhash-xxhash) ;;
esac],
[enable_fmhash_xxhash=no]
)
AM_CONDITIONAL(ENABLE_FMHASH, [test "x$enable_fmhash" = "xyes" || test "x$enable_fmhash_xxhash" = "xyes"])
AM_CONDITIONAL(ENABLE_FMHASH_XXHASH, test x$enable_fmhash_xxhash = xyes)
if test "$enable_fmhash_xxhash" = "yes"; then
AC_CHECK_LIB([xxhash], [XXH64], [
AC_CHECK_HEADER([xxhash.h], [
AC_DEFINE(USE_HASH_XXHASH, 1,
[Using XXHASH for hash64.])
HASH_XXHASH_LIBS="-lxxhash"
AC_SUBST(HASH_XXHASH_LIBS)],
[AC_MSG_ERROR([Unable to add XXHASH support for hash64.])])
])
fi
#faup header checks
AC_ARG_ENABLE(ffaup,
[AS_HELP_STRING([--enable-ffaup],[Enable ffaup support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_ffaup="yes" ;;
no) enable_ffaup="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ffaup) ;;
esac],
[enable_ffaup=no]
)
AM_CONDITIONAL(ENABLE_FFAUP, test x$enable_ffaup = xyes)
if test "$enable_ffaup" = "yes"; then
AC_CHECK_LIB([faupl], [faup_init], [
AC_CHECK_HEADER([faup/faup.h], [
FAUP_LIBS="-lfaupl"
AC_SUBST(FAUP_LIBS)],
[AC_MSG_ERROR([Unable to add faup support for URL parsing.])])
])
fi
# rscript function unflatten
AC_ARG_ENABLE(fmunflatten,
[AS_HELP_STRING([--enable-fmunflatten],[Enable fmunflatten support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_fmunflatten="yes" ;;
no) enable_fmunflatten="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fmunflatten) ;;
esac],
[enable_fmunflatten=no]
)
AM_CONDITIONAL(ENABLE_FMUNFLATTEN, test x$enable_fmunflatten = xyes)
#gssapi
AC_ARG_ENABLE(gssapi_krb5,
[AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_gssapi_krb5="yes" ;;
no) enable_gssapi_krb5="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gssapi-krb5) ;;
esac],
[enable_gssapi_krb5=no]
)
case "${os_type}" in
solaris) GSSLIB=gss ;;
*) GSSLIB=gssapi_krb5 ;;
esac
if test $enable_gssapi_krb5 = yes; then
AC_CHECK_LIB($GSSLIB, gss_acquire_cred, [
AC_CHECK_HEADER(gssapi/gssapi.h, [
AC_DEFINE(USE_GSSAPI,,
Define if you want to use GSSAPI)
GSS_LIBS="-l$GSSLIB"
AC_SUBST(GSS_LIBS)
])
])
fi
AM_CONDITIONAL(ENABLE_GSSAPI, test x$enable_gssapi_krb5 = xyes)
# shall the testbench try to run test that require root permissions?
# This is uncommon. Test skip if run under non-root, but that pollutes the
# testbench result. So the default is not to do that.
AC_ARG_ENABLE(root_tests,
[AS_HELP_STRING([--enable-root-tests],[enable root tests in testbench @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_root_tests="yes" ;;
no) enable_root_tests="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-root-tests) ;;
esac],
[enable_root_tests=no]
)
AM_CONDITIONAL(ENABLE_ROOT_TESTS, test x$enable_root_tests = xyes)
# multithreading via pthreads
if test "$os_type" != "solaris"
then
AC_CHECK_HEADERS(
[pthread.h],
[
AC_CHECK_LIB(
[pthread],
[pthread_create],
[
PTHREADS_LIBS="-lpthread"
if test "$unamestr" = "AIX"; then
case "${CC}" in
*xlc*|*xlC*) PTHREADS_CFLAGS="-qthreaded" ;;
*) PTHREADS_CFLAGS="-lpthreads" ;;
esac
else
PTHREADS_CFLAGS="-pthread"
fi
AC_SUBST(PTHREADS_LIBS)
AC_SUBST(PTHREADS_CFLAGS)
],
[AC_MSG_FAILURE([pthread is missing])],
[-lpthread]
)
],
[AC_MSG_FAILURE([pthread is missing])]
)
fi
AC_CHECK_LIB(
[pthread],
[pthread_rwlockattr_setkind_np],
[AC_DEFINE(
[HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP],
[1],
[Set-kind available for rwlock attr.])])
AC_CHECK_LIB(
[pthread],
[pthread_setname_np],
[AC_DEFINE(
[HAVE_PTHREAD_SETNAME_NP],
[1],
[Can set thread-name.])])
AC_SEARCH_LIBS(
[pthread_setschedparam],
[pthread],
[
rsyslog_have_pthread_setschedparam=yes
AC_DEFINE([HAVE_PTHREAD_SETSCHEDPARAM],
[1],
[Can set thread scheduling parameters])
],
[
rsyslog_have_pthread_setschedparam=no
]
)
AC_CHECK_HEADERS(
[sched.h],
[
rsyslog_have_sched_h=yes
],
[
rsyslog_have_sched_h=no
]
)
if test "$rsyslog_have_pthread_setschedparam" = "yes" -a "$rsyslog_have_sched_h" = "yes"; then
save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS(sched_get_priority_max, rt)
if test "x$ac_cv_search" != "xno"; then
AC_CHECK_FUNCS(sched_get_priority_max)
fi
IMUDP_LIBS=$LIBS
AC_SUBST(IMUDP_LIBS)
LIBS=$save_LIBS
fi
if test "$unamestr" = "AIX"; then
enable_klog="no"
else
# klog
AC_ARG_ENABLE(klog,
[AS_HELP_STRING([--enable-klog],[Integrated klog functionality @<:@default=yes@:>@])],
[case "${enableval}" in
yes) enable_klog="yes" ;;
no) enable_klog="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-klog) ;;
esac],
[enable_klog="yes"]
)
fi
AM_CONDITIONAL(ENABLE_IMKLOG, test x$enable_klog = xyes)
AM_CONDITIONAL(ENABLE_IMKLOG_BSD, test x$os_type = xbsd)
AM_CONDITIONAL(ENABLE_IMKLOG_LINUX, test x$os_type = xlinux)
AM_CONDITIONAL(ENABLE_IMKLOG_SOLARIS, test x$os_type = xsolaris)
# kmsg
AC_ARG_ENABLE(kmsg,
[AS_HELP_STRING([--enable-kmsg],[Kmsg structured kernel logs functionality @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_kmsg="yes" ;;
no) enable_kmsg="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-kmsg) ;;
esac],
[enable_kmsg="no"]
)
AM_CONDITIONAL(ENABLE_IMKMSG, test x$enable_kmsg = xyes)
# imjournal
AC_ARG_ENABLE(imjournal,
[AS_HELP_STRING([--enable-imjournal],[Systemd journal message import @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_imjournal="yes" ;;
no) enable_imjournal="no" ;;
optional) enable_imjournal="optional" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-imjournal) ;;
esac],
[enable_imjournal="no"]
)
imjournal_use_dummy="no"
if test "x$enable_imjournal" = "xyes" -o "x$enable_imjournal" = "xoptional"; then
PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd >= 234] , [AC_DEFINE(NEW_JOURNAL, 1, [new systemd present])] , [
PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd >= 209] , , [
PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197], , [
AS_IF([test x$enable_imjournal = xyes],
AC_MSG_FAILURE([imjournal support libraries are missing])
)
imjournal_use_dummy="yes"
])
])
])
fi
AM_CONDITIONAL(IMJOURNAL_USE_DUMMY, test x$imjournal_use_dummy = xyes)
AM_CONDITIONAL(ENABLE_IMJOURNAL, test x$enable_imjournal = xyes -o x$enable_imjournal = xoptional)
# use libsystemd
AC_ARG_ENABLE(libsystemd,
[AS_HELP_STRING([--enable-libsystemd],[Enable libsystemd mode @<:@default=auto@:>@])],
[case "${enableval}" in
yes) enable_libsystemd="yes" ;;
no) enable_libsystemd="no" ;;
auto) enable_libsystemd="auto" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-libsystemd) ;;
esac],
[enable_libsystemd="auto"]
)
if test "$enable_libsystemd" = "yes"; then
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd],
[ AC_DEFINE(HAVE_LIBSYSTEMD, 1, [libsystemd present]) ]
)
fi
if test "$enable_libsystemd" = "auto"; then
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd],
[ AC_DEFINE(HAVE_LIBSYSTEMD, 1, [libsystemd present])
AC_MSG_NOTICE([--enable-libsystemd in auto mode])
enable_libsystemd="yes"
],
[ AC_MSG_WARN([libsystemd not present - disabling systemd support])
enable_libsystemd="no"
]
)
AC_MSG_NOTICE([--enable-libsystemd in auto mode, enable-libsystemd is set to ${enable_libsystemd}])
fi
# inet
AC_ARG_ENABLE(inet,
[AS_HELP_STRING([--enable-inet],[Enable networking support @<:@default=yes@:>@])],
[case "${enableval}" in
yes) enable_inet="yes" ;;
no) enable_inet="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-inet) ;;
esac],
[enable_inet="yes"]
)
AM_CONDITIONAL(ENABLE_INET, test x$enable_inet = xyes)
if test "$enable_inet" = "yes"; then
AC_DEFINE(SYSLOG_INET, 1, [network support is integrated.])
fi
# jemalloc
AC_ARG_ENABLE(jemalloc,
[AS_HELP_STRING([--enable-jemalloc],[Enable jemalloc support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_jemalloc="yes" ;;
no) enable_jemalloc="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-jemalloc) ;;
esac],
[enable_jemalloc="no"]
)
AM_CONDITIONAL(ENABLE_JEMALLOC, test x$enable_jemalloc = xyes)
if test "$enable_jemalloc" = "yes"; then
AC_CHECK_LIB(
[jemalloc],
[malloc_stats_print],
[RT_LIBS="$RT_LIBS -ljemalloc"
AC_DEFINE(HAVE_JEMALLOC, 1, [jemalloc support is integrated.])
],
[AC_MSG_FAILURE([jemalloc library is missing])],
[]
)
fi
# support for unlimited select() syscall
AC_ARG_ENABLE(unlimited_select,
[AS_HELP_STRING([--enable-unlimited-select],[Enable unlimited select() syscall @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_unlimited_select="yes" ;;
no) enable_unlimited_select="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-unlimited-select) ;;
esac],
[enable_unlimited_select="no"]
)
if test "$enable_unlimited_select" = "yes"; then
AC_DEFINE(USE_UNLIMITED_SELECT, 1, [If defined, the select() syscall won't be limited to a particular number of file descriptors.])
fi
# support for systemd unit files
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
# debug
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[Enable debug mode @<:@default=auto@:>@])],
[case "${enableval}" in
yes) enable_debug="yes" ;;
no) enable_debug="no" ;;
auto) enable_debug="auto" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[enable_debug="auto"]
)
if test "$enable_debug" = "auto"; then
if test "x$in_git_src" = "xyes"; then
enable_debug="yes"
else
enable_debug="no"
fi
AC_MSG_NOTICE([enable-debug in auto mode, enable-debug is set to ${enable_debug}])
fi
if test "$enable_debug" = "yes"; then
AC_DEFINE(DEBUG, 1, [Defined if debug mode is enabled (its easier to check).])
fi
if test "$enable_debug" = "no"; then
AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
fi
# debug-symbols
AC_ARG_ENABLE(debug_symbols,
[AS_HELP_STRING([--disable-debug-symbols],[Disable debugging symbols @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_debug_symbols="yes" ;;
no) enable_debug_symbols="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-debug-symbols) ;;
esac],
[enable_debug_symbols="yes"]
)
# total debugless: highest performance, but no way at all to enable debug
# logging
AC_ARG_ENABLE(debugless,
[AS_HELP_STRING([--enable-debugless],[Enable runtime instrumentation mode @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_debugless="yes" ;;
no) enable_debugless="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debugless) ;;
esac],
[enable_debugless="no"]
)
if test "$enable_debugless" = "yes"; then
AC_DEFINE(DEBUGLESS, 1, [Defined if debugless mode is enabled.])
fi
# valgrind
AC_ARG_ENABLE(valgrind,
[AS_HELP_STRING([--enable-valgrind],[Enable somes special code that rsyslog core developers consider useful for testing. Do NOT use if you don't exactly know what you are doing, except if told so by rsyslog developers. NOT to be used by distro maintainers for building regular packages. @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_valgrind="yes" ;;
no) enable_valgrind="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
esac],
[enable_valgrind="no"]
)
if test "$enable_valgrind" = "yes"; then
AC_DEFINE(VALGRIND, 1, [Defined if valgrind support settings are to be enabled (e.g. prevents dlclose()).])
fi
# compile diagnostic tools (small helpers usually not needed)
AC_ARG_ENABLE(diagtools,
[AS_HELP_STRING([--enable-diagtools],[Enable diagnostic tools @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_diagtools="yes" ;;
no) enable_diagtools="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-diagtools) ;;
esac],
[enable_diagtools=no]
)
AM_CONDITIONAL(ENABLE_DIAGTOOLS, test x$enable_diagtools = xyes)
# compile end-user tools
AC_ARG_ENABLE(usertools,
[AS_HELP_STRING([--enable-usertools],[Enable end user tools @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_usertools="yes" ;;
no) enable_usertools="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-usertools) ;;
esac],
[enable_usertools=no]
)
AM_CONDITIONAL(ENABLE_USERTOOLS, test x$enable_usertools = xyes)
# MySQL support
AC_ARG_ENABLE(mysql,
[AS_HELP_STRING([--enable-mysql],[Enable MySql database support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_mysql="yes" ;;
no) enable_mysql="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql) ;;
esac],
[enable_mysql=no]
)
AS_IF([test "x$enable_mysql" = "xyes"],[
PKG_CHECK_MODULES([MYSQL],[mysqlclient],,[
AC_CHECK_PROG(
[MYSQL_CONFIG],
[mysql_config],
[mysql_config],
[no],,
)
AS_IF([test "x${MYSQL_CONFIG}" = "xno"],[
AC_MSG_FAILURE([mysql_config not found - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue])
])
MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
MYSQL_LIBS=`$MYSQL_CONFIG --libs`
])
AC_MSG_CHECKING(if we have mysql_library_init)
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
save_LIBS="$LIBS"
AC_CHECK_LIB(
[mysqlclient],
[mysql_init],
,
[AC_MSG_FAILURE([MySQL library is missing])],
[$MYSQL_LIBS]
)
LIBS="$LIBS $MYSQL_LIBS"
AC_TRY_LINK(
[#include <mysql.h>
#include <stdio.h>],
[mysql_library_init(0, NULL, NULL)],
[have_mysql_library_init=yes],
[have_mysql_library_init=no])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
])
AM_CONDITIONAL(ENABLE_MYSQL, test x$enable_mysql = xyes)
if test "$have_mysql_library_init" = "yes"; then
AC_DEFINE([HAVE_MYSQL_LIBRARY_INIT], [1], [mysql_library_init available])
fi
AC_SUBST(MYSQL_CFLAGS)
AC_SUBST(MYSQL_LIBS)
# PostgreSQL support
AC_ARG_ENABLE(pgsql,
[AS_HELP_STRING([--enable-pgsql],[Enable PostgreSQL database support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_pgsql="yes" ;;
no) enable_pgsql="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pgsql) ;;
esac],
[enable_pgsql=no]
)
if test "x$enable_pgsql" = "xyes"; then
PKG_CHECK_MODULES([PGSQL], [libpq],, [
AC_CHECK_PROG(
[PG_CONFIG],
[pg_config],
[pg_config],
[no],,,
)
if test "x${PG_CONFIG}" = "xno"; then
AC_MSG_FAILURE([pg_config not found])
fi
AC_CHECK_LIB(
[pq],
[PQconnectdb],
[PGSQL_CFLAGS="-I`$PG_CONFIG --includedir`"
PGSQL_LIBS="-L`$PG_CONFIG --libdir` -lpq"
],
[AC_MSG_FAILURE([PgSQL library is missing])],
[-L`$PG_CONFIG --libdir`]
)
])
AC_CHECK_LIB(
[pq],
[PGsslInUse],
[AC_DEFINE([HAVE_PGSSLINUSE], [1], [PGsslInUse function available])]
)
fi
AM_CONDITIONAL(ENABLE_PGSQL, test x$enable_pgsql = xyes)
AC_SUBST(PGSQL_CFLAGS)
AC_SUBST(PGSQL_LIBS)
# libdbi support
AC_ARG_ENABLE(libdbi,
[AS_HELP_STRING([--enable-libdbi],[Enable libdbi database support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_libdbi="yes" ;;
no) enable_libdbi="no" ;;
optional) enable_libdbi="optional" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-libdbi) ;;
esac],
[enable_libdbi=no]
)
libdbi_use_dummy="no"
if test "x$enable_libdbi" = "xyes" -o x$enable_libdbi = xoptional; then
AC_CHECK_HEADERS(
[dbi/dbi.h],,[
AS_IF([test x$enable_libdbi = xyes],
AC_MSG_FAILURE([libdbi is missing])
)
libdbi_use_dummy="yes"
]
)
AC_CHECK_LIB(
[dbi],
[dbi_initialize],
[LIBDBI_CFLAGS=""
LIBDBI_LIBS="-ldbi"
], [
AS_IF([test x$enable_libdbi = xyes],
AC_MSG_FAILURE([libdbi is missing])
)
libdbi_use_dummy="yes"
]
)
AC_CHECK_LIB(
[dbi],
[dbi_initialize_r],
[AC_DEFINE([HAVE_DBI_R], [1], [Define to 1 if libdbi supports the new plugin-safe interface])]
)
AC_CHECK_LIB(
[dbi],
[dbi_conn_transaction_begin],
[AC_DEFINE([HAVE_DBI_TXSUPP], [1], [Define to 1 if libdbi supports transactions])]
)
fi
AM_CONDITIONAL(LIBDBI_USE_DUMMY, test x$libdbi_use_dummy = xyes)
AM_CONDITIONAL(ENABLE_OMLIBDBI, test x$enable_libdbi = xyes -o x$enable_libdbi = xoptional)
AC_SUBST(LIBDBI_CFLAGS)
AC_SUBST(LIBDBI_LIBS)
# SNMP support
AC_ARG_ENABLE(snmp,
[AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_snmp="yes" ;;
no) enable_snmp="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-snmp) ;;
esac],
[enable_snmp=no]
)
if test "x$enable_snmp" = "xyes"; then
AC_CHECK_HEADERS(
[net-snmp/net-snmp-config.h],,
[AC_MSG_FAILURE([Net-SNMP is missing])]
)
AC_CHECK_LIB(
[netsnmp],
[snmp_timeout],
[SNMP_CFLAGS=""
SNMP_LIBS="-lnetsnmp"
],
[AC_MSG_FAILURE([Net-SNMP library is missing])]
)
fi
AM_CONDITIONAL(ENABLE_SNMP, test x$enable_snmp = xyes)