1 # Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 1998-2003 Internet Software Consortium.
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.
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.
18 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
21 AC_REVISION($Revision: 1.512.8.1 $)
23 AC_INIT(lib/dns/name.c)
26 AC_CONFIG_HEADER(config.h)
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.
40 lt_cv_sys_max_cmd_len=4096;
48 AC_SUBST(STD_CINCLUDES)
49 AC_SUBST(STD_CDEFINES)
50 AC_SUBST(STD_CWARNINGS)
53 # Warn if the user specified libbind, which is now deprecated
54 AC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
56 case "$enable_libbind" in
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.])
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.
70 AC_CONFIG_FILES([make/rules make/includes])
77 # The POSIX ln(1) program. Non-POSIX systems may substitute
78 # "copy" or something.
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.
95 AC_PATH_PROGS(ETAGS, etags emacs-etags)
98 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
99 # GNU emacs etags, and it requires the -L flag.
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
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.
117 AC_PATH_PROGS(PERL, perl5 perl)
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.
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
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
142 case "$sysconfdir" in
147 case "$localstatedir" in
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.
168 # Not all systems have dirname.
171 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
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"
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
186 # However, if the user sets $CC to be something, let that override
189 if test "X$CC" = "X" ; then
195 # Use Sun's cc if it is available, but watch
196 # out for /usr/ucb/cc; it will never be the right
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=.
209 if test -f "$ac_dir/cc"; then
230 # gcc's optimiser is broken at -02 for ultrasparc
232 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
241 # OS dependent CC flags
244 # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
245 # -D_XOPEN_SOURCE_EXTENDED.
247 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
248 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
250 #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
252 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
253 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
256 # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
258 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
259 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
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.
267 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
268 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
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>
284 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
285 AC_C_FLEXIBLE_ARRAY_MEMBER
288 # Older versions of HP/UX don't define seteuid() and setegid()
290 AC_CHECK_FUNCS(seteuid setresuid)
291 AC_CHECK_FUNCS(setegid setresgid)
294 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
295 # is reported to not support "static inline" (RT #1212).
297 AC_MSG_CHECKING(for static inline breakage)
302 static inline int foo1() {
306 static inline int foo2() {
311 AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
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)],
321 #include <sys/types.h>
322 #include <sys/socket.h>
323 int getsockname(int, struct sockaddr *, size_t *);
325 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
326 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
329 #include <sys/types.h>
330 #include <sys/socket.h>
332 AC_SUBST(ISC_SOCKADDR_LEN_T)
334 AC_MSG_CHECKING(for long long)
335 AC_TRY_COMPILE([],[long long i = 0; return (0);],
337 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
339 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
340 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
343 # check for GCC noreturn attribute
345 AC_MSG_CHECKING(for GCC noreturn attribute)
346 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
348 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
349 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
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)
357 # check if we have lifconf
359 AC_MSG_CHECKING(for struct lifconf)
361 #include <sys/types.h>
362 #include <sys/socket.h>
366 struct lifconf lifconf;
367 lifconf.lifc_len = 0;
371 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
373 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
374 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
377 # check if we have kqueue
379 AC_ARG_ENABLE(kqueue,
380 [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
381 want_kqueue="$enableval", want_kqueue="yes")
384 AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
385 case $ac_cv_have_kqueue in
387 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
390 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
395 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
398 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
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.
405 [ --enable-epoll use Linux epoll when available [[default=auto]]],
406 want_epoll="$enableval", want_epoll="auto")
409 AC_MSG_CHECKING(epoll support)
411 #include <sys/epoll.h>
413 if (epoll_create(1) < 0)
419 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
421 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
424 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
427 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
430 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
433 # check if we support /dev/poll
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
440 AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
441 ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
443 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
447 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
450 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
453 # check if we need to #include sys/select.h explicitly
455 case $ac_cv_header_unistd_h in
457 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
459 #include <sys/types.h> /* Ultrix */
460 #include <unistd.h>],
461 [fd_set read_set; return (0);],
463 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
464 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
466 case $ac_cv_header_sys_select_h in
468 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
469 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
472 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
478 case $ac_cv_header_sys_select_h in
480 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
481 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
484 AC_MSG_ERROR([need either unistd.h or sys/select.h])
489 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
490 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
493 # Find the machine's endian flavor.
499 # was --with-openssl specified?
502 AC_MSG_CHECKING(for OpenSSL library)
504 [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
505 (Required for DNSSEC)],
506 use_openssl="$withval", use_openssl="auto")
508 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
509 if test "$use_openssl" = "auto"
511 for d in $openssldirs
513 if test -f $d/include/openssl/opensslv.h
521 case "$use_openssl" in
535 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
536 If you don't want OpenSSL, use --without-openssl])
539 if test "$use_openssl" = "yes"
541 # User did not specify a path - guess it
542 for d in $openssldirs
544 if test -f $d/include/openssl/opensslv.h
550 if test "$use_openssl" = "yes"
552 AC_MSG_RESULT(not found)
554 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
556 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
558 AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
560 USE_OPENSSL='-DOPENSSL'
561 if test "$use_openssl" = "/usr"
564 DNS_OPENSSL_LIBS="-lcrypto"
566 DST_OPENSSL_INC="-I$use_openssl/include"
569 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
572 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
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.
582 if test -f "$use_openssl/lib/libcrypto.dylib"
584 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
586 DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
590 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
594 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
596 saved_cflags="$CFLAGS"
598 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
599 LIBS="$LIBS $DNS_OPENSSL_LIBS"
600 AC_MSG_CHECKING(whether linking with OpenSSL works)
602 #include <openssl/err.h>
608 [AC_MSG_RESULT(yes)],
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)])
616 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
618 #include <openssl/err.h>],
619 [ DSO_METHOD_dlfcn(); ],
623 #include <openssl/err.h>
624 ],[ DSO_METHOD_dlfcn(); ],
626 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
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)])
632 [AC_MSG_RESULT(assuming it does work on target platform)]
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
640 AC_MSG_CHECKING(OpenSSL library version)
643 #include <openssl/opensslv.h>
645 if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
646 OPENSSL_VERSION_NUMBER < 0x00908000L) ||
647 OPENSSL_VERSION_NUMBER >= 0x0090804fL)
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");
657 [AC_MSG_RESULT(not compatible)
660 [AC_MSG_RESULT(assuming target platform has compatible version)])
663 AC_MSG_RESULT(Skipped OpenSSL version check)
667 AC_MSG_CHECKING(for OpenSSL DSA support)
668 if test -f $use_openssl/include/openssl/dsa.h
670 AC_DEFINE(HAVE_OPENSSL_DSA)
675 AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
677 AC_MSG_CHECKING(for OpenSSL GOST support)
680 #include <openssl/conf.h>
681 #include <openssl/engine.h>
683 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
686 OPENSSL_config(NULL);
688 e = ENGINE_by_id("gost");
691 if (ENGINE_init(e) <= 0)
706 AC_DEFINE(HAVE_OPENSSL_GOST, 1,
707 [Define if your OpenSSL version supports GOST.])
712 CFLAGS="$saved_cflags"
714 OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
715 OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
721 # This would include the system openssl path (and linker options to use
722 # it as needed) if it is found.
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"
733 # Use OpenSSL for hash functions
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
741 if test "$USE_OPENSSL" = ""
743 AC_MSG_ERROR([No OpenSSL for hash functions])
745 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
746 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
749 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
753 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
754 AC_SUBST(ISC_OPENSSL_INC)
757 # PKCS11 (aka crypto hardware) support
759 # This works only with the right OpenSSL with PKCS11 engine!
762 AC_MSG_CHECKING(for PKCS11 support)
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")
768 case "$use_pkcs11" in
770 AC_MSG_RESULT(disabled)
775 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
776 USE_PKCS11='-DUSE_PKCS11'
781 AC_SUBST(PKCS11_TOOLS)
783 AC_MSG_CHECKING(for PKCS11 tools)
784 case "$use_pkcs11" in
786 AC_MSG_RESULT(disabled)
787 PKCS11_PROVIDER="undefined"
790 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
791 PKCS11_PROVIDER="$use_pkcs11"
794 AC_SUBST(PKCS11_PROVIDER)
796 AC_MSG_CHECKING(for GSSAPI library)
798 [ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
799 use_gssapi="$withval", use_gssapi="no")
801 gssapidirs="/usr/local /usr/pkg /usr/kerberos /usr"
802 if test "$use_gssapi" = "yes"
806 if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h
814 case "$use_gssapi" in
816 AC_MSG_RESULT(disabled)
820 AC_MSG_ERROR([--with-gssapi must specify a path])
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>"])
830 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
831 AC_MSG_ERROR([gssapi.h not found])
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>"])
837 AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
838 [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
840 if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
841 AC_MSG_ERROR([krb5.h not found])
844 CPPFLAGS="$saved_cppflags"
847 # XXXDCL This probably doesn't work right on all systems.
848 # It will need to be worked on as problems become evident.
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.
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.
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.
869 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
870 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
872 "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
873 "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
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"
885 LIBS="-L$use_gssapi/lib $TRY_LIBS"
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) ;;
896 case $gssapi_linked in
897 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
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
909 if test "$use_gssapi" = "/usr" -a \
910 -f /usr/local/lib/libkrb5.a; then
914 case "$FIX_KTH_VS_MIT" in
916 case "$enable_static_linking" in
917 yes) gssapi_lib_suffix=".a" ;;
918 *) gssapi_lib_suffix=".so" ;;
927 sed -e s%^-l%$use_gssapi/lib/lib% \
928 -e s%$%$gssapi_lib_suffix%`
929 NEW_LIBS="$NEW_LIBS $new_lib"
932 AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
940 DST_GSSAPI_INC="-I$use_gssapi/include"
941 DNS_GSSAPI_LIBS="$LIBS"
943 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
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)
954 AC_SUBST(DST_GSSAPI_INC)
955 AC_SUBST(DNS_GSSAPI_LIBS)
956 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
959 # Applications linking with libdns also need to link with these libraries.
962 AC_SUBST(DNS_CRYPTO_LIBS)
965 # was --with-randomdev specified?
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")
972 case "$use_randomdev" in
976 devrandom=/dev/arandom
979 devrandom=/dev/random
982 AC_MSG_RESULT($devrandom)
983 AC_CHECK_FILE($devrandom,
984 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
988 AC_MSG_ERROR([--with-randomdev must specify a path])
991 AC_MSG_RESULT(disabled)
994 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
995 AC_MSG_RESULT(using "$use_randomdev")
1000 # Do we have arc4random() ?
1002 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1004 sinclude(config.threads.in)dnl
1008 if test "X$GCC" = "Xyes"; then
1012 CCOPT="$CCOPT -pthread"
1013 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1017 CCOPT="$CCOPT -pthread"
1020 LIBS="$LIBS -lthread"
1023 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1030 CCOPT="$CCOPT -pthread"
1037 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1039 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
1041 CCOPT="$CCOPT -Kthread"
1045 CCOPT="$CCOPT -Kpthread"
1049 ALWAYS_DEFINES="-D_REENTRANT"
1050 ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
1051 THREADOPTOBJS='${THREADOPTOBJS}'
1052 THREADOPTSRCS='${THREADOPTSRCS}'
1055 # We'd like to use sigwait() too
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),))))
1066 AC_CHECK_FUNC(pthread_attr_getstacksize,
1067 AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1069 AC_CHECK_FUNC(pthread_attr_setstacksize,
1070 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1073 # Additional OS-specific issues related to pthreads and sigwait.
1077 # One more place to look for sigwait.
1080 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1082 *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1083 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1084 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1087 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1092 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1093 # called before certain pthreads calls. This is deprecated
1096 *-bsdi3.*|*-bsdi4.0*)
1097 AC_DEFINE(NEED_PTHREAD_INIT)
1100 # LinuxThreads requires some changes to the way we
1101 # deal with signals.
1104 AC_DEFINE(HAVE_LINUXTHREADS)
1107 # Ensure the right sigwait() semantics on Solaris and make
1108 # sure we call pthread_setconcurrency.
1111 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1112 AC_CHECK_FUNC(pthread_setconcurrency,
1113 AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1116 # UnixWare does things its own way.
1118 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1119 AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1124 # Look for sysconf to allow detection of the number of processors.
1126 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1129 ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1130 thread_dir=nothreads
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)
1144 # was --with-libxml2 specified?
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")
1151 case "$use_libxml2" in
1156 case X`(xml2-config --version) 2>/dev/null` in
1158 libxml2_libs=`xml2-config --libs`
1159 libxml2_cflags=`xml2-config --cflags`
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`
1175 if test "X$libxml2_libs" != "X"
1178 CFLAGS="$CFLAGS $libxml2_cflags"
1179 LIBS="$LIBS $libxml2_libs"
1180 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1186 # In solaris 10, SMF can manage named service
1188 AC_CHECK_LIB(scf, smf_enable_instance)
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
1195 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1196 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1199 # Indicate what the final decision was regarding threads.
1201 AC_MSG_CHECKING(whether to build with threads)
1202 if $use_threads; then
1209 # End of pthreads stuff.
1215 AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
1216 want_largefile="yes", want_largefile="no")
1217 case $want_largefile in
1219 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1226 # Additional compiler settings.
1230 IRIX_DNSSEC_WARNINGS_HACK=""
1232 if test "X$GCC" = "Xyes"; then
1233 AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1235 CFLAGS="$CFLAGS -fno-strict-aliasing"
1236 AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1238 if test "$FNOSTRICTALIASING" = "yes"; then
1240 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
1243 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1247 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
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
1268 # Turn off the pointlessly noisy warnings.
1269 STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1272 CCOPT="$CCOPT -Ae -z"
1273 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1274 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1277 STD_CWARNINGS="-fullwarn -woff 1209"
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.
1285 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1290 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1298 AC_SUBST(MKDEPCFLAGS)
1300 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1305 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1308 # -lxnet buys us one big porting headache... standards, gotta love 'em.
1310 # AC_CHECK_LIB(xnet, socket, ,
1311 # AC_CHECK_LIB(socket, socket)
1314 # Use this for now, instead:
1322 AC_CHECK_LIB(socket, socket)
1323 AC_CHECK_LIB(nsl, inet_addr)
1328 # Work around Solaris's select() limitations.
1331 *-solaris2.[[89]]|*-solaris2.1?)
1332 AC_DEFINE(FD_SETSIZE, 65536,
1333 [Solaris hack to get select_large_fdset.])
1340 AC_MSG_CHECKING(whether to use purify)
1342 [ --with-purify[=PATH] use Rational purify],
1343 use_purify="$withval", use_purify="no")
1345 case "$use_purify" in
1349 AC_PATH_PROG(purify_path, purify, purify)
1352 purify_path="$use_purify"
1356 case "$use_purify" in
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"
1367 AC_MSG_ERROR([$purify_path not found.
1369 Please choose the proper path with the following command:
1371 configure --with-purify=PATH
1380 AC_ARG_WITH(libtool,
1381 [ --with-libtool use GNU libtool],
1382 use_libtool="$withval", use_libtool="no")
1384 case $use_libtool in
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'
1394 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1397 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1398 *) LIBTOOL_IN_MAIN= ;;
1407 LIBTOOL_MODE_COMPILE=
1408 LIBTOOL_MODE_INSTALL=
1410 LIBTOOL_ALLOW_UNDEFINED=
1416 # enable/disable dumping stack backtrace. Also check if the system supports
1417 # glibc-compatible backtrace() function.
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
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])],)
1430 ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1433 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
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" = ""
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.])
1446 if test "$use_libtool" = "yes"; then
1447 AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
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
1454 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1455 MKSYMTBL_PROGRAM="$PERL"
1456 if test $want_symtable = all; then
1457 ALWAYS_MAKE_SYMTABLE="yes"
1461 if test $want_symtable = yes -o $want_symtable = all
1463 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1471 AC_SUBST(MKSYMTBL_PROGRAM)
1472 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1475 # File name extension for static archive files, for those few places
1476 # where they are treated differently from dynamic ones.
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)
1491 # build exportable DNS library?
1493 AC_ARG_ENABLE(exportlib,
1494 [ --enable-exportlib build exportable library (GNU make required)
1496 case "$enable_exportlib" in
1499 for x in gmake gnumake make; do
1500 if $x --version 2>/dev/null | grep GNU > /dev/null; then
1505 if test -z "$gmake"; then
1506 AC_MSG_ERROR([exportlib requires GNU make. Install it or disable the feature.])
1508 LIBEXPORT=lib/export
1510 BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
1513 BIND9_CO_RULE=".c.$O:"
1516 AC_SUBST(BIND9_CO_RULE)
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/"
1526 AC_SUBST(export_libdir)
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/"
1536 AC_SUBST(export_includedir)
1539 # Here begins a very long section to determine the system's networking
1540 # capabilities. The order of the tests is significant.
1547 [ --enable-ipv6 use IPv6 [default=autodetect]])
1549 case "$enable_ipv6" in
1551 AC_DEFINE(WANT_IPV6)
1558 # We do the IPv6 compilation checking after libtool so that we can put
1559 # the right suffix on the files.
1561 AC_MSG_CHECKING(for IPv6 structures)
1563 #include <sys/types.h>
1564 #include <sys/socket.h>
1565 #include <netinet/in.h>],
1566 [struct sockaddr_in6 sin6; return (0);],
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.
1576 AC_MSG_CHECKING(for Kame IPv6 support)
1578 [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
1579 use_kame="$withval", use_kame="no")
1585 kame_path=/usr/local/v6
1588 kame_path="$use_kame"
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"
1601 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1603 Please choose the proper path with the following command:
1605 configure --with-kame=PATH
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.
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>"
1627 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1628 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1629 isc_netinet6in6_hack=""
1635 # This is similar to the netinet6/in6.h issue.
1638 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
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>"
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=""
1654 # Now delve deeper into the suitability of the IPv6 support.
1656 case "$found_ipv6" in
1658 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1659 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1661 AC_MSG_CHECKING(for in6_addr)
1663 #include <sys/types.h>
1664 #include <sys/socket.h>
1665 #include <netinet/in.h>
1666 $isc_netinetin6_hack
1667 $isc_netinet6in6_hack
1669 [struct in6_addr in6; return (0);],
1671 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1672 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1673 isc_in_addr6_hack=""],
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"])
1679 AC_MSG_CHECKING(for in6addr_any)
1681 #include <sys/types.h>
1682 #include <sys/socket.h>
1683 #include <netinet/in.h>
1684 $isc_netinetin6_hack
1685 $isc_netinet6in6_hack
1688 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1690 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1691 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1693 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1694 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1696 AC_MSG_CHECKING(for in6addr_loopback)
1698 #include <sys/types.h>
1699 #include <sys/socket.h>
1700 #include <netinet/in.h>
1701 $isc_netinetin6_hack
1702 $isc_netinet6in6_hack
1705 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1707 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1708 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1710 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1711 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1713 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1715 #include <sys/types.h>
1716 #include <sys/socket.h>
1717 #include <netinet/in.h>
1718 $isc_netinetin6_hack
1719 $isc_netinet6in6_hack
1721 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1723 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1724 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1726 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1727 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1728 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1730 AC_MSG_CHECKING(for in6_pktinfo)
1732 #include <sys/types.h>
1733 #include <sys/socket.h>
1734 #include <netinet/in.h>
1735 $isc_netinetin6_hack
1736 $isc_netinet6in6_hack
1738 [struct in6_pktinfo xyzzy; return (0);],
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"])
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"
1753 ISC_IPV6_O="ipv6.$O"
1754 ISC_ISCIPV6_O="unix/ipv6.$O"
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)
1780 AC_MSG_CHECKING([for struct if_laddrreq])
1782 #include <sys/types.h>
1783 #include <net/if6.h>
1784 ],[ struct if_laddrreq a; ],
1786 ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1788 ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1789 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1791 AC_MSG_CHECKING([for struct if_laddrconf])
1793 #include <sys/types.h>
1794 #include <net/if6.h>
1795 ],[ struct if_laddrconf a; ],
1797 ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1799 ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1800 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
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.
1809 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1811 #include <sys/types.h>
1812 #include <sys/socket.h>
1813 #include <netinet/in.h>
1814 #include <arpa/inet.h>
1816 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1818 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
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"])
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.
1834 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
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)); }],
1844 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
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"])
1858 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1859 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1862 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1866 # Turn on 4.4BSD style sa_len support.
1867 AC_DEFINE(_SOCKADDR_LEN)
1871 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1873 #include <sys/types.h>
1874 #include <sys/socket.h>],
1875 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1877 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1878 LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
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)
1886 # Look for a 4.4BSD or 4.3BSD struct msghdr
1888 AC_MSG_CHECKING(for struct msghdr flavor)
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)
1900 # Look for in_port_t.
1902 AC_MSG_CHECKING(for type in_port_t)
1904 #include <sys/types.h>
1905 #include <netinet/in.h>],
1906 [in_port_t port = 25; return (0);],
1908 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1910 ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1911 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1914 # Check for addrinfo
1916 AC_MSG_CHECKING(for struct addrinfo)
1918 #include <netdb.h>],
1919 [struct addrinfo a; return (0);],
1921 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1922 ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
1923 AC_DEFINE(HAVE_ADDRINFO)],
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)
1931 # Check for rrsetinfo
1933 AC_MSG_CHECKING(for struct rrsetinfo)
1935 #include <netdb.h>],
1936 [struct rrsetinfo r; return (0);],
1938 ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1940 ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1941 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1943 AC_MSG_CHECKING(for int sethostent)
1945 #include <netdb.h>],
1946 [int i = sethostent(0); return(0);],
1948 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1950 ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1951 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
1953 AC_MSG_CHECKING(for int endhostent)
1955 #include <netdb.h>],
1956 [int i = endhostent(); return(0);],
1958 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1960 ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1961 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1963 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1966 struct netent *getnetbyaddr(in_addr_t, int);],
1969 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1971 ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1972 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1974 AC_MSG_CHECKING(for int setnetent)
1976 #include <netdb.h>],
1977 [int i = setnetent(0); return(0);],
1979 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1981 ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1982 AC_SUBST(ISC_LWRES_SETNETENTINT)
1984 AC_MSG_CHECKING(for int endnetent)
1986 #include <netdb.h>],
1987 [int i = endnetent(); return(0);],
1989 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1991 ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1992 AC_SUBST(ISC_LWRES_ENDNETENTINT)
1994 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1997 struct hostent *gethostbyaddr(const void *, size_t, int);],
2000 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
2002 ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
2003 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
2005 AC_MSG_CHECKING(for h_errno in netdb.h)
2007 #include <netdb.h>],
2008 [h_errno = 1; return(0);],
2010 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
2012 ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
2013 AC_SUBST(ISC_LWRES_NEEDHERRNO)
2016 # Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
2017 # known variations here:
2019 AC_MSG_CHECKING(for getnameinfo prototype definitions)
2021 #include <sys/types.h>
2022 #include <sys/socket.h>
2024 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2025 socklen_t, char *, socklen_t, unsigned int);],
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).])],
2033 #include <sys/types.h>
2034 #include <sys/socket.h>
2036 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2037 size_t, char *, size_t, int);],
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)])])
2047 # ...and same for gai_strerror().
2049 AC_MSG_CHECKING(for gai_strerror prototype definitions)
2051 #include <sys/types.h>
2052 #include <sys/socket.h>
2054 char *gai_strerror(int ecode);],
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 *])])
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)
2078 AC_ARG_ENABLE(getifaddrs,
2079 [ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].],
2080 want_getifaddrs="$enableval", want_getifaddrs="yes")
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
2087 case $want_getifaddrs in
2089 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2090 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2093 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2100 # Look for a sysctl call to get the list of network interfaces.
2102 case $ac_cv_header_sys_sysctl_h in
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
2114 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2115 [AC_MSG_RESULT(no)])
2120 # Check for some other useful functions that are not ever-present.
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)
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)
2140 AC_CHECK_FUNC(strtoul,
2141 [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2142 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
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)
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)
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)
2163 AC_MSG_CHECKING(sprintf)
2167 [ char buf[2]; return(*sprintf(buf,"x"));],
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"
2174 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2175 LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2177 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2178 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
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"
2192 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2194 AC_SUBST(ISC_EXTRA_OBJS)
2195 AC_SUBST(ISC_EXTRA_SRCS)
2198 # Use our own SPNEGO implementation?
2200 AC_ARG_ENABLE(isc-spnego,
2201 [ --disable-isc-spnego use SPNEGO from GSSAPI library])
2203 if test -n "$USE_GSSAPI"
2205 case "$enable_isc_spnego" in
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)
2213 AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2218 AC_SUBST(USE_ISC_SPNEGO)
2220 AC_SUBST(DST_EXTRA_OBJS)
2221 AC_SUBST(DST_EXTRA_SRCS)
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".
2230 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2231 # %ld even for (long long)/
2233 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2234 # configure on Win32.
2236 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2240 long long int j = 0;
2243 sprintf(buf, "%lld", j);
2244 exit((sizeof(long long int) != sizeof(long int))? 0 :
2245 (strcmp(buf, "0") != 0));
2249 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2250 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
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)
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
2269 AC_CHECK_FUNCS(chroot)
2274 AC_ARG_ENABLE(linux-caps,
2275 [ --disable-linux-caps disable linux capabilities])
2276 case "$enable_linux_caps" in
2278 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
2279 AC_CHECK_LIB(cap, cap_set_proc)
2284 AC_CHECK_HEADERS(sys/prctl.h)
2286 AC_CHECK_HEADERS(sys/un.h,
2287 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2289 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2291 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2295 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2296 [Define if connect does not honour the permission on the UNIX domain socket.])
2299 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2300 [Define if connect does not honour the permission on the UNIX domain socket.])
2307 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2309 AC_MSG_CHECKING(for optarg declaration)
2314 [AC_MSG_RESULT(yes)],
2316 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2317 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2320 # BSD/OS, and perhaps some others, don't define rlim_t.
2322 AC_MSG_CHECKING(for type rlim_t)
2324 #include <sys/types.h>
2325 #include <sys/time.h>
2326 #include <sys/resource.h>],
2327 [rlim_t rl = 19671212; return (0);],
2329 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2332 AC_MSG_CHECKING(type of rlim_cur)
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)));}],
2339 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
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"],
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)])
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)])
2363 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2366 # Older HP-UX doesn't have gettune
2370 AC_CHECK_HEADERS(sys/dyntune.h)
2378 # Compaq TruCluster requires more code for handling cluster IP aliases
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]))
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().
2397 AC_DEFINE(BROKEN_RECVMSG, 1,
2398 [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2403 # Microsoft has their own way of handling shared libraries that requires
2404 # additional qualifiers on extern variables. Unix systems don't need it.
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"
2414 # Random remaining OS-specific issues involving compiler warnings.
2415 # XXXDCL print messages to indicate some compensation is being done?
2417 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2418 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2422 hack_shutup_pthreadonceinit=yes
2425 hack_shutup_sputaux=yes
2428 hack_shutup_sigwait=yes
2429 hack_shutup_sputaux=yes
2432 hack_shutup_stdargcast=yes
2435 hack_shutup_pthreadonceinit=yes
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], )
2442 case "$hack_shutup_pthreadonceinit" in
2445 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2447 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2451 case "$hack_shutup_sigwait" in
2454 # Shut up a -Wmissing-prototypes warning for sigwait().
2456 AC_DEFINE(SHUTUP_SIGWAIT)
2460 case "$hack_shutup_sputaux" in
2463 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2465 AC_DEFINE(SHUTUP_SPUTAUX)
2469 case "$hack_shutup_stdargcast" in
2472 # Shut up a -Wcast-qual warning from va_start().
2474 AC_DEFINE(SHUTUP_STDARG_CAST)
2478 AC_CHECK_HEADERS(strings.h,
2479 ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2481 ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2483 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2486 # Check for if_nametoindex() for IPv6 scoped addresses support
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
2494 AC_CHECK_LIB(ipv6, if_nametoindex,
2495 ac_cv_have_if_nametoindex=yes
2496 LIBS="-lipv6 $LIBS",)
2500 case $ac_cv_have_if_nametoindex in
2502 ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2505 ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2508 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2510 AC_CHECK_FUNCS(nanosleep)
2513 # Machine architecture dependent features
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
2524 if test "X$GCC" = "Xyes"; then
2525 AC_MSG_CHECKING([if asm("isc"); works])
2527 main() { asm("ics"); exit(0); }
2532 saved_cflags="$CFLAGS"
2533 CFLAGS="$CFLAGS -Wa,-many"
2535 main() { asm("ics"); exit(0); }
2537 [AC_MSG_RESULT([yes, required -Wa,-many])
2539 [AC_MSG_RESULT([no, use_atomic disabled])
2540 CFLAGS="$saved_cflags"
2542 [AC_MSG_RESULT([cross compile, assume yes])
2543 CFLAGS="$saved_cflags"
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
2568 # XXX: some old x86 architectures actually do not support
2569 # (some of) these operations. Do we need stricter checks?
2572 exit((sizeof(void *) == 8) ? 0 : 1);
2583 exit((sizeof(void *) == 8) ? 0 : 1);
2595 powerpc-*|powerpc64-*)
2598 mips-*|mipsel-*|mips64-*|mips64el-*)
2609 AC_MSG_RESULT($arch)
2612 if test "$have_atomic" = "yes"; then
2613 AC_MSG_CHECKING([compiler support for inline assembly code])
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
2620 if test $arch = "x86_64"; then
2621 # We can share the same code for gcc with x86_32
2624 if test $arch = "powerpc"; then
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.
2630 AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2632 __asm__ volatile ("li r0, 0x0\n"::);
2636 ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2637 ], [AC_MSG_RESULT(no)])
2642 # Tru64 compiler has its own syntax for inline
2646 #error "unexpected compiler"
2658 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2661 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2668 # See if the generic __asm function works. If not,
2669 # we need to disable the atomic operations.
2673 [compiler="standard"
2674 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2675 [compiler="not supported (atomic operations disabled)"
2681 AC_MSG_RESULT($compiler)
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"
2689 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2690 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2691 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2694 if test "$have_xaddq" = "yes"; then
2695 ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
2697 ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
2700 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2701 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
2702 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2703 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2705 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2706 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2707 AC_SUBST(ISC_PLATFORM_USESTDASM)
2708 AC_SUBST(ISC_PLATFORM_USEMACASM)
2711 AC_SUBST(ISC_ARCH_DIR)
2714 # Activate "rrset-order fixed" or not?
2716 AC_ARG_ENABLE(fixed-rrset,
2717 [ --enable-fixed-rrset enable fixed rrset ordering
2719 enable_fixed="$enableval",
2721 case "$enable_fixed" in
2723 AC_DEFINE(DNS_RDATASET_FIXED, 1,
2724 [Define to enable "rrset-order fixed" syntax.])
2733 # Enable response policy rewriting using NS IP addresses
2735 AC_ARG_ENABLE(rpz-nsip,
2736 [ --enable-rpz-nsip enable rpz-nsip rules [[default=no]]],
2737 enable_nsip="$enableval",
2739 case "$enable_nsip" in
2741 AC_DEFINE(ENABLE_RPZ_NSIP, 1,
2742 [Define to enable rpz-nsip rules.])
2751 # Enable response policy rewriting using NS name
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
2759 AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
2760 [Define to enable rpz-nsdname rules.])
2769 # Activate "filter-aaaa-on-v4" or not?
2771 AC_ARG_ENABLE(filter-aaaa,
2772 [ --enable-filter-aaaa enable filtering of AAAA records over IPv4
2774 enable_filter="$enableval",
2776 case "$enable_filter" in
2778 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
2779 [Define to enable the "filter-aaaa-on-v4" option.])
2788 # The following sets up how non-blocking i/o is established.
2789 # Sunos, cygwin and solaris 2.x (x<5) require special handling.
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.])
2799 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2800 [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2804 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2805 # This prevents the source address being set.
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.])
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.
2823 AC_PATH_PROGS(LATEX, latex, latex)
2826 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2833 AC_PATH_PROGS(W3M, w3m, w3m)
2837 # Look for xsltproc (libxslt)
2840 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2844 # Look for xmllint (libxml2)
2847 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2854 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
2858 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2859 # in a number of directories:
2861 # NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
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.
2870 AC_DEFUN(NOM_PATH_FILE, [
2872 AC_MSG_CHECKING(for $2)
2883 if test "X[$]$1" = "X"
2885 AC_MSG_RESULT("not found");
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).
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
2904 docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2907 docbook_xsl_trees="$withval"
2908 AC_MSG_RESULT($docbook_xsl_trees)
2913 # Look for stylesheets we need.
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)
2927 # Same dance for db2latex
2929 # No idea where this lives except on FreeBSD.
2932 db2latex_xsl_trees="/usr/local/share"
2935 # Look for stylesheets we need.
2938 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
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.
2945 AC_MSG_CHECKING(for db2latex/xsl/figures)
2946 for d in $db2latex_xsl_trees
2948 dd=$d/db2latex/xsl/figures
2951 XSLT_DB2LATEX_ADMONITIONS=$dd
2956 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2958 AC_MSG_RESULT(not found)
2959 XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2961 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2967 [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
2968 use_idn="$withval", use_idn="no")
2971 if test X$prefix = XNONE ; then
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
2991 if test X$prefix = XNONE ; then
2992 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2994 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
3001 iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
3006 [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
3007 iconvlib="$withval")
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.])
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"
3031 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
3036 AC_CHECK_HEADERS(locale.h)
3037 AC_CHECK_FUNCS(setlocale)
3042 AC_SUBST(BIND9_TOP_BUILDDIR)
3043 BIND9_TOP_BUILDDIR=`pwd`
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"
3059 BIND9_ISC_BUILDINCLUDE=""
3060 BIND9_ISCCC_BUILDINCLUDE=""
3061 BIND9_ISCCFG_BUILDINCLUDE=""
3062 BIND9_DNS_BUILDINCLUDE=""
3063 BIND9_LWRES_BUILDINCLUDE=""
3064 BIND9_BIND9_BUILDINCLUDE=""
3067 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
3068 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
3070 AC_SUBST_FILE(BIND9_MAKE_RULES)
3071 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
3074 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}"
3075 AC_SUBST(BIND9_VERSION)
3077 if test -z "$ac_configure_args"; then
3078 BIND9_CONFIGARGS="defaults"
3080 for a in $ac_configure_args
3082 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
3085 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
3086 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
3087 AC_SUBST(BIND9_CONFIGARGS)
3089 AC_SUBST_FILE(LIBISC_API)
3090 LIBISC_API=$srcdir/lib/isc/api
3092 AC_SUBST_FILE(LIBISCCC_API)
3093 LIBISCCC_API=$srcdir/lib/isccc/api
3095 AC_SUBST_FILE(LIBISCCFG_API)
3096 LIBISCCFG_API=$srcdir/lib/isccfg/api
3098 AC_SUBST_FILE(LIBDNS_API)
3099 LIBDNS_API=$srcdir/lib/dns/api
3101 AC_SUBST_FILE(LIBBIND9_API)
3102 LIBBIND9_API=$srcdir/lib/bind9/api
3104 AC_SUBST_FILE(LIBLWRES_API)
3105 LIBLWRES_API=$srcdir/lib/lwres/api
3107 AC_SUBST_FILE(LIBIRS_API)
3108 LIBIRS_API=$srcdir/lib/irs/api
3111 # Configure any DLZ drivers.
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.
3117 # This section has to come after the libtool stuff because it needs to
3118 # know how to name the driver object files.
3122 DLZ_DRIVER_INCLUDES=""
3128 sinclude(contrib/dlz/config.dlz.in)
3130 AC_MSG_CHECKING(for DLZ)
3132 if test -n "$USE_DLZ"
3135 USE_DLZ="-DDLZ $USE_DLZ"
3136 DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3137 AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3140 DLZ_DRIVER_RULES=/dev/null
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)
3151 if test "$cross_compiling" = "yes"; then
3152 if test -z "$BUILD_CC"; then
3153 AC_ERROR([BUILD_CC not set])
3155 BUILD_CFLAGS="$BUILD_CFLAGS"
3156 BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3157 BUILD_LDFLAGS="$BUILD_LDFLAGS"
3158 BUILD_LIBS="$BUILD_LIBS"
3161 BUILD_CFLAGS="$CFLAGS"
3162 BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3163 BUILD_LDFLAGS="$LDFLAGS"
3168 for e in $BUILD_LDFLAGS ; do
3173 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3174 NEWFLAGS="$NEWFLAGS $e $ee"
3177 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3178 NEWFLAGS="$NEWFLAGS $e $ee"
3181 ee=`echo $e | sed -e 's%^-L%-R%'`
3182 NEWFLAGS="$NEWFLAGS $e $ee"
3185 NEWFLAGS="$NEWFLAGS $e"
3190 NEWFLAGS="$NEWFLAGS $e"
3194 BUILD_LDFLAGS="$NEWFLAGS"
3197 for e in $DNS_GSSAPI_LIBS ; do
3202 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3203 NEWFLAGS="$NEWFLAGS $e $ee"
3206 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3207 NEWFLAGS="$NEWFLAGS $e $ee"
3210 ee=`echo $e | sed -e 's%^-L%-R%'`
3211 NEWFLAGS="$NEWFLAGS $e $ee"
3214 NEWFLAGS="$NEWFLAGS $e"
3219 NEWFLAGS="$NEWFLAGS $e"
3223 DNS_GSSAPI_LIBS="$NEWFLAGS"
3226 for e in $DNS_CRYPTO_LIBS ; do
3231 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3232 NEWFLAGS="$NEWFLAGS $e $ee"
3235 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3236 NEWFLAGS="$NEWFLAGS $e $ee"
3239 ee=`echo $e | sed -e 's%^-L%-R%'`
3240 NEWFLAGS="$NEWFLAGS $e $ee"
3243 NEWFLAGS="$NEWFLAGS $e"
3248 NEWFLAGS="$NEWFLAGS $e"
3252 DNS_CRYPTO_LIBS="$NEWFLAGS"
3255 AC_SUBST(BUILD_CFLAGS)
3256 AC_SUBST(BUILD_CPPFLAGS)
3257 AC_SUBST(BUILD_LDFLAGS)
3258 AC_SUBST(BUILD_LIBS)
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).
3268 [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
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.
3282 bin/confgen/Makefile
3283 bin/confgen/unix/Makefile
3287 bin/named/unix/Makefile
3288 bin/nsupdate/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
3316 contrib/check-secure-delegation.pl
3317 contrib/zone-edit.sh
3320 doc/doxygen/Doxyfile
3321 doc/doxygen/Makefile
3322 doc/doxygen/doxygen-input-filter
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
3332 lib/bind9/include/Makefile
3333 lib/bind9/include/bind9/Makefile
3335 lib/dns/include/Makefile
3336 lib/dns/include/dns/Makefile
3337 lib/dns/include/dst/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
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
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
3381 lib/isccc/include/Makefile
3382 lib/isccc/include/isccc/Makefile
3384 lib/isccfg/include/Makefile
3385 lib/isccfg/include/isccfg/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
3396 lib/tests/include/Makefile
3397 lib/tests/include/tests/Makefile
3407 # Now that the Makefiles exist we can ensure that everything is rebuilt.
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
3418 if test "X$USE_OPENSSL" = "X"; then
3420 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
3424 if test "X$OPENSSL_WARNING" != "X"; then
3426 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3427 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 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
3433 WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
3434 WARNING CVE-2006-2940. WARNING
3436 WARNING It is recommended that you upgrade to OpenSSL WARNING
3437 WARNING version 0.9.8d/0.9.7l (or greater). WARNING
3439 WARNING You can disable this warning by specifying: WARNING
3441 WARNING --disable-openssl-version-check WARNING
3443 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3444 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3448 # Tell Emacs to edit this file in shell mode.