]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/bind9/lib/bind/configure.in
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / bind9 / lib / bind / configure.in
1 # Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 2001, 2003  Internet Software Consortium.
3 #
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
7 #
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
15
16 AC_REVISION($Revision: 1.90.18.43 $)
17
18 AC_INIT(resolv/herror.c)
19 AC_PREREQ(2.13)
20
21 AC_CONFIG_HEADER(config.h)
22
23 AC_CANONICAL_HOST
24
25 AC_PROG_MAKE_SET
26 AC_PROG_RANLIB
27 AC_PROG_INSTALL
28
29 AC_SUBST(STD_CINCLUDES)
30 AC_SUBST(STD_CDEFINES)
31 AC_SUBST(STD_CWARNINGS)
32 AC_SUBST(CCOPT)
33
34 AC_PATH_PROG(AR, ar)
35 ARFLAGS="cruv"
36 AC_SUBST(AR)
37 AC_SUBST(ARFLAGS)
38
39 # The POSIX ln(1) program.  Non-POSIX systems may substitute
40 # "copy" or something.
41 LN=ln
42 AC_SUBST(LN)
43
44 case "$AR" in
45         "")
46                 AC_MSG_ERROR([
47 ar program not found.  Please fix your PATH to include the directory in
48 which ar resides, or set AR in the environment with the full path to ar.
49 ])
50
51                 ;;
52 esac
53
54 #
55 # Etags.
56 #
57 AC_PATH_PROGS(ETAGS, etags emacs-etags)
58
59 #
60 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
61 # GNU emacs etags, and it requires the -L flag.
62 #
63 if test "X$ETAGS" != "X"; then
64         AC_MSG_CHECKING(for Exuberant Ctags etags)
65         if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
66                 AC_MSG_RESULT(yes)
67                 ETAGS="$ETAGS -L"
68         else
69                 AC_MSG_RESULT(no)
70         fi
71 fi
72 AC_SUBST(ETAGS)
73
74 #
75 # Perl is optional; it is used only by some of the system test scripts.
76 #
77 AC_PATH_PROGS(PERL, perl5 perl)
78 AC_SUBST(PERL)
79
80 #
81 # isc/list.h and others clash with the rest of BIND 9
82 #
83 case "$includedir" in
84         '${prefix}/include')
85                 includedir='${prefix}/bind/include'
86                 ;;
87 esac
88 case "$libdir" in
89         '${prefix}/lib')
90                 libdir='${prefix}/bind/lib'
91                 ;;
92 esac
93
94 #
95 # Make sure INSTALL uses an absolute path, else it will be wrong in all
96 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
97 # configure based on the location of the file where it is substituted.
98 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
99 # subdirectory of install-sh, This relative path will be wrong for all
100 # directories more than one level down from install-sh.
101 #
102 case "$INSTALL" in
103         /*)
104                 ;;
105         *)
106                 #
107                 # Not all systems have dirname.
108                 #
109                 changequote({, })
110                 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
111                 changequote([, ])
112
113                 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
114                 test "$ac_dir" = "$ac_prog" && ac_dir=.
115                 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
116                 INSTALL="$ac_dir/$ac_prog"
117                 ;;
118 esac
119
120 #
121 # On these hosts, we really want to use cc, not gcc, even if it is
122 # found.  The gcc that these systems have will not correctly handle
123 # pthreads.
124 #
125 # However, if the user sets $CC to be something, let that override
126 # our change.
127 #
128 if test "X$CC" = "X" ; then
129         case "$host" in
130                 *-dec-osf*)
131                         CC="cc"
132                         ;;
133                 *-solaris*)
134                         # Use Sun's cc if it is available, but watch
135                         # out for /usr/ucb/cc; it will never be the right
136                         # compiler to use.
137                         #
138                         # If setting CC here fails, the AC_PROG_CC done
139                         # below might still find gcc.
140                         IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
141                         for ac_dir in $PATH; do
142                                 test -z "$ac_dir" && ac_dir=.
143                                 case "$ac_dir" in
144                                 /usr/ucb)
145                                         # exclude
146                                         ;;
147                                 *)
148                                         if test -f "$ac_dir/cc"; then
149                                                 CC="$ac_dir/cc"
150                                                 break
151                                         fi
152                                         ;;
153                                 esac
154                         done
155                         IFS="$ac_save_ifs"
156                         ;;
157                 *-hp-hpux*)
158                         CC="cc"
159                         ;;
160                 mips-sgi-irix*)
161                         CC="cc"
162                         ;;
163         esac
164 fi
165
166
167 AC_PROG_CC
168
169 AC_HEADER_STDC
170
171
172 AC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h stropts.h memory.h)
173
174 AC_C_CONST
175 AC_C_INLINE
176 AC_TYPE_SIZE_T
177 AC_CHECK_TYPE(ssize_t,signed)
178 AC_CHECK_TYPE(uintptr_t,unsigned long)
179 AC_HEADER_TIME
180 #
181 # check if we need to #include sys/select.h explicitly
182 #
183 case $ac_cv_header_unistd_h in
184 yes)
185 AC_MSG_CHECKING(if unistd.h defines fd_set)
186 AC_TRY_COMPILE([
187 #include <unistd.h>],
188 [fd_set read_set; return (0);],
189         [AC_MSG_RESULT(yes)
190          ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
191          ],
192         [AC_MSG_RESULT(no)
193         case ac_cv_header_sys_select_h in
194         yes)
195          ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
196                 ;;
197         no)
198                 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
199                 ;;
200         esac
201         ])
202         ;;
203 no)
204         case ac_cv_header_sys_select_h in
205         yes)
206              ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
207                 ;;
208         no)
209                 AC_MSG_ERROR([need either unistd.h or sys/select.h])
210                 ;;
211         esac
212         ;;
213 esac
214 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
215
216 #
217 # Find the machine's endian flavor.
218 #
219 AC_C_BIGENDIAN
220
221 AC_ARG_WITH(irs-gr,[ --with-irs-gr              Build ....],
222 want_irs_gr="$withval", want_irs_gr="no")
223 case "$want_irs_gr" in
224 yes) WANT_IRS_GR="#define WANT_IRS_GR 1"
225      WANT_IRS_GR_OBJS="\${WANT_IRS_GR_OBJS}"
226         ;;
227 *) WANT_IRS_GR="#undef WANT_IRS_GR" WANT_IRS_GR_OBJS="";;
228 esac
229 AC_SUBST(WANT_IRS_GR)
230 AC_SUBST(WANT_IRS_GR_OBJS)
231
232 AC_ARG_WITH(irs-pw,[ --with-irs-pw              Build ....],
233 want_irs_pw="$withval", want_irs_pw="no")
234 case "$want_irs_pw" in
235 yes) WANT_IRS_PW="#define WANT_IRS_PW 1"
236      WANT_IRS_PW_OBJS="\${WANT_IRS_PW_OBJS}";;
237 *) WANT_IRS_PW="#undef WANT_IRS_PW" WANT_IRS_PW_OBJS="";;
238 esac
239 AC_SUBST(WANT_IRS_PW)
240 AC_SUBST(WANT_IRS_PW_OBJS)
241
242 AC_ARG_WITH(irs-nis,[ --with-irs-nis            Build ....],
243 want_irs_nis="$withval", want_irs_nis="no")
244 case "$want_irs_nis" in
245 yes)
246         WANT_IRS_NIS="#define WANT_IRS_NIS 1"
247         WANT_IRS_NIS_OBJS="\${WANT_IRS_NIS_OBJS}"
248         case "$want_irs_gr" in
249         yes)
250                 WANT_IRS_NISGR_OBJS="\${WANT_IRS_NISGR_OBJS}";;
251         *)
252                 WANT_IRS_NISGR_OBJS="";;
253         esac
254         case "$want_irs_pw" in
255         yes)
256                 WANT_IRS_NISPW_OBJS="\${WANT_IRS_NISPW_OBJS}";;
257         *)
258                 WANT_IRS_NISPW_OBJS="";;
259         esac
260         ;;
261 *)
262         WANT_IRS_NIS="#undef WANT_IRS_NIS"
263         WANT_IRS_NIS_OBJS=""
264         WANT_IRS_NISGR_OBJS=""
265         WANT_IRS_NISPW_OBJS="";;
266 esac
267 AC_SUBST(WANT_IRS_NIS)
268 AC_SUBST(WANT_IRS_NIS_OBJS)
269 AC_SUBST(WANT_IRS_NISGR_OBJS)
270 AC_SUBST(WANT_IRS_NISPW_OBJS)
271 AC_TRY_RUN([
272 #ifdef HAVE_DB_H
273 int have_db_h = 1;
274 #else
275 int have_db_h = 0;
276 #endif
277 main() { return(!have_db_h); }
278 ],
279 WANT_IRS_DBPW_OBJS="\${WANT_IRS_DBPW_OBJS}"
280 ,
281 WANT_IRS_DBPW_OBJS=""
282 ,
283 WANT_IRS_DBPW_OBJS=""
284 )
285 AC_SUBST(WANT_IRS_DBPW_OBJS)
286
287 #
288 # was --with-randomdev specified?
289 #
290 AC_MSG_CHECKING(for random device)
291 AC_ARG_WITH(randomdev,
292 [  --with-randomdev=PATH Specify path for random device],
293     use_randomdev="$withval", use_randomdev="unspec")
294
295 case "$use_randomdev" in
296         unspec)
297                 case "$host" in
298                         *-openbsd*)
299                                 devrandom=/dev/srandom
300                                 ;;
301                         *)
302                                 devrandom=/dev/random
303                                 ;;
304                 esac
305                 AC_MSG_RESULT($devrandom)
306                 AC_CHECK_FILE($devrandom,
307                               AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
308                                                  "$devrandom"),)
309                 ;;
310         yes)
311                 AC_MSG_ERROR([--with-randomdev must specify a path])
312                 ;;
313         *)
314                 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
315                 AC_MSG_RESULT(using "$use_randomdev")
316                 ;;
317 esac
318
319 sinclude(../../config.threads.in)dnl
320
321 if $use_threads
322 then
323         if test "X$GCC" = "Xyes"; then
324                 case "$host" in
325                 *-freebsd*)
326                         CC="$CC -pthread"
327                         CCOPT="$CCOPT -pthread"
328                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
329                         ;;
330                 *-openbsd*)
331                         CC="$CC -pthread"
332                         CCOPT="$CCOPT -pthread"
333                         ;;
334                 *-solaris*)
335                         LIBS="$LIBS -lthread"
336                         ;;
337                 *-ibm-aix*)
338                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
339                         ;;
340                 esac
341         else
342                 case $host in
343                 *-dec-osf*)
344                         CC="$CC -pthread"
345                         CCOPT="$CCOPT -pthread"
346                         ;;
347                 *-solaris*)
348                         CC="$CC -mt"
349                         CCOPT="$CCOPT -mt"
350                         ;;
351                 *-ibm-aix*)
352                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
353                         ;;
354                 *-UnixWare*)
355                         CC="$CC -Kthread"
356                         CCOPT="$CCOPT -Kthread"
357                         ;;
358                 esac
359         fi
360         AC_DEFINE(_REENTRANT)
361         ALWAYS_DEFINES="-D_REENTRANT"
362         DO_PTHREADS="#define DO_PTHREADS 1"
363         WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}"
364         WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}"
365         case $host in
366         ia64-hp-hpux11.*)
367                 WANT_IRS_THREADS_OBJS="";;
368         *)
369                 WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}";;
370         esac
371         WANT_THREADS_OBJS="\${WANT_THREADS_OBJS}"
372         thread_dir=pthreads
373
374         #
375         # We'd like to use sigwait() too
376         #
377         AC_CHECK_FUNC(sigwait,
378                       AC_DEFINE(HAVE_SIGWAIT),
379                       AC_CHECK_LIB(c, sigwait,
380                       AC_DEFINE(HAVE_SIGWAIT),
381                       AC_CHECK_LIB(pthread, sigwait,
382                                    AC_DEFINE(HAVE_SIGWAIT),
383                                    AC_CHECK_LIB(pthread, _Psigwait,
384                                                 AC_DEFINE(HAVE_SIGWAIT),))))
385
386         AC_CHECK_FUNC(pthread_attr_getstacksize,
387                       AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
388
389         #
390         # Additional OS-specific issues related to pthreads and sigwait.
391         #
392         case "$host" in
393                 #
394                 # One more place to look for sigwait.
395                 #
396                 *-freebsd*)
397                         AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
398                         ;;
399                 #
400                 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
401                 # called before certain pthreads calls.  This is deprecated
402                 # in BSD/OS 4.1.
403                 #
404                 *-bsdi3.*|*-bsdi4.0*)
405                         AC_DEFINE(NEED_PTHREAD_INIT)
406                         ;;
407                 #
408                 # LinuxThreads requires some changes to the way we
409                 # deal with signals.
410                 #
411                 *-linux*)
412                         AC_DEFINE(HAVE_LINUXTHREADS)
413                         ;;
414                 #
415                 # Ensure the right sigwait() semantics on Solaris and make
416                 # sure we call pthread_setconcurrency.
417                 #
418                 *-solaris*)
419                         AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
420                         AC_CHECK_FUNC(pthread_setconcurrency,
421                                       AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
422                         AC_DEFINE(POSIX_GETPWUID_R)
423                         AC_DEFINE(POSIX_GETPWNAM_R)
424                         AC_DEFINE(POSIX_GETGRGID_R)
425                         AC_DEFINE(POSIX_GETGRNAM_R)
426                         ;;
427                 *hpux11*)
428                         AC_DEFINE(NEED_ENDNETGRENT_R)
429                         AC_DEFINE(_PTHREADS_DRAFT4)
430                         ;;
431                 #
432                 # UnixWare does things its own way.
433                 #
434                 *-UnixWare*)
435                         AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
436                         ;;
437         esac
438
439         #
440         # Look for sysconf to allow detection of the number of processors.
441         #
442         AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
443
444 else
445         ALWAYS_DEFINES=""
446         DO_PTHREADS="#undef DO_PTHREADS"
447         WANT_IRS_THREADSGR_OBJS=""
448         WANT_IRS_THREADSPW_OBJS=""
449         WANT_IRS_THREADS_OBJS=""
450         WANT_THREADS_OBJS=""
451         thread_dir=nothreads
452 fi
453
454 AC_SUBST(ALWAYS_DEFINES)
455 AC_SUBST(DO_PTHREADS)
456 AC_SUBST(WANT_IRS_THREADSGR_OBJS)
457 AC_SUBST(WANT_IRS_THREADSPW_OBJS)
458 AC_SUBST(WANT_IRS_THREADS_OBJS)
459 AC_SUBST(WANT_THREADS_OBJS)
460
461 AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))
462 AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))
463 AC_CHECK_FUNC(memchr, AC_DEFINE(HAVE_MEMCHR))
464 AC_CHECK_FUNC(strtoul, , AC_DEFINE(NEED_STRTOUL))
465
466 AC_CHECK_FUNC(if_nametoindex,
467         [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"],
468         [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"])
469 AC_SUBST(USE_IFNAMELINKID)
470
471 ISC_THREAD_DIR=$thread_dir
472 AC_SUBST(ISC_THREAD_DIR)
473
474 AC_CHECK_FUNC(daemon,
475 [DAEMON_OBJS="" NEED_DAEMON="#undef NEED_DAEMON"]
476 ,
477 [DAEMON_OBJS="\${DAEMON_OBJS}" NEED_DAEMON="#define NEED_DAEMON 1"]
478 )
479 AC_SUBST(DAEMON_OBJS)
480 AC_SUBST(NEED_DAEMON)
481
482 AC_CHECK_FUNC(strsep,
483 [STRSEP_OBJS="" NEED_STRSEP="#undef NEED_STRSEP"]
484 ,
485 [STRSEP_OBJS="\${STRSEP_OBJS}" NEED_STRSEP="#define NEED_STRSEP 1"]
486 )
487 AC_SUBST(STRSEP_OBJS)
488 AC_SUBST(NEED_STRSEP)
489
490 AC_CHECK_FUNC(strerror, [NEED_STRERROR="#undef NEED_STRERROR"],
491 [NEED_STRERROR="#define NEED_STRERROR 1"])
492 AC_SUBST(NEED_STRERROR)
493
494 if test -n "$NEED_STRERROR"
495 then
496         AC_MSG_CHECKING([for extern char * sys_errlist[]])
497         AC_TRY_LINK([ extern int sys_nerr; extern char *sys_errlist[]; ],
498                     [ const char *p = sys_errlist[0]; ],
499                     AC_MSG_RESULT(yes)
500                     AC_DEFINE(USE_SYSERROR_LIST),
501                     AC_MSG_RESULT(no))
502 fi
503
504 #
505 # flockfile is usually provided by pthreads, but we may want to use it
506 # even if compiled with --disable-threads.
507 #
508 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
509
510
511 # Indicate what the final decision was regarding threads.
512 #
513 AC_MSG_CHECKING(whether to build with threads)
514 if $use_threads; then
515         AC_MSG_RESULT(yes)
516 else
517         AC_MSG_RESULT(no)
518 fi
519
520
521 # End of pthreads stuff.
522 #
523
524 #
525 # Additional compiler settings.
526 #
527 MKDEPCC="$CC"
528 MKDEPCFLAGS="-M"
529 IRIX_DNSSEC_WARNINGS_HACK=""
530
531 if test "X$GCC" = "Xyes"; then
532         AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
533         SAVE_CFLAGS=$CFLAGS
534         CFLAGS=-fno-strict-aliasing
535         AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
536         CFLAGS=$SAVE_CFLAGS
537         if test "$FNOSTRICTALIASING" = "yes"; then
538                 AC_MSG_RESULT(yes)
539                 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
540         else
541                 AC_MSG_RESULT(no)
542                 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
543         fi
544 else
545         case $host in
546         *-dec-osf*)
547                 CC="$CC -std"
548                 CCOPT="$CCOPT -std"
549                 MKDEPCC="$CC"
550                 ;;
551         *-hp-hpux*)
552                 CC="$CC -Ae -z"
553                 # The version of the C compiler that constantly warns about
554                 # 'const' as well as alignment issues is unfortunately not
555                 # able to be discerned via the version of the operating
556                 # system, nor does cc have a version flag.
557                 case "`$CC +W 123 2>&1`" in
558                 *Unknown?option*)
559                         STD_CWARNINGS="+w1"
560                         ;;
561                 *)
562                         # Turn off the pointlessly noisy warnings.
563                         STD_CWARNINGS="+w1 +W 474,530,2193,2236"
564                         ;;
565                 esac
566                 CCOPT="$CCOPT -Ae -z"
567                 LIBS="-Wl,+vnocompatwarnings $LIBS"
568 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>&1 | awk '"'"'BEGIN {colon=0; rec="";} { for (i = 0 ; i < NF; i++) { if (colon && a[$i]) continue; if ($i == "\\") continue; if (!colon) { rec =  $i continue; } if ($i == ":") { rec = rec " :" colon = 1 continue; } if (length(rec $i) > 76) { print rec " \\"; rec = "\t" $i; a[$i] = 1; } else { rec = rec " " $i a[$i] = 1; } } } END {print rec}'"'"' >>$TMP'
569                 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
570                 ;;
571         *-sgi-irix*)
572                 STD_CWARNINGS="-fullwarn -woff 1209"
573                 #
574                 # Silence more than 250 instances of
575                 #   "prototyped function redeclared without prototype"
576                 # and 11 instances of
577                 #   "variable ... was set but never used"
578                 # from lib/dns/sec/openssl.
579                 #
580                 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
581                 ;;
582         *-solaris*)
583                 MKDEPCFLAGS="-xM"
584                 ;;
585         *-UnixWare*)
586                 CC="$CC -w"
587                 ;;
588         esac
589 fi
590
591 #
592 # _GNU_SOURCE is needed to access the fd_bits field of struct fd_set, which
593 # is supposed to be opaque.
594 #
595 case $host in
596         *linux*)
597                 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
598                 ;;
599 esac
600
601 AC_SUBST(MKDEPCC)
602 AC_SUBST(MKDEPCFLAGS)
603 AC_SUBST(MKDEPPROG)
604 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
605
606 #
607 # NLS
608 #
609 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
610
611 #
612 # -lxnet buys us one big porting headache...  standards, gotta love 'em.
613 #
614 # AC_CHECK_LIB(xnet, socket, ,
615 #    AC_CHECK_LIB(socket, socket)
616 #    AC_CHECK_LIB(nsl, inet_ntoa)
617 # )
618 #
619 # Use this for now, instead:
620 #
621 case "$host" in
622         mips-sgi-irix*)
623                 ;;
624         ia64-hp-hpux11.*)
625                 AC_CHECK_LIB(socket, socket)
626                 AC_CHECK_LIB(nsl, inet_ntoa)
627                 ;;
628         *)
629                 AC_CHECK_LIB(d4r, gethostbyname_r)
630                 AC_CHECK_LIB(socket, socket)
631                 AC_CHECK_LIB(nsl, inet_ntoa)
632                 ;;
633 esac
634
635 #
636 # Purify support
637 #
638 AC_MSG_CHECKING(whether to use purify)
639 AC_ARG_WITH(purify,
640         [  --with-purify[=PATH] use Rational purify],
641         use_purify="$withval", use_purify="no")
642
643 case "$use_purify" in
644         no)
645                 ;;
646         yes)
647                 AC_PATH_PROG(purify_path, purify, purify)
648                 ;;
649         *)
650                 purify_path="$use_purify"
651                 ;;
652 esac
653
654 case "$use_purify" in
655         no)
656                 AC_MSG_RESULT(no)
657                 PURIFY=""
658                 ;;
659         *)
660                 if test -f $purify_path || test $purify_path = purify; then
661                         AC_MSG_RESULT($purify_path)
662                         PURIFYFLAGS="`echo $PURIFYOPTIONS`"
663                         PURIFY="$purify_path $PURIFYFLAGS"
664                 else
665                         AC_MSG_ERROR([$purify_path not found.
666
667 Please choose the proper path with the following command:
668
669     configure --with-purify=PATH
670 ])
671                 fi
672                 ;;
673 esac
674
675 AC_SUBST(PURIFY)
676
677 #
678 # GNU libtool support
679 #
680 case $host in
681 sunos*)
682     # Just set the maximum command line length for sunos as it otherwise
683     # takes a exceptionally long time to work it out. Required for libtool.
684     lt_cv_sys_max_cmd_len=4096;
685     ;;
686 esac
687
688 AC_ARG_WITH(libtool,
689             [  --with-libtool   use GNU libtool (following indented options supported)],
690             use_libtool="$withval", use_libtool="no")
691
692 case $use_libtool in
693         yes)
694                 AM_PROG_LIBTOOL
695                 O=lo
696                 A=la
697                 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
698                 LIBTOOL_MODE_COMPILE='--mode=compile'
699                 LIBTOOL_MODE_INSTALL='--mode=install'
700                 LIBTOOL_MODE_LINK='--mode=link'
701                 ;;
702         *)
703                 O=o
704                 A=a
705                 LIBTOOL=
706                 AC_SUBST(LIBTOOL)
707                 LIBTOOL_MKDEP_SED=
708                 LIBTOOL_MODE_COMPILE=
709                 LIBTOOL_MODE_INSTALL=
710                 LIBTOOL_MODE_LINK=
711                 ;;
712 esac
713
714 #
715 # File name extension for static archive files, for those few places
716 # where they are treated differently from dynamic ones.
717 #
718 SA=a
719
720 AC_SUBST(O)
721 AC_SUBST(A)
722 AC_SUBST(SA)
723 AC_SUBST(LIBTOOL_MKDEP_SED)
724 AC_SUBST(LIBTOOL_MODE_COMPILE)
725 AC_SUBST(LIBTOOL_MODE_INSTALL)
726 AC_SUBST(LIBTOOL_MODE_LINK)
727
728 #
729 # Here begins a very long section to determine the system's networking
730 # capabilities.  The order of the tests is signficant.
731 #
732
733 #
734 # IPv6
735 #
736 AC_ARG_ENABLE(ipv6,
737         [  --enable-ipv6                use IPv6 [default=autodetect]])
738
739 case "$enable_ipv6" in
740         yes|''|autodetect)
741                 AC_DEFINE(WANT_IPV6)
742                 ;;
743         no)
744                 ;;
745 esac
746
747 #
748 # We do the IPv6 compilation checking after libtool so that we can put
749 # the right suffix on the files.
750 #
751 AC_MSG_CHECKING(for IPv6 structures)
752 AC_TRY_COMPILE([
753 #include <sys/types.h>
754 #include <sys/socket.h>
755 #include <netinet/in.h>],
756 [struct sockaddr_in6 sin6; return (0);],
757         [AC_MSG_RESULT(yes)
758          found_ipv6=yes],
759         [AC_MSG_RESULT(no)
760          found_ipv6=no])
761
762 #
763 # See whether IPv6 support is provided via a Kame add-on.
764 # This is done before other IPv6 linking tests to LIBS is properly set.
765 #
766 AC_MSG_CHECKING(for Kame IPv6 support)
767 AC_ARG_WITH(kame,
768         [  --with-kame[=PATH]   use Kame IPv6 [default path /usr/local/v6]],
769         use_kame="$withval", use_kame="no")
770
771 case "$use_kame" in
772         no)
773                 ;;
774         yes)
775                 kame_path=/usr/local/v6
776                 ;;
777         *)
778                 kame_path="$use_kame"
779                 ;;
780 esac
781
782 case "$use_kame" in
783         no)
784                 AC_MSG_RESULT(no)
785                 ;;
786         *)
787                 if test -f $kame_path/lib/libinet6.a; then
788                         AC_MSG_RESULT($kame_path/lib/libinet6.a)
789                         LIBS="-L$kame_path/lib -linet6 $LIBS"
790                 else
791                         AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
792
793 Please choose the proper path with the following command:
794
795     configure --with-kame=PATH
796 ])
797                 fi
798                 ;;
799 esac
800
801 #
802 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
803 # Including it on Kame-using platforms is very bad, though, because
804 # Kame uses #error against direct inclusion.   So include it on only
805 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
806 # This is done before the in6_pktinfo check because that's what
807 # netinet6/in6.h is needed for.
808 #
809 changequote({, })
810 case "$host" in
811 *-bsdi4.[01]*)
812         ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
813         isc_netinet6in6_hack="#include <netinet6/in6.h>"
814         ;;
815 *)
816         ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
817         isc_netinet6in6_hack=""
818         ;;
819 esac
820 changequote([, ])
821
822 #
823 # This is similar to the netinet6/in6.h issue.
824 #
825 case "$host" in
826 *-UnixWare*)
827         ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
828         ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
829         isc_netinetin6_hack="#include <netinet/in6.h>"
830         ;;
831 *)
832         ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
833         ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
834         isc_netinetin6_hack=""
835         ;;
836 esac
837
838 #
839 # Now delve deeper into the suitability of the IPv6 support.
840 #
841 case "$found_ipv6" in
842         yes)
843                 HAS_INET6_STRUCTS="#define HAS_INET6_STRUCTS 1"
844
845                 AC_MSG_CHECKING(for in6_addr)
846                 AC_TRY_COMPILE([
847 #include <sys/types.h>
848 #include <sys/socket.h>
849 #include <netinet/in.h>
850 $isc_netinetin6_hack
851 $isc_netinet6in6_hack
852 ],
853 [struct in6_addr in6; return (0);],
854                 [AC_MSG_RESULT(yes)
855                  HAS_IN_ADDR6="#undef HAS_IN_ADDR6"
856                  isc_in_addr6_hack=""],
857                 [AC_MSG_RESULT(no)
858                  HAS_IN_ADDR6="#define HAS_IN_ADDR6 1"
859                  isc_in_addr6_hack="#define in6_addr in_addr6"])
860
861                 AC_MSG_CHECKING(for in6addr_any)
862                 AC_TRY_LINK([
863 #include <sys/types.h>
864 #include <sys/socket.h>
865 #include <netinet/in.h>
866 $isc_netinetin6_hack
867 $isc_netinet6in6_hack
868 $isc_in_addr6_hack
869 ],
870                 [struct in6_addr in6; in6 = in6addr_any; return (0);],
871                         [AC_MSG_RESULT(yes)
872                          NEED_IN6ADDR_ANY="#undef NEED_IN6ADDR_ANY"],
873                         [AC_MSG_RESULT(no)
874                          NEED_IN6ADDR_ANY="#define NEED_IN6ADDR_ANY 1"])
875
876                 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
877                 AC_TRY_COMPILE([
878 #include <sys/types.h>
879 #include <sys/socket.h>
880 #include <netinet/in.h>
881 $isc_netinetin6_hack
882 $isc_netinet6in6_hack
883 ],
884                 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
885                         [AC_MSG_RESULT(yes)
886                          result="#define HAVE_SIN6_SCOPE_ID 1"],
887                         [AC_MSG_RESULT(no)
888                          result="#undef HAVE_SIN6_SCOPE_ID"])
889                 HAVE_SIN6_SCOPE_ID="$result"
890
891                 AC_MSG_CHECKING(for in6_pktinfo)
892                 AC_TRY_COMPILE([
893 #include <sys/types.h>
894 #include <sys/socket.h>
895 #include <netinet/in.h>
896 $isc_netinetin6_hack
897 $isc_netinet6in6_hack
898 ],
899                 [struct in6_pktinfo xyzzy; return (0);],
900                         [AC_MSG_RESULT(yes)
901                          ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
902                         [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
903                          ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
904                 ;;
905         no)
906                 HAS_INET6_STRUCTS="#undef HAS_INET6_STRUCTS"
907                 NEED_IN6ADDR_ANY="#undef NEED_IN6ADDR_ANY"
908                 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
909                 HAVE_SIN6_SCOPE_ID="#define HAVE_SIN6_SCOPE_ID 1"
910                 ISC_IPV6_H="ipv6.h"
911                 ISC_IPV6_O="ipv6.$O"
912                 ISC_ISCIPV6_O="unix/ipv6.$O"
913                 ISC_IPV6_C="ipv6.c"
914                 ;;
915 esac
916
917 AC_MSG_CHECKING(for sockaddr_storage)
918 AC_TRY_COMPILE([
919 #include <sys/types.h>
920 #include <sys/socket.h>
921 #include <netinet/in.h>
922 ],
923 [struct sockaddr_storage xyzzy; return (0);],
924         [AC_MSG_RESULT(yes)
925          HAVE_SOCKADDR_STORAGE="#define HAVE_SOCKADDR_STORAGE 1"],
926         [AC_MSG_RESULT(no)
927          HAVE_SOCKADDR_STORAGE="#undef HAVE_SOCKADDR_STORAGE"])
928
929 AC_SUBST(HAS_INET6_STRUCTS)
930 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
931 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
932 AC_SUBST(HAS_IN_ADDR6)
933 AC_SUBST(NEED_IN6ADDR_ANY)
934 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
935 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
936 AC_SUBST(ISC_IPV6_H)
937 AC_SUBST(ISC_IPV6_O)
938 AC_SUBST(ISC_ISCIPV6_O)
939 AC_SUBST(ISC_IPV6_C)
940 AC_SUBST(HAVE_SIN6_SCOPE_ID)
941 AC_SUBST(HAVE_SOCKADDR_STORAGE)
942
943 #
944 # Check for network functions that are often missing.  We do this
945 # after the libtool checking, so we can put the right suffix on
946 # the files.  It also needs to come after checking for a Kame add-on,
947 # which provides some (all?) of the desired functions.
948 #
949 AC_MSG_CHECKING([for inet_ntop])
950 AC_TRY_LINK([
951 #include <sys/types.h>
952 #include <netinet/in.h>
953 #include <arpa/inet.h>],
954         [inet_ntop(0, 0, 0, 0); return (0);],
955         [AC_MSG_RESULT(yes)
956         ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
957
958         [AC_MSG_RESULT(no)
959         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
960         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
961         ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
962 AC_MSG_CHECKING([for inet_pton])
963 AC_TRY_LINK([
964 #include <sys/types.h>
965 #include <netinet/in.h>
966 #include <arpa/inet.h>],
967         [inet_pton(0, 0, 0); return (0);],
968         [AC_MSG_RESULT(yes)
969         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
970
971         [AC_MSG_RESULT(no)
972         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
973         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
974         ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
975 AC_MSG_CHECKING([for inet_aton])
976 AC_TRY_LINK([
977 #include <sys/types.h>
978 #include <netinet/in.h>
979 #include <arpa/inet.h>],
980         [struct in_addr in; inet_aton(0, &in); return (0);],
981         [AC_MSG_RESULT(yes)
982         ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
983
984         [AC_MSG_RESULT(no)
985         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
986         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
987         ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
988
989 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
990 AC_SUBST(ISC_PLATFORM_NEEDPTON)
991 AC_SUBST(ISC_PLATFORM_NEEDATON)
992
993 #
994 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
995 #
996 case "$host" in
997         *-dec-osf*)
998                 # Tru64 broke send() by defining it to send_OBSOLETE
999                 AC_DEFINE(REENABLE_SEND)
1000                 # Turn on 4.4BSD style sa_len support.
1001                 AC_DEFINE(_SOCKADDR_LEN)
1002                 ;;
1003 esac
1004
1005 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1006 AC_TRY_COMPILE([
1007 #include <sys/types.h>
1008 #include <sys/socket.h>],
1009 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1010         [AC_MSG_RESULT(yes)
1011         HAVE_SA_LEN="#define HAVE_SA_LEN 1"],
1012         [AC_MSG_RESULT(no)
1013         HAVE_SA_LEN="#undef HAVE_SA_LEN"])
1014 AC_SUBST(HAVE_SA_LEN)
1015
1016 # HAVE_MINIMUM_IFREQ
1017
1018 case "$host" in
1019         *-bsdi[2345]*)  have_minimum_ifreq=yes;;
1020         *-darwin*)      have_minimum_ifreq=yes;;
1021         *-freebsd*)     have_minimum_ifreq=yes;;
1022         *-lynxos*)      have_minimum_ifreq=yes;;
1023         *-netbsd*)      have_minimum_ifreq=yes;;
1024         *-next*)        have_minimum_ifreq=yes;;
1025         *-openbsd*)     have_minimum_ifreq=yes;;
1026         *-rhapsody*)    have_minimum_ifreq=yes;;
1027 esac
1028
1029 case "$have_minimum_ifreq" in
1030         yes)
1031                 HAVE_MINIMUM_IFREQ="#define HAVE_MINIMUM_IFREQ 1";;
1032         no)
1033                 HAVE_MINIMUM_IFREQ="#undef HAVE_MINIMUM_IFREQ";;
1034         *)
1035                 HAVE_MINIMUM_IFREQ="#undef HAVE_MINIMUM_IFREQ";;
1036 esac
1037 AC_SUBST(HAVE_MINIMUM_IFREQ)
1038
1039 # PORT_DIR
1040 PORT_DIR=port/unknown
1041 SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
1042 BSD_COMP="#undef BSD_COMP"
1043 USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
1044 PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
1045 HAVE_MD5="#undef HAVE_MD5"
1046 USE_POLL="#undef HAVE_POLL"
1047 SOLARIS2="#undef SOLARIS2"
1048 case "$host" in
1049         *aix3.2*)       PORT_DIR="port/aix32";;
1050         *aix4*)         PORT_DIR="port/aix4";;
1051         *aix5*)         PORT_DIR="port/aix5";;
1052         *aux3*)         PORT_DIR="port/aux3";;
1053         *-bsdi2*)       PORT_DIR="port/bsdos2";;
1054         *-bsdi*)        PORT_DIR="port/bsdos";;
1055         *-cygwin*)
1056                         PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
1057                         PORT_DIR="port/cygwin";;
1058         *-darwin*)      PORT_DIR="port/darwin";;
1059         *-osf*)         PORT_DIR="port/decunix";;
1060         *-freebsd*)     PORT_DIR="port/freebsd";;
1061         *-hpux9*)       PORT_DIR="port/hpux9";;
1062         *-hpux10*)      PORT_DIR="port/hpux10";;
1063         *-hpux11*)      PORT_DIR="port/hpux";;
1064         *-irix*)        PORT_DIR="port/irix";;
1065         *-linux*)       PORT_DIR="port/linux";;
1066         *-lynxos*)      PORT_DIR="port/lynxos";;
1067         *-mpe*)         PORT_DIR="port/mpe";;
1068         *-netbsd*)      PORT_DIR="port/netbsd";;
1069         *-next*)        PORT_DIR="port/next";;
1070         *-openbsd*)     PORT_DIR="port/openbsd";;
1071         *-qnx*)         PORT_DIR="port/qnx";;
1072         *-rhapsody*)    PORT_DIR="port/rhapsody";;
1073         *-sunos4*)
1074                         AC_DEFINE(NEED_SUN4PROTOS)
1075                         PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
1076                         PORT_DIR="port/sunos";;
1077         *-solaris2.[[01234]])
1078                         BSD_COMP="#define BSD_COMP 1"
1079                         SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
1080                         USE_FIONBIO_IOCTL="#define USE_FIONBIO_IOCTL 1"
1081                         SOLARIS2="#define SOLARIS2 1"
1082                         PORT_DIR="port/solaris";;
1083         *-solaris2.5)
1084                         BSD_COMP="#define BSD_COMP 1"
1085                         SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
1086                         SOLARIS2="#define SOLARIS2 1"
1087                         PORT_DIR="port/solaris";;
1088         *-solaris2.[[67]])
1089                         BSD_COMP="#define BSD_COMP 1"
1090                         SOLARIS2="#define SOLARIS2 1"
1091                         PORT_DIR="port/solaris";;
1092         *-solaris2*)    BSD_COMP="#define BSD_COMP 1"
1093                         USE_POLL="#define USE_POLL 1"
1094                         HAVE_MD5="#define HAVE_MD5 1"
1095                         SOLARIS2="#define SOLARIS2 1"
1096                         PORT_DIR="port/solaris";;
1097         *-ultrix*)      PORT_DIR="port/ultrix";;
1098         *-sco-sysv*uw2.0*)      PORT_DIR="port/unixware20";;
1099         *-sco-sysv*uw2.1.2*)    PORT_DIR="port/unixware212";;
1100         *-sco-sysv*uw7*)        PORT_DIR="port/unixware7";;
1101 esac
1102
1103 AC_SUBST(BSD_COMP)
1104 AC_SUBST(SOLARIS_BITTYPES)
1105 AC_SUBST(USE_FIONBIO_IOCTL)
1106 AC_SUBST(PORT_NONBLOCK)
1107 AC_SUBST(PORT_DIR)
1108 AC_SUBST(USE_POLL)
1109 AC_SUBST(HAVE_MD5)
1110 AC_SUBST(SOLARIS2)
1111 PORT_INCLUDE=${PORT_DIR}/include
1112 AC_SUBST(PORT_INCLUDE)
1113
1114 #
1115 # Look for a 4.4BSD or 4.3BSD struct msghdr
1116 #
1117 AC_MSG_CHECKING(for struct msghdr flavor)
1118 AC_TRY_COMPILE([
1119 #include <sys/types.h>
1120 #include <sys/socket.h>],
1121 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1122         [AC_MSG_RESULT(4.4BSD)
1123         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1124         [AC_MSG_RESULT(4.3BSD)
1125         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1126 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1127
1128 #
1129 # Look for in_port_t.
1130 #
1131 AC_MSG_CHECKING(for type in_port_t)
1132 AC_TRY_COMPILE([
1133 #include <sys/types.h>
1134 #include <netinet/in.h>],
1135 [in_port_t port = 25; return (0);],
1136         [AC_MSG_RESULT(yes)
1137         ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1138         [AC_MSG_RESULT(no)
1139         ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1140 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1141
1142 AC_MSG_CHECKING(for struct timespec)
1143 AC_TRY_COMPILE([
1144 #include <sys/types.h>
1145 #include <time.h>],
1146 [struct timespec ts = { 0, 0 }; return (0);],
1147         [AC_MSG_RESULT(yes)
1148         ISC_PLATFORM_NEEDTIMESPEC="#undef ISC_PLATFORM_NEEDTIMESPEC"],
1149         [AC_MSG_RESULT(no)
1150         ISC_PLATFORM_NEEDTIMESPEC="#define ISC_PLATFORM_NEEDTIMESPEC 1"])
1151 AC_SUBST(ISC_PLATFORM_NEEDTIMESPEC)
1152
1153 #
1154 # Check for addrinfo
1155 #
1156 AC_MSG_CHECKING(for struct addrinfo)
1157 AC_TRY_COMPILE([
1158 #include <netdb.h>],
1159 [struct addrinfo a; return (0);],
1160         [AC_MSG_RESULT(yes)
1161         AC_DEFINE(HAVE_ADDRINFO)],
1162         [AC_MSG_RESULT(no)])
1163
1164 AC_MSG_CHECKING(for int sethostent)
1165 AC_TRY_COMPILE([
1166 #include <netdb.h>],
1167 [int i = sethostent(0); return(0);],
1168         [AC_MSG_RESULT(yes)],
1169         [AC_MSG_RESULT(no)])
1170
1171 AC_MSG_CHECKING(for int endhostent)
1172 AC_TRY_COMPILE([
1173 #include <netdb.h>],
1174 [int i = endhostent(); return(0);],
1175         [AC_MSG_RESULT(yes)
1176         ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1177         [AC_MSG_RESULT(no)
1178         ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1179 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1180
1181 AC_MSG_CHECKING(for int setnetent)
1182 AC_TRY_COMPILE([
1183 #include <netdb.h>],
1184 [int i = setnetent(0); return(0);],
1185         [AC_MSG_RESULT(yes)
1186         ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1187         [AC_MSG_RESULT(no)
1188         ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1189 AC_SUBST(ISC_LWRES_SETNETENTINT)
1190
1191 AC_MSG_CHECKING(for int endnetent)
1192 AC_TRY_COMPILE([
1193 #include <netdb.h>],
1194 [int i = endnetent(); return(0);],
1195         [AC_MSG_RESULT(yes)
1196         ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1197         [AC_MSG_RESULT(no)
1198         ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1199 AC_SUBST(ISC_LWRES_ENDNETENTINT)
1200
1201 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1202 AC_TRY_COMPILE([
1203 #include <netdb.h>
1204 struct hostent *gethostbyaddr(const void *, size_t, int);],
1205 [return(0);],
1206         [AC_MSG_RESULT(yes)
1207         ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1208         [AC_MSG_RESULT(no)
1209         ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1210 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1211
1212 AC_MSG_CHECKING(for h_errno in netdb.h)
1213 AC_TRY_COMPILE([
1214 #include <netdb.h>],
1215 [h_errno = 1; return(0);],
1216         [AC_MSG_RESULT(yes)
1217         ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1218         [AC_MSG_RESULT(no)
1219         ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1220 AC_SUBST(ISC_LWRES_NEEDHERRNO)
1221
1222 AC_CHECK_FUNC(getipnodebyname,
1223         [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1224         [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1225 AC_CHECK_FUNC(getnameinfo,
1226         [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1227         [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1228 AC_CHECK_FUNC(getaddrinfo,
1229         [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
1230         AC_DEFINE(HAVE_GETADDRINFO)],
1231         [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
1232 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
1233 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
1234 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
1235 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
1236 AC_CHECK_FUNC(pselect,
1237               [NEED_PSELECT="#undef NEED_PSELECT"],
1238               [NEED_PSELECT="#define NEED_PSELECT"])
1239 AC_SUBST(NEED_PSELECT)
1240 AC_CHECK_FUNC(gettimeofday,
1241               [NEED_GETTIMEOFDAY="#undef NEED_GETTIMEOFDAY"],
1242               [NEED_GETTIMEOFDAY="#define NEED_GETTIMEOFDAY 1"])
1243 AC_SUBST(NEED_GETTIMEOFDAY)
1244 AC_CHECK_FUNC(strndup,
1245               [HAVE_STRNDUP="#define HAVE_STRNDUP 1"],
1246               [HAVE_STRNDUP="#undef HAVE_STRNDUP"])
1247 AC_SUBST(HAVE_STRNDUP)
1248
1249 #
1250 # Look for a sysctl call to get the list of network interfaces.
1251 #
1252 AC_MSG_CHECKING(for interface list sysctl)
1253 AC_EGREP_CPP(found_rt_iflist, [
1254 #include <sys/param.h>
1255 #include <sys/sysctl.h>
1256 #include <sys/socket.h>
1257 #ifdef NET_RT_IFLIST
1258 found_rt_iflist
1259 #endif
1260 ],
1261         [AC_MSG_RESULT(yes)
1262          AC_DEFINE(HAVE_IFLIST_SYSCTL)],
1263         [AC_MSG_RESULT(no)])
1264
1265 #
1266 # Check for some other useful functions that are not ever-present.
1267 #
1268 AC_CHECK_FUNC(strsep,
1269         [ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
1270         [ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
1271
1272
1273 AC_MSG_CHECKING(for char *sprintf)
1274 AC_TRY_COMPILE([
1275 #include <stdio.h>
1276 ],
1277 [ char buf[2]; return(*sprintf(buf,"x"));],
1278 AC_DEFINE(SPRINTF_CHAR)
1279 AC_MSG_RESULT(yes)
1280 ,
1281 AC_MSG_RESULT(no)
1282 )
1283
1284 AC_MSG_CHECKING(for char *vsprintf)
1285 case $host in
1286 *sunos4*) # not decared in any header file.
1287 AC_DEFINE(VSPRINTF_CHAR)
1288 AC_MSG_RESULT(yes)
1289 ;;
1290 *)
1291 AC_TRY_COMPILE([
1292 #include <stdio.h>
1293 ],
1294 [ char buf[2]; return(*vsprintf(buf,"x"));],
1295 AC_DEFINE(VSPRINTF_CHAR)
1296 AC_MSG_RESULT(yes)
1297 ,
1298 AC_MSG_RESULT(no)
1299 )
1300 ;;
1301 esac
1302
1303 AC_CHECK_FUNC(vsnprintf,
1304         [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"],
1305         [ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
1306          ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
1307          ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"])
1308 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
1309 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
1310
1311 AC_SUBST(ISC_EXTRA_OBJS)
1312 AC_SUBST(ISC_EXTRA_SRCS)
1313
1314 # Determine the printf format characters to use when printing
1315 # values of type isc_int64_t.  We make the assumption that platforms
1316 # where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
1317 # want "%ld" and everyone else can use "%lld".  Win32 uses "%I64d",
1318 # but that's defined elsewhere since we don't use configure on Win32.
1319 #
1320 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
1321 AC_TRY_RUN([main() { exit(!(sizeof(long long int) == sizeof(long int))); }],
1322         [AC_MSG_RESULT(l)
1323         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
1324         [AC_MSG_RESULT(ll)
1325         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'],
1326         [AC_MSG_RESULT(default ll)
1327         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'])
1328 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
1329
1330 #
1331 # Security Stuff
1332 #
1333 AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
1334
1335 #
1336 # for accept, recvfrom, getpeername etc.
1337 #
1338 AC_MSG_CHECKING(for socket length type)
1339 AC_TRY_COMPILE([
1340 #include <sys/types.h>
1341 #include <sys/socket.h>
1342 int accept(int, struct sockaddr *, socklen_t *);
1343 ],[],
1344 [ISC_SOCKLEN_T="#define ISC_SOCKLEN_T socklen_t"
1345 AC_MSG_RESULT(socklen_t)]
1346 ,
1347 AC_TRY_COMPILE([
1348 #include <sys/types.h>
1349 #include <sys/socket.h>
1350 int accept(int, struct sockaddr *, unsigned int *);
1351 ],[],
1352 [ISC_SOCKLEN_T="#define ISC_SOCKLEN_T unsigned int"
1353 AC_MSG_RESULT(unsigned int)]
1354 ,
1355 AC_TRY_COMPILE([
1356 #include <sys/types.h>
1357 #include <sys/socket.h>
1358 int accept(int, struct sockaddr *, unsigned long *);
1359 ],[],
1360 [ISC_SOCKLEN_T="#define ISC_SOCKLEN_T unsigned long"
1361 AC_MSG_RESULT(unsigned long)]
1362 ,
1363 AC_TRY_COMPILE([
1364 #include <sys/types.h>
1365 #include <sys/socket.h>
1366 int accept(int, struct sockaddr *, long *);
1367 ],[],
1368 [ISC_SOCKLEN_T="#define ISC_SOCKLEN_T long"
1369 AC_MSG_RESULT(long)]
1370 ,
1371 ISC_SOCKLEN_T="#define ISC_SOCKLEN_T int"
1372 AC_MSG_RESULT(int)
1373 ))))
1374 AC_SUBST(ISC_SOCKLEN_T)
1375
1376 AC_CHECK_FUNC(getgrouplist,
1377 AC_TRY_COMPILE(
1378 [#include <unistd.h>
1379 int
1380 getgrouplist(const char *name, int basegid, int *groups, int *ngroups) {
1381 }
1382 ],
1383 [return (0);],
1384 GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, int *ngroups"
1385 ,
1386 GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
1387 ),
1388 GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
1389 AC_DEFINE(NEED_GETGROUPLIST)
1390 )
1391 AC_SUBST(GETGROUPLIST_ARGS)
1392
1393 AC_CHECK_FUNC(setgroupent,,AC_DEFINE(NEED_SETGROUPENT))
1394
1395 case $host in
1396 ia64-hp-hpux11.*)
1397 ;;
1398 *)
1399 AC_CHECK_FUNC(getnetbyaddr_r,
1400 AC_TRY_COMPILE(
1401 [
1402 #undef _REENTRANT
1403 #define _REENTRANT
1404 #define _OSF_SOURCE
1405 #undef __USE_MISC
1406 #define __USE_MISC
1407 #include <netdb.h>
1408 struct netent *
1409 getnetbyaddr_r(long net, int type, struct netent *result, char *buffer,
1410 int buflen) {}
1411 ],
1412 [return (0)],
1413 [
1414 NET_R_ARGS="#define NET_R_ARGS char *buf, int buflen"
1415 NET_R_BAD="#define NET_R_BAD NULL"
1416 NET_R_COPY="#define NET_R_COPY buf, buflen"
1417 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS"
1418 NET_R_OK="#define NET_R_OK nptr"
1419 NET_R_SETANSWER="#undef NET_R_SETANSWER"
1420 NET_R_RETURN="#define NET_R_RETURN struct netent *"
1421 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
1422 NETENT_DATA="#undef NETENT_DATA"
1423 ],
1424 AC_TRY_COMPILE(
1425 [
1426 #undef _REENTRANT
1427 #define _REENTRANT
1428 #define _OSF_SOURCE
1429 #undef __USE_MISC
1430 #define __USE_MISC
1431 #include <netdb.h>
1432 int getnetbyaddr_r (unsigned long int, int, struct netent *,
1433                     char *, size_t, struct netent **, int *);
1434 ],
1435 [return (0)],
1436 [
1437 NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop"
1438 NET_R_BAD="#define NET_R_BAD ERANGE"
1439 NET_R_COPY="#define NET_R_COPY buf, buflen"
1440 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen"
1441 NET_R_OK="#define NET_R_OK 0"
1442 NET_R_SETANSWER="#define NET_R_SETANSWER 1"
1443 NET_R_RETURN="#define NET_R_RETURN int"
1444 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int"
1445 NETENT_DATA="#undef NETENT_DATA"
1446 ],
1447 AC_TRY_COMPILE(
1448 [
1449 #undef _REENTRANT
1450 #define _REENTRANT
1451 #define _OSF_SOURCE
1452 #undef __USE_MISC
1453 #define __USE_MISC
1454 #include <netdb.h>
1455 extern int getnetbyaddr_r(int, int, struct netent *, struct netent_data *);
1456 ],
1457 [return (0)],
1458 [
1459 NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
1460 NET_R_BAD="#define NET_R_BAD (-1)"
1461 NET_R_COPY="#define NET_R_COPY ndptr"
1462 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
1463 NET_R_OK="#define NET_R_OK 0"
1464 NET_R_SETANSWER="#undef NET_R_SETANSWER"
1465 NET_R_RETURN="#define NET_R_RETURN int"
1466 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int"
1467 NETENT_DATA="#define NETENT_DATA 1"
1468 ],
1469 AC_TRY_COMPILE(
1470 #undef __USE_MISC
1471 #define __USE_MISC
1472 [#include <netdb.h>
1473 int getnetbyaddr_r (in_addr_t, int, struct netent *, struct netent_data *);
1474 ],
1475 [return (0)],
1476 [
1477 NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
1478 NET_R_BAD="#define NET_R_BAD (-1)"
1479 NET_R_COPY="#define NET_R_COPY ndptr"
1480 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
1481 NET_R_OK="#define NET_R_OK 0"
1482 NET_R_SETANSWER="#undef NET_R_SETANSWER"
1483 NET_R_RETURN="#define NET_R_RETURN int"
1484 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
1485 NETENT_DATA="#define NETENT_DATA 1"
1486 ],
1487 AC_TRY_COMPILE(
1488 #undef __USE_MISC
1489 #define __USE_MISC
1490 [#include <netdb.h>
1491 int getnetbyaddr_r (long, int, struct netent *, struct netent_data *);
1492 ],
1493 [return (0)],
1494 [
1495 NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
1496 NET_R_BAD="#define NET_R_BAD (-1)"
1497 NET_R_COPY="#define NET_R_COPY ndptr"
1498 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
1499 NET_R_OK="#define NET_R_OK 0"
1500 NET_R_SETANSWER="#undef NET_R_SETANSWER"
1501 NET_R_RETURN="#define NET_R_RETURN int"
1502 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
1503 NETENT_DATA="#define NETENT_DATA 1"
1504 ],
1505 AC_TRY_COMPILE(
1506 #undef __USE_MISC
1507 #define __USE_MISC
1508 [#include <netdb.h>
1509 int getnetbyaddr_r (uint32_t, int, struct netent *,
1510                     char *, size_t, struct netent **, int *);
1511 ],
1512 [return (0)],
1513 [
1514 NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop"
1515 NET_R_BAD="#define NET_R_BAD ERANGE"
1516 NET_R_COPY="#define NET_R_COPY buf, buflen"
1517 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen"
1518 NET_R_OK="#define NET_R_OK 0"
1519 NET_R_SETANSWER="#define NET_R_SETANSWER 1"
1520 NET_R_RETURN="#define NET_R_RETURN int"
1521 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int"
1522 NETENT_DATA="#undef NETENT_DATA"
1523 ],
1524 )
1525 )
1526 )
1527 )
1528 )
1529 )
1530 ,
1531 NET_R_ARGS="#define NET_R_ARGS char *buf, int buflen"
1532 NET_R_BAD="#define NET_R_BAD NULL"
1533 NET_R_COPY="#define NET_R_COPY buf, buflen"
1534 NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS"
1535 NET_R_OK="#define NET_R_OK nptr"
1536 NET_R_SETANSWER="#undef NET_R_SETANSWER"
1537 NET_R_RETURN="#define NET_R_RETURN struct netent *"
1538 GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
1539 NETENT_DATA="#undef NETENT_DATA"
1540 )
1541 esac
1542
1543 case "$host" in
1544 *dec-osf*) GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int" ;;
1545 esac
1546 AC_SUBST(NET_R_ARGS)
1547 AC_SUBST(NET_R_BAD)
1548 AC_SUBST(NET_R_COPY)
1549 AC_SUBST(NET_R_COPY_ARGS)
1550 AC_SUBST(NET_R_OK)
1551 AC_SUBST(NET_R_SETANSWER)
1552 AC_SUBST(NET_R_RETURN)
1553 AC_SUBST(GETNETBYADDR_ADDR_T)
1554 AC_SUBST(NETENT_DATA)
1555
1556 AC_CHECK_FUNC(setnetent_r,
1557 AC_TRY_COMPILE(
1558 [
1559 #undef __USE_MISC
1560 #define __USE_MISC
1561 #include <netdb.h>
1562 void  setnetent_r (int);
1563 ] ,[return (0);],[
1564 NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/"
1565 NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/"
1566 NET_R_SET_RETURN="#define NET_R_SET_RETURN void"
1567 ],
1568 AC_TRY_COMPILE(
1569 [
1570 #define _REENTRANT
1571 #undef __USE_MISC
1572 #define __USE_MISC
1573 #include <netdb.h>
1574 extern int setnetent_r(int, struct netent_data *);
1575 ] ,[return (0);],[
1576 NET_R_ENT_ARGS="#define NET_R_ENT_ARGS struct netent_data *ndptr"
1577 NET_R_SET_RESULT="#define NET_R_SET_RESULT NET_R_OK"
1578 NET_R_SET_RETURN="#define NET_R_SET_RETURN int"
1579 ],
1580 )
1581 )
1582 ,
1583 NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/"
1584 NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/"
1585 NET_R_SET_RETURN="#define NET_R_SET_RETURN void"
1586 )
1587 AC_SUBST(NET_R_ENT_ARGS)
1588 AC_SUBST(NET_R_SET_RESULT)
1589 AC_SUBST(NET_R_SET_RETURN)
1590
1591
1592 case $host in
1593 ia64-hp-hpux11.*)
1594 ;;
1595 *)
1596 AC_CHECK_FUNC(endnetent_r,
1597 AC_TRY_COMPILE(
1598 [
1599 #undef _REENTRANT
1600 #define _REENTRANT
1601 #undef __USE_MISC
1602 #define __USE_MISC
1603 #include <netdb.h>
1604 void  endnetent_r (void);
1605 ] ,[return (0);],[
1606 NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
1607 NET_R_END_RETURN="#define NET_R_END_RETURN void"
1608 ],
1609 AC_TRY_COMPILE(
1610 [
1611 #undef _REENTRANT
1612 #define _REENTRANT
1613 #undef __USE_MISC
1614 #define __USE_MISC
1615 #include <netdb.h>
1616 extern int endnetent_r(struct netent_data *);
1617 ] ,[return (0);],[
1618 NET_R_END_RESULT="#define NET_R_END_RESULT(x) return (x)"
1619 NET_R_END_RETURN="#define NET_R_END_RETURN int"
1620 ],
1621 AC_TRY_COMPILE(
1622 [
1623 #undef _REENTRANT
1624 #define _REENTRANT
1625 #undef __USE_MISC
1626 #define __USE_MISC
1627 #include <netdb.h>
1628 extern void endnetent_r(struct netent_data *);
1629 ] ,[return (0);],[
1630 NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
1631 NET_R_END_RETURN="#define NET_R_END_RETURN void"
1632 ],
1633 )
1634 )
1635 )
1636 ,
1637 NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
1638 NET_R_END_RETURN="#define NET_R_END_RETURN void"
1639 )
1640 esac
1641 AC_SUBST(NET_R_END_RESULT)
1642 AC_SUBST(NET_R_END_RETURN)
1643
1644 AC_CHECK_FUNC(getgrnam_r,,AC_DEFINE(NEED_GETGRNAM_R))
1645 AC_CHECK_FUNC(getgrgid_r,,AC_DEFINE(NEED_GETGRGID_R))
1646
1647 AC_CHECK_FUNC(getgrent_r,
1648 AC_TRY_COMPILE(
1649 [
1650 #include <grp.h>
1651 struct group *getgrent_r(struct group *grp, char *buffer,
1652            int buflen) {}
1653 ] ,[return (0);],[
1654 GROUP_R_ARGS="#define GROUP_R_ARGS char *buf, int buflen"
1655 GROUP_R_BAD="#define GROUP_R_BAD NULL"
1656 GROUP_R_OK="#define GROUP_R_OK gptr"
1657 GROUP_R_RETURN="#define GROUP_R_RETURN struct group *"
1658 ],
1659 )
1660 ,
1661 GROUP_R_ARGS="#define GROUP_R_ARGS char *buf, int buflen"
1662 GROUP_R_BAD="#define GROUP_R_BAD NULL"
1663 GROUP_R_OK="#define GROUP_R_OK gptr"
1664 GROUP_R_RETURN="#define GROUP_R_RETURN struct group *"
1665 AC_DEFINE(NEED_GETGRENT_R)
1666 )
1667 AC_SUBST(GROUP_R_ARGS)
1668 AC_SUBST(GROUP_R_BAD)
1669 AC_SUBST(GROUP_R_OK)
1670 AC_SUBST(GROUP_R_RETURN)
1671
1672 AC_CHECK_FUNC(endgrent_r,
1673 ,
1674 GROUP_R_END_RESULT="#define GROUP_R_END_RESULT(x) /*empty*/"
1675 GROUP_R_END_RETURN="#define GROUP_R_END_RETURN void"
1676 GROUP_R_ENT_ARGS="#define GROUP_R_ENT_ARGS void"
1677 AC_DEFINE(NEED_ENDGRENT_R)
1678 )
1679 AC_SUBST(GROUP_R_END_RESULT)
1680 AC_SUBST(GROUP_R_END_RETURN)
1681 AC_SUBST(GROUP_R_ENT_ARGS)
1682
1683 AC_CHECK_FUNC(setgrent_r,
1684 ,
1685 GROUP_R_SET_RESULT="#undef GROUP_R_SET_RESULT /*empty*/"
1686 GROUP_R_SET_RETURN="#define GROUP_R_SET_RETURN void"
1687 AC_DEFINE(NEED_SETGRENT_R)
1688 )
1689 AC_SUBST(GROUP_R_SET_RESULT)
1690 AC_SUBST(GROUP_R_SET_RETURN)
1691
1692
1693 case $host in
1694 ia64-hp-hpux11.*)
1695 ;;
1696 *)
1697 AC_CHECK_FUNC(gethostbyname_r,
1698 AC_TRY_COMPILE(
1699 [
1700 #undef __USE_MISC
1701 #define __USE_MISC
1702 #include <netdb.h>
1703 struct hostent  *gethostbyname_r
1704 (const char *name, struct hostent *hp, char *buf, int len, int *h_errnop) {}
1705 ],
1706 [return (0);],
1707 [
1708 HOST_R_ARGS="#define HOST_R_ARGS char *buf, int buflen, int *h_errnop"
1709 HOST_R_BAD="#define HOST_R_BAD NULL"
1710 HOST_R_COPY="#define HOST_R_COPY buf, buflen"
1711 HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
1712 HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
1713 HOST_R_OK="#define HOST_R_OK hptr"
1714 HOST_R_RETURN="#define HOST_R_RETURN struct hostent *"
1715 HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
1716 HOSTENT_DATA="#undef HOSTENT_DATA"
1717 ]
1718 ,
1719 AC_TRY_COMPILE([
1720 #undef __USE_MISC
1721 #define __USE_MISC
1722 #include <netdb.h>
1723 int gethostbyname_r(const char *name,
1724                           struct hostent *result,
1725                           struct hostent_data *hdptr);
1726 ],,[
1727 HOST_R_ARGS="#define HOST_R_ARGS struct hostent_data *hdptr"
1728 HOST_R_BAD="#define HOST_R_BAD (-1)"
1729 HOST_R_COPY="#define HOST_R_COPY hdptr"
1730 HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS HOST_R_ARGS"
1731 HOST_R_ERRNO="#undef HOST_R_ERRNO"
1732 HOST_R_OK="#define HOST_R_OK 0"
1733 HOST_R_RETURN="#define HOST_R_RETURN int"
1734 HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
1735 HOSTENT_DATA="#define HOSTENT_DATA 1"
1736 ],
1737 AC_TRY_COMPILE([
1738 #undef __USE_MISC
1739 #define __USE_MISC
1740 #include <netdb.h>
1741 extern int gethostbyname_r (const char *,
1742                                  struct hostent *,
1743                                  char *, size_t,
1744                                  struct hostent **,
1745                                  int *);
1746 ],,[
1747 HOST_R_ARGS="#define HOST_R_ARGS char *buf, size_t buflen, struct hostent **answerp, int *h_errnop"
1748 HOST_R_BAD="#define HOST_R_BAD ERANGE"
1749 HOST_R_COPY="#define HOST_R_COPY buf, buflen"
1750 HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
1751 HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
1752 HOST_R_OK="#define HOST_R_OK 0"
1753 HOST_R_RETURN="#define HOST_R_RETURN int"
1754 HOST_R_SETANSWER="#define HOST_R_SETANSWER 1"
1755 HOSTENT_DATA="#undef HOSTENT_DATA"
1756 ],
1757 )))
1758 ,
1759 HOST_R_ARGS="#define HOST_R_ARGS char *buf, int buflen, int *h_errnop"
1760 HOST_R_BAD="#define HOST_R_BAD NULL"
1761 HOST_R_COPY="#define HOST_R_COPY buf, buflen"
1762 HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
1763 HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
1764 HOST_R_OK="#define HOST_R_OK hptr"
1765 HOST_R_RETURN="#define HOST_R_RETURN struct hostent *"
1766 HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
1767 HOSTENT_DATA="#undef HOSTENT_DATA"
1768 )
1769 esac
1770 AC_SUBST(HOST_R_ARGS)
1771 AC_SUBST(HOST_R_BAD)
1772 AC_SUBST(HOST_R_COPY)
1773 AC_SUBST(HOST_R_COPY_ARGS)
1774 AC_SUBST(HOST_R_ERRNO)
1775 AC_SUBST(HOST_R_OK)
1776 AC_SUBST(HOST_R_RETURN)
1777 AC_SUBST(HOST_R_SETANSWER)
1778 AC_SUBST(HOSTENT_DATA)
1779
1780 case $host in
1781 ia64-hp-hpux11.*)
1782 ;;
1783 *)
1784 AC_CHECK_FUNC(endhostent_r,
1785 AC_TRY_COMPILE([
1786 #undef _REENTRANT
1787 #define _REENTRANT
1788 #undef __USE_MISC
1789 #define __USE_MISC
1790 #include <netdb.h>
1791 int endhostent_r(struct hostent_data *buffer);
1792 ], ,
1793 HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) return (x)"
1794 HOST_R_END_RETURN="#define HOST_R_END_RETURN int"
1795 HOST_R_ENT_ARGS="#define HOST_R_ENT_ARGS struct hostent_data *hdptr"
1796 ,
1797 AC_TRY_COMPILE([
1798 #undef _REENTRANT
1799 #define _REENTRANT
1800 #undef __USE_MISC
1801 #define __USE_MISC
1802 #include <netdb.h>
1803 extern void endhostent_r(struct hostent_data *ht_data);
1804 ],[],[
1805 HOST_R_END_RESULT="#define HOST_R_END_RESULT(x)"
1806 HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
1807 HOST_R_ENT_ARGS="#define HOST_R_ENT_ARGS struct hostent_data *hdptr"
1808 ],
1809 AC_TRY_COMPILE([
1810 #undef _REENTRANT
1811 #define _REENTRANT
1812 #undef __USE_MISC
1813 #define __USE_MISC
1814 #include <netdb.h>
1815 extern void endhostent_r(void);
1816 ],[],[
1817 HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) /*empty*/"
1818 HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
1819 HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/"
1820 ],
1821 )
1822 )
1823 )
1824 ,
1825 HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) /*empty*/"
1826 HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
1827 HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/"
1828 )
1829 esac;
1830 AC_SUBST(HOST_R_END_RESULT)
1831 AC_SUBST(HOST_R_END_RETURN)
1832 AC_SUBST(HOST_R_ENT_ARGS)
1833
1834 case $host in
1835 ia64-hp-hpux11.*)
1836 ;;
1837 *)
1838 AC_CHECK_FUNC(sethostent_r,
1839 AC_TRY_COMPILE([
1840 #undef _REENTRANT
1841 #define _REENTRANT
1842 #undef __USE_MISC
1843 #define __USE_MISC
1844 #include <netdb.h>
1845 extern void sethostent_r(int flag, struct hostent_data *ht_data);],[],
1846 [HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT /*empty*/"
1847 HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"],
1848 AC_TRY_COMPILE([
1849 #undef _REENTRANT
1850 #define _REENTRANT
1851 #undef __USE_MISC
1852 #define __USE_MISC
1853 #include <netdb.h>
1854 extern int sethostent_r(int flag, struct hostent_data *ht_data);],[],
1855 [HOST_R_SET_RESULT="#define HOST_R_SET_RESULT 0"
1856 HOST_R_SET_RETURN="#define HOST_R_SET_RETURN int"],
1857 AC_TRY_COMPILE([
1858 #undef _REENTRANT
1859 #define _REENTRANT
1860 #undef __USE_MISC
1861 #define __USE_MISC
1862 #include <netdb.h>
1863 void            sethostent_r (int);],[],
1864 [HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT"
1865 HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"],
1866 )
1867 )
1868 )
1869 ,
1870 HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT"
1871 HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"
1872 )
1873 esac
1874 AC_SUBST(HOST_R_SET_RESULT)
1875 AC_SUBST(HOST_R_SET_RETURN)
1876
1877
1878 AC_MSG_CHECKING(struct passwd element pw_class)
1879 AC_TRY_COMPILE([
1880 #include <sys/types.h>
1881 #include <pwd.h>
1882 ],[struct passwd *pw; pw->pw_class = "";],
1883 AC_MSG_RESULT(yes)
1884 AC_DEFINE(HAS_PW_CLASS)
1885 ,
1886                 AC_MSG_RESULT(no)
1887 )
1888
1889 AC_TRY_COMPILE([
1890 #include <sys/types.h>
1891 #include <pwd.h>
1892 void
1893 setpwent(void) {}
1894 ],
1895 [return (0);],
1896 SETPWENT_VOID="#define SETPWENT_VOID 1"
1897 ,
1898 SETPWENT_VOID="#undef SETPWENT_VOID"
1899 )
1900 AC_SUBST(SETPWENT_VOID)
1901
1902 AC_TRY_COMPILE([
1903 #include <sys/types.h>
1904 #include <grp.h>
1905 void
1906 setgrent(void) {}
1907 ],
1908 [return (0);],
1909 SETGRENT_VOID="#define SETGRENT_VOID 1"
1910 ,
1911 SETGRENT_VOID="#undef SETGRENT_VOID"
1912 )
1913 AC_SUBST(SETGRENT_VOID)
1914
1915 case $host in
1916 ia64-hp-hpux11.*)
1917 NGR_R_CONST="#define NGR_R_CONST"
1918 ;;
1919 *-hp-hpux11.*)
1920 #
1921 # HPUX doesn't have a prototype for getnetgrent_r().
1922 #
1923 NGR_R_CONST="#define NGR_R_CONST"
1924 NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
1925 NGR_R_BAD="#define NGR_R_BAD (0)"
1926 NGR_R_COPY="#define NGR_R_COPY buf, buflen"
1927 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
1928 NGR_R_OK="#define NGR_R_OK 1"
1929 NGR_R_RETURN="#define NGR_R_RETURN int"
1930 ;;
1931
1932 *)
1933 AC_CHECK_FUNC(getnetgrent_r,
1934 AC_TRY_COMPILE(
1935 [
1936 #undef __USE_MISC
1937 #define __USE_MISC
1938 #undef _REEENTRANT
1939 #define _REEENTRANT
1940 #include <netdb.h>
1941 #include <unistd.h>
1942 int getnetgrent_r(char **m, char **u, char **d, char *b, int l) {}
1943 ]
1944 ,
1945 [return (0);],
1946 [
1947 NGR_R_CONST="#define NGR_R_CONST"
1948 NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
1949 NGR_R_BAD="#define NGR_R_BAD (0)"
1950 NGR_R_COPY="#define NGR_R_COPY buf, buflen"
1951 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
1952 NGR_R_OK="#define NGR_R_OK 1"
1953 NGR_R_RETURN="#define NGR_R_RETURN int"
1954 ]
1955 ,
1956 AC_TRY_COMPILE(
1957 [
1958 #undef __USE_MISC
1959 #define __USE_MISC
1960 #undef _REEENTRANT
1961 #define _REEENTRANT
1962 #include <netdb.h>
1963 #include <unistd.h>
1964 int getnetgrent_r(char **m, char **u, char **d, char *b, size_t l) {}
1965 ]
1966 ,
1967 [return (0);],
1968 [
1969 NGR_R_CONST="#define NGR_R_CONST"
1970 NGR_R_ARGS="#define NGR_R_ARGS char *buf, size_t buflen"
1971 NGR_R_BAD="#define NGR_R_BAD (0)"
1972 NGR_R_COPY="#define NGR_R_COPY buf, buflen"
1973 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
1974 NGR_R_OK="#define NGR_R_OK 1"
1975 NGR_R_RETURN="#define NGR_R_RETURN int"
1976 ]
1977 ,
1978 AC_TRY_COMPILE(
1979 [
1980 #undef __USE_MISC
1981 #define __USE_MISC
1982 #undef _REEENTRANT
1983 #define _REEENTRANT
1984 #include <netdb.h>
1985 #include <unistd.h>
1986 extern int getnetgrent_r(char **, char **, char **, void **);
1987 ]
1988 ,
1989 [return (0);],
1990 [
1991 NGR_R_CONST="#define NGR_R_CONST"
1992 NGR_R_ARGS="#define NGR_R_ARGS void **buf"
1993 NGR_R_BAD="#define NGR_R_BAD (0)"
1994 NGR_R_COPY="#define NGR_R_COPY buf"
1995 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
1996 NGR_R_OK="#define NGR_R_OK 1"
1997 NGR_R_RETURN="#define NGR_R_RETURN int"
1998 NGR_R_PRIVATE="#define NGR_R_PRIVATE 1"
1999 ]
2000 ,
2001 AC_TRY_COMPILE(
2002 [
2003 #undef __USE_MISC
2004 #define __USE_MISC
2005 #undef _REEENTRANT
2006 #define _REEENTRANT
2007 #include <netdb.h>
2008 #include <unistd.h>
2009 extern int getnetgrent_r(const char **, const char **, const char **, void *);
2010 ]
2011 ,
2012 [return (0);],
2013 [
2014 NGR_R_CONST="#define NGR_R_CONST const"
2015 NGR_R_ARGS="#define NGR_R_ARGS void *buf"
2016 NGR_R_BAD="#define NGR_R_BAD (0)"
2017 NGR_R_COPY="#define NGR_R_COPY buf"
2018 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
2019 NGR_R_OK="#define NGR_R_OK 1"
2020 NGR_R_RETURN="#define NGR_R_RETURN int"
2021 NGR_R_PRIVATE="#define NGR_R_PRIVATE 2"
2022 ]
2023 ,
2024 )
2025 )
2026 )
2027 )
2028 ,
2029 NGR_R_CONST="#define NGR_R_CONST"
2030 NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
2031 NGR_R_BAD="#define NGR_R_BAD (0)"
2032 NGR_R_COPY="#define NGR_R_COPY buf, buflen"
2033 NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
2034 NGR_R_OK="#define NGR_R_OK 1"
2035 NGR_R_RETURN="#define NGR_R_RETURN int"
2036 )
2037 esac
2038 AC_SUBST(NGR_R_CONST)
2039 AC_SUBST(NGR_R_ARGS)
2040 AC_SUBST(NGR_R_BAD)
2041 AC_SUBST(NGR_R_COPY)
2042 AC_SUBST(NGR_R_COPY_ARGS)
2043 AC_SUBST(NGR_R_OK)
2044 AC_SUBST(NGR_R_RETURN)
2045 AC_SUBST(NGR_R_PRIVATE)
2046
2047 AC_CHECK_FUNC(endnetgrent_r,
2048 AC_TRY_COMPILE(
2049 [
2050 #undef __USE_MISC
2051 #define __USE_MISC
2052 #undef _REEENTRANT
2053 #define _REEENTRANT
2054 #include <netdb.h>
2055 #include <unistd.h>
2056 void endnetgrent_r(void **ptr);
2057 ]
2058 ,
2059 [return (0);]
2060 ,
2061 [
2062 NGR_R_END_RESULT="#define NGR_R_END_RESULT(x)  /* empty */"
2063 NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
2064 NGR_R_END_ARGS="#define NGR_R_END_ARGS NGR_R_ARGS"
2065 ]
2066 ,
2067 AC_TRY_COMPILE(
2068 [
2069 #undef __USE_MISC
2070 #define __USE_MISC
2071 #undef _REEENTRANT
2072 #define _REEENTRANT
2073 #include <netdb.h>
2074 #include <unistd.h>
2075 void endnetgrent_r(void *ptr);
2076 ]
2077 ,
2078 [return (0);]
2079 ,
2080 [
2081 NGR_R_END_RESULT="#define NGR_R_END_RESULT(x)  /* empty */"
2082 NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
2083 NGR_R_END_ARGS="#define NGR_R_END_ARGS void *buf"
2084 ]
2085 ,
2086 [
2087 NGR_R_END_RESULT="#define NGR_R_END_RESULT(x)  return (x)"
2088 NGR_R_END_RETURN="#define NGR_R_END_RETURN int"
2089 NGR_R_END_ARGS="#define NGR_R_END_ARGS NGR_R_ARGS"
2090 ]
2091 )
2092 )
2093 ,
2094 NGR_R_END_RESULT="#define NGR_R_END_RESULT(x)  /*empty*/"
2095 NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
2096 NGR_R_END_ARGS="#undef NGR_R_END_ARGS /*empty*/"
2097 AC_DEFINE(NEED_ENDNETGRENT_R)
2098 )
2099 AC_SUBST(NGR_R_END_RESULT)
2100 AC_SUBST(NGR_R_END_RETURN)
2101 AC_SUBST(NGR_R_END_ARGS)
2102
2103 AC_CHECK_FUNC(setnetgrent_r,
2104 [
2105 case "$host" in
2106 *bsdi*)
2107         #
2108         # No prototype
2109         #
2110         NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /*empty*/"
2111         NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
2112         NGR_R_SET_ARGS="#define NGR_R_SET_ARGS NGR_R_ARGS"
2113         NGR_R_SET_CONST="#define NGR_R_SET_CONST"
2114         ;;
2115 *hpux*)
2116         #
2117         # No prototype
2118         #
2119         NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
2120         NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
2121         NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS /* empty */"
2122         NGR_R_SET_CONST="#define NGR_R_SET_CONST"
2123         ;;
2124 *)
2125 AC_TRY_COMPILE(
2126 [
2127 #undef __USE_MISC
2128 #define __USE_MISC
2129 #undef _REEENTRANT
2130 #define _REEENTRANT
2131 #include <netdb.h>
2132 #include <unistd.h>
2133 void setnetgrent_r(void **ptr);
2134 ]
2135 ,
2136 [return (0);]
2137 ,
2138 [
2139 NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /* empty */"
2140 NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
2141 NGR_R_SET_ARGS="#define NGR_R_SET_ARGS void **buf"
2142 NGR_R_SET_CONST="#define NGR_R_SET_CONST"
2143 ]
2144 ,
2145 AC_TRY_COMPILE(
2146 [
2147 #undef __USE_MISC
2148 #define __USE_MISC
2149 #undef _REEENTRANT
2150 #define _REEENTRANT
2151 #include <netdb.h>
2152 #include <unistd.h>
2153 extern int setnetgrent_r(char *, void **);
2154 ]
2155 ,
2156 [return (0);]
2157 ,
2158 [
2159 NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
2160 NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
2161 NGR_R_SET_ARGS="#define NGR_R_SET_ARGS void **buf"
2162 NGR_R_SET_CONST="#define NGR_R_SET_CONST"
2163 ]
2164 ,
2165 [
2166 NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
2167 NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
2168 NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS"
2169 NGR_R_SET_CONST="#define NGR_R_SET_CONST const"
2170 ]
2171 ))
2172 ;;
2173 esac
2174 ]
2175 ,
2176 NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /*empty*/"
2177 NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
2178 NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS"
2179 NGR_R_SET_CONST="#define NGR_R_SET_CONST const"
2180 )
2181
2182 AC_SUBST(NGR_R_SET_RESULT)
2183 AC_SUBST(NGR_R_SET_RETURN)
2184 AC_SUBST(NGR_R_SET_ARGS)
2185 AC_SUBST(NGR_R_SET_CONST)
2186
2187 AC_CHECK_FUNC(innetgr_r,,AC_DEFINE(NEED_INNETGR_R))
2188
2189 case $host in
2190 ia64-hp-hpux11.*)
2191 ;;
2192 *)
2193 AC_CHECK_FUNC(getprotoent_r,
2194 AC_TRY_COMPILE(
2195 [
2196 #undef __USE_MISC
2197 #define __USE_MISC
2198 #include <netdb.h>
2199 struct protoent *getprotoent_r(struct protoent *result,
2200                  char *buffer, int buflen) {}
2201 ]
2202 ,
2203 [return (0);]
2204 ,
2205 [
2206 PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, int buflen"
2207 PROTO_R_BAD="#define PROTO_R_BAD NULL"
2208 PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
2209 PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
2210 PROTO_R_OK="#define PROTO_R_OK pptr"
2211 PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
2212 PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
2213 PROTOENT_DATA="#undef PROTOENT_DATA"
2214 ]
2215 ,
2216 AC_TRY_COMPILE(
2217 [
2218 #undef __USE_MISC
2219 #define __USE_MISC
2220 #include <netdb.h>
2221 int getprotoent_r (struct protoent *, char *, size_t, struct protoent **);
2222
2223 ]
2224 ,
2225 [return (0);]
2226 ,
2227 [
2228 PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, size_t buflen, struct protoent **answerp"
2229 PROTO_R_BAD="#define PROTO_R_BAD ERANGE"
2230 PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
2231 PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS char *buf, size_t buflen"
2232 PROTO_R_OK="#define PROTO_R_OK 0"
2233 PROTO_R_SETANSWER="#define PROTO_R_SETANSWER 1"
2234 PROTO_R_RETURN="#define PROTO_R_RETURN int"
2235 PROTOENT_DATA="#undef PROTOENT_DATA"
2236 ]
2237 ,
2238 AC_TRY_COMPILE(
2239 [
2240 #undef __USE_MISC
2241 #define __USE_MISC
2242 #include <netdb.h>
2243 int getprotoent_r (struct protoent *, struct protoent_data *prot_data);
2244
2245 ]
2246 ,
2247 [return (0);]
2248 ,
2249 [
2250 PROTO_R_ARGS="#define PROTO_R_ARGS struct protoent_data *prot_data"
2251 PROTO_R_BAD="#define PROTO_R_BAD (-1)"
2252 PROTO_R_COPY="#define PROTO_R_COPY prot_data"
2253 PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS struct protoent_data *pdptr"
2254 PROTO_R_OK="#define PROTO_R_OK 0"
2255 PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
2256 PROTO_R_RETURN="#define PROTO_R_RETURN int"
2257 PROTOENT_DATA="#define PROTOENT_DATA 1"
2258 ]
2259 ,
2260 )
2261 )
2262 )
2263 ,
2264 PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, int buflen"
2265 PROTO_R_BAD="#define PROTO_R_BAD NULL"
2266 PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
2267 PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
2268 PROTO_R_OK="#define PROTO_R_OK pptr"
2269 PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
2270 PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
2271 PROTOENT_DATA="#undef PROTOENT_DATA"
2272 )
2273 ;;
2274 esac
2275 AC_SUBST(PROTO_R_ARGS)
2276 AC_SUBST(PROTO_R_BAD)
2277 AC_SUBST(PROTO_R_COPY)
2278 AC_SUBST(PROTO_R_COPY_ARGS)
2279 AC_SUBST(PROTO_R_OK)
2280 AC_SUBST(PROTO_R_SETANSWER)
2281 AC_SUBST(PROTO_R_RETURN)
2282 AC_SUBST(PROTOENT_DATA)
2283
2284 case $host in
2285 ia64-hp-hpux11.*)
2286 ;;
2287 *)
2288 AC_CHECK_FUNC(endprotoent_r,
2289 AC_TRY_COMPILE(
2290 [
2291 #undef _REENTRANT
2292 #define _REENTRANT
2293 #undef __USE_MISC
2294 #define __USE_MISC
2295 #include <netdb.h>
2296 void endprotoent_r(void);
2297 ]
2298 ,,
2299 [
2300 PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
2301 PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
2302 PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS"
2303 PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
2304 ]
2305 ,
2306 AC_TRY_COMPILE(
2307 [
2308 #undef _REENTRANT
2309 #define _REENTRANT
2310 #undef __USE_MISC
2311 #define __USE_MISC
2312 #include <netdb.h>
2313 void endprotoent_r(struct protoent_data *);
2314 ]
2315 ,,
2316 [
2317 PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
2318 PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
2319 PROTO_R_ENT_ARGS="#define PROTO_R_ENT_ARGS struct protoent_data *proto_data"
2320 PROTO_R_ENT_UNUSED="#define PROTO_R_ENT_UNUSED UNUSED(proto_data)"
2321 ]
2322 ,
2323 AC_TRY_COMPILE(
2324 [
2325 #undef _REENTRANT
2326 #define _REENTRANT
2327 #undef __USE_MISC
2328 #define __USE_MISC
2329 #include <netdb.h>
2330 int endprotoent_r(struct protoent_data *);
2331 ]
2332 ,,
2333 [
2334 PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) return(0)"
2335 PROTO_R_END_RETURN="#define PROTO_R_END_RETURN int"
2336 PROTO_R_ENT_ARGS="#define PROTO_R_ENT_ARGS struct protoent_data *proto_data"
2337 PROTO_R_ENT_UNUSED="#define PROTO_R_ENT_UNUSED UNUSED(proto_data)"
2338 ]
2339 ,
2340 )
2341 )
2342 )
2343 ,
2344 PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
2345 PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
2346 PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS /*empty*/"
2347 PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
2348 )
2349 esac
2350 AC_SUBST(PROTO_R_END_RESULT)
2351 AC_SUBST(PROTO_R_END_RETURN)
2352 AC_SUBST(PROTO_R_ENT_ARGS)
2353 AC_SUBST(PROTO_R_ENT_UNUSED)
2354
2355 case $host in
2356 ia64-hp-hpux11.*)
2357 ;;
2358 *)
2359 AC_CHECK_FUNC(setprotoent_r,
2360 AC_TRY_COMPILE(
2361 [
2362 #undef _REENTRANT
2363 #define _REENTRANT
2364 #undef __USE_MISC
2365 #define __USE_MISC
2366 #include <netdb.h>
2367 void               setprotoent_r __P((int));
2368 ],[],
2369 PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
2370 PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void"
2371 ,
2372 AC_TRY_COMPILE(
2373 [
2374 #undef _REENTRANT
2375 #define _REENTRANT
2376 #undef __USE_MISC
2377 #define __USE_MISC
2378 #include <netdb.h>
2379 int setprotoent_r (int, struct protoent_data *);
2380 ],[],
2381 PROTO_R_SET_RESULT="#define PROTO_R_SET_RESULT (0)"
2382 PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN int"
2383 ,
2384 )
2385 )
2386 ,
2387 PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
2388 PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void"
2389 )
2390 esac
2391 AC_SUBST(PROTO_R_SET_RESULT)
2392 AC_SUBST(PROTO_R_SET_RETURN)
2393
2394 AC_CHECK_FUNC(getpwent_r,
2395 AC_TRY_COMPILE(
2396 [
2397 #include <sys/types.h>
2398 #include <pwd.h>
2399 struct passwd *
2400 getpwent_r(struct passwd *pwptr, char *buf, int buflen) {}
2401 ]
2402 ,
2403 []
2404 ,
2405 PASS_R_ARGS="#define PASS_R_ARGS char *buf, int buflen"
2406 PASS_R_BAD="#define PASS_R_BAD NULL"
2407 PASS_R_COPY="#define PASS_R_COPY buf, buflen"
2408 PASS_R_COPY_ARGS="#define PASS_R_COPY_ARGS PASS_R_ARGS"
2409 PASS_R_OK="#define PASS_R_OK pwptr"
2410 PASS_R_RETURN="#define PASS_R_RETURN struct passwd *"
2411 ,
2412 )
2413 ,
2414 PASS_R_ARGS="#define PASS_R_ARGS char *buf, int buflen"
2415 PASS_R_BAD="#define PASS_R_BAD NULL"
2416 PASS_R_COPY="#define PASS_R_COPY buf, buflen"
2417 PASS_R_COPY_ARGS="#define PASS_R_COPY_ARGS PASS_R_ARGS"
2418 PASS_R_OK="#define PASS_R_OK pwptr"
2419 PASS_R_RETURN="#define PASS_R_RETURN struct passwd *"
2420 AC_DEFINE(NEED_GETPWENT_R)
2421 )
2422 AC_SUBST(PASS_R_ARGS)
2423 AC_SUBST(PASS_R_BAD)
2424 AC_SUBST(PASS_R_COPY)
2425 AC_SUBST(PASS_R_COPY_ARGS)
2426 AC_SUBST(PASS_R_OK)
2427 AC_SUBST(PASS_R_RETURN)
2428
2429 AC_CHECK_FUNC(endpwent_r,
2430 AC_TRY_COMPILE(
2431 [
2432 #include <pwd.h>
2433 void endpwent_r(FILE **pwfp);
2434 ], ,
2435 PASS_R_END_RESULT="#define PASS_R_END_RESULT(x) /*empty*/"
2436 PASS_R_END_RETURN="#define PASS_R_END_RETURN void"
2437 PASS_R_ENT_ARGS="#define PASS_R_ENT_ARGS FILE **pwptr"
2438 ,
2439 )
2440 ,
2441 PASS_R_END_RESULT="#define PASS_R_END_RESULT(x) /*empty*/"
2442 PASS_R_END_RETURN="#define PASS_R_END_RETURN void"
2443 PASS_R_ENT_ARGS="#undef PASS_R_ENT_ARGS"
2444 AC_DEFINE(NEED_ENDPWENT_R)
2445 )
2446 AC_SUBST(PASS_R_END_RESULT)
2447 AC_SUBST(PASS_R_END_RETURN)
2448 AC_SUBST(PASS_R_ENT_ARGS)
2449 AC_CHECK_FUNC(setpassent_r,,AC_DEFINE(NEED_SETPASSENT_R))
2450 AC_CHECK_FUNC(setpassent,,AC_DEFINE(NEED_SETPASSENT))
2451
2452 AC_CHECK_FUNC(setpwent_r,
2453 AC_TRY_COMPILE([
2454 #include <pwd.h>
2455 void setpwent_r(FILE **pwfp);
2456 ], ,
2457 PASS_R_SET_RESULT="#undef PASS_R_SET_RESULT /* empty */"
2458 PASS_R_SET_RETURN="#define PASS_R_SET_RETURN int"
2459 ,
2460 AC_TRY_COMPILE([
2461 #include <pwd.h>
2462 int setpwent_r(FILE **pwfp);
2463 ], ,
2464 PASS_R_SET_RESULT="#define PASS_R_SET_RESULT 0"
2465 PASS_R_SET_RETURN="#define PASS_R_SET_RETURN int"
2466 ,
2467 )
2468 )
2469 ,
2470 PASS_R_SET_RESULT="#undef PASS_R_SET_RESULT /*empty*/"
2471 PASS_R_SET_RETURN="#define PASS_R_SET_RETURN void"
2472 AC_DEFINE(NEED_SETPWENT_R)
2473 )
2474 AC_SUBST(PASS_R_SET_RESULT)
2475 AC_SUBST(PASS_R_SET_RETURN)
2476
2477 AC_CHECK_FUNC(getpwnam_r,,AC_DEFINE(NEED_GETPWNAM_R))
2478 AC_CHECK_FUNC(getpwuid_r,,AC_DEFINE(NEED_GETPWUID_R))
2479
2480 case $host in
2481 ia64-hp-hpux11.*)
2482 ;;
2483 *)
2484 AC_CHECK_FUNC(getservent_r,
2485 AC_TRY_COMPILE([
2486 #undef __USE_MISC
2487 #define __USE_MISC
2488 #include <netdb.h>
2489 struct servent *
2490 getservent_r(struct servent *result, char *buffer, int buflen) {}
2491 ],[return (0);],
2492 [
2493 SERV_R_ARGS="#define SERV_R_ARGS char *buf, int buflen"
2494 SERV_R_BAD="#define SERV_R_BAD NULL"
2495 SERV_R_COPY="#define SERV_R_COPY buf, buflen"
2496 SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS SERV_R_ARGS"
2497 SERV_R_OK="#define SERV_R_OK sptr"
2498 SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
2499 SERV_R_RETURN="#define SERV_R_RETURN struct servent *"
2500 ]
2501 ,
2502 AC_TRY_COMPILE([
2503 #undef __USE_MISC
2504 #define __USE_MISC
2505 #include <netdb.h>
2506 int
2507 getservent_r (struct servent *, char *, size_t, struct servent **);
2508 ],[return (0);],
2509 [
2510 SERV_R_ARGS="#define SERV_R_ARGS char *buf, size_t buflen, struct servent **answerp"
2511 SERV_R_BAD="#define SERV_R_BAD ERANGE"
2512 SERV_R_COPY="#define SERV_R_COPY buf, buflen"
2513 SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS char *buf, size_t buflen"
2514 SERV_R_OK="#define SERV_R_OK (0)"
2515 SERV_R_SETANSWER="#define SERV_R_SETANSWER 1"
2516 SERV_R_RETURN="#define SERV_R_RETURN int"
2517 ]
2518 ,
2519 AC_TRY_COMPILE([
2520 #undef __USE_MISC
2521 #define __USE_MISC
2522 #include <netdb.h>
2523 int
2524 getservent_r (struct servent *, struct servent_data *serv_data);
2525 ],[return (0);],
2526 [
2527 SERV_R_ARGS="#define SERV_R_ARGS struct servent_data *serv_data"
2528 SERV_R_BAD="#define SERV_R_BAD (-1)"
2529 SERV_R_COPY="#define SERV_R_COPY serv_data"
2530 SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS struct servent_data *sdptr"
2531 SERV_R_OK="#define SERV_R_OK (0)"
2532 SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
2533 SERV_R_RETURN="#define SERV_R_RETURN int"
2534 SERVENT_DATA="#define SERVENT_DATA 1"
2535 ]
2536 ,
2537 )
2538 )
2539 )
2540 ,
2541 SERV_R_ARGS="#define SERV_R_ARGS char *buf, int buflen"
2542 SERV_R_BAD="#define SERV_R_BAD NULL"
2543 SERV_R_COPY="#define SERV_R_COPY buf, buflen"
2544 SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS SERV_R_ARGS"
2545 SERV_R_OK="#define SERV_R_OK sptr"
2546 SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
2547 SERV_R_RETURN="#define SERV_R_RETURN struct servent *"
2548 )
2549 esac
2550 AC_SUBST(SERV_R_ARGS)
2551 AC_SUBST(SERV_R_BAD)
2552 AC_SUBST(SERV_R_COPY)
2553 AC_SUBST(SERV_R_COPY_ARGS)
2554 AC_SUBST(SERV_R_OK)
2555 AC_SUBST(SERV_R_SETANSWER)
2556 AC_SUBST(SERV_R_RETURN)
2557 AC_SUBST(SERVENT_DATA)
2558
2559 case $host in
2560 ia64-hp-hpux11.*)
2561 ;;
2562 *)
2563 AC_CHECK_FUNC(endservent_r,
2564 AC_TRY_COMPILE(
2565 [
2566 #undef _REENTRANT
2567 #define _REENTRANT
2568 #undef __USE_MISC
2569 #define __USE_MISC
2570 #include <netdb.h>
2571 void endservent_r(void);
2572 ]
2573 ,
2574 ,
2575 [
2576 SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
2577 SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
2578 SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
2579 SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
2580 ]
2581 ,
2582 AC_TRY_COMPILE(
2583 [
2584 #undef _REENTRANT
2585 #define _REENTRANT
2586 #undef __USE_MISC
2587 #define __USE_MISC
2588 #include <netdb.h>
2589 void endservent_r(struct servent_data *serv_data);
2590 ]
2591 ,
2592 ,
2593 [
2594 SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
2595 SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
2596 SERV_R_ENT_ARGS="#define SERV_R_ENT_ARGS struct servent_data *serv_data"
2597 SERV_R_ENT_UNUSED="#define SERV_R_ENT_UNUSED UNUSED(serv_data)"
2598 ]
2599 ,
2600 AC_TRY_COMPILE(
2601 [
2602 #undef _REENTRANT
2603 #define _REENTRANT
2604 #undef __USE_MISC
2605 #define __USE_MISC
2606 #include <netdb.h>
2607 int endservent_r(struct servent_data *serv_data);
2608 ]
2609 ,
2610 ,
2611 [
2612 SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) return(x)"
2613 SERV_R_END_RETURN="#define SERV_R_END_RETURN int "
2614 SERV_R_ENT_ARGS="#define SERV_R_ENT_ARGS struct servent_data *serv_data"
2615 SERV_R_ENT_UNUSED="#define SERV_R_ENT_UNUSED UNUSED(serv_data)"
2616 ]
2617 ,
2618 )
2619 )
2620 )
2621 ,
2622 SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
2623 SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
2624 SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
2625 SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
2626 )
2627 esac
2628 AC_SUBST(SERV_R_END_RESULT)
2629 AC_SUBST(SERV_R_END_RETURN)
2630 AC_SUBST(SERV_R_ENT_ARGS)
2631 AC_SUBST(SERV_R_ENT_UNUSED)
2632
2633 case $host in
2634 ia64-hp-hpux11.*)
2635 ;;
2636 *)
2637 AC_CHECK_FUNC(setservent_r,
2638 AC_TRY_COMPILE(
2639 [
2640 #undef _REENTRANT
2641 #define _REENTRANT
2642 #undef __USE_MISC
2643 #define __USE_MISC
2644 #include <netdb.h>
2645 void setservent_r(int);
2646 ]
2647 ,,
2648 [
2649 SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
2650 SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void"
2651 ]
2652 ,
2653 AC_TRY_COMPILE(
2654 [
2655 #undef _REENTRANT
2656 #define _REENTRANT
2657 #undef __USE_MISC
2658 #define __USE_MISC
2659 #include <netdb.h>
2660 int setservent_r(int, struct servent_data *);
2661 ]
2662 ,,
2663 [
2664 SERV_R_SET_RESULT="#define SERV_R_SET_RESULT (0)"
2665 SERV_R_SET_RETURN="#define SERV_R_SET_RETURN int"
2666 ]
2667 ,
2668 )
2669 )
2670 ,
2671 SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
2672 SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void"
2673 )
2674 esac
2675 AC_SUBST(SERV_R_SET_RESULT)
2676 AC_SUBST(SERV_R_SET_RETURN)
2677
2678 AC_TRY_COMPILE(
2679 [
2680 #undef _REENTRANT
2681 #define _REENTRANT
2682 #undef __USE_MISC
2683 #define __USE_MISC
2684 #include <unistd.h>
2685 #include <netdb.h>
2686 int innetgr(const char *netgroup, const char *host, const char *user, const char *domain);
2687 ]
2688 ,,
2689 [
2690 INNETGR_ARGS="#undef INNETGR_ARGS"
2691 ]
2692 ,
2693 AC_TRY_COMPILE(
2694 [
2695 #undef _REENTRANT
2696 #define _REENTRANT
2697 #undef __USE_MISC
2698 #define __USE_MISC
2699 #include <unistd.h>
2700 #include <netdb.h>
2701 int innetgr(char *netgroup, char *host, char *user, char *domain);
2702 ]
2703 ,,
2704 [
2705 INNETGR_ARGS="#define INNETGR_ARGS char *netgroup, char *host, char *user, char *domain"
2706 ]
2707 ,
2708 ))
2709
2710 AC_TRY_COMPILE(
2711 [
2712 #undef _REENTRANT
2713 #define _REENTRANT
2714 #undef __USE_MISC
2715 #define __USE_MISC
2716 #include <unistd.h>
2717 #include <netdb.h>
2718 void setnetgrent(const char *);
2719 ]
2720 ,,
2721 [
2722 SETNETGRENT_ARGS="#undef SETNETGRENT_ARGS"
2723 ]
2724 ,
2725 AC_TRY_COMPILE(
2726 [
2727 #undef _REENTRANT
2728 #define _REENTRANT
2729 #undef __USE_MISC
2730 #define __USE_MISC
2731 #include <unistd.h>
2732 #include <netdb.h>
2733 void setnetgrent(char *);
2734 ]
2735 ,,
2736 [
2737 SETNETGRENT_ARGS="#define SETNETGRENT_ARGS char *netgroup"
2738 ]
2739 ,
2740 ))
2741 AC_SUBST(SETNETGRENT_ARGS)
2742 AC_SUBST(INNETGR_ARGS)
2743
2744 #
2745 # Random remaining OS-specific issues involving compiler warnings.
2746 # XXXDCL print messages to indicate some compensation is being done?
2747 #
2748 BROKEN_IN6ADDR_INIT_MACROS="#undef BROKEN_IN6ADDR_INIT_MACROS"
2749
2750 case "$host" in
2751         *-aix5.1.*)
2752                 hack_shutup_pthreadmutexinit=yes
2753                 hack_shutup_in6addr_init_macros=yes
2754                 ;;
2755         *-aix5.[[23]].*)
2756                 hack_shutup_in6addr_init_macros=yes
2757                 ;;
2758         *-bsdi3.1*)
2759                 hack_shutup_sputaux=yes
2760                 ;;
2761         *-bsdi4.0*)
2762                 hack_shutup_sigwait=yes
2763                 hack_shutup_sputaux=yes
2764                 hack_shutup_in6addr_init_macros=yes
2765                 ;;
2766         *-bsdi4.1*)
2767                 hack_shutup_stdargcast=yes
2768                 ;;
2769         *-hpux11.11)
2770                 hack_shutup_in6addr_init_macros=yes
2771                 ;;
2772         *-osf5.1|*-osf5.1b)
2773                 hack_shutup_in6addr_init_macros=yes
2774                 ;;
2775         *-solaris2.8)
2776                 hack_shutup_in6addr_init_macros=yes
2777                 ;;
2778         *-solaris2.9)
2779                 hack_shutup_in6addr_init_macros=yes
2780                 ;;
2781         *-solaris2.1[[0-9]])
2782                 hack_shutup_in6addr_init_macros=yes
2783                 ;;
2784 esac
2785
2786 case "$hack_shutup_pthreadmutexinit" in
2787         yes)
2788                 #
2789                 # Shut up PTHREAD_MUTEX_INITIALIZER unbraced
2790                 # initializer warnings.
2791                 #
2792                 AC_DEFINE(SHUTUP_MUTEX_INITIALIZER)
2793                 ;;
2794 esac
2795
2796 case "$hack_shutup_sigwait" in
2797         yes)
2798                 #
2799                 # Shut up a -Wmissing-prototypes warning for sigwait().
2800                 #
2801                 AC_DEFINE(SHUTUP_SIGWAIT)
2802                 ;;
2803 esac
2804
2805 case "$hack_shutup_sputaux" in
2806         yes)
2807                 #
2808                 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2809                 #
2810                 AC_DEFINE(SHUTUP_SPUTAUX)
2811                 ;;
2812 esac
2813
2814 case "$hack_shutup_stdargcast" in
2815         yes)
2816                 #
2817                 # Shut up a -Wcast-qual warning from va_start().
2818                 #
2819                 AC_DEFINE(SHUTUP_STDARG_CAST)
2820                 ;;
2821 esac
2822
2823 case "$hack_shutup_in6addr_init_macros" in
2824         yes)
2825                 AC_DEFINE(BROKEN_IN6ADDR_INIT_MACROS, 1, [Defined if IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need to be redefined.] )
2826                 ;;
2827 esac
2828
2829 #
2830 # Substitutions
2831 #
2832 AC_SUBST(BIND9_TOP_BUILDDIR)
2833 BIND9_TOP_BUILDDIR=`pwd`
2834
2835 AC_SUBST_FILE(BIND9_INCLUDES)
2836 BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2837
2838 AC_SUBST_FILE(BIND9_MAKE_RULES)
2839 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2840
2841 . $srcdir/../../version
2842 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2843 AC_SUBST(BIND9_VERSION)
2844
2845 AC_SUBST_FILE(LIBBIND_API)
2846 LIBBIND_API=$srcdir/api
2847
2848 AC_OUTPUT(
2849         make/rules
2850         make/mkdep
2851         make/includes
2852         Makefile
2853         bsd/Makefile
2854         dst/Makefile
2855         include/Makefile
2856         inet/Makefile
2857         irs/Makefile
2858         isc/Makefile
2859         nameser/Makefile
2860         port_after.h
2861         port_before.h
2862         resolv/Makefile
2863         port/Makefile
2864         ${PORT_DIR}/Makefile
2865         ${PORT_INCLUDE}/Makefile
2866         include/isc/platform.h
2867 )
2868
2869 # Tell Emacs to edit this file in shell mode.
2870 # Local Variables:
2871 # mode: sh
2872 # End: