-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
229 lines (181 loc) · 6.04 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
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file: Copyright (C) 1997,1998,1999,2000,2001,2002 Planix, Inc.
dnl - see COPYING for details
AC_INIT([NewSyslog], [0.0.0.0-Autoconf-broken], [woods-newsyslog@robohack.planix.com], [newsyslog])
dnl NOTICE: We must use the obsolete forms of the next two macros
dnl with Autoconf-2.53 and newer because that's the only way to keep
dnl PACKAGE (i.e. the tarname) and VERSION dynamic at "./configure"
dnl runtime.
AC_SOURCE_VERSION(./VERSION)
AM_INIT_AUTOMAKE("$PACKAGE", "$VERSION")
dnl Required Autoconf version.
AC_PREREQ(2.61)
AC_REVISION([#ident "@(#)newsyslog:configure.in:$Format:%D:%ci:%cN:%h$"])
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_LANG([C])
AC_PROG_MAKE_SET
AC_PROG_INSTALL
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
dnl Try to get a POSIX.1 environment.
AC_USE_SYSTEM_EXTENSIONS
AC_ISC_POSIX
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(errno.h netdb.h paths.h string.h sys/types.h sys/file.h sys/param.h unistd.h)
AC_CHECK_HEADERS(sys/user.h, , , [
#include <sys/types.h>
#include <sys/param.h>
])
AC_CHECK_HEADERS(sys/proc.h, , , [
#include <sys/types.h>
#include <sys/param.h>
#include <sys/user.h>
])
AC_CHECK_HEADERS(linux/tasks.h linux/threads.h)
AC_MSG_CHECKING(for sys/cdefs.h)
AC_TRY_CPP([
#include <sys/cdefs.h>
int main __P((int, char **));
], fd_cv_have_sys_cdefs_h=yes, fd_cv_have_sys_cdefs_h=no)
AC_MSG_RESULT($fd_cv_have_sys_cdefs_h)
if test $fd_cv_have_sys_cdefs_h = no ; then
# ideally this would be '-I$(srcdir)/compat'
CPPFLAGS="-Icompat $CPPFLAGS"
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_TYPES(unsigned long long)
AC_TYPE_SIGNAL
dnl Checks for library functions.
AC_DECL_SYS_SIGNAME
AC_DECL_SYS_NSIG
AC_CHECK_DECLS([getopt, optind, opterr, optarg, optopt], [], [], [
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif])dnl
AC_CHECK_DECLS([setgroupent], [], [], [#include <grp.h>])
AC_CHECK_DECLS([setpassent], [], [], [#include <pwd.h>])
AC_CHECK_DECLS([sig2str, str2sig, strsignal], [], [], [
#include <signal.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif])dnl
AC_CHECK_DECLS([strchr, strdup, strrchr, strtok], [], [], [
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif])dnl
AC_CHECK_DECLS([exit, strtol, strtoul], [], [], [
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#include <limits.h>])dnl
dnl STUPID GNU/Linux and/or glibc only declares strptime()
dnl if _XOPEN_SOURCE is defined!
AC_CHECK_DECLS(strptime, [], [], [#include <time.h>])
# note sys_signame is not a function, but this test works anyway
# thanks to C and the way the tests are written for this check....
AC_REPLACE_FUNCS([setgroupent setpassent sig2str snprintf str2sig strdup \
strerror strptime strsignal strtok sys_signame])dnl
dnl Note that although bzero() is deprectated and non-standard we only
dnl need its capabilities, not those of the fancier and more standard
dnl memset(), so because bzero() can be defined in terms of memset()
dnl by a macro, but not the other way around, we use bzero() in the
dnl code and account for its absence with a macro.
dnl Also note that checking for flock() here doesn't guarantee a
dnl working flock()!
dnl checking for sys_nsig won't work on SunOS-5 where it's actually
dnl renamed by a macro to a private identifier. However on SunOS-5
dnl there's no sys_signame so we'll end up using our own sys_nsigname
dnl and we won't need sys_nsig because SunOS-5 does have strsignal().
AC_CHECK_FUNCS([bzero flock getopt isnan isinf memset mkstemp rename strchr \
strrchr strtol strtoul sys_nsig])dnl
AM_WITH_DMALLOC
dnl handle "--with-gzip"
AC_MSG_CHECKING(for name of archive compression program)
AC_ARG_WITH(gzip,
AC_HELP_STRING([--with-gzip],
[use GNU Zip instead of compress]),
[COMPRESS_PROG=gzip
COMPRESS_SUFFIX=".gz"],
[COMPRESS_PROG=compress
COMPRESS_SUFFIX=".Z"]
)
AC_MSG_RESULT($COMPRESS_PROG with $COMPRESS_SUFFIX)
AC_SUBST(COMPRESS_SUFFIX)
AC_DEFINE_UNQUOTED(COMPRESS_SUFFIX, "$COMPRESS_SUFFIX",
[Compressed file suffix string])
AC_PATH_PROG(PATH_COMPRESS, $COMPRESS_PROG)
AC_SUBST(PATH_COMPRESS)
AC_DEFINE_UNQUOTED(PATH_COMPRESS, "$PATH_COMPRESS",
[File compression program pathname])
dnl handle "--with-syslogd_pid=path"
AC_MSG_CHECKING(for name of syslogd's pid file)
case "$localstatedir" in
/*)
expandedlocalstatedir=$localstatedir
;;
*)
oldprefix=$prefix
if test ".$prefix" = .NONE ; then
prefix=$ac_default_prefix
fi
expandedlocalstatedir=`eval echo $localstatedir`
prefix=$oldprefix
;;
esac
AC_ARG_WITH(syslogd_pid,
AC_HELP_STRING([--with-syslogd_pid=path],
[syslogd's PID file (localstatedir/run/syslog.pid)]),
[syslogd_pidfile=$withval],
[syslogd_pidfile=$expandedlocalstatedir/run/syslog.pid]
)
AC_SUBST(syslogd_pidfile)
AC_DEFINE_UNQUOTED(PATH_SYSLOGD_PIDFILE, "$syslogd_pidfile",
[Pathname of syslogd's default PID file])
AC_MSG_RESULT($syslogd_pidfile)
dnl handle "--with-newsyslog_conf=path"
AC_MSG_CHECKING(for name of config file)
case "$sysconfdir" in
/*)
expandedsysconfdir=$sysconfdir
;;
*)
oldprefix=$prefix
if test ".$prefix" = .NONE ; then
prefix=$ac_default_prefix
fi
expandedsysconfdir=`eval echo $sysconfdir`
prefix=$oldprefix
;;
esac
AC_ARG_WITH(newsyslog_conf,
AC_HELP_STRING([--with-newsyslog_conf=path],
[configuration file (sysconfdir/newsyslog.conf)]),
[path_config=$withval],
[path_config=$expandedsysconfdir/newsyslog.conf]
)
AC_SUBST(path_config)
AC_DEFINE_UNQUOTED(PATH_CONFIG, "$path_config",
[Default path to the configuration file])
AC_MSG_RESULT($path_config)
dnl Files to create from their *.in templates:
AC_CONFIG_FILES([Makefile Makefile.BSD newsyslog.conf.5so newsyslog.8so])
AC_OUTPUT