]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bind9/configure.in
Upgrade to version 9.8.0-P4
[FreeBSD/FreeBSD.git] / contrib / bind9 / configure.in
1 # Copyright (C) 2004-2011  Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 1998-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 dnl
17 AC_DIVERT_PUSH(1)dnl
18 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
19 AC_DIVERT_POP()dnl
20
21 AC_REVISION($Revision: 1.512.8.1 $)
22
23 AC_INIT(lib/dns/name.c)
24 AC_PREREQ(2.59)
25
26 AC_CONFIG_HEADER(config.h)
27
28 AC_CANONICAL_HOST
29
30 AC_PROG_MAKE_SET
31
32 #
33 # GNU libtool support
34 #
35 case $build_os in
36 sunos*)
37     # Just set the maximum command line length for sunos as it otherwise
38     # takes a exceptionally long time to work it out. Required for libtool.
39      
40     lt_cv_sys_max_cmd_len=4096;
41     ;;
42 esac
43
44 AC_PROG_LIBTOOL
45 AC_PROG_INSTALL
46 AC_PROG_LN_S
47
48 AC_SUBST(STD_CINCLUDES)
49 AC_SUBST(STD_CDEFINES)
50 AC_SUBST(STD_CWARNINGS)
51 AC_SUBST(CCOPT)
52
53 # Warn if the user specified libbind, which is now deprecated
54 AC_ARG_ENABLE(libbind, [  --enable-libbind        deprecated])
55
56 case "$enable_libbind" in
57         yes)
58                 AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
59 It is available from http://www.isc.org as a separate download.])
60                 ;;
61         no|'')
62                 ;;
63 esac
64
65 #
66 # Make very sure that these are the first files processed by
67 # config.status, since we use the processed output as the input for
68 # AC_SUBST_FILE() substitutions in other files.
69 #
70 AC_CONFIG_FILES([make/rules make/includes])
71
72 AC_PATH_PROG(AR, ar)
73 ARFLAGS="cruv"
74 AC_SUBST(AR)
75 AC_SUBST(ARFLAGS)
76
77 # The POSIX ln(1) program.  Non-POSIX systems may substitute
78 # "copy" or something.
79 LN=ln
80 AC_SUBST(LN)
81
82 case "$AR" in
83         "")
84                 AC_MSG_ERROR([
85 ar program not found.  Please fix your PATH to include the directory in
86 which ar resides, or set AR in the environment with the full path to ar.
87 ])
88
89                 ;;
90 esac
91
92 #
93 # Etags.
94 #
95 AC_PATH_PROGS(ETAGS, etags emacs-etags)
96
97 #
98 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
99 # GNU emacs etags, and it requires the -L flag.
100 #
101 if test "X$ETAGS" != "X"; then
102         AC_MSG_CHECKING(for Exuberant Ctags etags)
103         if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
104                 AC_MSG_RESULT(yes)
105                 ETAGS="$ETAGS -L"
106         else
107                 AC_MSG_RESULT(no)
108         fi
109 fi
110 AC_SUBST(ETAGS)
111
112 #
113 # Perl is optional; it is used only by some of the system test scripts.
114 # Note: the backtrace feature (see below) uses perl to build the symbol table,
115 # but it still compiles without perl, in which case an empty table will be used.
116 #
117 AC_PATH_PROGS(PERL, perl5 perl)
118 AC_SUBST(PERL)
119
120 #
121 # Special processing of paths depending on whether --prefix,
122 # --sysconfdir or --localstatedir arguments were given.  What's
123 # desired is some compatibility with the way previous versions
124 # of BIND built; they defaulted to /usr/local for most parts of
125 # the installation, but named.boot/named.conf was in /etc
126 # and named.pid was in /var/run.
127 #
128 # So ... if none of --prefix, --sysconfdir or --localstatedir are
129 # specified, set things up that way.  If --prefix is given, use
130 # it for sysconfdir and localstatedir the way configure normally
131 # would.  To change the prefix for everything but leave named.conf
132 # in /etc or named.pid in /var/run, then do this the usual configure way:
133 # ./configure --prefix=/somewhere --sysconfdir=/etc
134 # ./configure --prefix=/somewhere --localstatedir=/var
135 #
136 # To put named.conf and named.pid in /usr/local with everything else,
137 # set the prefix explicitly to /usr/local even though that's the default:
138 # ./configure --prefix=/usr/local
139 #
140 case "$prefix" in
141         NONE)
142                 case "$sysconfdir" in
143                         '${prefix}/etc')
144                                 sysconfdir=/etc
145                                 ;;
146                 esac
147                 case "$localstatedir" in
148                         '${prefix}/var')
149                                 localstatedir=/var
150                                 ;;
151                 esac
152                 ;;
153 esac
154
155 #
156 # Make sure INSTALL uses an absolute path, else it will be wrong in all
157 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
158 # configure based on the location of the file where it is substituted.
159 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
160 # subdirectory of install-sh, This relative path will be wrong for all
161 # directories more than one level down from install-sh.
162 #
163 case "$INSTALL" in
164         /*)
165                 ;;
166         *)
167                 #
168                 # Not all systems have dirname.
169                 #
170                 changequote({, })
171                 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
172                 changequote([, ])
173
174                 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
175                 test "$ac_dir" = "$ac_prog" && ac_dir=.
176                 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
177                 INSTALL="$ac_dir/$ac_prog"
178                 ;;
179 esac
180
181 #
182 # On these hosts, we really want to use cc, not gcc, even if it is
183 # found.  The gcc that these systems have will not correctly handle
184 # pthreads.
185 #
186 # However, if the user sets $CC to be something, let that override
187 # our change.
188 #
189 if test "X$CC" = "X" ; then
190         case "$host" in
191                 *-dec-osf*)
192                         CC="cc"
193                         ;;
194                 *-solaris*)
195                         # Use Sun's cc if it is available, but watch
196                         # out for /usr/ucb/cc; it will never be the right
197                         # compiler to use.
198                         #
199                         # If setting CC here fails, the AC_PROG_CC done
200                         # below might still find gcc.
201                         IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
202                         for ac_dir in $PATH; do
203                                 test -z "$ac_dir" && ac_dir=.
204                                 case "$ac_dir" in
205                                 /usr/ucb)
206                                         # exclude
207                                         ;;
208                                 *)
209                                         if test -f "$ac_dir/cc"; then
210                                                 CC="$ac_dir/cc"
211                                                 break
212                                         fi
213                                         ;;
214                                 esac
215                         done
216                         IFS="$ac_save_ifs"
217                         ;;
218                 *-hp-hpux*)
219                         CC="cc"
220                         ;;
221                 mips-sgi-irix*)
222                         CC="cc"
223                         ;;
224         esac
225 fi
226
227 AC_PROG_CC
228
229 #
230 # gcc's optimiser is broken at -02 for ultrasparc
231 #
232 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
233         case "$host" in
234         sparc-*)
235                 CCFLAGS="-g -O1"
236                 ;;
237         esac
238 fi
239
240 #
241 # OS dependent CC flags
242 #
243 case "$host" in
244         # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
245         # -D_XOPEN_SOURCE_EXTENDED.
246         *-dec-osf*)
247                 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
248                 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
249                 ;;
250         #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
251         *-hp-hpux*)
252                 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
253                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
254                 LIBS="-lxnet $LIBS"
255                 ;;
256         # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
257         *-solaris*)
258                 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
259                 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
260                 ;;
261         # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
262         # parts of the IPv6 Advanced Socket API as a result.  This is stupid
263         # as it breaks how the two halves (Basic and Advanced) of the IPv6
264         # Socket API were designed to be used but we have to live with it.
265         # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
266         *-linux*)
267                 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
268                 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
269                 ;;
270 esac
271
272 AC_HEADER_STDC
273
274 AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
275 [$ac_includes_default
276 #ifdef HAVE_SYS_PARAM_H
277 # include <sys/param.h>
278 #endif
279 ])
280
281 AC_C_CONST
282 AC_C_INLINE
283 AC_C_VOLATILE
284 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
285 AC_C_FLEXIBLE_ARRAY_MEMBER
286
287 #
288 # Older versions of HP/UX don't define seteuid() and setegid()
289 #
290 AC_CHECK_FUNCS(seteuid setresuid)
291 AC_CHECK_FUNCS(setegid setresgid)
292
293 #
294 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
295 # is reported to not support "static inline" (RT #1212).
296 #
297 AC_MSG_CHECKING(for static inline breakage)
298 AC_TRY_COMPILE(, [
299                 foo1();
300         }
301
302         static inline int foo1() {
303                 return 0;
304         }
305
306         static inline int foo2() {
307                 return foo1();
308         ],
309         [AC_MSG_RESULT(no)],
310         [AC_MSG_RESULT(yes)
311          AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
312
313 AC_TYPE_SIZE_T
314 AC_CHECK_TYPE(ssize_t, int)
315 AC_CHECK_TYPE(uintptr_t,unsigned long)
316 AC_CHECK_TYPE(socklen_t,
317 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
318 [
319 AC_TRY_COMPILE(
320 [
321 #include <sys/types.h>
322 #include <sys/socket.h>
323 int getsockname(int, struct sockaddr *, size_t *);
324 ],[],
325 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
326 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
327 ],
328 [
329 #include <sys/types.h>
330 #include <sys/socket.h>
331 ])
332 AC_SUBST(ISC_SOCKADDR_LEN_T)
333 AC_HEADER_TIME
334 AC_MSG_CHECKING(for long long)
335 AC_TRY_COMPILE([],[long long i = 0; return (0);],
336         [AC_MSG_RESULT(yes)
337                 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
338         [AC_MSG_RESULT(no)
339                 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
340 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
341
342 #
343 # check for GCC noreturn attribute
344 #
345 AC_MSG_CHECKING(for GCC noreturn attribute)
346 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
347         [AC_MSG_RESULT(yes)
348                 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
349                 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
350         [AC_MSG_RESULT(no)
351                 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
352                 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
353 AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
354 AC_SUBST(ISC_PLATFORM_NORETURN_POST)
355
356 #
357 # check if we have lifconf
358 #
359 AC_MSG_CHECKING(for struct lifconf)
360 AC_TRY_COMPILE([
361 #include <sys/types.h>
362 #include <sys/socket.h>
363 #include <net/if.h>
364 ],
365 [
366 struct lifconf lifconf;
367 lifconf.lifc_len = 0;
368 ]
369 ,
370         [AC_MSG_RESULT(yes)
371                 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
372         [AC_MSG_RESULT(no)
373                 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
374 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
375
376 #
377 # check if we have kqueue
378 #
379 AC_ARG_ENABLE(kqueue,
380         [  --enable-kqueue         use BSD kqueue when available [[default=yes]]],
381               want_kqueue="$enableval",  want_kqueue="yes")
382 case $want_kqueue in
383 yes)
384         AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
385         case $ac_cv_have_kqueue in
386         yes)
387                 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
388                 ;;
389         *)
390                 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
391                 ;;
392         esac
393         ;;
394 *)
395         ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
396         ;;
397 esac
398 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
399
400 #
401 # check if we have epoll.  Linux kernel 2.4 has epoll_create() which fails,
402 # so we need to try running the code, not just test its existence.
403 #
404 AC_ARG_ENABLE(epoll,
405 [  --enable-epoll          use Linux epoll when available [[default=auto]]],
406               want_epoll="$enableval",  want_epoll="auto")
407 case $want_epoll in
408 auto)
409         AC_MSG_CHECKING(epoll support)
410         AC_TRY_RUN([
411 #include <sys/epoll.h>
412 int main() {
413         if (epoll_create(1) < 0)
414                 return (1);
415         return (0);
416 }
417 ],
418         [AC_MSG_RESULT(yes)
419         ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
420         [AC_MSG_RESULT(no)
421         ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
422         ;;
423 yes)
424         ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
425         ;;
426 *)
427         ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
428         ;;
429 esac
430 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
431
432 #
433 # check if we support /dev/poll
434 #
435 AC_ARG_ENABLE(devpoll,
436         [  --enable-devpoll        use /dev/poll when available [[default=yes]]],
437               want_devpoll="$enableval",  want_devpoll="yes")
438 case $want_devpoll in
439 yes)
440         AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
441         ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
442         ,
443         ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
444         )
445         ;;
446 *)
447         ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
448         ;;
449 esac
450 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
451
452 #
453 # check if we need to #include sys/select.h explicitly
454 #
455 case $ac_cv_header_unistd_h in
456 yes)
457 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
458 AC_TRY_COMPILE([
459 #include <sys/types.h> /* Ultrix */
460 #include <unistd.h>],
461 [fd_set read_set; return (0);],
462         [AC_MSG_RESULT(yes)
463          ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
464          LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
465         [AC_MSG_RESULT(no)
466         case $ac_cv_header_sys_select_h in
467         yes)
468          ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
469          LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
470                 ;;
471         no)
472                 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
473                 ;;
474         esac
475         ])
476         ;;
477 no)
478         case $ac_cv_header_sys_select_h in
479         yes)
480              ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
481              LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
482                 ;;
483         no)
484                 AC_MSG_ERROR([need either unistd.h or sys/select.h])
485                 ;;
486         esac
487         ;;
488 esac
489 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
490 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
491
492 #
493 # Find the machine's endian flavor.
494 #
495 AC_C_BIGENDIAN
496
497
498 #
499 # was --with-openssl specified?
500 #
501 OPENSSL_WARNING=
502 AC_MSG_CHECKING(for OpenSSL library)
503 AC_ARG_WITH(openssl,
504 [  --with-openssl[=PATH]     Build with OpenSSL [yes|no|path].
505                           (Required for DNSSEC)],
506     use_openssl="$withval", use_openssl="auto")
507
508 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
509 if test "$use_openssl" = "auto"
510 then
511         for d in $openssldirs
512         do
513                 if test -f $d/include/openssl/opensslv.h
514                 then
515                         use_openssl=$d
516                         break
517                 fi
518         done
519 fi
520 OPENSSL_GOST=""
521 case "$use_openssl" in
522         no)
523                 AC_MSG_RESULT(no)
524                 DST_OPENSSL_INC=""
525                 USE_OPENSSL=""
526                 OPENSSLLINKOBJS=""
527                 OPENSSLLINKSRCS=""
528                 ;;
529         auto)
530                 DST_OPENSSL_INC=""
531                 USE_OPENSSL=""
532                 OPENSSLLINKOBJS=""
533                 OPENSSLLINKSRCS=""
534                 AC_MSG_ERROR(
535 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
536 If you don't want OpenSSL, use --without-openssl])
537                 ;;
538         *)
539                 if test "$use_openssl" = "yes"
540                 then
541                         # User did not specify a path - guess it
542                         for d in $openssldirs
543                         do
544                                 if test -f $d/include/openssl/opensslv.h
545                                 then
546                                         use_openssl=$d
547                                         break
548                                 fi
549                         done
550                         if test "$use_openssl" = "yes"
551                         then
552                                 AC_MSG_RESULT(not found)
553                                 AC_MSG_ERROR(
554 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
555                         fi
556                 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
557                 then
558                         AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
559                 fi
560                 USE_OPENSSL='-DOPENSSL'
561                 if test "$use_openssl" = "/usr"
562                 then
563                         DST_OPENSSL_INC=""
564                         DNS_OPENSSL_LIBS="-lcrypto"
565                 else
566                         DST_OPENSSL_INC="-I$use_openssl/include"
567                         case $host in
568                         *-solaris*)
569                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
570                                 ;;
571                         *-hp-hpux*)
572                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
573                                 ;;
574                         *-apple-darwin*)
575                                 #
576                                 # Apple's ld seaches for serially for dynamic
577                                 # then static libraries.  This means you can't
578                                 # use -L to override dynamic system libraries
579                                 # with static ones when linking.  Instead
580                                 # we specify a absolute path.
581                                 #
582                                 if test -f "$use_openssl/lib/libcrypto.dylib"
583                                 then
584                                         DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
585                                 else
586                                         DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
587                                 fi
588                                 ;;
589                         *)
590                                 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
591                                 ;;
592                         esac
593                 fi
594                 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
595
596                 saved_cflags="$CFLAGS"
597                 saved_libs="$LIBS"
598                 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
599                 LIBS="$LIBS $DNS_OPENSSL_LIBS"
600                 AC_MSG_CHECKING(whether linking with OpenSSL works)
601                 AC_TRY_RUN([
602 #include <openssl/err.h>
603 int main() {
604         ERR_clear_error();
605         return (0);
606 }
607 ],
608                 [AC_MSG_RESULT(yes)],
609                 [AC_MSG_RESULT(no)
610                  AC_MSG_ERROR(Could not run test program using OpenSSL from
611 $use_openssl/lib and $use_openssl/include.
612 Please check the argument to --with-openssl and your
613 shared library configuration (e.g., LD_LIBRARY_PATH).)],
614                 [AC_MSG_RESULT(assuming it does work on target platform)])
615
616                 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
617                 AC_TRY_LINK([
618 #include <openssl/err.h>],
619 [ DSO_METHOD_dlfcn(); ],
620                 [AC_MSG_RESULT(no)],
621                 [LIBS="$LIBS -ldl"
622                 AC_TRY_LINK([
623 #include <openssl/err.h>
624 ],[ DSO_METHOD_dlfcn(); ],
625                 [AC_MSG_RESULT(yes)
626                 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
627                 ],
628                  [AC_MSG_RESULT(unknown)
629                  AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
630                 [AC_MSG_RESULT(assuming it does work on target platform)])
631                 ],
632                 [AC_MSG_RESULT(assuming it does work on target platform)]
633                 )
634                  
635 AC_ARG_ENABLE(openssl-version-check,
636 [AC_HELP_STRING([--enable-openssl-version-check],
637         [Check OpenSSL Version @<:@default=yes@:>@])])
638 case "$enable_openssl_version_check" in
639 yes|'')
640                 AC_MSG_CHECKING(OpenSSL library version)
641                 AC_TRY_RUN([
642 #include <stdio.h>
643 #include <openssl/opensslv.h>
644 int main() {
645         if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
646              OPENSSL_VERSION_NUMBER < 0x00908000L) ||
647              OPENSSL_VERSION_NUMBER >= 0x0090804fL)
648                 return (0);
649         printf("\n\nFound   OPENSSL_VERSION_NUMBER %#010x\n",
650                 OPENSSL_VERSION_NUMBER);
651         printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
652                "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
653         return (1);
654 }
655                 ],
656                 [AC_MSG_RESULT(ok)],
657                 [AC_MSG_RESULT(not compatible)
658                  OPENSSL_WARNING=yes
659                 ],
660                 [AC_MSG_RESULT(assuming target platform has compatible version)])
661 ;;
662 no)
663         AC_MSG_RESULT(Skipped OpenSSL version check)
664 ;;
665 esac
666
667                 AC_MSG_CHECKING(for OpenSSL DSA support)
668                 if test -f $use_openssl/include/openssl/dsa.h
669                 then
670                         AC_DEFINE(HAVE_OPENSSL_DSA)
671                         AC_MSG_RESULT(yes)
672                 else
673                         AC_MSG_RESULT(no)
674                 fi
675                 AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
676
677                 AC_MSG_CHECKING(for OpenSSL GOST support)
678                 have_gost=""
679                 AC_TRY_RUN([
680 #include <openssl/conf.h>
681 #include <openssl/engine.h>
682 int main() {
683 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
684         ENGINE *e;
685
686         OPENSSL_config(NULL);
687
688         e = ENGINE_by_id("gost");
689         if (e == NULL)
690                 return (1);
691         if (ENGINE_init(e) <= 0)
692                 return (1);
693         return (0);
694 #else
695         return (1);
696 #endif
697 }
698 ],
699                 [AC_MSG_RESULT(yes)
700                 have_gost="yes"],
701                 [AC_MSG_RESULT(no)
702                 have_gost="no"])
703                 case $have_gost in
704                 yes)
705                         OPENSSL_GOST="yes"
706                         AC_DEFINE(HAVE_OPENSSL_GOST, 1,
707                                   [Define if your OpenSSL version supports GOST.])
708                         ;;
709                 *)
710                         ;;
711                 esac
712                 CFLAGS="$saved_cflags"
713                 LIBS="$saved_libs"
714                 OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
715                 OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
716
717                 ;;
718 esac
719
720 #
721 # This would include the system openssl path (and linker options to use
722 # it as needed) if it is found.
723 #
724
725 AC_SUBST(USE_OPENSSL)
726 AC_SUBST(DST_OPENSSL_INC)
727 AC_SUBST(OPENSSLLINKOBJS)
728 AC_SUBST(OPENSSLLINKSRCS)
729 AC_SUBST(OPENSSL_GOST)
730 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
731
732 #
733 # Use OpenSSL for hash functions
734 #
735
736 AC_ARG_ENABLE(openssl-hash,
737         [  --enable-openssl-hash   use OpenSSL for hash functions [[default=no]]],
738         want_openssl_hash="$enableval", want_openssl_hash="no")
739 case $want_openssl_hash in
740         yes)
741                 if test "$USE_OPENSSL" = ""
742                 then
743                         AC_MSG_ERROR([No OpenSSL for hash functions])
744                 fi
745                 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
746                 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
747                 ;;
748         no)
749                 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
750                 ISC_OPENSSL_INC=""
751                 ;;
752 esac
753 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
754 AC_SUBST(ISC_OPENSSL_INC)
755
756 #
757 # PKCS11 (aka crypto hardware) support
758 #
759 # This works only with the right OpenSSL with PKCS11 engine!
760 #
761
762 AC_MSG_CHECKING(for PKCS11 support)
763 AC_ARG_WITH(pkcs11,
764 [  --with-pkcs11[=PATH]      Build with PKCS11 support [yes|no|path]
765                           (PATH is for the PKCS11 provider)],
766    use_pkcs11="$withval", use_pkcs11="no")
767
768 case "$use_pkcs11" in
769         no|'')
770                 AC_MSG_RESULT(disabled)
771                 USE_PKCS11=''
772                 PKCS11_TOOLS=''
773                 ;;
774         yes|*)
775                 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
776                 USE_PKCS11='-DUSE_PKCS11'
777                 PKCS11_TOOLS=pkcs11
778                 ;;
779 esac
780 AC_SUBST(USE_PKCS11)
781 AC_SUBST(PKCS11_TOOLS)
782
783 AC_MSG_CHECKING(for PKCS11 tools)
784 case "$use_pkcs11" in
785         no|yes|'')
786                 AC_MSG_RESULT(disabled)
787                 PKCS11_PROVIDER="undefined"
788                 ;;
789        *)
790                 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
791                 PKCS11_PROVIDER="$use_pkcs11"
792                 ;;
793 esac
794 AC_SUBST(PKCS11_PROVIDER)
795
796 AC_MSG_CHECKING(for GSSAPI library)
797 AC_ARG_WITH(gssapi,
798 [  --with-gssapi=PATH      Specify path for system-supplied GSSAPI],
799     use_gssapi="$withval", use_gssapi="no")
800
801 gssapidirs="/usr/local /usr/pkg /usr/kerberos /usr"
802 if test "$use_gssapi" = "yes"
803 then
804         for d in $gssapidirs
805         do
806                 if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h
807                 then
808                         use_gssapi=$d
809                         break
810                 fi
811         done
812 fi
813
814 case "$use_gssapi" in
815         no)
816                 AC_MSG_RESULT(disabled)
817                 USE_GSSAPI=''
818                 ;;
819         yes)
820                 AC_MSG_ERROR([--with-gssapi must specify a path])
821                 ;;
822         *)
823                 AC_MSG_RESULT(looking in $use_gssapi/lib)
824                 USE_GSSAPI='-DGSSAPI'
825                 saved_cppflags="$CPPFLAGS"
826                 CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
827                 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
828                     [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
829
830                 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
831                     AC_MSG_ERROR([gssapi.h not found])
832                 fi
833
834                 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
835                     [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"])
836
837                 AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
838                     [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
839
840                 if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
841                     AC_MSG_ERROR([krb5.h not found])
842                 fi
843
844                 CPPFLAGS="$saved_cppflags"
845
846                 #
847                 # XXXDCL This probably doesn't work right on all systems.
848                 # It will need to be worked on as problems become evident.
849                 #
850                 # Essentially the problems here relate to two different
851                 # areas.  The first area is building with either KTH
852                 # or MIT Kerberos, particularly when both are present on
853                 # the machine.  The other is static versus dynamic linking.
854                 #
855                 # On the KTH vs MIT issue, Both have libkrb5 that can mess
856                 # up the works if one implementation ends up trying to
857                 # use the other's krb.  This is unfortunately a situation
858                 # that very easily arises.
859                 #
860                 # Dynamic linking when the dependency information is built
861                 # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
862                 # all such problems go away, but when that setup is not
863                 # present, because either the dynamic libraries lack
864                 # dependencies or static linking is being done, then the
865                 # problems start to show up.
866                 saved_libs="$LIBS"
867                 for TRY_LIBS in \
868                     "-lgssapi_krb5" \
869                     "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
870                     "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
871                     "-lgssapi" \
872                     "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
873                     "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
874                     "-lgss -lkrb5"
875                 do
876                     # Note that this does not include $saved_libs, because
877                     # on FreeBSD machines this configure script has added
878                     # -L/usr/local/lib to LIBS, which can make the
879                     # -lgssapi_krb5 test succeed with shared libraries even
880                     # when you are trying to build with KTH in /usr/lib.
881                     if test "$use_gssapi" = "/usr"
882                     then
883                             LIBS="$TRY_LIBS"
884                     else
885                             LIBS="-L$use_gssapi/lib $TRY_LIBS"
886                     fi
887                     AC_MSG_CHECKING(linking as $TRY_LIBS)
888                     AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
889                                 gssapi_linked=yes, gssapi_linked=no)
890                     case $gssapi_linked in
891                     yes) AC_MSG_RESULT(yes); break ;;
892                     no)  AC_MSG_RESULT(no) ;;
893                     esac
894                 done
895
896                 case $gssapi_linked in
897                 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
898                 esac
899
900                 #
901                 # XXXDCL Major kludge.  Tries to cope with KTH in /usr/lib
902                 # but MIT in /usr/local/lib and trying to build with KTH.
903                 # /usr/local/lib can end up earlier on the link lines.
904                 # Like most kludges, this one is not only inelegant it
905                 # is also likely to be the wrong thing to do at least as
906                 # many times as it is the right thing.  Something better
907                 # needs to be done.
908                 #
909                 if test "$use_gssapi" = "/usr" -a \
910                         -f /usr/local/lib/libkrb5.a; then
911                     FIX_KTH_VS_MIT=yes
912                 fi
913
914                 case "$FIX_KTH_VS_MIT" in
915                 yes)
916                     case "$enable_static_linking" in
917                     yes) gssapi_lib_suffix=".a"  ;;
918                     *)   gssapi_lib_suffix=".so" ;;
919                     esac
920
921                     for lib in $LIBS; do
922                         case $lib in
923                         -L*)
924                             ;;
925                         -l*)
926                             new_lib=`echo $lib |
927                                      sed -e s%^-l%$use_gssapi/lib/lib% \
928                                          -e s%$%$gssapi_lib_suffix%`
929                             NEW_LIBS="$NEW_LIBS $new_lib"
930                             ;;
931                         *)
932                            AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
933                             ;;
934                         esac
935                     done
936                     LIBS="$NEW_LIBS"
937                     ;;
938                 esac
939
940                 DST_GSSAPI_INC="-I$use_gssapi/include"
941                 DNS_GSSAPI_LIBS="$LIBS"
942
943                 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
944                 LIBS="$saved_libs"
945                 ;;
946 esac
947
948 AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
949 AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
950 AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
951 AC_SUBST(ISC_PLATFORM_KRB5HEADER)
952
953 AC_SUBST(USE_GSSAPI)
954 AC_SUBST(DST_GSSAPI_INC)
955 AC_SUBST(DNS_GSSAPI_LIBS)
956 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
957
958 #
959 # Applications linking with libdns also need to link with these libraries.
960 #
961
962 AC_SUBST(DNS_CRYPTO_LIBS)
963
964 #
965 # was --with-randomdev specified?
966 #
967 AC_MSG_CHECKING(for random device)
968 AC_ARG_WITH(randomdev,
969 [  --with-randomdev=PATH   Specify path for random device],
970     use_randomdev="$withval", use_randomdev="unspec")
971
972 case "$use_randomdev" in
973         unspec)
974                 case "$host" in
975                         *-openbsd*)
976                                 devrandom=/dev/arandom
977                                 ;;
978                         *)
979                                 devrandom=/dev/random
980                                 ;;
981                 esac
982                 AC_MSG_RESULT($devrandom)
983                 AC_CHECK_FILE($devrandom,
984                               AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
985                                                  "$devrandom"),)
986                 ;;
987         yes)
988                 AC_MSG_ERROR([--with-randomdev must specify a path])
989                 ;;
990         no)
991                 AC_MSG_RESULT(disabled)
992                 ;;
993         *)
994                 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
995                 AC_MSG_RESULT(using "$use_randomdev")
996                 ;;
997 esac
998
999 #
1000 # Do we have arc4random() ?
1001 #
1002 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1003
1004 sinclude(config.threads.in)dnl
1005
1006 if $use_threads
1007 then
1008         if test "X$GCC" = "Xyes"; then
1009                 case "$host" in
1010                 *-freebsd*)
1011                         CC="$CC -pthread"
1012                         CCOPT="$CCOPT -pthread"
1013                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1014                         ;;
1015                 *-openbsd*)
1016                         CC="$CC -pthread"
1017                         CCOPT="$CCOPT -pthread"
1018                         ;;
1019                 *-solaris*)
1020                         LIBS="$LIBS -lthread"
1021                         ;;
1022                 *-ibm-aix*)
1023                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1024                         ;;
1025                 esac
1026         else
1027                 case $host in
1028                 *-dec-osf*)
1029                         CC="$CC -pthread"
1030                         CCOPT="$CCOPT -pthread"
1031                         ;;
1032                 *-solaris*)
1033                         CC="$CC -mt"
1034                         CCOPT="$CCOPT -mt"
1035                         ;;
1036                 *-ibm-aix*)
1037                         STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1038                         ;;
1039                 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
1040                         CC="$CC -Kthread"
1041                         CCOPT="$CCOPT -Kthread"
1042                         ;;
1043                 *-*-sysv*OpenUNIX*)
1044                         CC="$CC -Kpthread"
1045                         CCOPT="$CCOPT -Kpthread"
1046                         ;;
1047                 esac
1048         fi
1049         ALWAYS_DEFINES="-D_REENTRANT"
1050         ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
1051         THREADOPTOBJS='${THREADOPTOBJS}'
1052         THREADOPTSRCS='${THREADOPTSRCS}'
1053         thread_dir=pthreads
1054         #
1055         # We'd like to use sigwait() too
1056         #
1057         AC_CHECK_FUNC(sigwait,
1058                       AC_DEFINE(HAVE_SIGWAIT),
1059                       AC_CHECK_LIB(c, sigwait,
1060                       AC_DEFINE(HAVE_SIGWAIT),
1061                       AC_CHECK_LIB(pthread, sigwait,
1062                                    AC_DEFINE(HAVE_SIGWAIT),
1063                                    AC_CHECK_LIB(pthread, _Psigwait,
1064                                                 AC_DEFINE(HAVE_SIGWAIT),))))
1065
1066         AC_CHECK_FUNC(pthread_attr_getstacksize,
1067                       AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1068
1069         AC_CHECK_FUNC(pthread_attr_setstacksize,
1070                       AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1071
1072         #
1073         # Additional OS-specific issues related to pthreads and sigwait.
1074         #
1075         case "$host" in
1076                 #
1077                 # One more place to look for sigwait.
1078                 #
1079                 *-freebsd*)
1080                         AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1081                         case $host in
1082                         *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1083                         *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1084                                 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1085                                 ;;
1086                         *-freebsd6.*)
1087                                 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1088                                 ;;
1089                         esac
1090                         ;;
1091                 #
1092                 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1093                 # called before certain pthreads calls.  This is deprecated
1094                 # in BSD/OS 4.1.
1095                 #
1096                 *-bsdi3.*|*-bsdi4.0*)
1097                         AC_DEFINE(NEED_PTHREAD_INIT)
1098                         ;;
1099                 #
1100                 # LinuxThreads requires some changes to the way we
1101                 # deal with signals.
1102                 #
1103                 *-linux*)
1104                         AC_DEFINE(HAVE_LINUXTHREADS)
1105                         ;;
1106                 #
1107                 # Ensure the right sigwait() semantics on Solaris and make
1108                 # sure we call pthread_setconcurrency.
1109                 #
1110                 *-solaris*)
1111                         AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1112                         AC_CHECK_FUNC(pthread_setconcurrency,
1113                                       AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1114                         ;;
1115                 #
1116                 # UnixWare does things its own way.
1117                 #
1118                 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1119                         AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1120                         ;;
1121         esac
1122
1123         #
1124         # Look for sysconf to allow detection of the number of processors.
1125         #
1126         AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1127
1128 else
1129         ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1130         thread_dir=nothreads
1131         THREADOPTOBJS=""
1132         THREADOPTSRCS=""
1133         ALWAYS_DEFINES=""
1134 fi
1135
1136 AC_SUBST(ALWAYS_DEFINES)
1137 AC_SUBST(ISC_PLATFORM_USETHREADS)
1138 AC_SUBST(THREADOPTOBJS)
1139 AC_SUBST(THREADOPTSRCS)
1140 ISC_THREAD_DIR=$thread_dir
1141 AC_SUBST(ISC_THREAD_DIR)
1142
1143 #
1144 # was --with-libxml2 specified?
1145 #
1146 AC_MSG_CHECKING(for libxml2 library)
1147 AC_ARG_WITH(libxml2,
1148 [  --with-libxml2[=PATH]     Build with libxml2 library [yes|no|path]],
1149     use_libxml2="$withval", use_libxml2="auto")
1150
1151 case "$use_libxml2" in
1152         no)
1153                 DST_LIBXML2_INC=""
1154                 ;;
1155         auto|yes)
1156                 case X`(xml2-config --version) 2>/dev/null` in
1157                 X2.[[67]].*)
1158                         libxml2_libs=`xml2-config --libs`
1159                         libxml2_cflags=`xml2-config --cflags`
1160                         ;;
1161                 *)
1162                         libxml2_libs=
1163                         libxml2_cflags=
1164                         ;;
1165                 esac
1166                 ;;
1167         *)
1168                 if test -f "$use_libxml2/bin/xml2-config" ; then
1169                         libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
1170                         libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
1171                 fi
1172                 ;;
1173 esac
1174
1175 if test "X$libxml2_libs" != "X"
1176 then
1177         AC_MSG_RESULT(yes)
1178         CFLAGS="$CFLAGS $libxml2_cflags"
1179         LIBS="$LIBS $libxml2_libs"
1180         AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1181 else
1182         AC_MSG_RESULT(no)
1183 fi
1184
1185 #
1186 # In solaris 10, SMF can manage named service
1187 #
1188 AC_CHECK_LIB(scf, smf_enable_instance)
1189
1190 #
1191 # flockfile is usually provided by pthreads, but we may want to use it
1192 # even if compiled with --disable-threads.  getc_unlocked might also not
1193 # be defined.
1194 #
1195 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1196 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1197
1198
1199 # Indicate what the final decision was regarding threads.
1200 #
1201 AC_MSG_CHECKING(whether to build with threads)
1202 if $use_threads; then
1203         AC_MSG_RESULT(yes)
1204 else
1205         AC_MSG_RESULT(no)
1206 fi
1207
1208
1209 # End of pthreads stuff.
1210 #
1211
1212 #
1213 # Large File
1214 #
1215 AC_ARG_ENABLE(largefile, [  --enable-largefile    64-bit file support],
1216               want_largefile="yes", want_largefile="no")
1217 case $want_largefile in
1218         yes)
1219                 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1220                 ;;
1221         *)
1222                 ;;
1223 esac
1224
1225 #
1226 # Additional compiler settings.
1227 #
1228 MKDEPCC="$CC"
1229 MKDEPCFLAGS="-M"
1230 IRIX_DNSSEC_WARNINGS_HACK=""
1231
1232 if test "X$GCC" = "Xyes"; then
1233         AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1234         SAVE_CFLAGS=$CFLAGS
1235         CFLAGS="$CFLAGS -fno-strict-aliasing"
1236         AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1237         CFLAGS=$SAVE_CFLAGS
1238         if test "$FNOSTRICTALIASING" = "yes"; then
1239                 AC_MSG_RESULT(yes)
1240         STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
1241         else
1242                 AC_MSG_RESULT(no)
1243         STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1244         fi
1245         case "$host" in
1246         *-hp-hpux*)
1247                 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1248                 ;;
1249         esac
1250 else
1251         case $host in
1252         *-dec-osf*)
1253                 CC="$CC -std"
1254                 CCOPT="$CCOPT -std"
1255                 MKDEPCC="$CC"
1256                 ;;
1257         *-hp-hpux*)
1258                 CC="$CC -Ae -z"
1259                 # The version of the C compiler that constantly warns about
1260                 # 'const' as well as alignment issues is unfortunately not
1261                 # able to be discerned via the version of the operating
1262                 # system, nor does cc have a version flag.
1263                 case "`$CC +W 123 2>&1`" in
1264                 *Unknown?option*)
1265                         STD_CWARNINGS="+w1"
1266                         ;;
1267                 *)
1268                         # Turn off the pointlessly noisy warnings.
1269                         STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1270                         ;;
1271                 esac
1272                 CCOPT="$CCOPT -Ae -z"
1273                 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1274                 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1275                 ;;
1276         *-sgi-irix*)
1277                 STD_CWARNINGS="-fullwarn -woff 1209"
1278                 #
1279                 # Silence more than 250 instances of
1280                 #   "prototyped function redeclared without prototype"
1281                 # and 11 instances of
1282                 #   "variable ... was set but never used"
1283                 # from lib/dns/sec/openssl.
1284                 #
1285                 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1286                 ;;
1287         *-solaris*)
1288                 MKDEPCFLAGS="-xM"
1289                 ;;
1290         *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1291                 # UnixWare
1292                 CC="$CC -w"
1293                 ;;
1294         esac
1295 fi
1296
1297 AC_SUBST(MKDEPCC)
1298 AC_SUBST(MKDEPCFLAGS)
1299 AC_SUBST(MKDEPPROG)
1300 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1301
1302 #
1303 # NLS
1304 #
1305 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1306
1307 #
1308 # -lxnet buys us one big porting headache...  standards, gotta love 'em.
1309 #
1310 # AC_CHECK_LIB(xnet, socket, ,
1311 #    AC_CHECK_LIB(socket, socket)
1312 # )
1313 #
1314 # Use this for now, instead:
1315 #
1316 case "$host" in
1317         mips-sgi-irix*)
1318                 ;;
1319         *-linux*)
1320                 ;;
1321         *)
1322                 AC_CHECK_LIB(socket, socket)
1323                 AC_CHECK_LIB(nsl, inet_addr)
1324                 ;;
1325 esac
1326
1327 #
1328 # Work around Solaris's select() limitations.
1329 #
1330 case "$host" in
1331         *-solaris2.[[89]]|*-solaris2.1?)
1332         AC_DEFINE(FD_SETSIZE, 65536,
1333                   [Solaris hack to get select_large_fdset.])
1334         ;;
1335 esac
1336
1337 #
1338 # Purify support
1339 #
1340 AC_MSG_CHECKING(whether to use purify)
1341 AC_ARG_WITH(purify,
1342         [  --with-purify[=PATH]      use Rational purify],
1343         use_purify="$withval", use_purify="no")
1344
1345 case "$use_purify" in
1346         no)
1347                 ;;
1348         yes)
1349                 AC_PATH_PROG(purify_path, purify, purify)
1350                 ;;
1351         *)
1352                 purify_path="$use_purify"
1353                 ;;
1354 esac
1355
1356 case "$use_purify" in
1357         no)
1358                 AC_MSG_RESULT(no)
1359                 PURIFY=""
1360                 ;;
1361         *)
1362                 if test -f $purify_path || test $purify_path = purify; then
1363                         AC_MSG_RESULT($purify_path)
1364                         PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1365                         PURIFY="$purify_path $PURIFYFLAGS"
1366                 else
1367                         AC_MSG_ERROR([$purify_path not found.
1368
1369 Please choose the proper path with the following command:
1370
1371     configure --with-purify=PATH
1372 ])
1373                 fi
1374                 ;;
1375 esac
1376
1377 AC_SUBST(PURIFY)
1378
1379
1380 AC_ARG_WITH(libtool,
1381             [  --with-libtool          use GNU libtool],
1382             use_libtool="$withval", use_libtool="no")
1383
1384 case $use_libtool in
1385         yes)
1386                 AM_PROG_LIBTOOL
1387                 O=lo
1388                 A=la
1389                 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1390                 LIBTOOL_MODE_COMPILE='--mode=compile'
1391                 LIBTOOL_MODE_INSTALL='--mode=install'
1392                 LIBTOOL_MODE_LINK='--mode=link'
1393                 case "$host" in
1394                 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1395                 esac
1396                 case "$host" in
1397                 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1398                 *) LIBTOOL_IN_MAIN= ;;
1399                 esac;
1400                 ;;
1401         *)
1402                 O=o
1403                 A=a
1404                 LIBTOOL=
1405                 AC_SUBST(LIBTOOL)
1406                 LIBTOOL_MKDEP_SED=
1407                 LIBTOOL_MODE_COMPILE=
1408                 LIBTOOL_MODE_INSTALL=
1409                 LIBTOOL_MODE_LINK=
1410                 LIBTOOL_ALLOW_UNDEFINED=
1411                 LIBTOOL_IN_MAIN=
1412                 ;;
1413 esac
1414
1415 #
1416 # enable/disable dumping stack backtrace.  Also check if the system supports
1417 # glibc-compatible backtrace() function.
1418 #
1419 AC_ARG_ENABLE(backtrace,
1420 [  --enable-backtrace      log stack backtrace on abort [[default=yes]]],
1421               want_backtrace="$enableval",  want_backtrace="yes")
1422 case $want_backtrace in
1423 yes)
1424         ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
1425         AC_TRY_LINK([#include <execinfo.h>],
1426         [return (backtrace((void **)0, 0));],
1427         [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
1428         ;;
1429 *)
1430         ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1431         ;;
1432 esac
1433 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
1434
1435 AC_ARG_ENABLE(symtable,
1436 [  --enable-symtable       use internal symbol table for backtrace
1437                           [[all|minimal(default)|none]]],
1438                 want_symtable="$enableval",  want_symtable="minimal")
1439 case $want_symtable in
1440 yes|all|minimal)     # "yes" is a hidden value equivalent to "minimal"
1441         if test "$PERL" = ""
1442         then
1443                 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
1444 Install perl or explicitly disable the feature by --disable-symtable.])
1445         fi
1446         if test "$use_libtool" = "yes"; then
1447                 AC_MSG_WARN([Internal symbol table does not work with libtool.  Disabling symbol table.])
1448         else
1449                 # we generate the internal symbol table only for those systems
1450                 # known to work to avoid unexpected build failure.  Also, warn
1451                 # about unsupported systems when the feature is enabled
1452                 #  manually.
1453                 case $host_os in
1454                 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1455                         MKSYMTBL_PROGRAM="$PERL"
1456                         if test $want_symtable = all; then
1457                                 ALWAYS_MAKE_SYMTABLE="yes"
1458                         fi
1459                         ;;
1460                 *)
1461                         if test $want_symtable = yes -o $want_symtable = all
1462                         then
1463                                 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1464                         fi
1465                 esac
1466         fi
1467         ;;
1468 *)
1469         ;;
1470 esac
1471 AC_SUBST(MKSYMTBL_PROGRAM)
1472 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1473
1474 #
1475 # File name extension for static archive files, for those few places
1476 # where they are treated differently from dynamic ones.
1477 #
1478 SA=a
1479
1480 AC_SUBST(O)
1481 AC_SUBST(A)
1482 AC_SUBST(SA)
1483 AC_SUBST(LIBTOOL_MKDEP_SED)
1484 AC_SUBST(LIBTOOL_MODE_COMPILE)
1485 AC_SUBST(LIBTOOL_MODE_INSTALL)
1486 AC_SUBST(LIBTOOL_MODE_LINK)
1487 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1488 AC_SUBST(LIBTOOL_IN_MAIN)
1489
1490 #
1491 # build exportable DNS library?
1492 #
1493 AC_ARG_ENABLE(exportlib,
1494         [  --enable-exportlib   build exportable library (GNU make required)
1495                         [[default=no]]])
1496 case "$enable_exportlib" in
1497         yes)
1498                 gmake=
1499                 for x in gmake gnumake make; do
1500                         if $x --version 2>/dev/null | grep GNU > /dev/null; then
1501                                 gmake=$x
1502                                 break;
1503                         fi
1504                 done
1505                 if test -z "$gmake"; then
1506                         AC_MSG_ERROR([exportlib requires GNU make.  Install it or disable the feature.])
1507                 fi
1508                 LIBEXPORT=lib/export
1509                 AC_SUBST(LIBEXPORT)
1510                 BIND9_CO_RULE="%.$O:  \${srcdir}/%.c"
1511                 ;;
1512         no|*)
1513                 BIND9_CO_RULE=".c.$O:"
1514                 ;;
1515 esac
1516 AC_SUBST(BIND9_CO_RULE)
1517
1518 AC_ARG_WITH(export-libdir,
1519         [  --with-export-libdir[=PATH]
1520                         installation directory for the export library
1521                         [[EPREFIX/lib/bind9]]],
1522         export_libdir="$withval",)
1523 if test -z "$export_libdir"; then
1524         export_libdir="\${exec_prefix}/lib/bind9/"
1525 fi
1526 AC_SUBST(export_libdir)
1527
1528 AC_ARG_WITH(export-includedir,
1529         [  --with-export-includedir[=PATH]
1530                         installation directory for the header files of the
1531                         export library [[PREFIX/include/bind9]]],
1532         export_includedir="$withval",)
1533 if test -z "$export_includedir"; then
1534         export_includedir="\${prefix}/include/bind9/"
1535 fi
1536 AC_SUBST(export_includedir)
1537
1538 #
1539 # Here begins a very long section to determine the system's networking
1540 # capabilities.  The order of the tests is significant.
1541 #
1542
1543 #
1544 # IPv6
1545 #
1546 AC_ARG_ENABLE(ipv6,
1547         [  --enable-ipv6           use IPv6 [default=autodetect]])
1548
1549 case "$enable_ipv6" in
1550         yes|''|autodetect)
1551                 AC_DEFINE(WANT_IPV6)
1552                 ;;
1553         no)
1554                 ;;
1555 esac
1556
1557 #
1558 # We do the IPv6 compilation checking after libtool so that we can put
1559 # the right suffix on the files.
1560 #
1561 AC_MSG_CHECKING(for IPv6 structures)
1562 AC_TRY_COMPILE([
1563 #include <sys/types.h>
1564 #include <sys/socket.h>
1565 #include <netinet/in.h>],
1566 [struct sockaddr_in6 sin6; return (0);],
1567         [AC_MSG_RESULT(yes)
1568          found_ipv6=yes],
1569         [AC_MSG_RESULT(no)
1570          found_ipv6=no])
1571
1572 #
1573 # See whether IPv6 support is provided via a Kame add-on.
1574 # This is done before other IPv6 linking tests to LIBS is properly set.
1575 #
1576 AC_MSG_CHECKING(for Kame IPv6 support)
1577 AC_ARG_WITH(kame,
1578         [  --with-kame[=PATH]     use Kame IPv6 [default path /usr/local/v6]],
1579         use_kame="$withval", use_kame="no")
1580
1581 case "$use_kame" in
1582         no)
1583                 ;;
1584         yes)
1585                 kame_path=/usr/local/v6
1586                 ;;
1587         *)
1588                 kame_path="$use_kame"
1589                 ;;
1590 esac
1591
1592 case "$use_kame" in
1593         no)
1594                 AC_MSG_RESULT(no)
1595                 ;;
1596         *)
1597                 if test -f $kame_path/lib/libinet6.a; then
1598                         AC_MSG_RESULT($kame_path/lib/libinet6.a)
1599                         LIBS="-L$kame_path/lib -linet6 $LIBS"
1600                 else
1601                         AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1602
1603 Please choose the proper path with the following command:
1604
1605     configure --with-kame=PATH
1606 ])
1607                 fi
1608                 ;;
1609 esac
1610
1611 #
1612 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1613 # Including it on Kame-using platforms is very bad, though, because
1614 # Kame uses #error against direct inclusion.   So include it on only
1615 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1616 # This is done before the in6_pktinfo check because that's what
1617 # netinet6/in6.h is needed for.
1618 #
1619 changequote({, })
1620 case "$host" in
1621 *-bsdi4.[01]*)
1622         ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1623         LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1624         isc_netinet6in6_hack="#include <netinet6/in6.h>"
1625         ;;
1626 *)
1627         ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1628         LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1629         isc_netinet6in6_hack=""
1630         ;;
1631 esac
1632 changequote([, ])
1633
1634 #
1635 # This is similar to the netinet6/in6.h issue.
1636 #
1637 case "$host" in
1638 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1639         # UnixWare
1640         ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1641         LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1642         ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1643         isc_netinetin6_hack="#include <netinet/in6.h>"
1644         ;;
1645 *)
1646         ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1647         LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1648         ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1649         isc_netinetin6_hack=""
1650         ;;
1651 esac
1652
1653 #
1654 # Now delve deeper into the suitability of the IPv6 support.
1655 #
1656 case "$found_ipv6" in
1657         yes)
1658                 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1659                 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1660
1661                 AC_MSG_CHECKING(for in6_addr)
1662                 AC_TRY_COMPILE([
1663 #include <sys/types.h>
1664 #include <sys/socket.h>
1665 #include <netinet/in.h>
1666 $isc_netinetin6_hack
1667 $isc_netinet6in6_hack
1668 ],
1669 [struct in6_addr in6; return (0);],
1670                 [AC_MSG_RESULT(yes)
1671                  ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1672                  LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1673                  isc_in_addr6_hack=""],
1674                 [AC_MSG_RESULT(no)
1675                  ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1676                  LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1677                  isc_in_addr6_hack="#define in6_addr in_addr6"])
1678
1679                 AC_MSG_CHECKING(for in6addr_any)
1680                 AC_TRY_LINK([
1681 #include <sys/types.h>
1682 #include <sys/socket.h>
1683 #include <netinet/in.h>
1684 $isc_netinetin6_hack
1685 $isc_netinet6in6_hack
1686 $isc_in_addr6_hack
1687 ],
1688                 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1689                         [AC_MSG_RESULT(yes)
1690                          ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1691                          LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1692                         [AC_MSG_RESULT(no)
1693                          ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1694                          LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1695
1696                 AC_MSG_CHECKING(for in6addr_loopback)
1697                 AC_TRY_LINK([
1698 #include <sys/types.h>
1699 #include <sys/socket.h>
1700 #include <netinet/in.h>
1701 $isc_netinetin6_hack
1702 $isc_netinet6in6_hack
1703 $isc_in_addr6_hack
1704 ],
1705                 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1706                         [AC_MSG_RESULT(yes)
1707                          ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1708                          LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1709                         [AC_MSG_RESULT(no)
1710                          ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1711                          LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1712
1713                 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1714                 AC_TRY_COMPILE([
1715 #include <sys/types.h>
1716 #include <sys/socket.h>
1717 #include <netinet/in.h>
1718 $isc_netinetin6_hack
1719 $isc_netinet6in6_hack
1720 ],
1721                 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1722                         [AC_MSG_RESULT(yes)
1723                          ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1724                          result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1725                         [AC_MSG_RESULT(no)
1726                          ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1727                          result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1728                 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1729
1730                 AC_MSG_CHECKING(for in6_pktinfo)
1731                 AC_TRY_COMPILE([
1732 #include <sys/types.h>
1733 #include <sys/socket.h>
1734 #include <netinet/in.h>
1735 $isc_netinetin6_hack
1736 $isc_netinet6in6_hack
1737 ],
1738                 [struct in6_pktinfo xyzzy; return (0);],
1739                         [AC_MSG_RESULT(yes)
1740                          ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1741                         [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1742                          ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1743                 ;;
1744         no)
1745                 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1746                 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1747                 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1748                 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1749                 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1750                 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1751                 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1752                 ISC_IPV6_H="ipv6.h"
1753                 ISC_IPV6_O="ipv6.$O"
1754                 ISC_ISCIPV6_O="unix/ipv6.$O"
1755                 ISC_IPV6_C="ipv6.c"
1756                 ;;
1757 esac
1758
1759 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
1760 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1761 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1762 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1763 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1764 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1765 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1766 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1767 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1768 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1769 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1770 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1771 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1772 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1773 AC_SUBST(ISC_IPV6_H)
1774 AC_SUBST(ISC_IPV6_O)
1775 AC_SUBST(ISC_ISCIPV6_O)
1776 AC_SUBST(ISC_IPV6_C)
1777 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1778 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1779
1780 AC_MSG_CHECKING([for struct if_laddrreq])
1781 AC_TRY_LINK([
1782 #include <sys/types.h>
1783 #include <net/if6.h>
1784 ],[ struct if_laddrreq a; ],
1785         [AC_MSG_RESULT(yes)
1786         ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1787         [AC_MSG_RESULT(no)
1788         ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1789 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1790
1791 AC_MSG_CHECKING([for struct if_laddrconf])
1792 AC_TRY_LINK([
1793 #include <sys/types.h>
1794 #include <net/if6.h>
1795 ],[ struct if_laddrconf a; ],
1796         [AC_MSG_RESULT(yes)
1797         ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1798         [AC_MSG_RESULT(no)
1799         ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1800 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1801
1802 #
1803 # Check for network functions that are often missing.  We do this
1804 # after the libtool checking, so we can put the right suffix on
1805 # the files.  It also needs to come after checking for a Kame add-on,
1806 # which provides some (all?) of the desired functions.
1807 #
1808
1809 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1810 AC_TRY_RUN([
1811 #include <sys/types.h>
1812 #include <sys/socket.h>
1813 #include <netinet/in.h>
1814 #include <arpa/inet.h>
1815 main() {
1816 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1817         [AC_MSG_RESULT(yes)
1818         ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1819
1820         [AC_MSG_RESULT(no)
1821         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1822         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1823         ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1824         [AC_MSG_RESULT(assuming inet_ntop needed)
1825         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1826         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1827         ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1828
1829
1830 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1831 # addresses with less than four octets, like "1.2.3".  Also leading
1832 # zeros should also be rejected.
1833
1834 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
1835 AC_TRY_RUN([
1836 #include <sys/types.h>
1837 #include <sys/socket.h>
1838 #include <netinet/in.h>
1839 #include <arpa/inet.h>
1840 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1841                              inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
1842                              (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1843         [AC_MSG_RESULT(yes)
1844         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1845         [AC_MSG_RESULT(no)
1846         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1847         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1848         ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1849         [AC_MSG_RESULT(assuming target platform has working inet_pton)
1850         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1851         [AC_MSG_RESULT(assuming inet_pton needed)
1852         ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1853         ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1854         ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1855         [AC_MSG_RESULT(assuming target platform has working inet_pton)
1856         ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1857
1858 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1859 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1860
1861 #
1862 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1863 #
1864 case "$host" in
1865         *-dec-osf*)
1866                 # Turn on 4.4BSD style sa_len support.
1867                 AC_DEFINE(_SOCKADDR_LEN)
1868                 ;;
1869 esac
1870
1871 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1872 AC_TRY_COMPILE([
1873 #include <sys/types.h>
1874 #include <sys/socket.h>],
1875 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1876         [AC_MSG_RESULT(yes)
1877         ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1878         LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1879         [AC_MSG_RESULT(no)
1880         ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1881         LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1882 AC_SUBST(ISC_PLATFORM_HAVESALEN)
1883 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
1884
1885 #
1886 # Look for a 4.4BSD or 4.3BSD struct msghdr
1887 #
1888 AC_MSG_CHECKING(for struct msghdr flavor)
1889 AC_TRY_COMPILE([
1890 #include <sys/types.h>
1891 #include <sys/socket.h>],
1892 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1893         [AC_MSG_RESULT(4.4BSD)
1894         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1895         [AC_MSG_RESULT(4.3BSD)
1896         ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1897 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1898
1899 #
1900 # Look for in_port_t.
1901 #
1902 AC_MSG_CHECKING(for type in_port_t)
1903 AC_TRY_COMPILE([
1904 #include <sys/types.h>
1905 #include <netinet/in.h>],
1906 [in_port_t port = 25; return (0);],
1907         [AC_MSG_RESULT(yes)
1908         ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1909         [AC_MSG_RESULT(no)
1910         ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1911 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1912
1913 #
1914 # Check for addrinfo
1915 #
1916 AC_MSG_CHECKING(for struct addrinfo)
1917 AC_TRY_COMPILE([
1918 #include <netdb.h>],
1919 [struct addrinfo a; return (0);],
1920         [AC_MSG_RESULT(yes)
1921         ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1922         ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
1923         AC_DEFINE(HAVE_ADDRINFO)],
1924         [AC_MSG_RESULT(no)
1925         ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
1926         ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
1927 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
1928 AC_SUBST(ISC_IRS_NEEDADDRINFO)
1929
1930 #
1931 # Check for rrsetinfo
1932 #
1933 AC_MSG_CHECKING(for struct rrsetinfo)
1934 AC_TRY_COMPILE([
1935 #include <netdb.h>],
1936 [struct rrsetinfo r; return (0);],
1937         [AC_MSG_RESULT(yes)
1938         ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1939         [AC_MSG_RESULT(no)
1940         ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1941 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1942
1943 AC_MSG_CHECKING(for int sethostent)
1944 AC_TRY_COMPILE([
1945 #include <netdb.h>],
1946 [int i = sethostent(0); return(0);],
1947         [AC_MSG_RESULT(yes)
1948         ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1949         [AC_MSG_RESULT(no)
1950         ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1951 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
1952
1953 AC_MSG_CHECKING(for int endhostent)
1954 AC_TRY_COMPILE([
1955 #include <netdb.h>],
1956 [int i = endhostent(); return(0);],
1957         [AC_MSG_RESULT(yes)
1958         ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1959         [AC_MSG_RESULT(no)
1960         ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1961 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1962
1963 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1964 AC_TRY_COMPILE([
1965 #include <netdb.h>
1966 struct netent *getnetbyaddr(in_addr_t, int);],
1967 [],
1968         [AC_MSG_RESULT(yes)
1969         ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1970         [AC_MSG_RESULT(no)
1971         ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1972 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1973
1974 AC_MSG_CHECKING(for int setnetent)
1975 AC_TRY_COMPILE([
1976 #include <netdb.h>],
1977 [int i = setnetent(0); return(0);],
1978         [AC_MSG_RESULT(yes)
1979         ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1980         [AC_MSG_RESULT(no)
1981         ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1982 AC_SUBST(ISC_LWRES_SETNETENTINT)
1983
1984 AC_MSG_CHECKING(for int endnetent)
1985 AC_TRY_COMPILE([
1986 #include <netdb.h>],
1987 [int i = endnetent(); return(0);],
1988         [AC_MSG_RESULT(yes)
1989         ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1990         [AC_MSG_RESULT(no)
1991         ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1992 AC_SUBST(ISC_LWRES_ENDNETENTINT)
1993
1994 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1995 AC_TRY_COMPILE([
1996 #include <netdb.h>
1997 struct hostent *gethostbyaddr(const void *, size_t, int);],
1998 [return(0);],
1999         [AC_MSG_RESULT(yes)
2000         ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
2001         [AC_MSG_RESULT(no)
2002         ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
2003 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
2004
2005 AC_MSG_CHECKING(for h_errno in netdb.h)
2006 AC_TRY_COMPILE([
2007 #include <netdb.h>],
2008 [h_errno = 1; return(0);],
2009         [AC_MSG_RESULT(yes)
2010         ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
2011         [AC_MSG_RESULT(no)
2012         ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
2013 AC_SUBST(ISC_LWRES_NEEDHERRNO)
2014
2015 #
2016 # Sadly, the definitions of system-supplied getnameinfo(3) vary.  Try to catch
2017 # known variations here:
2018 #
2019 AC_MSG_CHECKING(for getnameinfo prototype definitions)
2020 AC_TRY_COMPILE([
2021 #include <sys/types.h>
2022 #include <sys/socket.h>
2023 #include <netdb.h>
2024 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2025                 socklen_t, char *, socklen_t, unsigned int);],
2026 [ return (0);],
2027         [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
2028          AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
2029                    [Define to the buffer length type used by getnameinfo(3).])
2030          AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
2031                    [Define to the flags type used by getnameinfo(3).])],
2032 [AC_TRY_COMPILE([
2033 #include <sys/types.h>
2034 #include <sys/socket.h>
2035 #include <netdb.h>
2036 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2037                 size_t, char *, size_t, int);],
2038 [ return (0);],
2039         [AC_MSG_RESULT(size_t for buflen; int for flags)
2040          AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
2041          AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
2042 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2043 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
2044 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])
2045
2046 #
2047 # ...and same for gai_strerror().
2048 #
2049 AC_MSG_CHECKING(for gai_strerror prototype definitions)
2050 AC_TRY_COMPILE([
2051 #include <sys/types.h>
2052 #include <sys/socket.h>
2053 #include <netdb.h>
2054 char *gai_strerror(int ecode);],
2055 [ return (0); ],
2056         [AC_MSG_RESULT(returning char *)
2057          AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
2058          [return type of gai_strerror])],
2059 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2060 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
2061
2062 AC_CHECK_FUNC(getipnodebyname,
2063         [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
2064         [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
2065 AC_CHECK_FUNC(getnameinfo,
2066         [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
2067         [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
2068 AC_CHECK_FUNC(getaddrinfo,
2069         [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
2070         AC_DEFINE(HAVE_GETADDRINFO)],
2071         [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
2072 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
2073 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
2074 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
2075 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
2076 AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
2077
2078 AC_ARG_ENABLE(getifaddrs,
2079 [  --enable-getifaddrs     Enable the use of getifaddrs() [[yes|no]].],
2080     want_getifaddrs="$enableval",  want_getifaddrs="yes")
2081
2082 #
2083 # This interface iteration code for getifaddrs() will fall back to using
2084 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
2085 # addresses.
2086
2087 case $want_getifaddrs in
2088 glibc)
2089 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2090 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2091 ;;
2092 yes)
2093 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2094 ;;
2095 no)
2096 ;;
2097 esac
2098
2099 #
2100 # Look for a sysctl call to get the list of network interfaces.
2101 #
2102 case $ac_cv_header_sys_sysctl_h in
2103 yes)
2104 AC_MSG_CHECKING(for interface list sysctl)
2105 AC_EGREP_CPP(found_rt_iflist, [
2106 #include <sys/param.h>
2107 #include <sys/sysctl.h>
2108 #include <sys/socket.h>
2109 #ifdef NET_RT_IFLIST
2110 found_rt_iflist
2111 #endif
2112 ],
2113         [AC_MSG_RESULT(yes)
2114          AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2115         [AC_MSG_RESULT(no)])
2116 ;;
2117 esac
2118
2119 #
2120 # Check for some other useful functions that are not ever-present.
2121 #
2122
2123 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
2124 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
2125 # reportedly defines strsep() without declaring it in <string.h> when
2126 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
2127 # AC_CHECK_FUNC() incorrectly succeeds because it declares
2128 # the function itself.
2129 AC_MSG_CHECKING(for correctly declared strsep())
2130 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
2131         [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
2132         [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
2133 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
2134
2135 AC_CHECK_FUNC(memmove,
2136         [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
2137         [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
2138 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
2139
2140 AC_CHECK_FUNC(strtoul,
2141         [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2142          LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
2143          GENRANDOMLIB=""],
2144         [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
2145          LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
2146          GENRANDOMLIB='${ISCLIBS}'])
2147 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
2148 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
2149 AC_SUBST(GENRANDOMLIB)
2150
2151 AC_CHECK_FUNC(strlcpy,
2152         [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
2153         [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
2154 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
2155
2156 AC_CHECK_FUNC(strlcat,
2157         [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
2158         [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
2159 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
2160
2161 ISC_PRINT_OBJS=
2162 ISC_PRINT_SRCS=
2163 AC_MSG_CHECKING(sprintf)
2164 AC_TRY_COMPILE([
2165 #include <stdio.h>
2166 ],
2167 [ char buf[2]; return(*sprintf(buf,"x"));],
2168 [
2169 ISC_PRINT_OBJS="print.$O"
2170 ISC_PRINT_SRCS="print.c"
2171 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
2172 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
2173 ],
2174 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2175  LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2176 )
2177 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2178 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
2179
2180 AC_CHECK_FUNC(vsnprintf,
2181         [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
2182          LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
2183         [ISC_PRINT_OBJS="print.$O"
2184          ISC_PRINT_SRCS="print.c"
2185          ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
2186          LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
2187 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
2188 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
2189 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
2190 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
2191
2192 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2193
2194 AC_SUBST(ISC_EXTRA_OBJS)
2195 AC_SUBST(ISC_EXTRA_SRCS)
2196
2197 #
2198 # Use our own SPNEGO implementation?
2199 #
2200 AC_ARG_ENABLE(isc-spnego,
2201         [  --disable-isc-spnego    use SPNEGO from GSSAPI library])
2202
2203 if test -n "$USE_GSSAPI"
2204 then
2205         case "$enable_isc_spnego" in
2206                 yes|'')
2207                         USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
2208                         DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
2209                         DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
2210                         AC_MSG_RESULT(using SPNEGO from lib/dns)
2211                         ;;
2212                 no)
2213                         AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2214                         ;;
2215         esac
2216 fi
2217
2218 AC_SUBST(USE_ISC_SPNEGO)
2219
2220 AC_SUBST(DST_EXTRA_OBJS)
2221 AC_SUBST(DST_EXTRA_SRCS)
2222
2223 # Determine the printf format characters to use when printing
2224 # values of type isc_int64_t. This will normally be "ll", but where
2225 # the compiler treats "long long" as a alias for "long" and printf
2226 # doesn't know about "long long" use "l".  Hopefully the sprintf
2227 # will produce a inconsistent result in the later case.  If the compiler
2228 # fails due to seeing "%lld" we fall back to "l".
2229 #
2230 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2231 # %ld even for (long long)/
2232 #
2233 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2234 # configure on Win32.
2235 #
2236 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2237 AC_TRY_RUN([
2238 #include <stdio.h>
2239 main() {
2240         long long int j = 0;
2241         char buf[100];
2242         buf[0] = 0;
2243         sprintf(buf, "%lld", j);
2244         exit((sizeof(long long int) != sizeof(long int))? 0 :
2245              (strcmp(buf, "0") != 0));
2246
2247 ],
2248         [AC_MSG_RESULT(ll)
2249         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2250         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
2251         [AC_MSG_RESULT(l)
2252         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
2253         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
2254         [AC_MSG_RESULT(assuming target platform uses ll)
2255         ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2256         LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
2257 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
2258 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
2259
2260 #
2261 # Security Stuff
2262 #
2263 # Note it is very recommended to *not* disable chroot(),
2264 # this is only because chroot() was made obsolete by Posix.
2265 AC_ARG_ENABLE(chroot,
2266         [  --disable-chroot        disable chroot])
2267 case "$enable_chroot" in
2268         yes|'')
2269                 AC_CHECK_FUNCS(chroot)
2270                 ;;
2271         no)
2272                 ;;
2273 esac
2274 AC_ARG_ENABLE(linux-caps,
2275         [  --disable-linux-caps   disable linux capabilities])
2276 case "$enable_linux_caps" in
2277         yes|'')
2278                 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
2279                 AC_CHECK_LIB(cap, cap_set_proc)
2280                 ;;
2281         no)
2282                 ;;
2283 esac
2284 AC_CHECK_HEADERS(sys/prctl.h)
2285
2286 AC_CHECK_HEADERS(sys/un.h,
2287 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2288 ,
2289 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2290 )
2291 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2292
2293 case "$host" in
2294 *-solaris*)
2295         AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2296                   [Define if connect does not honour the permission on the UNIX domain socket.])
2297         ;;
2298 *-sunos*)
2299         AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2300                   [Define if connect does not honour the permission on the UNIX domain socket.])
2301         ;;
2302 esac
2303
2304 #
2305 # Time Zone Stuff
2306 #
2307 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2308
2309 AC_MSG_CHECKING(for optarg declaration)
2310 AC_TRY_COMPILE([
2311 #include <unistd.h>
2312 ],
2313 [optarg = 0;],
2314 [AC_MSG_RESULT(yes)],
2315 [AC_MSG_RESULT(no)
2316 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2317 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2318
2319 #
2320 # BSD/OS, and perhaps some others, don't define rlim_t.
2321 #
2322 AC_MSG_CHECKING(for type rlim_t)
2323 AC_TRY_COMPILE([
2324 #include <sys/types.h>
2325 #include <sys/time.h>
2326 #include <sys/resource.h>],
2327 [rlim_t rl = 19671212; return (0);],
2328 [AC_MSG_RESULT(yes)
2329  ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2330 [AC_MSG_RESULT(no)
2331
2332 AC_MSG_CHECKING(type of rlim_cur)
2333 AC_TRY_RUN([
2334 #include <sys/types.h>
2335 #include <sys/time.h>
2336 #include <sys/resource.h>
2337 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
2338 [AC_MSG_RESULT(int)
2339 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
2340 [
2341 AC_TRY_RUN([
2342 #include <sys/types.h>
2343 #include <sys/time.h>
2344 #include <sys/resource.h>
2345 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
2346 [AC_MSG_RESULT(long int)
2347 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
2348 [
2349 AC_TRY_RUN([
2350 #include <sys/types.h>
2351 #include <sys/time.h>
2352 #include <sys/resource.h>
2353 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
2354 [AC_MSG_RESULT(long long int)
2355 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
2356 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
2357 ],[AC_MSG_ERROR(this cannot happen)])
2358 ],[AC_MSG_ERROR(this cannot happen)])
2359 ],[
2360 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
2361 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
2362 ])
2363 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2364
2365 #
2366 # Older HP-UX doesn't have gettune
2367 #
2368 case "$host" in
2369         *-hp-hpux*)
2370                 AC_CHECK_HEADERS(sys/dyntune.h)
2371                 ;;
2372         *)
2373                 ;;
2374 esac
2375
2376
2377 #
2378 # Compaq TruCluster requires more code for handling cluster IP aliases
2379 #
2380 case "$host" in
2381         *-dec-osf*)
2382                 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
2383                 AC_CHECK_FUNC(clua_getaliasaddress,
2384                                 AC_DEFINE(HAVE_TRUCLUSTER, 1,
2385                                         [Define if running under Compaq TruCluster]))
2386                 ;;
2387         *)
2388                 ;;
2389 esac
2390
2391 #
2392 # Some hosts need msg_namelen to match the size of the socket structure.
2393 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
2394 #
2395 case $host in
2396 *os2*|*hp-mpeix*)
2397         AC_DEFINE(BROKEN_RECVMSG, 1,
2398                   [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2399         ;;
2400 esac
2401
2402 #
2403 # Microsoft has their own way of handling shared libraries that requires
2404 # additional qualifiers on extern variables.  Unix systems don't need it.
2405 #
2406 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
2407 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
2408 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
2409 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
2410 AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
2411 IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
2412
2413 #
2414 # Random remaining OS-specific issues involving compiler warnings.
2415 # XXXDCL print messages to indicate some compensation is being done?
2416 #
2417 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2418 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2419
2420 case "$host" in
2421         *-aix5.[[123]].*)
2422                 hack_shutup_pthreadonceinit=yes
2423                 ;;
2424         *-bsdi3.1*)
2425                 hack_shutup_sputaux=yes
2426                 ;;
2427         *-bsdi4.0*)
2428                 hack_shutup_sigwait=yes
2429                 hack_shutup_sputaux=yes
2430                 ;;
2431         [*-bsdi4.[12]*])
2432                 hack_shutup_stdargcast=yes
2433                 ;;
2434         [*-solaris2.[89]])
2435                 hack_shutup_pthreadonceinit=yes
2436                 ;;
2437         *-solaris2.1[[0-9]])
2438                 AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
2439                 ;;
2440 esac
2441
2442 case "$hack_shutup_pthreadonceinit" in
2443         yes)
2444                 #
2445                 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2446                 #
2447                 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2448                 ;;
2449 esac
2450
2451 case "$hack_shutup_sigwait" in
2452         yes)
2453                 #
2454                 # Shut up a -Wmissing-prototypes warning for sigwait().
2455                 #
2456                 AC_DEFINE(SHUTUP_SIGWAIT)
2457                 ;;
2458 esac
2459
2460 case "$hack_shutup_sputaux" in
2461         yes)
2462                 #
2463                 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2464                 #
2465                 AC_DEFINE(SHUTUP_SPUTAUX)
2466                 ;;
2467 esac
2468
2469 case "$hack_shutup_stdargcast" in
2470         yes)
2471                 #
2472                 # Shut up a -Wcast-qual warning from va_start().
2473                 #
2474                 AC_DEFINE(SHUTUP_STDARG_CAST)
2475                 ;;
2476 esac
2477
2478 AC_CHECK_HEADERS(strings.h,
2479   ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2480 ,
2481   ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2482 )
2483 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2484
2485 #
2486 # Check for if_nametoindex() for IPv6 scoped addresses support
2487 #
2488 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2489                 ac_cv_have_if_nametoindex=no)
2490 case $ac_cv_have_if_nametoindex in
2491 no)
2492         case "$host" in
2493         *-hp-hpux*)
2494                 AC_CHECK_LIB(ipv6, if_nametoindex,
2495                                 ac_cv_have_if_nametoindex=yes
2496                                 LIBS="-lipv6 $LIBS",)
2497         ;;
2498         esac
2499 esac
2500 case $ac_cv_have_if_nametoindex in
2501 yes)
2502         ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2503         ;;
2504 *)
2505         ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2506         ;;
2507 esac
2508 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2509
2510 AC_CHECK_FUNCS(nanosleep)
2511
2512 #
2513 # Machine architecture dependent features
2514 #
2515 AC_ARG_ENABLE(atomic,
2516         [  --enable-atomic        enable machine specific atomic operations
2517                           [[default=autodetect]]],
2518                         enable_atomic="$enableval",
2519                         enable_atomic="autodetect")
2520 case "$enable_atomic" in
2521         yes|''|autodetect)
2522                 case "$host" in
2523                 powerpc-ibm-aix*)
2524                         if test "X$GCC" = "Xyes"; then
2525                                 AC_MSG_CHECKING([if asm("isc"); works])
2526                                 AC_TRY_COMPILE(,[
2527                                 main() { asm("ics"); exit(0); }
2528                                 ],
2529                                 [AC_MSG_RESULT(yes)
2530                                  use_atomic=yes],
2531                                 [
2532                                 saved_cflags="$CFLAGS"
2533                                 CFLAGS="$CFLAGS -Wa,-many"
2534                                 AC_TRY_RUN([
2535                                 main() { asm("ics"); exit(0); }
2536                                 ],
2537                                 [AC_MSG_RESULT([yes, required -Wa,-many])
2538                                  use_atomic=yes],
2539                                 [AC_MSG_RESULT([no, use_atomic disabled])
2540                                  CFLAGS="$saved_cflags"
2541                                  use_atomic=no],
2542                                 [AC_MSG_RESULT([cross compile, assume yes])
2543                                  CFLAGS="$saved_cflags"
2544                                  use_atomic=yes])
2545                                 ]
2546                                 )
2547                         else
2548                                 use_atomic=yes
2549                         fi
2550                         ;;
2551                 *)
2552                         use_atomic=yes
2553                         ;;
2554                 esac
2555                 ;;
2556         no)
2557                 use_atomic=no
2558                 arch=noatomic
2559                 ;;
2560 esac
2561
2562 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2563 if test "$use_atomic" = "yes"; then
2564         AC_MSG_CHECKING([architecture type for atomic operations])
2565         have_atomic=yes         # set default
2566         case "$host" in
2567         [i[3456]86-*])
2568                 # XXX: some old x86 architectures actually do not support
2569                 #      (some of) these operations.  Do we need stricter checks?
2570 AC_TRY_RUN([
2571 main() {
2572         exit((sizeof(void *) == 8) ? 0 : 1);
2573 }
2574 ],
2575                 [arch=x86_64
2576                 have_xaddq=yes],
2577                 [arch=x86_32],
2578                 [arch=x86_32])
2579         ;;
2580         x86_64-*|amd64-*)
2581 AC_TRY_RUN([
2582 main() {
2583        exit((sizeof(void *) == 8) ? 0 : 1);
2584 }
2585 ],
2586                [arch=x86_64
2587                have_xaddq=yes],
2588                [arch=x86_32],
2589                [arch=x86_64
2590                have_xaddq=yes])
2591         ;;
2592         alpha*-*)
2593                 arch=alpha
2594         ;;
2595         powerpc-*|powerpc64-*)
2596                 arch=powerpc
2597         ;;
2598         mips-*|mipsel-*|mips64-*|mips64el-*)
2599                 arch=mips
2600         ;;
2601         ia64-*)
2602                 arch=ia64
2603         ;;
2604         *)
2605                 have_atomic=no
2606                 arch=noatomic
2607         ;;
2608         esac
2609         AC_MSG_RESULT($arch)
2610 fi
2611
2612 if test "$have_atomic" = "yes"; then
2613         AC_MSG_CHECKING([compiler support for inline assembly code])
2614
2615         compiler=generic
2616         # Check whether the compiler supports the assembly syntax we provide.
2617         if test "X$GCC" = "Xyes"; then
2618                 # GCC's ASM extension always works
2619                 compiler=gcc
2620                 if test $arch = "x86_64"; then
2621                         # We can share the same code for gcc with x86_32
2622                         arch=x86_32
2623                 fi
2624                 if test $arch = "powerpc"; then
2625                         #
2626                         # The MacOS (and maybe others) uses "r0" for register
2627                         # zero. Under linux/ibm it is "0" for register 0.
2628                         # Probe to see if we have a MacOS style assembler.
2629                         #
2630                         AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2631                         AC_TRY_COMPILE(, [
2632                         __asm__ volatile ("li r0, 0x0\n"::);
2633                         ], [
2634                         AC_MSG_RESULT(yes)
2635                         compiler="mac"
2636                         ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2637                         ], [AC_MSG_RESULT(no)])
2638                 fi
2639         else
2640                 case "$host" in
2641                 alpha*-dec-osf*)
2642                         # Tru64 compiler has its own syntax for inline 
2643                         # assembly.
2644                         AC_TRY_COMPILE(, [
2645 #ifndef __DECC
2646 #error "unexpected compiler"
2647 #endif
2648                                 return (0);],
2649                                 [compiler=osf],)
2650                 ;;
2651                 powerpc-ibm-aix*)
2652                         compiler=aix
2653                 ;;
2654                 esac
2655         fi
2656         case "$compiler" in
2657         gcc)
2658                 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2659                 ;;
2660         osf)
2661                 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2662                 ;;
2663         aix)
2664                 ;;
2665         mac)
2666                 ;;
2667         *)
2668                 # See if the generic __asm function works.  If not,
2669                 # we need to disable the atomic operations.
2670                 AC_TRY_LINK(, [
2671                                         __asm("nop")
2672                                 ],
2673                 [compiler="standard"
2674                 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2675                 [compiler="not supported (atomic operations disabled)"
2676                 have_atomic=no
2677                 arch=noatomic ]);
2678                 ;;
2679         esac
2680
2681         AC_MSG_RESULT($compiler)
2682 fi
2683
2684 if test "$have_atomic" = "yes"; then
2685         ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2686         ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2687         ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2688 else
2689         ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2690         ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2691         ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2692 fi
2693
2694 if test "$have_xaddq" = "yes"; then
2695         ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
2696 else
2697         ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
2698 fi
2699
2700 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2701 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
2702 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2703 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2704
2705 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2706 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2707 AC_SUBST(ISC_PLATFORM_USESTDASM)
2708 AC_SUBST(ISC_PLATFORM_USEMACASM)
2709
2710 ISC_ARCH_DIR=$arch
2711 AC_SUBST(ISC_ARCH_DIR)
2712
2713 #
2714 # Activate "rrset-order fixed" or not?
2715 #
2716 AC_ARG_ENABLE(fixed-rrset,
2717         [  --enable-fixed-rrset    enable fixed rrset ordering
2718                           [[default=no]]],
2719                         enable_fixed="$enableval",
2720                         enable_fixed="no")
2721 case "$enable_fixed" in
2722         yes)
2723                 AC_DEFINE(DNS_RDATASET_FIXED, 1,
2724                           [Define to enable "rrset-order fixed" syntax.])
2725                 ;;
2726         no)
2727                 ;;
2728         *)
2729                 ;;
2730 esac
2731
2732 #
2733 # Enable response policy rewriting using NS IP addresses
2734 #
2735 AC_ARG_ENABLE(rpz-nsip,
2736         [  --enable-rpz-nsip      enable rpz-nsip rules [[default=no]]],
2737                         enable_nsip="$enableval",
2738                         enable_nsip="no")
2739 case "$enable_nsip" in
2740         yes)
2741                 AC_DEFINE(ENABLE_RPZ_NSIP, 1,
2742                           [Define to enable rpz-nsip rules.])
2743                 ;;
2744         no)
2745                 ;;
2746         *)
2747                 ;;
2748 esac
2749
2750 #
2751 # Enable response policy rewriting using NS name
2752 #
2753 AC_ARG_ENABLE(rpz-nsdname,
2754         [  --enable-rpz-nsdname   enable rpz-nsdname rules [[default=no]]],
2755                         enable_nsdname="$enableval",
2756                         enable_nsdname="no")
2757 case "$enable_nsdname" in
2758         yes)
2759                 AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
2760                           [Define to enable rpz-nsdname rules.])
2761                 ;;
2762         no)
2763                 ;;
2764         *)
2765                 ;;
2766 esac
2767
2768 #
2769 # Activate "filter-aaaa-on-v4" or not?
2770 #
2771 AC_ARG_ENABLE(filter-aaaa,
2772         [  --enable-filter-aaaa    enable filtering of AAAA records over IPv4
2773                           [[default=no]]],
2774                         enable_filter="$enableval",
2775                         enable_filter="no")
2776 case "$enable_filter" in
2777         yes)
2778                 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
2779                           [Define to enable the "filter-aaaa-on-v4" option.])
2780                 ;;
2781         no)
2782                 ;;
2783         *)
2784                 ;;
2785 esac
2786
2787 #
2788 #  The following sets up how non-blocking i/o is established.
2789 #  Sunos, cygwin and solaris 2.x (x<5) require special handling.
2790 #
2791 case "$host" in
2792 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2793 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2794 *-solaris2.[[01234]])
2795         AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2796         AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2797                   [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2798         ;;
2799 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2800              [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2801         ;;
2802 esac
2803 #
2804 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2805 # This prevents the source address being set.
2806 #
2807 case "$host" in
2808 *-solaris2.[[012345]]|*-solaris2.5.1)
2809         AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2810                   [Define if you cannot bind() before connect() for TCP sockets.])
2811         ;;
2812 esac
2813 #
2814 # The following sections deal with tools used for formatting
2815 # the documentation.  They are all optional, unless you are
2816 # a developer editing the documentation source.
2817 #
2818
2819 #
2820 # Look for TeX.
2821 #
2822
2823 AC_PATH_PROGS(LATEX, latex, latex)
2824 AC_SUBST(LATEX)
2825
2826 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2827 AC_SUBST(PDFLATEX)
2828
2829 #
2830 # Look for w3m
2831 #
2832
2833 AC_PATH_PROGS(W3M, w3m, w3m)
2834 AC_SUBST(W3M)
2835
2836 #
2837 # Look for xsltproc (libxslt)
2838 #
2839
2840 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2841 AC_SUBST(XSLTPROC)
2842
2843 #
2844 # Look for xmllint (libxml2)
2845 #
2846
2847 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2848 AC_SUBST(XMLLINT)
2849
2850 #
2851 # Look for Doxygen
2852 #
2853
2854 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
2855 AC_SUBST(DOXYGEN)
2856
2857 #
2858 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2859 # in a number of directories:
2860 #
2861 #   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2862 #
2863 # If the file FILENAME is found in one of the DIRECTORIES, the shell
2864 # variable VARIABLE is defined to its absolute pathname.  Otherwise, 
2865 # it is set to FILENAME, with no directory prefix (that's not terribly
2866 # useful, but looks less confusing in substitutions than leaving it
2867 # empty).  The variable VARIABLE will be substituted into output files.
2868
2869
2870 AC_DEFUN(NOM_PATH_FILE, [
2871 $1=""
2872 AC_MSG_CHECKING(for $2)
2873 for d in $3
2874 do
2875         f=$d/$2
2876         if test -f $f
2877         then
2878                 $1=$f
2879                 AC_MSG_RESULT($f)
2880                 break
2881         fi
2882 done
2883 if test "X[$]$1" = "X"
2884 then
2885         AC_MSG_RESULT("not found");
2886         $1=$2
2887 fi
2888 AC_SUBST($1)
2889 ])
2890
2891 #
2892 # Look for Docbook-XSL stylesheets.  Location probably varies by system.
2893 # If it's not explicitly specified, guess where it might be found, based on
2894 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
2895 # of at the moment).
2896 #
2897 AC_MSG_CHECKING(for Docbook-XSL path)
2898 AC_ARG_WITH(docbook-xsl,
2899 [  --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
2900    docbook_path="$withval", docbook_path="auto")
2901 case "$docbook_path" in
2902 auto)
2903         AC_MSG_RESULT(auto)
2904         docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2905         ;;
2906 *)
2907         docbook_xsl_trees="$withval"
2908         AC_MSG_RESULT($docbook_xsl_trees)
2909         ;;
2910 esac
2911
2912 #
2913 # Look for stylesheets we need.
2914 #
2915
2916 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
2917 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
2918 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
2919 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
2920 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
2921 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
2922 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
2923 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
2924 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
2925
2926 #
2927 # Same dance for db2latex
2928 #
2929 # No idea where this lives except on FreeBSD.
2930 #
2931
2932 db2latex_xsl_trees="/usr/local/share"
2933
2934 #
2935 # Look for stylesheets we need.
2936 #
2937
2938 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2939
2940 #
2941 # Look for "admonition" image directory.  Can't use NOM_PATH_FILE()
2942 # because it's a directory, so just do the same things, inline.
2943 #
2944
2945 AC_MSG_CHECKING(for db2latex/xsl/figures)
2946 for d in $db2latex_xsl_trees
2947 do
2948         dd=$d/db2latex/xsl/figures
2949         if test -d $dd
2950         then
2951                 XSLT_DB2LATEX_ADMONITIONS=$dd
2952                 AC_MSG_RESULT($dd)
2953                 break
2954         fi
2955 done
2956 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2957 then
2958         AC_MSG_RESULT(not found)
2959         XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2960 fi
2961 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2962
2963 #
2964 # IDN support
2965 #
2966 AC_ARG_WITH(idn,
2967         [  --with-idn[=MPREFIX]      enable IDN support using idnkit [default PREFIX]],
2968         use_idn="$withval", use_idn="no")
2969 case "$use_idn" in
2970 yes)
2971         if test X$prefix = XNONE ; then
2972                 idn_path=/usr/local
2973         else
2974                 idn_path=$prefix
2975         fi
2976         ;;
2977 no)
2978         ;;
2979 *)
2980         idn_path="$use_idn"
2981         ;;
2982 esac
2983
2984 iconvinc=
2985 iconvlib=
2986 AC_ARG_WITH(libiconv,
2987         [  --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
2988         use_libiconv="$withval", use_libiconv="no")
2989 case "$use_libiconv" in
2990 yes)
2991         if test X$prefix = XNONE ; then
2992                 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2993         else
2994                 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
2995         fi
2996         ;;
2997 no)
2998         iconvlib=
2999         ;;
3000 *)
3001         iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
3002         ;;
3003 esac
3004
3005 AC_ARG_WITH(iconv,
3006         [  --with-iconv[=LIBSPEC]    specify iconv library [default -liconv]],
3007         iconvlib="$withval")
3008 case "$iconvlib" in
3009 no)
3010         iconvlib=
3011         ;;
3012 yes)
3013         iconvlib=-liconv
3014         ;;
3015 esac
3016
3017 AC_ARG_WITH(idnlib,
3018         [  --with-idnlib=ARG       specify libidnkit],
3019         idnlib="$withval", idnlib="no")
3020 if test "$idnlib" = yes; then
3021         AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
3022 fi
3023
3024 IDNLIBS=
3025 if test "$use_idn" != no; then
3026         AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
3027         STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
3028         if test "$idnlib" != no; then
3029                 IDNLIBS="$idnlib $iconvlib"
3030         else
3031                 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
3032         fi
3033 fi
3034 AC_SUBST(IDNLIBS)
3035
3036 AC_CHECK_HEADERS(locale.h)
3037 AC_CHECK_FUNCS(setlocale)
3038
3039 #
3040 # Substitutions
3041 #
3042 AC_SUBST(BIND9_TOP_BUILDDIR)
3043 BIND9_TOP_BUILDDIR=`pwd`
3044
3045 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
3046 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
3047 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
3048 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
3049 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
3050 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
3051 if test "X$srcdir" != "X"; then
3052         BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
3053         BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
3054         BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
3055         BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
3056         BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
3057         BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
3058 else
3059         BIND9_ISC_BUILDINCLUDE=""
3060         BIND9_ISCCC_BUILDINCLUDE=""
3061         BIND9_ISCCFG_BUILDINCLUDE=""
3062         BIND9_DNS_BUILDINCLUDE=""
3063         BIND9_LWRES_BUILDINCLUDE=""
3064         BIND9_BIND9_BUILDINCLUDE=""
3065 fi
3066
3067 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
3068 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
3069
3070 AC_SUBST_FILE(BIND9_MAKE_RULES)
3071 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
3072
3073 . $srcdir/version
3074 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}"
3075 AC_SUBST(BIND9_VERSION)
3076
3077 if test -z "$ac_configure_args"; then
3078         BIND9_CONFIGARGS="defaults"
3079 else
3080         for a in $ac_configure_args
3081         do
3082                 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
3083         done
3084 fi
3085 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
3086 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
3087 AC_SUBST(BIND9_CONFIGARGS)
3088
3089 AC_SUBST_FILE(LIBISC_API)
3090 LIBISC_API=$srcdir/lib/isc/api
3091
3092 AC_SUBST_FILE(LIBISCCC_API)
3093 LIBISCCC_API=$srcdir/lib/isccc/api
3094
3095 AC_SUBST_FILE(LIBISCCFG_API)
3096 LIBISCCFG_API=$srcdir/lib/isccfg/api
3097
3098 AC_SUBST_FILE(LIBDNS_API)
3099 LIBDNS_API=$srcdir/lib/dns/api
3100
3101 AC_SUBST_FILE(LIBBIND9_API)
3102 LIBBIND9_API=$srcdir/lib/bind9/api
3103
3104 AC_SUBST_FILE(LIBLWRES_API)
3105 LIBLWRES_API=$srcdir/lib/lwres/api
3106
3107 AC_SUBST_FILE(LIBIRS_API)
3108 LIBIRS_API=$srcdir/lib/irs/api
3109
3110 #
3111 # Configure any DLZ drivers.
3112 #
3113 # If config.dlz.in selects one or more DLZ drivers, it will set
3114 # USE_DLZ to a non-empty value, which will be our clue to
3115 # enable the DLZ core functions.
3116 #
3117 # This section has to come after the libtool stuff because it needs to
3118 # know how to name the driver object files.
3119 #
3120
3121 USE_DLZ=""
3122 DLZ_DRIVER_INCLUDES=""
3123 DLZ_DRIVER_LIBS=""
3124 DLZ_DRIVER_SRCS=""
3125 DLZ_DRIVER_OBJS=""
3126 DLZ_SYSTEM_TEST=""
3127
3128 sinclude(contrib/dlz/config.dlz.in)
3129
3130 AC_MSG_CHECKING(for DLZ)
3131
3132 if test -n "$USE_DLZ"
3133 then
3134         AC_MSG_RESULT(yes)
3135         USE_DLZ="-DDLZ $USE_DLZ"
3136         DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3137         AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3138 else
3139         AC_MSG_RESULT(no)
3140         DLZ_DRIVER_RULES=/dev/null
3141 fi
3142
3143 AC_SUBST(USE_DLZ)
3144 AC_SUBST(DLZ_DRIVER_INCLUDES)
3145 AC_SUBST(DLZ_DRIVER_LIBS)
3146 AC_SUBST(DLZ_DRIVER_SRCS)
3147 AC_SUBST(DLZ_DRIVER_OBJS)
3148 AC_SUBST(DLZ_SYSTEM_TEST)
3149 AC_SUBST_FILE(DLZ_DRIVER_RULES)
3150
3151 if test "$cross_compiling" = "yes"; then
3152         if test -z "$BUILD_CC"; then
3153                 AC_ERROR([BUILD_CC not set])
3154         fi
3155         BUILD_CFLAGS="$BUILD_CFLAGS"
3156         BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3157         BUILD_LDFLAGS="$BUILD_LDFLAGS"
3158         BUILD_LIBS="$BUILD_LIBS"
3159 else
3160         BUILD_CC="$CC" 
3161         BUILD_CFLAGS="$CFLAGS" 
3162         BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3163         BUILD_LDFLAGS="$LDFLAGS"
3164         BUILD_LIBS="$LIBS"
3165 fi
3166
3167 NEWFLAGS=""
3168 for e in $BUILD_LDFLAGS ; do
3169     case $e in
3170         -L*)
3171             case $host_os in
3172                 netbsd*)
3173                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3174                     NEWFLAGS="$NEWFLAGS $e $ee"
3175                     ;;
3176                 freebsd*)
3177                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3178                     NEWFLAGS="$NEWFLAGS $e $ee"
3179                     ;;
3180                 solaris*)
3181                     ee=`echo $e | sed -e 's%^-L%-R%'`
3182                     NEWFLAGS="$NEWFLAGS $e $ee"
3183                     ;;
3184                 *)
3185                     NEWFLAGS="$NEWFLAGS $e"
3186                     ;;
3187                 esac
3188             ;;
3189         *)
3190             NEWFLAGS="$NEWFLAGS $e"
3191             ;;
3192     esac
3193 done
3194 BUILD_LDFLAGS="$NEWFLAGS"
3195
3196 NEWFLAGS=""
3197 for e in $DNS_GSSAPI_LIBS ; do
3198     case $e in
3199         -L*)
3200             case $host_os in
3201                 netbsd*)
3202                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3203                     NEWFLAGS="$NEWFLAGS $e $ee"
3204                     ;;
3205                 freebsd*)
3206                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3207                     NEWFLAGS="$NEWFLAGS $e $ee"
3208                     ;;
3209                 solaris*)
3210                     ee=`echo $e | sed -e 's%^-L%-R%'`
3211                     NEWFLAGS="$NEWFLAGS $e $ee"
3212                     ;;
3213                 *)
3214                     NEWFLAGS="$NEWFLAGS $e"
3215                     ;;
3216                 esac
3217             ;;
3218         *)
3219             NEWFLAGS="$NEWFLAGS $e"
3220             ;;
3221     esac
3222 done
3223 DNS_GSSAPI_LIBS="$NEWFLAGS"
3224
3225 NEWFLAGS=""
3226 for e in $DNS_CRYPTO_LIBS ; do
3227     case $e in
3228         -L*)
3229             case $host_os in
3230                 netbsd*)
3231                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3232                     NEWFLAGS="$NEWFLAGS $e $ee"
3233                     ;;
3234                 freebsd*)
3235                     ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3236                     NEWFLAGS="$NEWFLAGS $e $ee"
3237                     ;;
3238                 solaris*)
3239                     ee=`echo $e | sed -e 's%^-L%-R%'`
3240                     NEWFLAGS="$NEWFLAGS $e $ee"
3241                     ;;
3242                 *)
3243                     NEWFLAGS="$NEWFLAGS $e"
3244                     ;;
3245                 esac
3246             ;;
3247         *)
3248             NEWFLAGS="$NEWFLAGS $e"
3249             ;;
3250     esac
3251 done
3252 DNS_CRYPTO_LIBS="$NEWFLAGS"
3253
3254 AC_SUBST(BUILD_CC)
3255 AC_SUBST(BUILD_CFLAGS)
3256 AC_SUBST(BUILD_CPPFLAGS)
3257 AC_SUBST(BUILD_LDFLAGS)
3258 AC_SUBST(BUILD_LIBS)
3259
3260 #
3261 # Commands to run at the end of config.status.
3262 # Don't just put these into configure, it won't work right if somebody
3263 # runs config.status directly (which autoconf allows).
3264 #
3265
3266 AC_CONFIG_COMMANDS(
3267         [chmod],
3268         [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
3269
3270 #
3271 # Files to configure.  These are listed here because we used to
3272 # specify them as arguments to AC_OUTPUT.  It's (now) ok to move these
3273 # elsewhere if there's a good reason for doing so.
3274 #
3275
3276 AC_CONFIG_FILES([
3277   make/Makefile
3278   make/mkdep
3279         Makefile
3280         bin/Makefile
3281         bin/check/Makefile
3282         bin/confgen/Makefile
3283         bin/confgen/unix/Makefile
3284         bin/dig/Makefile
3285         bin/dnssec/Makefile
3286         bin/named/Makefile
3287         bin/named/unix/Makefile
3288         bin/nsupdate/Makefile
3289         bin/pkcs11/Makefile
3290         bin/rndc/Makefile
3291         bin/tests/Makefile
3292         bin/tests/atomic/Makefile
3293         bin/tests/db/Makefile
3294         bin/tests/dst/Makefile
3295         bin/tests/hashes/Makefile
3296         bin/tests/headerdep_test.sh
3297         bin/tests/master/Makefile
3298         bin/tests/mem/Makefile
3299         bin/tests/names/Makefile
3300         bin/tests/net/Makefile
3301         bin/tests/rbt/Makefile
3302         bin/tests/resolver/Makefile
3303         bin/tests/sockaddr/Makefile
3304         bin/tests/system/Makefile
3305         bin/tests/system/conf.sh
3306         bin/tests/system/filter-aaaa/Makefile
3307         bin/tests/system/gost/prereq.sh
3308         bin/tests/system/lwresd/Makefile
3309         bin/tests/system/rpz/Makefile
3310         bin/tests/system/tkey/Makefile
3311         bin/tests/tasks/Makefile
3312         bin/tests/timers/Makefile
3313         bin/tests/virtual-time/Makefile
3314         bin/tests/virtual-time/conf.sh
3315         bin/tools/Makefile
3316         contrib/check-secure-delegation.pl
3317         contrib/zone-edit.sh
3318         doc/Makefile
3319         doc/arm/Makefile
3320         doc/doxygen/Doxyfile
3321         doc/doxygen/Makefile
3322         doc/doxygen/doxygen-input-filter
3323         doc/misc/Makefile
3324         doc/xsl/Makefile
3325         doc/xsl/isc-docbook-chunk.xsl
3326         doc/xsl/isc-docbook-html.xsl
3327         doc/xsl/isc-docbook-latex.xsl
3328         doc/xsl/isc-manpage.xsl
3329         isc-config.sh
3330         lib/Makefile
3331         lib/bind9/Makefile
3332         lib/bind9/include/Makefile
3333         lib/bind9/include/bind9/Makefile
3334         lib/dns/Makefile
3335         lib/dns/include/Makefile
3336         lib/dns/include/dns/Makefile
3337         lib/dns/include/dst/Makefile
3338         lib/export/Makefile
3339         lib/export/dns/Makefile
3340         lib/export/dns/include/Makefile
3341         lib/export/dns/include/dns/Makefile
3342         lib/export/dns/include/dst/Makefile
3343         lib/export/irs/Makefile
3344         lib/export/irs/include/Makefile
3345         lib/export/irs/include/irs/Makefile
3346         lib/export/isc/$thread_dir/Makefile
3347         lib/export/isc/$thread_dir/include/Makefile
3348         lib/export/isc/$thread_dir/include/isc/Makefile
3349         lib/export/isc/Makefile
3350         lib/export/isc/include/Makefile
3351         lib/export/isc/include/isc/Makefile
3352         lib/export/isc/nls/Makefile
3353         lib/export/isc/unix/Makefile
3354         lib/export/isc/unix/include/Makefile
3355         lib/export/isc/unix/include/isc/Makefile
3356         lib/export/isccfg/Makefile
3357         lib/export/isccfg/include/Makefile
3358         lib/export/isccfg/include/isccfg/Makefile
3359         lib/export/samples/Makefile
3360         lib/export/samples/Makefile-postinstall
3361         lib/irs/Makefile
3362         lib/irs/include/Makefile
3363         lib/irs/include/irs/Makefile
3364         lib/irs/include/irs/netdb.h
3365         lib/irs/include/irs/platform.h
3366         lib/isc/$arch/Makefile
3367         lib/isc/$arch/include/Makefile
3368         lib/isc/$arch/include/isc/Makefile
3369         lib/isc/$thread_dir/Makefile
3370         lib/isc/$thread_dir/include/Makefile
3371         lib/isc/$thread_dir/include/isc/Makefile
3372         lib/isc/Makefile
3373         lib/isc/include/Makefile
3374         lib/isc/include/isc/Makefile
3375         lib/isc/include/isc/platform.h
3376         lib/isc/nls/Makefile
3377         lib/isc/unix/Makefile
3378         lib/isc/unix/include/Makefile
3379         lib/isc/unix/include/isc/Makefile
3380         lib/isccc/Makefile
3381         lib/isccc/include/Makefile
3382         lib/isccc/include/isccc/Makefile
3383         lib/isccfg/Makefile
3384         lib/isccfg/include/Makefile
3385         lib/isccfg/include/isccfg/Makefile
3386         lib/lwres/Makefile
3387         lib/lwres/include/Makefile
3388         lib/lwres/include/lwres/Makefile
3389         lib/lwres/include/lwres/netdb.h
3390         lib/lwres/include/lwres/platform.h
3391         lib/lwres/man/Makefile
3392         lib/lwres/unix/Makefile
3393         lib/lwres/unix/include/Makefile
3394         lib/lwres/unix/include/lwres/Makefile
3395         lib/tests/Makefile
3396         lib/tests/include/Makefile
3397         lib/tests/include/tests/Makefile
3398 ])
3399
3400 #
3401 # Do it
3402 #
3403
3404 AC_OUTPUT
3405
3406 #
3407 # Now that the Makefiles exist we can ensure that everything is rebuilt.
3408 #
3409 AC_ARG_WITH(make-clean,
3410 [  --with-make-clean      Run "make clean" at end of configure [[yes|no]].],
3411     make_clean="$withval", make_clean="yes")
3412 case "$make_clean" in
3413 yes)
3414         make clean
3415         ;;
3416 esac
3417
3418 if test "X$USE_OPENSSL" = "X"; then
3419 cat << \EOF                                                             
3420 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
3421 EOF
3422 fi
3423
3424 if test "X$OPENSSL_WARNING" != "X"; then
3425 cat << \EOF
3426 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3427 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3428 WARNING                                                                 WARNING
3429 WARNING         Your OpenSSL crypto library may be vulnerable to        WARNING
3430 WARNING         one or more of the the following known security         WARNING
3431 WARNING         flaws:                                                  WARNING
3432 WARNING                                                                 WARNING
3433 WARNING         CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and         WARNING
3434 WARNING         CVE-2006-2940.                                          WARNING
3435 WARNING                                                                 WARNING
3436 WARNING         It is recommended that you upgrade to OpenSSL           WARNING
3437 WARNING         version 0.9.8d/0.9.7l (or greater).                     WARNING
3438 WARNING                                                                 WARNING
3439 WARNING         You can disable this warning by specifying:             WARNING
3440 WARNING                                                                 WARNING
3441 WARNING               --disable-openssl-version-check                   WARNING
3442 WARNING                                                                 WARNING
3443 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3444 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3445 EOF
3446 fi
3447
3448 # Tell Emacs to edit this file in shell mode.
3449 # Local Variables:
3450 # mode: sh
3451 # End: