forked from xinetd-org/xinetd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
344 lines (315 loc) · 9.43 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
AC_INIT(xinetd/main.c)
AC_CANONICAL_SYSTEM
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_LIB(compat, main)
AC_SEARCH_LIBS(gethostbyname, nsl socket resolv)
AC_SEARCH_LIBS(getnameinfo, nsl socket resolv)
AC_SEARCH_LIBS(inet_ntop, nsl socket resolv)
AC_CHECK_FUNCS(getnameinfo inet_ntop)
AC_CHECK_FUNCS(difftime, ,
AC_CHECK_LIB(m, difftime))
AC_CHECK_FUNCS(fcvt, ,
AC_CHECK_LIB(m, fcvt))
AC_CHECK_FUNCS(ecvt, ,
AC_CHECK_LIB(m, ecvt))
AC_CHECK_FUNCS(gcvt, ,
AC_CHECK_LIB(m, gcvt))
AC_CHECK_FUNC(strerror, [AC_DEFINE(HAVE_STRERROR)])
AC_CHECK_FUNC(strcasecmp, [AC_DEFINE(HAVE_STRCASECMP)])
AC_CHECK_FUNC(socket, ,
AC_CHECK_LIB(socket, socket, ,
AC_CHECK_LIB(nsl, socket)))
AC_CHECK_FUNC(inet_aton, ,
AC_CHECK_LIB(nsl, inet_aton, ,
AC_CHECK_LIB(socket, inet_aton, ,
AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)]))))
AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV)])
AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL)])
AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST)])
AC_CHECK_FUNC(gai_strerror,[AC_DEFINE(HAVE_GAI_STRERROR)])
AC_CHECK_FUNC(freeaddrinfo,[AC_DEFINE(HAVE_FREEADDRINFO)])
AC_CHECK_FUNC(getaddrinfo,[AC_DEFINE(HAVE_GETADDRINFO)])
AC_CHECK_HEADERS(sys/types.h sys/termios.h termios.h sys/ioctl.h sys/select.h rpc/rpc.h rpc/rpcent.h sys/file.h ftw.h machine/reg.h netdb.h)
AC_CHECK_HEADER(sys/resource.h, [AC_DEFINE(HAVE_SYS_RESOURCE_H)])
AC_CHECK_HEADER(arpa/inet.h, [AC_DEFINE(HAVE_ARPA_INET_H)])
AC_CHECK_HEADER(grp.h, [AC_DEFINE(HAVE_GRP_H)])
AC_CHECK_HEADER(rpc/pmap_clnt.h, [AC_DEFINE(HAVE_RPC_PMAP_CLNT_H)])
AC_CHECK_HEADER(sys/socket.h, [AC_DEFINE(HAVE_SYS_SOCKET_H)])
AC_CHECK_HEADER(sys/signal.h, [AC_DEFINE(HAVE_SYS_SIGNAL_H)])
AC_CHECK_HEADER(crypt.h, [AC_DEFINE(HAVE_CRYPT_H)])
AC_CHECK_HEADER(stdint.h, [AC_DEFINE(HAVE_STDINT_H)])
AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H)])
AC_CHECK_HEADER(sys/filio.h, [AC_DEFINE(HAVE_SYS_FILIO_H)])
AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [AC_DEFINE(HAVE_DNSREGISTRATION) AC_DEFINE(HAVE_MDNS)])
AC_ARG_WITH(howl, [ --with-howl=PATH Compile in howl support.
PATH is the prefix where howl is installed,
and is not optional.],
[ OLDCFLAGS=$CFLAGS; CFLAGS="-I$withval/include/howl/ $CFLAGS";
OLDLDFLAGS=$LDFLAGS; LDFLAGS="-L$withval/lib/ $LDFLAGS";
OLDCPPFLAGS=$CPPFLAGS; CPPFLAGS="-I$withval/include/howl/ $CPPFLAGS";
AC_CHECK_HEADER($withval/include/howl/howl.h,
[AC_DEFINE(HAVE_HOWL) AC_DEFINE(HAVE_MDNS)],
[CFLAGS=$OLDCFLAGS; LDFLAGS=$OLDLDFLAGS; CPPFLAGS=$OLDCPPFLAGS;])
AC_CHECK_LIB(howl, sw_discovery_publish, [LIBS="-lhowl $LIBS"], [
OLDLIBS=$LIBS; LIBS="-lpthread $LIBS";
AC_CHECK_LIB(howl, main, [LIBS="-lhowl $LIBS"],
[LIBS=$OLDLIBS])
])
])
XINETD_CHECK_TYPE(uint16_t, unsigned short)
XINETD_CHECK_TYPE(uint32_t, unsigned int)
XINETD_CHECK_TYPE(uint64_t, unsigned long long)
XINETD_CHECK_TYPE(uid_t, unsigned int)
XINETD_CHECK_TYPE(gid_t, unsigned int)
XINETD_CHECK_TYPE(socklen_t, unsigned int)
XINETD_CHECK_TYPE(rlim_t, long long)
AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
],
[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
[ ac_cv_have_struct_addrinfo="yes" ],
[ ac_cv_have_struct_addrinfo="no" ]
)
])
if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_ADDRINFO)
fi
AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <netinet/in.h>
],
[ struct in6_addr s; s.s6_addr[0] = 0; ],
[ ac_cv_have_struct_in6_addr="yes" ],
[ ac_cv_have_struct_in6_addr="no" ]
)
])
if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
fi
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <netinet/in.h>
],
[ struct sockaddr_in6 s; s.sin6_family = 0; ],
[ ac_cv_have_struct_sockaddr_in6="yes" ],
[ ac_cv_have_struct_sockaddr_in6="no" ]
)
])
if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
fi
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
],
[ struct sockaddr_storage s; ],
[ ac_cv_have_struct_sockaddr_storage="yes" ],
[ ac_cv_have_struct_sockaddr_storage="no" ]
)
])
if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
fi
case "$target_os" in
solaris*)
AC_DEFINE(N0_SIGLIST)
AC_DEFINE(solaris)
AC_MSG_CHECKING(whether to compile in loadavg)
AC_ARG_WITH(loadavg,
[ --with-loadavg[=PATH] Compile in loadavg support.],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_CHECK_LIB(kstat, main)
AC_CHECK_HEADER(kstat.h, [AC_DEFINE(HAVE_KSTAT_H)])
AC_DEFINE(HAVE_LOADAVG)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
esac ], AC_MSG_RESULT(no) )
;;
osf*)
LDFLAGS=-oldstyle_liblookup
AC_MSG_CHECKING(whether to compile in loadavg)
AC_ARG_WITH(loadavg,,
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
esac ], AC_MSG_RESULT(no))
;;
linux*|freebsd*)
AC_CHECK_LIB(crypt, main)
AC_MSG_CHECKING(whether to compile in loadavg)
AC_ARG_WITH(loadavg,,
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
esac ], AC_MSG_RESULT(no))
;;
darwin* | "Mac OS"*)
ac_cv_prog_RANLIB="ranlib"
# AC_CHECK_FUNCS doesn't look in the proper header file...
AC_DEFINE(HAVE_ISATTY)
CFLAGS="$CFLAGS -no-cpp-precomp"
AC_MSG_CHECKING(whether to compile in loadavg)
AC_ARG_WITH(loadavg,,
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LOADAVG)
;;
esac ], AC_MSG_RESULT(no))
;;
*bsdi*)
AC_MSG_CHECKING(whether to compile in loadavg)
AC_ARG_WITH(loadavg,,
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(bsdi)
AC_DEFINE(HAVE_LOADAVG)
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(bsdi)
AC_DEFINE(HAVE_LOADAVG)
;;
esac ], AC_MSG_RESULT(no))
;;
esac
AC_CHECK_LIB(c, crypt, [:], [
AC_CHECK_LIB(crypt, crypt, [
LIBS="-lcrypt $LIBS"
AC_DEFINE(HAVE_LIBCRYPT) ], []) ])
AC_CHECK_LIB(m, log10, [ LIBS="-lm $LIBS" ], [])
AC_MSG_CHECKING(whether to default to ipv6)
AC_ARG_WITH(inet6, [ --with-inet6 Compile in ipv6 support. (obsolete)],
AC_MSG_RESULT(ignored), AC_MSG_RESULT(ignored) )
AC_MSG_CHECKING(whether to use libwrap)
AC_ARG_WITH(libwrap,
[ --with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support.],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_CHECK_LIB(wrap, request_init, [
AC_DEFINE(LIBWRAP)
WRAPLIBS="-lwrap"
AC_DEFINE(HAVE_LIBWRAP) ])
AC_CHECK_LIB(nsl, yp_get_default_domain, [
WRAPLIBS="$WRAPLIBS -lnsl" ])
LIBS="$WRAPLIBS $LIBS"
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(LIBWRAP)
if test -d "$withval"; then
WRAPLIBS="-L$withval -lwrap"
else
WRAPLIBS="$withval"
fi
AC_CHECK_LIB(nsl, yp_get_default_domain, [
WRAPLIBS="$WRAPLIBS -lnsl" ])
OLDLIBS="$LIBS"
LIBS="$WRAPLIBS $LIBS"
AC_TRY_LINK([ int allow_severity; int deny_severity; ],
[ hosts_access(); ], [], [ AC_MSG_ERROR(Could not find the $withval library. You must first install tcp_wrappers.) ])
;;
esac ],
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(whether to use labeled-networking)
AC_ARG_WITH(labeled-networking,
[ --with-labeled-networking[=PATH] Compile in labeled networking support.],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_CHECK_LIB(selinux, setexeccon, [
AC_DEFINE(LABELED_NET)
LABELLIBS="-lselinux" ])
LIBS="$LABELLIBS $LIBS"
;;
*)
AC_MSG_RESULT(yes)
AC_DEFINE(LABELED_NET)
if test -d "$withval"; then
LABELLIBS="-L$withval -lselinux"
else
LABELLIBS="$withval"
fi
LIBS="$LABELLIBS $LIBS"
;;
esac ],
AC_MSG_RESULT(no)
)
AC_FUNC_MMAP
AC_CHECK_FUNCS(isatty)
AC_CHECK_FUNCS(memcpy)
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(sigvec)
AC_CHECK_FUNCS(setsid)
AC_CHECK_FUNCS(strftime)
# AC_CHECK_TYPE(R_OK,4)
mkdir -p libs/src/misc
mkdir -p libs/src/pset
mkdir -p libs/src/sio
mkdir -p libs/src/str
mkdir -p libs/src/xlog
mkdir -p libs/include
mkdir -p libs/lib
mkdir -p libs/man
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile libs/src/misc/Makefile libs/src/pset/Makefile libs/src/sio/Makefile libs/src/str/Makefile libs/src/xlog/Makefile libs/src/portable/Makefile xinetd/Makefile)
cp config.h libs/include