-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
143 lines (117 loc) · 4.16 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([sysklogd], [1.8.0], [gladkov.alexey@gmail.com])
AC_CONFIG_SRCDIR([src/attribute.h])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([subdir-objects color-tests dist-xz])
AM_SILENT_RULES([yes])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_HEADER_RESOLV
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h paths.h stddef.h \
stdint.h stdlib.h string.h sys/file.h sys/ioctl.h \
sys/param.h sys/socket.h sys/time.h syslog.h unistd.h utmp.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_STRNLEN
AC_CHECK_FUNC([alarm], [], [AC_MSG_ERROR([required function 'alarm' is missing.])])
AC_CHECK_FUNC([epoll_create1], [], [AC_MSG_ERROR([required function 'epoll_create1' is missing.])])
AC_CHECK_FUNC([epoll_ctl], [], [AC_MSG_ERROR([required function 'epoll_ctl' is missing.])])
AC_CHECK_FUNC([epoll_wait], [], [AC_MSG_ERROR([required function 'epoll_wait' is missing.])])
AC_CHECK_FUNC([dup2], [], [AC_MSG_ERROR([required function 'dup2' is missing.])])
AX_GCC_FUNC_ATTRIBUTE(format)
AX_GCC_FUNC_ATTRIBUTE(nonnull)
AX_GCC_FUNC_ATTRIBUTE(noreturn)
AX_GCC_FUNC_ATTRIBUTE(pure)
AX_GCC_FUNC_ATTRIBUTE(unused)
AX_ADD_FORTIFY_SOURCE
AX_APPEND_COMPILE_FLAGS([ \
-Wall \
-Wextra \
-Wstrict-prototypes \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wmissing-format-attribute \
-Wdisabled-optimization \
-Wwrite-strings \
-Wcast-align \
-Wshadow \
-Wstringop-overflow=3 \
-Wsuggest-attribute=pure \
-Wsuggest-attribute=const \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=malloc \
-Wsuggest-attribute=format \
])
AC_ARG_ENABLE(werror,
[AS_HELP_STRING([--enable-werror], [turn on -Werror for some kind of warnings])],
[use_werror=$enableval], [use_werror=no])
if test "$use_werror" = yes; then
AX_APPEND_COMPILE_FLAGS([-Werror])
fi
AC_ARG_WITH(klog-start-delay,
AS_HELP_STRING(--with-klog-start-delay=NSECS, [Start-up delay in klogd]),
[AC_DEFINE([KLOGD_DELAY], $withval, [KLOGD_DELAY])])
AC_ARG_ENABLE(checksums,
AS_HELP_STRING(--disable-checksums, [Whether the syslogd should create checksum chains for log entries]),
[use_checksums=$enableval], [use_checksums=yes])
if test "$use_checksums" != no; then
AC_DEFINE([USE_CHECKSUMS], 1, [Whether the syslogd should create checksum chains for log entries])
fi
AC_ARG_ENABLE(inet-family,
AS_HELP_STRING(--disable-inet-family, [Whether the syslogd should use INET protocol family]),
[use_inet_family=$enableval], [use_inet_family=yes])
if test "$use_inet_family" != no; then
AC_DEFINE([SYSLOG_INET], 1, [Use INET protocol to receive messages])
fi
AC_ARG_ENABLE(inet6_family,
AS_HELP_STRING(--disable-inet6-family, [Whether the syslogd should use INET6 protocol family]),
[use_inet6_family=$enableval], [use_inet6_family=yes])
if test "$use_inet6_family" != no; then
AC_DEFINE([SYSLOG_INET6], 1, [Use INET6 protocol to receive messages])
fi
AC_ARG_ENABLE(unix-domain,
AS_HELP_STRING(--disable-unix-domain, [Whether the syslogd should use UNIX domain sockets]),
[use_unix_domain=$enableval], [use_unix_domain=yes])
if test "$use_unix_domain" != no; then
AC_DEFINE([SYSLOG_UNIXAF], 1, [Use UNIX domain sockets to receive messages])
fi
AC_CONFIG_FILES([Makefile
man/Makefile
src/Makefile
src/klogd/Makefile
src/syslogd/Makefile
tests/Makefile])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
=============
prefix: ${prefix}
libdir: ${libdir}
bindir: ${bindir}
datadir: ${datadir}
compiler: ${CC}
cppflags: ${CPPFLAGS}
cflags: ${CFLAGS}
Create checksum chains: ${use_checksums}
Use INET protocol family: ${use_inet_family}
Use INET6 protocol family: ${use_inet6_family}
Use UNIX domain sockets: ${use_unix_domain}
])