roken-frag.m4 revision 127808
138061Smsmithdnl $Id: roken-frag.m4,v 1.45.2.1 2004/04/01 07:27:35 joda Exp $
238061Smsmithdnl
338061Smsmithdnl some code to get roken working
438061Smsmithdnl
538061Smsmithdnl rk_ROKEN(subdir)
638061Smsmithdnl
738061SmsmithAC_DEFUN([rk_ROKEN], [
838061Smsmith
938061SmsmithAC_REQUIRE([rk_CONFIG_HEADER])
1038061Smsmith
1138061SmsmithDIR_roken=roken
1238061SmsmithLIB_roken='$(top_builddir)/$1/libroken.la'
1338061SmsmithINCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
1438061Smsmith
1538061Smsmithdnl Checks for programs
1638061SmsmithAC_REQUIRE([AC_PROG_CC])
1738061SmsmithAC_REQUIRE([AC_PROG_AWK])
1838061SmsmithAC_REQUIRE([AC_OBJEXT])
1938061SmsmithAC_REQUIRE([AC_EXEEXT])
2038061SmsmithAC_REQUIRE([AC_PROG_LIBTOOL])
2138061Smsmith
2238061SmsmithAC_REQUIRE([AC_MIPS_ABI])
2338061Smsmith
2438061Smsmithdnl C characteristics
2538061Smsmith
2638061SmsmithAC_REQUIRE([AC_C___ATTRIBUTE__])
2742443SnsouchAC_REQUIRE([AC_C_INLINE])
2838061SmsmithAC_REQUIRE([AC_C_CONST])
2938061SmsmithAC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
3038061Smsmith
3138061SmsmithAC_REQUIRE([rk_DB])
3238061Smsmith
3338061Smsmithdnl C types
3438061Smsmith
3538061SmsmithAC_REQUIRE([AC_TYPE_SIZE_T])
3638061SmsmithAC_HAVE_TYPE([ssize_t],[#include <unistd.h>])
3738061SmsmithAC_REQUIRE([AC_TYPE_PID_T])
3838061SmsmithAC_REQUIRE([AC_TYPE_UID_T])
3938061SmsmithAC_HAVE_TYPE([long long])
4038061Smsmith
4138061SmsmithAC_REQUIRE([rk_RETSIGTYPE])
4238061Smsmith
4338061Smsmithdnl Checks for header files.
4438061SmsmithAC_REQUIRE([AC_HEADER_STDC])
4538061SmsmithAC_REQUIRE([AC_HEADER_TIME])
4638061Smsmith
4738061SmsmithAC_CHECK_HEADERS([\
4838061Smsmith	arpa/inet.h				\
4938061Smsmith	arpa/nameser.h				\
5038061Smsmith	config.h				\
5138061Smsmith	crypt.h					\
5238061Smsmith	dirent.h				\
5338061Smsmith	errno.h					\
5438061Smsmith	err.h					\
5538061Smsmith	fcntl.h					\
5638061Smsmith	grp.h					\
5738061Smsmith	ifaddrs.h				\
5838061Smsmith	net/if.h				\
5938061Smsmith	netdb.h					\
6038061Smsmith	netinet/in.h				\
6138061Smsmith	netinet/in6.h				\
6238061Smsmith	netinet/in_systm.h			\
6338061Smsmith	netinet6/in6.h				\
6438061Smsmith	netinet6/in6_var.h			\
6538061Smsmith	paths.h					\
6638061Smsmith	pwd.h					\
6738061Smsmith	resolv.h				\
6838061Smsmith	rpcsvc/ypclnt.h				\
6938061Smsmith	shadow.h				\
7038061Smsmith	sys/bswap.h				\
7138061Smsmith	sys/ioctl.h				\
7238061Smsmith	sys/mman.h				\
7338061Smsmith	sys/param.h				\
7438061Smsmith	sys/proc.h				\
7538061Smsmith	sys/resource.h				\
7638061Smsmith	sys/socket.h				\
7738061Smsmith	sys/sockio.h				\
7838061Smsmith	sys/stat.h				\
7938061Smsmith	sys/sysctl.h				\
8038061Smsmith	sys/time.h				\
8138061Smsmith	sys/tty.h				\
8238061Smsmith	sys/types.h				\
8338061Smsmith	sys/uio.h				\
8438061Smsmith	sys/utsname.h				\
8538061Smsmith	sys/wait.h				\
8638061Smsmith	syslog.h				\
8738061Smsmith	termios.h				\
8838061Smsmith	unistd.h				\
8938061Smsmith	userconf.h				\
9038061Smsmith	usersec.h				\
9138061Smsmith	util.h					\
9238061Smsmith	vis.h					\
9338061Smsmith])
9438061Smsmith	
9538061SmsmithAC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
9638061Smsmith
9738061SmsmithAM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
9838061SmsmithAM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
9938061SmsmithAM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
10038061SmsmithAM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
10138061Smsmith
10238061Smsmithdnl Check for functions and libraries
10338061Smsmith
10438061SmsmithAC_FIND_FUNC(socket, socket)
10538061SmsmithAC_FIND_FUNC(gethostbyname, nsl)
10638061SmsmithAC_FIND_FUNC(syslog, syslog)
10738061Smsmith
10838061SmsmithAC_KRB_IPV6
10938061Smsmith
11038061SmsmithAC_FIND_FUNC(gethostbyname2, inet6 ip6)
11138061Smsmith
11238061SmsmithAC_FIND_FUNC(res_search, resolv,
11338061Smsmith[
11438061Smsmith#include <stdio.h>
11538061Smsmith#ifdef HAVE_SYS_TYPES_H
11638061Smsmith#include <sys/types.h>
11738061Smsmith#endif
11838061Smsmith#ifdef HAVE_NETINET_IN_H
11938061Smsmith#include <netinet/in.h>
12038061Smsmith#endif
12138061Smsmith#ifdef HAVE_ARPA_NAMESER_H
12238061Smsmith#include <arpa/nameser.h>
12338061Smsmith#endif
12438061Smsmith#ifdef HAVE_RESOLV_H
12538061Smsmith#include <resolv.h>
12638061Smsmith#endif
12738061Smsmith],
12838061Smsmith[0,0,0,0,0])
12938061Smsmith
13038061SmsmithAC_FIND_FUNC(res_nsearch, resolv,
13138061Smsmith[
13240993Snsouch#include <stdio.h>
13338061Smsmith#ifdef HAVE_SYS_TYPES_H
13440993Snsouch#include <sys/types.h>
13538061Smsmith#endif
13638061Smsmith#ifdef HAVE_NETINET_IN_H
13738061Smsmith#include <netinet/in.h>
13838061Smsmith#endif
13938061Smsmith#ifdef HAVE_ARPA_NAMESER_H
14038061Smsmith#include <arpa/nameser.h>
14138061Smsmith#endif
14238061Smsmith#ifdef HAVE_RESOLV_H
14338061Smsmith#include <resolv.h>
14438061Smsmith#endif
14538061Smsmith],
14638061Smsmith[0,0,0,0,0,0])
14738061Smsmith
14838061SmsmithAC_FIND_FUNC(dn_expand, resolv,
14938061Smsmith[
15038061Smsmith#include <stdio.h>
15138061Smsmith#ifdef HAVE_SYS_TYPES_H
15238061Smsmith#include <sys/types.h>
15338061Smsmith#endif
15438061Smsmith#ifdef HAVE_NETINET_IN_H
15538061Smsmith#include <netinet/in.h>
15638061Smsmith#endif
15738061Smsmith#ifdef HAVE_ARPA_NAMESER_H
15838061Smsmith#include <arpa/nameser.h>
15938061Smsmith#endif
16038061Smsmith#ifdef HAVE_RESOLV_H
16138061Smsmith#include <resolv.h>
16238061Smsmith#endif
16338061Smsmith],
16438061Smsmith[0,0,0,0,0])
16538061Smsmith
16638061Smsmithrk_CHECK_VAR(_res, 
16738061Smsmith[#include <stdio.h>
16838061Smsmith#ifdef HAVE_SYS_TYPES_H
16938061Smsmith#include <sys/types.h>
17038061Smsmith#endif
17138061Smsmith#ifdef HAVE_NETINET_IN_H
17238061Smsmith#include <netinet/in.h>
17338061Smsmith#endif
17438061Smsmith#ifdef HAVE_ARPA_NAMESER_H
17538061Smsmith#include <arpa/nameser.h>
17638061Smsmith#endif
17738061Smsmith#ifdef HAVE_RESOLV_H
17838061Smsmith#include <resolv.h>
17938061Smsmith#endif])
18038061Smsmith
18138061Smsmith
18238061SmsmithAC_BROKEN_SNPRINTF
18338061SmsmithAC_BROKEN_VSNPRINTF
18438061Smsmith
18538061SmsmithAC_BROKEN_GLOB
18638061Smsmithif test "$ac_cv_func_glob_working" != yes; then
18738061Smsmith	AC_LIBOBJ(glob)
18838061Smsmithfi
18938061SmsmithAM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
19038061Smsmith
19138061Smsmith
19238061SmsmithAC_CHECK_FUNCS([				\
19338061Smsmith	asnprintf				\
19438061Smsmith	asprintf				\
19538061Smsmith	atexit					\
19638061Smsmith	cgetent					\
19738061Smsmith	getconfattr				\
19838061Smsmith	getprogname				\
19938061Smsmith	getrlimit				\
20038061Smsmith	getspnam				\
20138061Smsmith	initstate				\
20238061Smsmith	issetugid				\
20338061Smsmith	on_exit					\
20438061Smsmith	random					\
20538061Smsmith	setprogname				\
20638061Smsmith	setstate				\
20738061Smsmith	strsvis					\
20838061Smsmith	strunvis				\
20938061Smsmith	strvis					\
21038061Smsmith	strvisx					\
21138061Smsmith	svis					\
21238061Smsmith	sysconf					\
21338061Smsmith	sysctl					\
21438061Smsmith	uname					\
21538061Smsmith	unvis					\
21638061Smsmith	vasnprintf				\
21740039Sdes	vasprintf				\
21838061Smsmith	vis					\
21938061Smsmith])
22038061Smsmith
22138061Smsmithif test "$ac_cv_func_cgetent" = no; then
22238061Smsmith	AC_LIBOBJ(getcap)
22338061Smsmithfi
22438061Smsmith
22538061SmsmithAC_REQUIRE([AC_FUNC_GETLOGIN])
22638061Smsmith
22738061SmsmithAC_REQUIRE([AC_FUNC_MMAP])
22838061Smsmith
22938061SmsmithAC_FIND_FUNC_NO_LIBS(getsockopt,,
23038061Smsmith[#ifdef HAVE_SYS_TYPES_H
23138061Smsmith#include <sys/types.h>
23238061Smsmith#endif
23338061Smsmith#ifdef HAVE_SYS_SOCKET_H
23438061Smsmith#include <sys/socket.h>
23538061Smsmith#endif],
23638061Smsmith[0,0,0,0,0])
23738061SmsmithAC_FIND_FUNC_NO_LIBS(setsockopt,,
23838061Smsmith[#ifdef HAVE_SYS_TYPES_H
23938061Smsmith#include <sys/types.h>
24038061Smsmith#endif
24138061Smsmith#ifdef HAVE_SYS_SOCKET_H
24238061Smsmith#include <sys/socket.h>
24338061Smsmith#endif],
24438061Smsmith[0,0,0,0,0])
24538061Smsmith
24638061SmsmithAC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
24738061Smsmith[#ifdef HAVE_NETDB_H
24838061Smsmith#include <netdb.h>
24938061Smsmith#endif],
25038061Smsmith17)
25138061SmsmithAC_NEED_PROTO([
25238061Smsmith#ifdef HAVE_NETDB_H
25338061Smsmith#include <netdb.h>
25438061Smsmith#endif],
25538061Smsmithhstrerror)
25638061Smsmith
25738061SmsmithAC_FOREACH([rk_func], [asprintf vasprintf asnprintf vasnprintf],
25838061Smsmith	[AC_NEED_PROTO([
25938061Smsmith	#include <stdio.h>
26038061Smsmith	#include <string.h>],
26138061Smsmith	rk_func)])
26238061Smsmith
26338061SmsmithAC_FIND_FUNC_NO_LIBS(bswap16,,
26438061Smsmith[#ifdef HAVE_SYS_BSWAP_H
26538061Smsmith#include <sys/bswap.h>
26638061Smsmith#endif],0)
26738061Smsmith
26838061SmsmithAC_FIND_FUNC_NO_LIBS(bswap32,,
26938061Smsmith[#ifdef HAVE_SYS_BSWAP_H
27038061Smsmith#include <sys/bswap.h>
27138061Smsmith#endif],0)
27238061Smsmith
27338061SmsmithAC_FIND_FUNC_NO_LIBS(pidfile,util,
27438061Smsmith[#ifdef HAVE_UTIL_H
27538061Smsmith#include <util.h>
27638061Smsmith#endif],0)
27738061Smsmith
27838061SmsmithAC_FIND_IF_NOT_BROKEN(getaddrinfo,,
27938061Smsmith[#ifdef HAVE_NETDB_H
28038061Smsmith#include <netdb.h>
28138061Smsmith#endif],[0,0,0,0])
28238061Smsmith
28338061SmsmithAC_FIND_IF_NOT_BROKEN(getnameinfo,,
28438061Smsmith[#ifdef HAVE_NETDB_H
28538061Smsmith#include <netdb.h>
28638061Smsmith#endif],[0,0,0,0,0,0,0])
28738061Smsmith
28838061SmsmithAC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
28938061Smsmith[#ifdef HAVE_NETDB_H
29038061Smsmith#include <netdb.h>
29138061Smsmith#endif],[0])
29238061Smsmith
29338061SmsmithAC_FIND_IF_NOT_BROKEN(gai_strerror,,
29438061Smsmith[#ifdef HAVE_NETDB_H
29538061Smsmith#include <netdb.h>
29638061Smsmith#endif],[0])
29738061Smsmith
29838061SmsmithAC_BROKEN([					\
29938061Smsmith	chown					\
30038061Smsmith	copyhostent				\
30138061Smsmith	daemon					\
30238061Smsmith	ecalloc					\
30338061Smsmith	emalloc					\
30438061Smsmith	erealloc				\
30538061Smsmith	estrdup					\
30638061Smsmith	err					\
30738061Smsmith	errx					\
30838061Smsmith	fchown					\
30938061Smsmith	flock					\
31038061Smsmith	fnmatch					\
31138061Smsmith	freehostent				\
31238061Smsmith	getcwd					\
31338061Smsmith	getdtablesize				\
31438061Smsmith	getegid					\
31538061Smsmith	geteuid					\
31638061Smsmith	getgid					\
31738061Smsmith	gethostname				\
31838061Smsmith	getifaddrs				\
31938061Smsmith	getipnodebyaddr				\
32038061Smsmith	getipnodebyname				\
32138061Smsmith	getopt					\
32238061Smsmith	gettimeofday				\
32338061Smsmith	getuid					\
32438061Smsmith	getusershell				\
32538061Smsmith	initgroups				\
32638061Smsmith	innetgr					\
32738061Smsmith	iruserok				\
32838061Smsmith	localtime_r				\
32938061Smsmith	lstat					\
33038061Smsmith	memmove					\
33138061Smsmith	mkstemp					\
33238061Smsmith	putenv					\
33338061Smsmith	rcmd					\
33438061Smsmith	readv					\
33538061Smsmith	recvmsg					\
33638061Smsmith	sendmsg					\
33738061Smsmith	setegid					\
33838061Smsmith	setenv					\
33942443Snsouch	seteuid					\
34038061Smsmith	strcasecmp				\
34138061Smsmith	strdup					\
34238061Smsmith	strerror				\
34338061Smsmith	strftime				\
34438061Smsmith	strlcat					\
34542443Snsouch	strlcpy					\
34642443Snsouch	strlwr					\
34742443Snsouch	strncasecmp				\
34842443Snsouch	strndup					\
34938061Smsmith	strnlen					\
35038061Smsmith	strptime				\
35138061Smsmith	strsep					\
35238061Smsmith	strsep_copy				\
35338061Smsmith	strtok_r				\
35438061Smsmith	strupr					\
35538061Smsmith	swab					\
35638061Smsmith	unsetenv				\
35738061Smsmith	verr					\
35838061Smsmith	verrx					\
35938061Smsmith	vsyslog					\
36038061Smsmith	vwarn					\
36138061Smsmith	vwarnx					\
36238061Smsmith	warn					\
36338061Smsmith	warnx					\
36438061Smsmith	writev					\
36538061Smsmith])
36638061Smsmith
36738061SmsmithAC_FOREACH([rk_func], [strndup strsep strtok_r],
36838061Smsmith	[AC_NEED_PROTO([#include <string.h>], rk_func)])
36938061Smsmith
37038061SmsmithAC_FOREACH([rk_func], [strsvis strunvis strvis strvisx svis unvis vis],
37138061Smsmith[AC_NEED_PROTO([#ifdef HAVE_VIS_H
37238061Smsmith#include <vis.h>
37338061Smsmith#endif], rk_func)])
37438061Smsmith
37538061SmsmithAC_BROKEN2(inet_aton,
37638061Smsmith[#ifdef HAVE_SYS_TYPES_H
37738061Smsmith#include <sys/types.h>
37838061Smsmith#endif
37938061Smsmith#ifdef HAVE_SYS_SOCKET_H
38038061Smsmith#include <sys/socket.h>
38138061Smsmith#endif
38238061Smsmith#ifdef HAVE_NETINET_IN_H
38338061Smsmith#include <netinet/in.h>
38438061Smsmith#endif
38538061Smsmith#ifdef HAVE_ARPA_INET_H
38638061Smsmith#include <arpa/inet.h>
38738061Smsmith#endif],
38838061Smsmith[0,0])
38938061Smsmith
39038061SmsmithAC_BROKEN2(inet_ntop,
39138061Smsmith[#ifdef HAVE_SYS_TYPES_H
39238061Smsmith#include <sys/types.h>
39338061Smsmith#endif
39438061Smsmith#ifdef HAVE_SYS_SOCKET_H
39538061Smsmith#include <sys/socket.h>
39638061Smsmith#endif
39740626Smsmith#ifdef HAVE_NETINET_IN_H
39840626Smsmith#include <netinet/in.h>
39940626Smsmith#endif
40040626Smsmith#ifdef HAVE_ARPA_INET_H
40140626Smsmith#include <arpa/inet.h>
40240626Smsmith#endif],
40340626Smsmith[0, 0, 0, 0])
40438061Smsmith
40538373SbdeAC_BROKEN2(inet_pton,
40638061Smsmith[#ifdef HAVE_SYS_TYPES_H
40738061Smsmith#include <sys/types.h>
40838061Smsmith#endif
40938061Smsmith#ifdef HAVE_SYS_SOCKET_H
41038061Smsmith#include <sys/socket.h>
41138061Smsmith#endif
41238061Smsmith#ifdef HAVE_NETINET_IN_H
41338061Smsmith#include <netinet/in.h>
41438061Smsmith#endif
41538061Smsmith#ifdef HAVE_ARPA_INET_H
41638061Smsmith#include <arpa/inet.h>
41738061Smsmith#endif],
41838061Smsmith[0,0,0])
41938061Smsmith
42038061Smsmithdnl
42138061Smsmithdnl Check for sa_len in struct sockaddr, 
42238061Smsmithdnl needs to come before the getnameinfo test
42338061Smsmithdnl
42438061SmsmithAC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
42538061Smsmith#include <sys/socket.h>])
42638061Smsmith
42738061Smsmithif test "$ac_cv_func_getnameinfo" = "yes"; then
42838061Smsmith  rk_BROKEN_GETNAMEINFO
42938061Smsmith  if test "$ac_cv_func_getnameinfo_broken" = yes; then
43042443Snsouch	AC_LIBOBJ(getnameinfo)
43138061Smsmith  fi
43238061Smsmithfi
43338061Smsmith
43438061Smsmithif test "$ac_cv_func_getaddrinfo" = "yes"; then
43538061Smsmith  rk_BROKEN_GETADDRINFO
43638061Smsmith  if test "$ac_cv_func_getaddrinfo_numserv" = no; then
43738061Smsmith	AC_LIBOBJ(getaddrinfo)
43838061Smsmith	AC_LIBOBJ(freeaddrinfo)
43938061Smsmith  fi
44038061Smsmithfi
44138061Smsmith
44238061SmsmithAC_NEED_PROTO([#include <stdlib.h>], setenv)
44338061SmsmithAC_NEED_PROTO([#include <stdlib.h>], unsetenv)
44438061SmsmithAC_NEED_PROTO([#include <unistd.h>], gethostname)
44538061SmsmithAC_NEED_PROTO([#include <unistd.h>], mkstemp)
44638061SmsmithAC_NEED_PROTO([#include <unistd.h>], getusershell)
44738061Smsmith
44838061SmsmithAC_NEED_PROTO([
44938061Smsmith#ifdef HAVE_SYS_TYPES_H
45038061Smsmith#include <sys/types.h>
45138061Smsmith#endif
45238061Smsmith#ifdef HAVE_SYS_SOCKET_H
45338061Smsmith#include <sys/socket.h>
45438061Smsmith#endif
45538061Smsmith#ifdef HAVE_NETINET_IN_H
45638061Smsmith#include <netinet/in.h>
45738061Smsmith#endif
45838061Smsmith#ifdef HAVE_ARPA_INET_H
45938061Smsmith#include <arpa/inet.h>
46038061Smsmith#endif],
46138061Smsmithinet_aton)
46238061Smsmith
46338061SmsmithAC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
46438061Smsmith
46538061SmsmithAC_REQUIRE([rk_BROKEN_REALLOC])dnl
46638061Smsmith
46738061Smsmithdnl AC_KRB_FUNC_GETCWD_BROKEN
46838061Smsmith
46938061Smsmithdnl
47038061Smsmithdnl Checks for prototypes and declarations
47138061Smsmithdnl
47238061Smsmith
47338061SmsmithAC_PROTO_COMPAT([
47438061Smsmith#ifdef HAVE_SYS_TYPES_H
47538061Smsmith#include <sys/types.h>
47638061Smsmith#endif
47738061Smsmith#ifdef HAVE_SYS_SOCKET_H
47838061Smsmith#include <sys/socket.h>
47938061Smsmith#endif
48038061Smsmith#ifdef HAVE_NETINET_IN_H
48138061Smsmith#include <netinet/in.h>
48238061Smsmith#endif
48338061Smsmith#ifdef HAVE_ARPA_INET_H
48438061Smsmith#include <arpa/inet.h>
48538061Smsmith#endif
48638061Smsmith#ifdef HAVE_NETDB_H
48738061Smsmith#include <netdb.h>
48838061Smsmith#endif
48938061Smsmith],
49038061Smsmithgethostbyname, struct hostent *gethostbyname(const char *))
49138061Smsmith
49238061SmsmithAC_PROTO_COMPAT([
49338061Smsmith#ifdef HAVE_SYS_TYPES_H
49438061Smsmith#include <sys/types.h>
49538061Smsmith#endif
49638061Smsmith#ifdef HAVE_SYS_SOCKET_H
49738061Smsmith#include <sys/socket.h>
49838061Smsmith#endif
49938061Smsmith#ifdef HAVE_NETINET_IN_H
50038061Smsmith#include <netinet/in.h>
50138061Smsmith#endif
50238061Smsmith#ifdef HAVE_ARPA_INET_H
50338061Smsmith#include <arpa/inet.h>
50438061Smsmith#endif
50538061Smsmith#ifdef HAVE_NETDB_H
50638061Smsmith#include <netdb.h>
50738061Smsmith#endif
50838061Smsmith],
50938061Smsmithgethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
51038061Smsmith
51138061SmsmithAC_PROTO_COMPAT([
51238061Smsmith#ifdef HAVE_SYS_TYPES_H
51338061Smsmith#include <sys/types.h>
51438061Smsmith#endif
51538061Smsmith#ifdef HAVE_SYS_SOCKET_H
51638061Smsmith#include <sys/socket.h>
51738061Smsmith#endif
51838061Smsmith#ifdef HAVE_NETINET_IN_H
51938061Smsmith#include <netinet/in.h>
52038061Smsmith#endif
52138061Smsmith#ifdef HAVE_ARPA_INET_H
52238061Smsmith#include <arpa/inet.h>
52338061Smsmith#endif
52438061Smsmith#ifdef HAVE_NETDB_H
52538061Smsmith#include <netdb.h>
52638061Smsmith#endif
52738061Smsmith],
52838061Smsmithgetservbyname, struct servent *getservbyname(const char *, const char *))
52938061Smsmith
53038061SmsmithAC_PROTO_COMPAT([
53138061Smsmith#ifdef HAVE_SYS_TYPES_H
53238061Smsmith#include <sys/types.h>
53338061Smsmith#endif
53438061Smsmith#ifdef HAVE_SYS_SOCKET_H
53538061Smsmith#include <sys/socket.h>
53638061Smsmith#endif
53738061Smsmith],
53838061Smsmithgetsockname, int getsockname(int, struct sockaddr*, socklen_t*))
53938061Smsmith
54038061SmsmithAC_PROTO_COMPAT([
54138061Smsmith#ifdef HAVE_SYSLOG_H
54238061Smsmith#include <syslog.h>
54338061Smsmith#endif
54438061Smsmith],
54538061Smsmithopenlog, void openlog(const char *, int, int))
54638061Smsmith
54738061SmsmithAC_NEED_PROTO([
54838061Smsmith#ifdef HAVE_CRYPT_H
54938061Smsmith#include <crypt.h>
55038061Smsmith#endif
55138061Smsmith#ifdef HAVE_UNISTD_H
55238061Smsmith#include <unistd.h>
55338061Smsmith#endif
55438061Smsmith],
55538061Smsmithcrypt)
55638061Smsmith
55738061Smsmithdnl variables
55838061Smsmith
55938061Smsmithrk_CHECK_VAR(h_errno, 
56038061Smsmith[#ifdef HAVE_SYS_TYPES_H
56138061Smsmith#include <sys/types.h>
56238061Smsmith#endif
56338061Smsmith#ifdef HAVE_NETDB_H
56438061Smsmith#include <netdb.h>
56538061Smsmith#endif])
56638061Smsmith
56738061Smsmithrk_CHECK_VAR(h_errlist, 
56838061Smsmith[#ifdef HAVE_NETDB_H
56938061Smsmith#include <netdb.h>
57038061Smsmith#endif])
57138061Smsmith
57238061Smsmithrk_CHECK_VAR(h_nerr, 
57338061Smsmith[#ifdef HAVE_NETDB_H
57438061Smsmith#include <netdb.h>
57538061Smsmith#endif])
57638061Smsmith
57738061Smsmithrk_CHECK_VAR([__progname], 
57838061Smsmith[#ifdef HAVE_ERR_H
57938061Smsmith#include <err.h>
58038061Smsmith#endif])
58138061Smsmith
58238061SmsmithAC_CHECK_DECLARATION([#include <stdlib.h>
58338061Smsmith#ifdef HAVE_UNISTD_H
58438061Smsmith#include <unistd.h>
58538061Smsmith#endif], optarg)
58638061SmsmithAC_CHECK_DECLARATION([#include <stdlib.h>
58738061Smsmith#ifdef HAVE_UNISTD_H
58838061Smsmith#include <unistd.h>
58938061Smsmith#endif], optind)
59038061SmsmithAC_CHECK_DECLARATION([#include <stdlib.h>
59138061Smsmith#ifdef HAVE_UNISTD_H
59238061Smsmith#include <unistd.h>
59338061Smsmith#endif], opterr)
59438061SmsmithAC_CHECK_DECLARATION([#include <stdlib.h>
59538061Smsmith#ifdef HAVE_UNISTD_H
59638061Smsmith#include <unistd.h>
59738061Smsmith#endif], optopt)
59838061Smsmith
59938061SmsmithAC_CHECK_DECLARATION([#include <stdlib.h>], environ)
60038061Smsmith
60138061Smsmithdnl
60238061Smsmithdnl Check for fields in struct tm
60338061Smsmithdnl
60438061Smsmith
60538061SmsmithAC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
60638061SmsmithAC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
60738061Smsmith
60838061Smsmithdnl
60938061Smsmithdnl or do we have a variable `timezone' ?
61038061Smsmithdnl
61138061Smsmith
61238061Smsmithrk_CHECK_VAR(timezone,[#include <time.h>])
61338061Smsmithrk_CHECK_VAR(altzone,[#include <time.h>])
61438061Smsmith
61538061SmsmithAC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
61638061SmsmithAC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
61738061SmsmithAC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
61838061SmsmithAC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
61938061SmsmithAC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
62038061SmsmithAC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
62138061SmsmithAC_HAVE_TYPE([struct iovec],[
62238061Smsmith#include <sys/types.h>
62338061Smsmith#include <sys/uio.h>
62438061Smsmith])
62538061SmsmithAC_HAVE_TYPE([struct msghdr],[
62638061Smsmith#include <sys/types.h>
62738061Smsmith#include <sys/socket.h>
62838061Smsmith])
62938061Smsmith
63038061Smsmithdnl
63138061Smsmithdnl Check for struct winsize
63238061Smsmithdnl
63338061Smsmith
63438061SmsmithAC_KRB_STRUCT_WINSIZE
63538061Smsmith
63638061Smsmithdnl
63738061Smsmithdnl Check for struct spwd
63838061Smsmithdnl
63938061Smsmith
64038061SmsmithAC_KRB_STRUCT_SPWD
64138061Smsmith
64238061Smsmithdnl won't work with automake
64338061Smsmithdnl moved to AC_OUTPUT in configure.in
64438061Smsmithdnl AC_CONFIG_FILES($1/Makefile)
64538061Smsmith
64638061SmsmithLIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
64738061Smsmith
64838061SmsmithAC_SUBST(DIR_roken)dnl
64938061SmsmithAC_SUBST(LIB_roken)dnl
65038061SmsmithAC_SUBST(INCLUDES_roken)dnl
65138061Smsmith])
65238061Smsmith