HEIMDAL: move code from source4/heimdal* to third_party/heimdal*
[samba.git] / third_party / heimdal / cf / roken-frag.m4
1 dnl $Id$
2 dnl
3 dnl some code to get roken working
4 dnl
5 dnl rk_ROKEN(subdir)
6 dnl
7 AC_DEFUN([rk_ROKEN], [
8
9 AC_REQUIRE([rk_CONFIG_HEADER])
10
11 DIR_roken=roken
12 LIB_roken='$(top_builddir)/$1/libroken.la'
13 INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
14
15 dnl Checks for programs
16 AC_REQUIRE([AC_PROG_CC])
17 AC_REQUIRE([AC_PROG_AWK])
18 AC_REQUIRE([AC_OBJEXT])
19 AC_REQUIRE([AC_EXEEXT])
20 AC_REQUIRE([LT_INIT])
21
22 AC_REQUIRE([AC_MIPS_ABI])
23
24 AC_DEFINE(rk_PATH_DELIM, '/', [Path name delimiter])
25
26 dnl C characteristics
27
28 AC_REQUIRE([AC_C___ATTRIBUTE__])
29 AC_REQUIRE([AC_C_INLINE])
30 AC_REQUIRE([AC_C_CONST])
31 rk_WFLAGS(-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -Wshadow)
32
33 dnl -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
34 dnl -Wcast-qual -Wswitch -Wformat=2 -Wwrite-strings
35
36 AC_REQUIRE([rk_DB])
37
38 dnl C types
39
40 AC_REQUIRE([AC_TYPE_SIZE_T])
41 AC_HAVE_TYPE([ssize_t],[#include <unistd.h>])
42 AC_REQUIRE([AC_TYPE_PID_T])
43 AC_REQUIRE([AC_TYPE_UID_T])
44 AC_HAVE_TYPE([long long])
45
46 AC_REQUIRE([rk_RETSIGTYPE])
47
48 dnl Checks for header files.
49 AC_REQUIRE([AC_HEADER_STDC])
50 AC_REQUIRE([AC_HEADER_TIME])
51
52 AC_CHECK_HEADERS([\
53         auxv.h                                  \
54         arpa/inet.h                             \
55         config.h                                \
56         crypt.h                                 \
57         dirent.h                                \
58         errno.h                                 \
59         err.h                                   \
60         fcntl.h                                 \
61         fnmatch.h                               \
62         grp.h                                   \
63         ifaddrs.h                               \
64         netinet/in.h                            \
65         netinet/in6.h                           \
66         netinet/in_systm.h                      \
67         netinet6/in6.h                          \
68         paths.h                                 \
69         poll.h                                  \
70         pwd.h                                   \
71         rpcsvc/ypclnt.h                         \
72         search.h                                \
73         shadow.h                                \
74         stdint.h                                \
75         sys/auxv.h                              \
76         sys/bswap.h                             \
77         sys/errno.h                             \
78         sys/exec_elf.h                          \
79         sys/ioctl.h                             \
80         sys/mman.h                              \
81         sys/param.h                             \
82         sys/resource.h                          \
83         sys/sockio.h                            \
84         sys/stat.h                              \
85         sys/time.h                              \
86         sys/tty.h                               \
87         sys/types.h                             \
88         sys/uio.h                               \
89         sys/utsname.h                           \
90         sys/wait.h                              \
91         syslog.h                                \
92         termios.h                               \
93         winsock2.h                              \
94         ws2tcpip.h                              \
95         unistd.h                                \
96         userconf.h                              \
97         usersec.h                               \
98         util.h                                  \
99 ])
100
101 AC_HAVE_TYPE([auxv_t],[#ifdef HAVE_AUXV_H
102 #include <auxv.h>
103 #endif
104 #ifdef HAVE_SYS_AUXV_H
105 #include <sys/auxv.h>
106 #endif
107 ])
108
109 AC_HAVE_TYPE([uintptr_t],[#ifdef HAVE_STDINT_H
110 #include <stdint.h>
111 #endif])
112
113 dnl Sunpro 5.2 has a vis.h which is something different.
114 AC_CHECK_HEADERS(vis.h, , , [
115 #include <vis.h>
116 #ifndef VIS_SP
117 #error invis
118 #endif])
119         
120 AC_CHECK_HEADERS(netdb.h, , , [AC_INCLUDES_DEFAULT
121 #ifdef HAVE_SYS_TYPES_H
122 #include <sys/types.h>
123 #endif
124 ])
125
126 AC_CHECK_HEADERS(sys/socket.h, , , [AC_INCLUDES_DEFAULT
127 #ifdef HAVE_SYS_TYPES_H
128 #include <sys/types.h>
129 #endif
130 ])
131
132 AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
133 #ifdef HAVE_SYS_TYPES_H
134 #include <sys/types.h>
135 #endif
136 #if HAVE_SYS_SOCKET_H
137 #include <sys/socket.h>
138 #endif])
139
140 AC_CHECK_HEADERS(netinet6/in6_var.h, , , [AC_INCLUDES_DEFAULT
141 #ifdef HAVE_SYS_TYPES_H
142 #include <sys/types.h>
143 #endif
144 #if HAVE_SYS_SOCKET_H
145 #include <sys/socket.h>
146 #endif
147 #ifdef HAVE_NETINET6_IN6_H
148 #include <netinet6/in6.h>
149 #endif
150 ])
151
152 AC_CHECK_HEADERS(sys/sysctl.h, , , [AC_INCLUDES_DEFAULT
153 #ifdef HAVE_SYS_PARAM_H
154 #include <sys/param.h>
155 #endif
156 ])
157
158 AC_CHECK_HEADERS(sys/proc.h, , , [AC_INCLUDES_DEFAULT
159 #ifdef HAVE_SYS_PARAM_H
160 #include <sys/param.h>
161 #endif
162 ])
163
164 AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
165
166 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
167 AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
168 AM_CONDITIONAL(have_search_h, test "$ac_cv_header_search_h" = yes)
169 AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
170
171 dnl Check for functions and libraries
172
173 AC_KRB_IPV6
174
175 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
176
177 rk_RESOLV
178
179 AC_BROKEN_SNPRINTF
180 AC_BROKEN_VSNPRINTF
181
182 AC_CHECK_FUNCS([                                \
183         asnprintf                               \
184         asprintf                                \
185         atexit                                  \
186         cgetent                                 \
187         getauxval                               \
188         getconfattr                             \
189         getprogname                             \
190         getrlimit                               \
191         issetugid                               \
192         memmem                                  \
193         mkdtemp                                 \
194         mkostemp                                \
195         on_exit                                 \
196         poll                                    \
197         random                                  \
198         secure_getenv                           \
199         setprogname                             \
200         strsvis                                 \
201         strsvisx                                \
202         strunvis                                \
203         strvis                                  \
204         strvisx                                 \
205         svis                                    \
206         sysconf                                 \
207         sysctl                                  \
208         tdelete                                 \
209         tfind                                   \
210         twalk                                   \
211         uname                                   \
212         unlinkat                                \
213         unvis                                   \
214         vasnprintf                              \
215         vasprintf                               \
216         vis                                     \
217 ])
218
219 if test "$ac_cv_func_cgetent" = no; then
220         AC_LIBOBJ(getcap)
221 fi
222 AM_CONDITIONAL(have_cgetent, test "$ac_cv_func_cgetent" = yes)
223
224 AC_REQUIRE([AC_FUNC_GETLOGIN])
225
226 AC_REQUIRE([AC_FUNC_MMAP])
227
228 AC_FIND_FUNC_NO_LIBS(getsockopt,,
229 [#ifdef HAVE_SYS_TYPES_H
230 #include <sys/types.h>
231 #endif
232 #ifdef HAVE_SYS_SOCKET_H
233 #include <sys/socket.h>
234 #endif],
235 [0,0,0,0,0])
236 AC_FIND_FUNC_NO_LIBS(setsockopt,,
237 [#ifdef HAVE_SYS_TYPES_H
238 #include <sys/types.h>
239 #endif
240 #ifdef HAVE_SYS_SOCKET_H
241 #include <sys/socket.h>
242 #endif],
243 [0,0,0,0,0])
244
245 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
246 [#ifdef HAVE_NETDB_H
247 #include <netdb.h>
248 #endif],
249 17)
250 AC_NEED_PROTO([
251 #ifdef HAVE_NETDB_H
252 #include <netdb.h>
253 #endif],
254 hstrerror)
255
256 AC_FOREACH([rk_func], [asprintf vasprintf asnprintf vasnprintf],
257         [AC_NEED_PROTO([
258         #include <stdio.h>
259         #include <string.h>],
260         rk_func)])
261
262 AC_FIND_FUNC_NO_LIBS(bswap16,,
263 [#ifdef HAVE_SYS_TYPES_H
264 #include <sys/types.h>
265 #endif
266 #ifdef HAVE_SYS_BSWAP_H
267 #include <sys/bswap.h>
268 #endif],0)
269
270 AC_FIND_FUNC_NO_LIBS(bswap32,,
271 [#ifdef HAVE_SYS_TYPES_H
272 #include <sys/types.h>
273 #endif
274 #ifdef HAVE_SYS_BSWAP_H
275 #include <sys/bswap.h>
276 #endif],0)
277
278 AC_FIND_FUNC_NO_LIBS(bswap64,,
279 [#ifdef HAVE_SYS_TYPES_H
280 #include <sys/types.h>
281 #endif
282 #ifdef HAVE_SYS_BSWAP_H
283 #include <sys/bswap.h>
284 #endif],0)
285
286 AC_FIND_FUNC_NO_LIBS(pidfile,util,
287 [#ifdef HAVE_UTIL_H
288 #include <util.h>
289 #endif],0)
290
291 AC_FIND_IF_NOT_BROKEN(getaddrinfo,,
292 [#ifdef HAVE_NETDB_H
293 #include <netdb.h>
294 #endif
295 #ifdef HAVE_WS2TCPIP_H
296 #include <ws2tcpip.h>
297 #endif],[0,0,0,0])
298
299 AC_FIND_IF_NOT_BROKEN(getnameinfo,,
300 [#ifdef HAVE_NETDB_H
301 #include <netdb.h>
302 #endif
303 #ifdef HAVE_WS2TCPIP_H
304 #include <ws2tcpip.h>
305 #endif],[0,0,0,0,0,0,0])
306
307 AC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
308 [#ifdef HAVE_NETDB_H
309 #include <netdb.h>
310 #endif
311 #ifdef HAVE_WS2TCPIP_H
312 #include <ws2tcpip.h>
313 #endif],[0])
314
315 AC_FIND_IF_NOT_BROKEN(gai_strerror,,
316 [#ifdef HAVE_NETDB_H
317 #include <netdb.h>
318 #endif
319 #ifdef HAVE_WS2TCPIP_H
320 #include <ws2tcpip.h>
321 #endif],[0])
322
323 AC_CHECK_LIB(util, emalloc)
324
325 case "$host_os" in
326         darwin*)
327                 ;;
328         *)
329                 AC_BROKEN([daemon]) ;;
330 esac
331
332 AC_BROKEN([                                     \
333         chown                                   \
334         copyhostent                             \
335         closefrom                               \
336         ecalloc                                 \
337         emalloc                                 \
338         erealloc                                \
339         estrdup                                 \
340         err                                     \
341         errx                                    \
342         fchown                                  \
343         flock                                   \
344         fnmatch                                 \
345         freehostent                             \
346         getcwd                                  \
347         getdtablesize                           \
348         getegid                                 \
349         geteuid                                 \
350         getgid                                  \
351         gethostname                             \
352         getifaddrs                              \
353         getipnodebyaddr                         \
354         getipnodebyname                         \
355         getopt                                  \
356         gettimeofday                            \
357         getuid                                  \
358         getusershell                            \
359         initgroups                              \
360         innetgr                                 \
361         localtime_r                             \
362         lstat                                   \
363         memmove                                 \
364         memset_s                                \
365         mergesort                               \
366         mergesort_r                             \
367         mkstemp                                 \
368         putenv                                  \
369         rcmd                                    \
370         readv                                   \
371         recvmsg                                 \
372         sendmsg                                 \
373         setegid                                 \
374         setenv                                  \
375         seteuid                                 \
376         strcasecmp                              \
377         strdup                                  \
378         strerror                                \
379         strftime                                \
380         strlcat                                 \
381         strlcpy                                 \
382         strlwr                                  \
383         strncasecmp                             \
384         strndup                                 \
385         strnlen                                 \
386         strptime                                \
387         strsep                                  \
388         strsep_copy                             \
389         strtok_r                                \
390         strtoll                                 \
391         strtoull                                \
392         strupr                                  \
393         swab                                    \
394         tsearch                                 \
395         timegm                                  \
396         unsetenv                                \
397         verr                                    \
398         verrx                                   \
399         vsyslog                                 \
400         vwarn                                   \
401         vwarnx                                  \
402         warn                                    \
403         warnx                                   \
404         writev                                  \
405 ])
406
407 AM_CONDITIONAL(have_fnmatch_h,
408         test "$ac_cv_header_fnmatch_h" = yes -a "$ac_cv_func_fnmatch" = yes)
409
410 AC_FOREACH([rk_func], [strndup strsep strtok_r],
411         [AC_NEED_PROTO([#include <string.h>], rk_func)])
412
413 AC_CHECK_FUNC([strtoll],
414     [AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
415         [Define if you have the function strtoll.])])
416
417 AC_CHECK_FUNC([strtoull],
418     [AC_DEFINE_UNQUOTED(HAVE_STRTOULL, 1,
419         [Define if you have the function strtoull.])])
420
421 AC_FOREACH([rk_func], [strsvis strsvisx strunvis strvis strvisx svis unvis vis],
422 [AC_NEED_PROTO([#ifdef HAVE_VIS_H
423 #include <vis.h>
424 #endif], rk_func)])
425
426 AC_MSG_CHECKING([checking for dirfd])
427 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
428 #ifdef HAVE_DIRENT_H
429 #include <dirent.h>
430 #endif
431 ]],
432         [[DIR *d = 0; dirfd(d);]])],
433         [ac_rk_have_dirfd=yes], [ac_rk_have_dirfd=no])
434 if test "$ac_rk_have_dirfd" = "yes" ; then
435         AC_DEFINE_UNQUOTED(HAVE_DIRFD, 1, [have a dirfd function/macro])
436 fi
437 AC_MSG_RESULT($ac_rk_have_dirfd)
438
439 AC_HAVE_STRUCT_FIELD(DIR, dd_fd, [#include <sys/types.h>
440 #ifdef HAVE_DIRENT_H
441 #include <dirent.h>
442 #endif])
443
444 AC_HAVE_STRUCT_FIELD(DIR, d_fd, [#include <sys/types.h>
445 #ifdef HAVE_DIRENT_H
446 #include <dirent.h>
447 #endif])
448
449 AC_BROKEN2(inet_aton,
450 [#ifdef HAVE_SYS_TYPES_H
451 #include <sys/types.h>
452 #endif
453 #ifdef HAVE_SYS_SOCKET_H
454 #include <sys/socket.h>
455 #endif
456 #ifdef HAVE_NETINET_IN_H
457 #include <netinet/in.h>
458 #endif
459 #ifdef HAVE_ARPA_INET_H
460 #include <arpa/inet.h>
461 #endif],
462 [0,0])
463
464 AC_BROKEN2(inet_ntop,
465 [#ifdef HAVE_SYS_TYPES_H
466 #include <sys/types.h>
467 #endif
468 #ifdef HAVE_SYS_SOCKET_H
469 #include <sys/socket.h>
470 #endif
471 #ifdef HAVE_NETINET_IN_H
472 #include <netinet/in.h>
473 #endif
474 #ifdef HAVE_ARPA_INET_H
475 #include <arpa/inet.h>
476 #endif],
477 [0, 0, 0, 0])
478
479 AC_BROKEN2(inet_pton,
480 [#ifdef HAVE_SYS_TYPES_H
481 #include <sys/types.h>
482 #endif
483 #ifdef HAVE_SYS_SOCKET_H
484 #include <sys/socket.h>
485 #endif
486 #ifdef HAVE_NETINET_IN_H
487 #include <netinet/in.h>
488 #endif
489 #ifdef HAVE_ARPA_INET_H
490 #include <arpa/inet.h>
491 #endif],
492 [0,0,0])
493
494 dnl
495 dnl Check for sa_len in struct sockaddr, 
496 dnl needs to come before the getnameinfo test
497 dnl
498 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
499 #include <sys/socket.h>])
500
501 if test "$ac_cv_func_getaddrinfo" = "yes"; then
502   rk_BROKEN_GETADDRINFO
503   if test "$ac_cv_func_getaddrinfo_numserv" = no; then
504         AC_LIBOBJ(getaddrinfo)
505         AC_LIBOBJ(freeaddrinfo)
506   fi
507 fi
508
509 AC_NEED_PROTO([#include <stdlib.h>], setenv)
510 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
511 AC_NEED_PROTO([#include <unistd.h>], gethostname)
512 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
513 AC_NEED_PROTO([#include <unistd.h>], getusershell)
514 AC_NEED_PROTO([#include <unistd.h>], daemon)
515
516 AC_NEED_PROTO([
517 #ifdef HAVE_SYS_TYPES_H
518 #include <sys/types.h>
519 #endif
520 #ifdef HAVE_SYS_SOCKET_H
521 #include <sys/socket.h>
522 #endif
523 #ifdef HAVE_NETINET_IN_H
524 #include <netinet/in.h>
525 #endif
526 #ifdef HAVE_ARPA_INET_H
527 #include <arpa/inet.h>
528 #endif],
529 inet_aton)
530
531 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
532
533 AC_REQUIRE([rk_BROKEN_REALLOC])dnl
534
535 dnl strerror_r is great fun, on linux it exists before sus catched up,
536 dnl so the return type is diffrent, lets check for both
537
538 AC_PROTO_COMPAT([
539 #include <stdio.h>
540 #include <string.h>
541 ],
542 strerror_r, int strerror_r(int, char *, size_t))
543
544 AC_CHECK_FUNC([strerror_r],
545     [AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
546         [Define if you have the function strerror_r.])])
547
548 dnl
549 dnl Checks for prototypes and declarations
550 dnl
551
552 AC_PROTO_COMPAT([
553 #ifdef HAVE_SYS_TYPES_H
554 #include <sys/types.h>
555 #endif
556 #ifdef HAVE_SYS_SOCKET_H
557 #include <sys/socket.h>
558 #endif
559 #ifdef HAVE_NETINET_IN_H
560 #include <netinet/in.h>
561 #endif
562 #ifdef HAVE_ARPA_INET_H
563 #include <arpa/inet.h>
564 #endif
565 #ifdef HAVE_NETDB_H
566 #include <netdb.h>
567 #endif
568 ],
569 gethostbyname, struct hostent *gethostbyname(const char *))
570
571 AC_PROTO_COMPAT([
572 #ifdef HAVE_SYS_TYPES_H
573 #include <sys/types.h>
574 #endif
575 #ifdef HAVE_SYS_SOCKET_H
576 #include <sys/socket.h>
577 #endif
578 #ifdef HAVE_NETINET_IN_H
579 #include <netinet/in.h>
580 #endif
581 #ifdef HAVE_ARPA_INET_H
582 #include <arpa/inet.h>
583 #endif
584 #ifdef HAVE_NETDB_H
585 #include <netdb.h>
586 #endif
587 ],
588 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
589
590 AC_PROTO_COMPAT([
591 #ifdef HAVE_SYS_TYPES_H
592 #include <sys/types.h>
593 #endif
594 #ifdef HAVE_SYS_SOCKET_H
595 #include <sys/socket.h>
596 #endif
597 #ifdef HAVE_NETINET_IN_H
598 #include <netinet/in.h>
599 #endif
600 #ifdef HAVE_ARPA_INET_H
601 #include <arpa/inet.h>
602 #endif
603 #ifdef HAVE_NETDB_H
604 #include <netdb.h>
605 #endif
606 ],
607 getservbyname, struct servent *getservbyname(const char *, const char *))
608
609 AC_PROTO_COMPAT([
610 #ifdef HAVE_SYS_TYPES_H
611 #include <sys/types.h>
612 #endif
613 #ifdef HAVE_SYS_SOCKET_H
614 #include <sys/socket.h>
615 #endif
616 ],
617 getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
618
619 AC_PROTO_COMPAT([
620 #ifdef HAVE_SYSLOG_H
621 #include <syslog.h>
622 #endif
623 ],
624 openlog, void openlog(const char *, int, int))
625
626 AC_NEED_PROTO([
627 #ifdef HAVE_CRYPT_H
628 #include <crypt.h>
629 #endif
630 #ifdef HAVE_UNISTD_H
631 #include <unistd.h>
632 #endif
633 ],
634 crypt)
635
636 dnl variables
637
638 rk_CHECK_VAR(h_errno, 
639 [#ifdef HAVE_SYS_TYPES_H
640 #include <sys/types.h>
641 #endif
642 #ifdef HAVE_NETDB_H
643 #include <netdb.h>
644 #endif
645 #ifdef HAVE_WS2TCPIP_H
646 #include <ws2tcpip.h>
647 #endif
648 ])
649
650 rk_CHECK_VAR(h_errlist, 
651 [#ifdef HAVE_NETDB_H
652 #include <netdb.h>
653 #endif
654 #ifdef HAVE_WS2TCPIP_H
655 #include <ws2tcpip.h>
656 #endif])
657
658 rk_CHECK_VAR(h_nerr, 
659 [#ifdef HAVE_NETDB_H
660 #include <netdb.h>
661 #endif
662 #ifdef HAVE_WS2TCPIP_H
663 #include <ws2tcpip.h>
664 #endif])
665
666 rk_CHECK_VAR([__progname], 
667 [#ifdef HAVE_ERR_H
668 #include <err.h>
669 #endif])
670
671 AC_CHECK_DECLS([optarg, optind, opterr, optopt, environ],[],[],[
672 #include <stdlib.h>
673 #ifdef HAVE_UNISTD_H
674 #include <unistd.h>
675 #endif])
676
677 dnl
678 dnl Check for fields in struct tm
679 dnl
680
681 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
682 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
683
684 dnl
685 dnl or do we have a variable `timezone' ?
686 dnl
687
688 rk_CHECK_VAR(timezone,[#include <time.h>])
689 rk_CHECK_VAR(altzone,[#include <time.h>])
690
691 AC_HAVE_TYPE([sa_family_t],[
692 #include <sys/types.h>
693 #ifdef HAVE_SYS_SOCKET_H
694 #include <sys/socket.h>
695 #endif
696 #ifdef HAVE_WS2TCPIP_H
697 #include <ws2tcpip.h>
698 #endif])
699 AC_HAVE_TYPE([socklen_t],[
700 #include <sys/types.h>
701 #ifdef HAVE_SYS_SOCKET_H
702 #include <sys/socket.h>
703 #endif
704 #ifdef HAVE_WS2TCPIP_H
705 #include <ws2tcpip.h>
706 #endif])
707 AC_HAVE_TYPE([struct sockaddr], [
708 #include <sys/types.h>
709 #ifdef HAVE_SYS_SOCKET_H
710 #include <sys/socket.h>
711 #endif
712 #ifdef HAVE_WS2TCPIP_H
713 #include <ws2tcpip.h>
714 #endif])
715 AC_HAVE_TYPE([struct sockaddr_storage], [
716 #include <sys/types.h>
717 #ifdef HAVE_SYS_SOCKET_H
718 #include <sys/socket.h>
719 #endif
720 #ifdef HAVE_WS2TCPIP_H
721 #include <ws2tcpip.h>
722 #endif])
723 AC_HAVE_TYPE([struct addrinfo], [
724 #include <sys/types.h>
725 #ifdef HAVE_NETDB_H
726 #include <netdb.h>
727 #endif
728 #ifdef HAVE_WS2TCPIP_H
729 #include <ws2tcpip.h>
730 #endif])
731 AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
732 AC_HAVE_TYPE([struct iovec],[
733 #include <sys/types.h>
734 #include <sys/uio.h>
735 ])
736 AC_HAVE_TYPE([struct msghdr],[
737 #include <sys/types.h>
738 #ifdef HAVE_SYS_SOCKET_H
739 #include <sys/socket.h>
740 #endif
741 #ifdef HAVE_WS2TCPIP_H
742 #include <ws2tcpip.h>
743 #endif])
744
745 dnl
746 dnl Check for struct winsize
747 dnl
748
749 AC_KRB_STRUCT_WINSIZE
750
751 dnl
752 dnl Check for struct spwd
753 dnl
754
755 AC_KRB_STRUCT_SPWD
756
757 #
758 # Check if we want samba's socket wrapper
759 #
760
761 samba_SOCKET_WRAPPER
762
763 dnl won't work with automake
764 dnl moved to AC_OUTPUT in configure.in
765 dnl AC_CONFIG_FILES($1/Makefile)
766
767 LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
768
769 AC_SUBST(DIR_roken)dnl
770 AC_SUBST(LIB_roken)dnl
771 AC_SUBST(INCLUDES_roken)dnl
772 ])