roken-frag.m4 revision 102644
1219820Sjeffdnl $Id: roken-frag.m4,v 1.42 2002/08/26 13:26:52 assar Exp $
2219820Sjeffdnl
3219820Sjeffdnl some code to get roken working
4219820Sjeffdnl
5219820Sjeffdnl rk_ROKEN(subdir)
6219820Sjeffdnl
7219820SjeffAC_DEFUN(rk_ROKEN, [
8219820Sjeff
9219820SjeffAC_REQUIRE([rk_CONFIG_HEADER])
10219820Sjeff
11219820SjeffDIR_roken=roken
12219820SjeffLIB_roken='$(top_builddir)/$1/libroken.la'
13219820SjeffINCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
14219820Sjeff
15219820Sjeffdnl Checks for programs
16219820SjeffAC_REQUIRE([AC_PROG_CC])
17219820SjeffAC_REQUIRE([AC_PROG_AWK])
18219820SjeffAC_REQUIRE([AC_OBJEXT])
19219820SjeffAC_REQUIRE([AC_EXEEXT])
20219820SjeffAC_REQUIRE([AC_PROG_LIBTOOL])
21219820Sjeff
22219820SjeffAC_REQUIRE([AC_MIPS_ABI])
23219820Sjeff
24219820Sjeffdnl C characteristics
25219820Sjeff
26219820SjeffAC_REQUIRE([AC_C___ATTRIBUTE__])
27219820SjeffAC_REQUIRE([AC_C_INLINE])
28219820SjeffAC_REQUIRE([AC_C_CONST])
29219820SjeffAC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
30219820Sjeff
31219820SjeffAC_REQUIRE([rk_DB])
32219820Sjeff
33219820Sjeffdnl C types
34219820Sjeff
35219820SjeffAC_REQUIRE([AC_TYPE_SIZE_T])
36219820SjeffAC_HAVE_TYPE([ssize_t],[#include <unistd.h>])
37219820SjeffAC_REQUIRE([AC_TYPE_PID_T])
38219820SjeffAC_REQUIRE([AC_TYPE_UID_T])
39219820SjeffAC_HAVE_TYPE([long long])
40219820Sjeff
41219820SjeffAC_REQUIRE([rk_RETSIGTYPE])
42219820Sjeff
43219820Sjeffdnl Checks for header files.
44219820SjeffAC_REQUIRE([AC_HEADER_STDC])
45219820SjeffAC_REQUIRE([AC_HEADER_TIME])
46219820Sjeff
47219820SjeffAC_CHECK_HEADERS([\
48219820Sjeff	arpa/inet.h				\
49219820Sjeff	arpa/nameser.h				\
50219820Sjeff	config.h				\
51219820Sjeff	crypt.h					\
52219820Sjeff	dirent.h				\
53219820Sjeff	errno.h					\
54219820Sjeff	err.h					\
55219820Sjeff	fcntl.h					\
56219820Sjeff	grp.h					\
57219820Sjeff	ifaddrs.h				\
58219820Sjeff	net/if.h				\
59219820Sjeff	netdb.h					\
60219820Sjeff	netinet/in.h				\
61219820Sjeff	netinet/in6.h				\
62219820Sjeff	netinet/in_systm.h			\
63219820Sjeff	netinet6/in6.h				\
64219820Sjeff	netinet6/in6_var.h			\
65219820Sjeff	paths.h					\
66219820Sjeff	pwd.h					\
67219820Sjeff	resolv.h				\
68219820Sjeff	rpcsvc/ypclnt.h				\
69219820Sjeff	shadow.h				\
70219820Sjeff	sys/bswap.h				\
71219820Sjeff	sys/ioctl.h				\
72219820Sjeff	sys/param.h				\
73219820Sjeff	sys/proc.h				\
74219820Sjeff	sys/resource.h				\
75219820Sjeff	sys/socket.h				\
76219820Sjeff	sys/sockio.h				\
77219820Sjeff	sys/stat.h				\
78219820Sjeff	sys/sysctl.h				\
79219820Sjeff	sys/time.h				\
80219820Sjeff	sys/tty.h				\
81219820Sjeff	sys/types.h				\
82219820Sjeff	sys/uio.h				\
83219820Sjeff	sys/utsname.h				\
84219820Sjeff	sys/wait.h				\
85219820Sjeff	syslog.h				\
86219820Sjeff	termios.h				\
87219820Sjeff	unistd.h				\
88219820Sjeff	userconf.h				\
89219820Sjeff	usersec.h				\
90219820Sjeff	util.h					\
91219820Sjeff	vis.h					\
92219820Sjeff])
93219820Sjeff	
94219820SjeffAC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
95219820Sjeff
96219820SjeffAM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
97219820SjeffAM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
98219820SjeffAM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
99219820SjeffAM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
100219820Sjeff
101219820Sjeffdnl Check for functions and libraries
102219820Sjeff
103219820SjeffAC_FIND_FUNC(socket, socket)
104219820SjeffAC_FIND_FUNC(gethostbyname, nsl)
105219820SjeffAC_FIND_FUNC(syslog, syslog)
106219820Sjeff
107219820SjeffAC_KRB_IPV6
108219820Sjeff
109219820SjeffAC_FIND_FUNC(gethostbyname2, inet6 ip6)
110219820Sjeff
111219820SjeffAC_FIND_FUNC(res_search, resolv,
112219820Sjeff[
113219820Sjeff#include <stdio.h>
114219820Sjeff#ifdef HAVE_SYS_TYPES_H
115219820Sjeff#include <sys/types.h>
116219820Sjeff#endif
117219820Sjeff#ifdef HAVE_NETINET_IN_H
118219820Sjeff#include <netinet/in.h>
119219820Sjeff#endif
120219820Sjeff#ifdef HAVE_ARPA_NAMESER_H
121219820Sjeff#include <arpa/nameser.h>
122219820Sjeff#endif
123219820Sjeff#ifdef HAVE_RESOLV_H
124219820Sjeff#include <resolv.h>
125219820Sjeff#endif
126219820Sjeff],
127219820Sjeff[0,0,0,0,0])
128219820Sjeff
129219820SjeffAC_FIND_FUNC(dn_expand, resolv,
130219820Sjeff[
131219820Sjeff#include <stdio.h>
132219820Sjeff#ifdef HAVE_SYS_TYPES_H
133219820Sjeff#include <sys/types.h>
134219820Sjeff#endif
135219820Sjeff#ifdef HAVE_NETINET_IN_H
136219820Sjeff#include <netinet/in.h>
137219820Sjeff#endif
138219820Sjeff#ifdef HAVE_ARPA_NAMESER_H
139219820Sjeff#include <arpa/nameser.h>
140219820Sjeff#endif
141219820Sjeff#ifdef HAVE_RESOLV_H
142219820Sjeff#include <resolv.h>
143219820Sjeff#endif
144219820Sjeff],
145219820Sjeff[0,0,0,0,0])
146219820Sjeff
147219820Sjeffrk_CHECK_VAR(_res, 
148219820Sjeff[#include <stdio.h>
149219820Sjeff#ifdef HAVE_SYS_TYPES_H
150219820Sjeff#include <sys/types.h>
151219820Sjeff#endif
152219820Sjeff#ifdef HAVE_NETINET_IN_H
153219820Sjeff#include <netinet/in.h>
154219820Sjeff#endif
155219820Sjeff#ifdef HAVE_ARPA_NAMESER_H
156219820Sjeff#include <arpa/nameser.h>
157219820Sjeff#endif
158219820Sjeff#ifdef HAVE_RESOLV_H
159219820Sjeff#include <resolv.h>
160219820Sjeff#endif])
161219820Sjeff
162219820Sjeff
163219820SjeffAC_BROKEN_SNPRINTF
164219820SjeffAC_BROKEN_VSNPRINTF
165219820Sjeff
166219820SjeffAC_BROKEN_GLOB
167219820Sjeffif test "$ac_cv_func_glob_working" != yes; then
168219820Sjeff	AC_LIBOBJ(glob)
169219820Sjefffi
170219820SjeffAM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
171219820Sjeff
172219820Sjeff
173219820SjeffAC_CHECK_FUNCS([				\
174219820Sjeff	asnprintf				\
175219820Sjeff	asprintf				\
176219820Sjeff	atexit					\
177219820Sjeff	cgetent					\
178219820Sjeff	getconfattr				\
179219820Sjeff	getprogname				\
180219820Sjeff	getrlimit				\
181219820Sjeff	getspnam				\
182219820Sjeff	initstate				\
183219820Sjeff	issetugid				\
184219820Sjeff	on_exit					\
185219820Sjeff	random					\
186219820Sjeff	setprogname				\
187219820Sjeff	setstate				\
188219820Sjeff	strsvis					\
189219820Sjeff	strunvis				\
190219820Sjeff	strvis					\
191219820Sjeff	strvisx					\
192219820Sjeff	svis					\
193219820Sjeff	sysconf					\
194219820Sjeff	sysctl					\
195219820Sjeff	uname					\
196219820Sjeff	unvis					\
197219820Sjeff	vasnprintf				\
198219820Sjeff	vasprintf				\
199219820Sjeff	vis					\
200219820Sjeff])
201219820Sjeff
202219820Sjeffif test "$ac_cv_func_cgetent" = no; then
203219820Sjeff	AC_LIBOBJ(getcap)
204219820Sjefffi
205219820Sjeff
206219820SjeffAC_REQUIRE([AC_FUNC_GETLOGIN])
207219820Sjeff
208219820SjeffAC_FIND_FUNC_NO_LIBS(getsockopt,,
209219820Sjeff[#ifdef HAVE_SYS_TYPES_H
210219820Sjeff#include <sys/types.h>
211219820Sjeff#endif
212219820Sjeff#ifdef HAVE_SYS_SOCKET_H
213219820Sjeff#include <sys/socket.h>
214219820Sjeff#endif],
215219820Sjeff[0,0,0,0,0])
216219820SjeffAC_FIND_FUNC_NO_LIBS(setsockopt,,
217219820Sjeff[#ifdef HAVE_SYS_TYPES_H
218219820Sjeff#include <sys/types.h>
219219820Sjeff#endif
220219820Sjeff#ifdef HAVE_SYS_SOCKET_H
221219820Sjeff#include <sys/socket.h>
222219820Sjeff#endif],
223219820Sjeff[0,0,0,0,0])
224219820Sjeff
225219820SjeffAC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
226219820Sjeff[#ifdef HAVE_NETDB_H
227219820Sjeff#include <netdb.h>
228219820Sjeff#endif],
229219820Sjeff17)
230219820SjeffAC_NEED_PROTO([
231219820Sjeff#ifdef HAVE_NETDB_H
232219820Sjeff#include <netdb.h>
233219820Sjeff#endif],
234219820Sjeffhstrerror)
235219820Sjeff
236219820SjeffAC_FOREACH([rk_func], [asprintf vasprintf asnprintf vasnprintf],
237219820Sjeff	[AC_NEED_PROTO([
238219820Sjeff	#include <stdio.h>
239219820Sjeff	#include <string.h>],
240219820Sjeff	rk_func)])
241219820Sjeff
242219820SjeffAC_FIND_FUNC_NO_LIBS(bswap16,,
243219820Sjeff[#ifdef HAVE_SYS_BSWAP_H
244219820Sjeff#include <sys/bswap.h>
245219820Sjeff#endif],0)
246219820Sjeff
247219820SjeffAC_FIND_FUNC_NO_LIBS(bswap32,,
248219820Sjeff[#ifdef HAVE_SYS_BSWAP_H
249219820Sjeff#include <sys/bswap.h>
250219820Sjeff#endif],0)
251219820Sjeff
252219820SjeffAC_FIND_FUNC_NO_LIBS(pidfile,util,
253219820Sjeff[#ifdef HAVE_UTIL_H
254219820Sjeff#include <util.h>
255219820Sjeff#endif],0)
256219820Sjeff
257219820SjeffAC_FIND_IF_NOT_BROKEN(getaddrinfo,,
258219820Sjeff[#ifdef HAVE_NETDB_H
259219820Sjeff#include <netdb.h>
260219820Sjeff#endif],[0,0,0,0])
261219820Sjeff
262219820SjeffAC_FIND_IF_NOT_BROKEN(getnameinfo,,
263219820Sjeff[#ifdef HAVE_NETDB_H
264219820Sjeff#include <netdb.h>
265219820Sjeff#endif],[0,0,0,0,0,0,0])
266219820Sjeff
267219820SjeffAC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
268219820Sjeff[#ifdef HAVE_NETDB_H
269219820Sjeff#include <netdb.h>
270219820Sjeff#endif],[0])
271219820Sjeff
272219820SjeffAC_FIND_IF_NOT_BROKEN(gai_strerror,,
273219820Sjeff[#ifdef HAVE_NETDB_H
274219820Sjeff#include <netdb.h>
275219820Sjeff#endif],[0])
276219820Sjeff
277219820SjeffAC_BROKEN([					\
278219820Sjeff	chown					\
279219820Sjeff	copyhostent				\
280219820Sjeff	daemon					\
281219820Sjeff	ecalloc					\
282219820Sjeff	emalloc					\
283219820Sjeff	erealloc				\
284219820Sjeff	estrdup					\
285219820Sjeff	err					\
286219820Sjeff	errx					\
287219820Sjeff	fchown					\
288219820Sjeff	flock					\
289219820Sjeff	fnmatch					\
290219820Sjeff	freehostent				\
291219820Sjeff	getcwd					\
292219820Sjeff	getdtablesize				\
293219820Sjeff	getegid					\
294219820Sjeff	geteuid					\
295219820Sjeff	getgid					\
296219820Sjeff	gethostname				\
297219820Sjeff	getifaddrs				\
298219820Sjeff	getipnodebyaddr				\
299219820Sjeff	getipnodebyname				\
300219820Sjeff	getopt					\
301219820Sjeff	gettimeofday				\
302219820Sjeff	getuid					\
303219820Sjeff	getusershell				\
304219820Sjeff	initgroups				\
305219820Sjeff	innetgr					\
306219820Sjeff	iruserok				\
307219820Sjeff	localtime_r				\
308219820Sjeff	lstat					\
309219820Sjeff	memmove					\
310219820Sjeff	mkstemp					\
311219820Sjeff	putenv					\
312219820Sjeff	rcmd					\
313219820Sjeff	readv					\
314219820Sjeff	recvmsg					\
315219820Sjeff	sendmsg					\
316219820Sjeff	setegid					\
317219820Sjeff	setenv					\
318219820Sjeff	seteuid					\
319219820Sjeff	strcasecmp				\
320219820Sjeff	strdup					\
321219820Sjeff	strerror				\
322219820Sjeff	strftime				\
323219820Sjeff	strlcat					\
324219820Sjeff	strlcpy					\
325219820Sjeff	strlwr					\
326219820Sjeff	strncasecmp				\
327219820Sjeff	strndup					\
328219820Sjeff	strnlen					\
329219820Sjeff	strptime				\
330219820Sjeff	strsep					\
331219820Sjeff	strsep_copy				\
332219820Sjeff	strtok_r				\
333219820Sjeff	strupr					\
334219820Sjeff	swab					\
335219820Sjeff	unsetenv				\
336219820Sjeff	verr					\
337219820Sjeff	verrx					\
338219820Sjeff	vsyslog					\
339219820Sjeff	vwarn					\
340219820Sjeff	vwarnx					\
341219820Sjeff	warn					\
342219820Sjeff	warnx					\
343219820Sjeff	writev					\
344219820Sjeff])
345219820Sjeff
346219820SjeffAC_FOREACH([rk_func], [strndup strsep strtok_r],
347219820Sjeff	[AC_NEED_PROTO([#include <string.h>], rk_func)])
348219820Sjeff
349219820SjeffAC_FOREACH([rk_func], [strsvis strunvis strvis strvisx svis unvis vis],
350219820Sjeff[AC_NEED_PROTO([#ifdef HAVE_VIS_H
351219820Sjeff#include <vis.h>
352219820Sjeff#endif], rk_func)])
353219820Sjeff
354219820SjeffAC_BROKEN2(inet_aton,
355219820Sjeff[#ifdef HAVE_SYS_TYPES_H
356219820Sjeff#include <sys/types.h>
357219820Sjeff#endif
358219820Sjeff#ifdef HAVE_SYS_SOCKET_H
359219820Sjeff#include <sys/socket.h>
360219820Sjeff#endif
361219820Sjeff#ifdef HAVE_NETINET_IN_H
362219820Sjeff#include <netinet/in.h>
363219820Sjeff#endif
364219820Sjeff#ifdef HAVE_ARPA_INET_H
365219820Sjeff#include <arpa/inet.h>
366219820Sjeff#endif],
367219820Sjeff[0,0])
368219820Sjeff
369219820SjeffAC_BROKEN2(inet_ntop,
370219820Sjeff[#ifdef HAVE_SYS_TYPES_H
371219820Sjeff#include <sys/types.h>
372219820Sjeff#endif
373219820Sjeff#ifdef HAVE_SYS_SOCKET_H
374219820Sjeff#include <sys/socket.h>
375219820Sjeff#endif
376219820Sjeff#ifdef HAVE_NETINET_IN_H
377219820Sjeff#include <netinet/in.h>
378219820Sjeff#endif
379219820Sjeff#ifdef HAVE_ARPA_INET_H
380219820Sjeff#include <arpa/inet.h>
381219820Sjeff#endif],
382219820Sjeff[0, 0, 0, 0])
383219820Sjeff
384219820SjeffAC_BROKEN2(inet_pton,
385219820Sjeff[#ifdef HAVE_SYS_TYPES_H
386219820Sjeff#include <sys/types.h>
387219820Sjeff#endif
388219820Sjeff#ifdef HAVE_SYS_SOCKET_H
389219820Sjeff#include <sys/socket.h>
390219820Sjeff#endif
391219820Sjeff#ifdef HAVE_NETINET_IN_H
392219820Sjeff#include <netinet/in.h>
393219820Sjeff#endif
394219820Sjeff#ifdef HAVE_ARPA_INET_H
395219820Sjeff#include <arpa/inet.h>
396219820Sjeff#endif],
397219820Sjeff[0,0,0])
398219820Sjeff
399219820Sjeffdnl
400219820Sjeffdnl Check for sa_len in struct sockaddr, 
401219820Sjeffdnl needs to come before the getnameinfo test
402219820Sjeffdnl
403219820SjeffAC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
404219820Sjeff#include <sys/socket.h>])
405219820Sjeff
406219820Sjeffif test "$ac_cv_func_getnameinfo" = "yes"; then
407219820Sjeff  rk_BROKEN_GETNAMEINFO
408219820Sjeff  if test "$ac_cv_func_getnameinfo_broken" = yes; then
409219820Sjeff	AC_LIBOBJ(getnameinfo)
410219820Sjeff  fi
411219820Sjefffi
412219820Sjeff
413219820Sjeffif test "$ac_cv_func_getaddrinfo" = "yes"; then
414219820Sjeff  rk_BROKEN_GETADDRINFO
415219820Sjeff  if test "$ac_cv_func_getaddrinfo_numserv" = no; then
416219820Sjeff	AC_LIBOBJ(getaddrinfo)
417219820Sjeff	AC_LIBOBJ(freeaddrinfo)
418219820Sjeff  fi
419219820Sjefffi
420219820Sjeff
421219820SjeffAC_NEED_PROTO([#include <stdlib.h>], setenv)
422219820SjeffAC_NEED_PROTO([#include <stdlib.h>], unsetenv)
423219820SjeffAC_NEED_PROTO([#include <unistd.h>], gethostname)
424219820SjeffAC_NEED_PROTO([#include <unistd.h>], mkstemp)
425219820SjeffAC_NEED_PROTO([#include <unistd.h>], getusershell)
426219820Sjeff
427219820SjeffAC_NEED_PROTO([
428219820Sjeff#ifdef HAVE_SYS_TYPES_H
429219820Sjeff#include <sys/types.h>
430219820Sjeff#endif
431219820Sjeff#ifdef HAVE_SYS_SOCKET_H
432219820Sjeff#include <sys/socket.h>
433219820Sjeff#endif
434219820Sjeff#ifdef HAVE_NETINET_IN_H
435219820Sjeff#include <netinet/in.h>
436219820Sjeff#endif
437219820Sjeff#ifdef HAVE_ARPA_INET_H
438219820Sjeff#include <arpa/inet.h>
439219820Sjeff#endif],
440219820Sjeffinet_aton)
441219820Sjeff
442219820SjeffAC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
443219820Sjeff
444219820SjeffAC_REQUIRE([rk_BROKEN_REALLOC])dnl
445219820Sjeff
446219820Sjeffdnl AC_KRB_FUNC_GETCWD_BROKEN
447219820Sjeff
448219820Sjeffdnl
449219820Sjeffdnl Checks for prototypes and declarations
450219820Sjeffdnl
451219820Sjeff
452219820SjeffAC_PROTO_COMPAT([
453219820Sjeff#ifdef HAVE_SYS_TYPES_H
454219820Sjeff#include <sys/types.h>
455219820Sjeff#endif
456219820Sjeff#ifdef HAVE_SYS_SOCKET_H
457219820Sjeff#include <sys/socket.h>
458219820Sjeff#endif
459219820Sjeff#ifdef HAVE_NETINET_IN_H
460219820Sjeff#include <netinet/in.h>
461219820Sjeff#endif
462219820Sjeff#ifdef HAVE_ARPA_INET_H
463219820Sjeff#include <arpa/inet.h>
464219820Sjeff#endif
465219820Sjeff#ifdef HAVE_NETDB_H
466219820Sjeff#include <netdb.h>
467219820Sjeff#endif
468219820Sjeff],
469219820Sjeffgethostbyname, struct hostent *gethostbyname(const char *))
470219820Sjeff
471219820SjeffAC_PROTO_COMPAT([
472219820Sjeff#ifdef HAVE_SYS_TYPES_H
473219820Sjeff#include <sys/types.h>
474219820Sjeff#endif
475219820Sjeff#ifdef HAVE_SYS_SOCKET_H
476219820Sjeff#include <sys/socket.h>
477219820Sjeff#endif
478219820Sjeff#ifdef HAVE_NETINET_IN_H
479219820Sjeff#include <netinet/in.h>
480219820Sjeff#endif
481219820Sjeff#ifdef HAVE_ARPA_INET_H
482219820Sjeff#include <arpa/inet.h>
483219820Sjeff#endif
484219820Sjeff#ifdef HAVE_NETDB_H
485219820Sjeff#include <netdb.h>
486219820Sjeff#endif
487219820Sjeff],
488219820Sjeffgethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
489219820Sjeff
490219820SjeffAC_PROTO_COMPAT([
491219820Sjeff#ifdef HAVE_SYS_TYPES_H
492219820Sjeff#include <sys/types.h>
493219820Sjeff#endif
494219820Sjeff#ifdef HAVE_SYS_SOCKET_H
495219820Sjeff#include <sys/socket.h>
496219820Sjeff#endif
497219820Sjeff#ifdef HAVE_NETINET_IN_H
498219820Sjeff#include <netinet/in.h>
499219820Sjeff#endif
500219820Sjeff#ifdef HAVE_ARPA_INET_H
501219820Sjeff#include <arpa/inet.h>
502219820Sjeff#endif
503219820Sjeff#ifdef HAVE_NETDB_H
504219820Sjeff#include <netdb.h>
505219820Sjeff#endif
506219820Sjeff],
507219820Sjeffgetservbyname, struct servent *getservbyname(const char *, const char *))
508219820Sjeff
509219820SjeffAC_PROTO_COMPAT([
510219820Sjeff#ifdef HAVE_SYS_TYPES_H
511219820Sjeff#include <sys/types.h>
512219820Sjeff#endif
513219820Sjeff#ifdef HAVE_SYS_SOCKET_H
514219820Sjeff#include <sys/socket.h>
515219820Sjeff#endif
516219820Sjeff],
517219820Sjeffgetsockname, int getsockname(int, struct sockaddr*, socklen_t*))
518219820Sjeff
519219820SjeffAC_PROTO_COMPAT([
520219820Sjeff#ifdef HAVE_SYSLOG_H
521219820Sjeff#include <syslog.h>
522219820Sjeff#endif
523219820Sjeff],
524219820Sjeffopenlog, void openlog(const char *, int, int))
525219820Sjeff
526219820SjeffAC_NEED_PROTO([
527219820Sjeff#ifdef HAVE_CRYPT_H
528219820Sjeff#include <crypt.h>
529219820Sjeff#endif
530219820Sjeff#ifdef HAVE_UNISTD_H
531219820Sjeff#include <unistd.h>
532219820Sjeff#endif
533219820Sjeff],
534219820Sjeffcrypt)
535219820Sjeff
536219820Sjeffdnl variables
537219820Sjeff
538219820Sjeffrk_CHECK_VAR(h_errno, 
539219820Sjeff[#ifdef HAVE_SYS_TYPES_H
540219820Sjeff#include <sys/types.h>
541219820Sjeff#endif
542219820Sjeff#ifdef HAVE_NETDB_H
543219820Sjeff#include <netdb.h>
544219820Sjeff#endif])
545219820Sjeff
546219820Sjeffrk_CHECK_VAR(h_errlist, 
547219820Sjeff[#ifdef HAVE_NETDB_H
548219820Sjeff#include <netdb.h>
549219820Sjeff#endif])
550219820Sjeff
551219820Sjeffrk_CHECK_VAR(h_nerr, 
552219820Sjeff[#ifdef HAVE_NETDB_H
553219820Sjeff#include <netdb.h>
554219820Sjeff#endif])
555219820Sjeff
556219820Sjeffrk_CHECK_VAR([__progname], 
557219820Sjeff[#ifdef HAVE_ERR_H
558219820Sjeff#include <err.h>
559219820Sjeff#endif])
560219820Sjeff
561219820SjeffAC_CHECK_DECLARATION([#include <stdlib.h>
562219820Sjeff#ifdef HAVE_UNISTD_H
563219820Sjeff#include <unistd.h>
564219820Sjeff#endif], optarg)
565219820SjeffAC_CHECK_DECLARATION([#include <stdlib.h>
566219820Sjeff#ifdef HAVE_UNISTD_H
567219820Sjeff#include <unistd.h>
568219820Sjeff#endif], optind)
569219820SjeffAC_CHECK_DECLARATION([#include <stdlib.h>
570219820Sjeff#ifdef HAVE_UNISTD_H
571219820Sjeff#include <unistd.h>
572219820Sjeff#endif], opterr)
573219820SjeffAC_CHECK_DECLARATION([#include <stdlib.h>
574219820Sjeff#ifdef HAVE_UNISTD_H
575219820Sjeff#include <unistd.h>
576219820Sjeff#endif], optopt)
577219820Sjeff
578219820SjeffAC_CHECK_DECLARATION([#include <stdlib.h>], environ)
579219820Sjeff
580219820Sjeffdnl
581219820Sjeffdnl Check for fields in struct tm
582219820Sjeffdnl
583219820Sjeff
584219820SjeffAC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
585219820SjeffAC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
586219820Sjeff
587219820Sjeffdnl
588219820Sjeffdnl or do we have a variable `timezone' ?
589219820Sjeffdnl
590219820Sjeff
591219820Sjeffrk_CHECK_VAR(timezone,[#include <time.h>])
592219820Sjeffrk_CHECK_VAR(altzone,[#include <time.h>])
593219820Sjeff
594219820SjeffAC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
595219820SjeffAC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
596219820SjeffAC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
597219820SjeffAC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
598219820SjeffAC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
599219820SjeffAC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
600219820SjeffAC_HAVE_TYPE([struct iovec],[
601219820Sjeff#include <sys/types.h>
602219820Sjeff#include <sys/uio.h>
603219820Sjeff])
604219820SjeffAC_HAVE_TYPE([struct msghdr],[
605219820Sjeff#include <sys/types.h>
606219820Sjeff#include <sys/socket.h>
607219820Sjeff])
608219820Sjeff
609219820Sjeffdnl
610219820Sjeffdnl Check for struct winsize
611219820Sjeffdnl
612219820Sjeff
613219820SjeffAC_KRB_STRUCT_WINSIZE
614219820Sjeff
615219820Sjeffdnl
616219820Sjeffdnl Check for struct spwd
617219820Sjeffdnl
618219820Sjeff
619219820SjeffAC_KRB_STRUCT_SPWD
620219820Sjeff
621219820Sjeffdnl won't work with automake
622219820Sjeffdnl moved to AC_OUTPUT in configure.in
623219820Sjeffdnl AC_CONFIG_FILES($1/Makefile)
624219820Sjeff
625219820SjeffLIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
626219820Sjeff
627219820SjeffAC_SUBST(DIR_roken)dnl
628219820SjeffAC_SUBST(LIB_roken)dnl
629219820SjeffAC_SUBST(INCLUDES_roken)dnl
630219820Sjeff])
631219820Sjeff