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.12 $)
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"
271 # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
272 # Setting this is sufficient to select the correct behavior for BIND 9.
275 STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
276 CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
282 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,,,
283 [$ac_includes_default
284 #ifdef HAVE_SYS_PARAM_H
285 # include <sys/param.h>
292 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
293 AC_C_FLEXIBLE_ARRAY_MEMBER
296 # Older versions of HP/UX don't define seteuid() and setegid()
298 AC_CHECK_FUNCS(seteuid setresuid)
299 AC_CHECK_FUNCS(setegid setresgid)
302 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
303 # is reported to not support "static inline" (RT #1212).
305 AC_MSG_CHECKING(for static inline breakage)
310 static inline int foo1() {
314 static inline int foo2() {
319 AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
322 AC_CHECK_TYPE(ssize_t, int)
323 AC_CHECK_TYPE(uintptr_t,unsigned long)
324 AC_CHECK_TYPE(socklen_t,
325 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
329 #include <sys/types.h>
330 #include <sys/socket.h>
331 int getsockname(int, struct sockaddr *, size_t *);
333 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
334 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
337 #include <sys/types.h>
338 #include <sys/socket.h>
340 AC_SUBST(ISC_SOCKADDR_LEN_T)
342 AC_MSG_CHECKING(for long long)
343 AC_TRY_COMPILE([],[long long i = 0; return (0);],
345 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
347 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
348 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
351 # check for GCC noreturn attribute
353 AC_MSG_CHECKING(for GCC noreturn attribute)
354 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
356 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
357 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
359 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
360 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
361 AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
362 AC_SUBST(ISC_PLATFORM_NORETURN_POST)
365 # check if we have lifconf
367 AC_MSG_CHECKING(for struct lifconf)
369 #include <sys/types.h>
370 #include <sys/socket.h>
374 struct lifconf lifconf;
375 lifconf.lifc_len = 0;
379 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
381 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
382 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
385 # check if we have kqueue
387 AC_ARG_ENABLE(kqueue,
388 [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
389 want_kqueue="$enableval", want_kqueue="yes")
392 AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
393 case $ac_cv_have_kqueue in
395 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
398 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
403 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
406 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
409 # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
410 # so we need to try running the code, not just test its existence.
413 [ --enable-epoll use Linux epoll when available [[default=auto]]],
414 want_epoll="$enableval", want_epoll="auto")
417 AC_MSG_CHECKING(epoll support)
419 #include <sys/epoll.h>
421 if (epoll_create(1) < 0)
427 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
429 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
432 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
435 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
438 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
441 # check if we support /dev/poll
443 AC_ARG_ENABLE(devpoll,
444 [ --enable-devpoll use /dev/poll when available [[default=yes]]],
445 want_devpoll="$enableval", want_devpoll="yes")
446 case $want_devpoll in
448 AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
449 ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
451 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
455 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
458 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
461 # check if we need to #include sys/select.h explicitly
463 case $ac_cv_header_unistd_h in
465 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
467 #include <sys/types.h> /* Ultrix */
468 #include <unistd.h>],
469 [fd_set read_set; return (0);],
471 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
472 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
474 case $ac_cv_header_sys_select_h in
476 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
477 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
480 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
486 case $ac_cv_header_sys_select_h in
488 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
489 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
492 AC_MSG_ERROR([need either unistd.h or sys/select.h])
497 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
498 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
501 # Find the machine's endian flavor.
507 # was --with-openssl specified?
510 AC_MSG_CHECKING(for OpenSSL library)
512 [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
513 (Required for DNSSEC)],
514 use_openssl="$withval", use_openssl="auto")
516 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
517 if test "$use_openssl" = "auto"
519 for d in $openssldirs
521 if test -f $d/include/openssl/opensslv.h
529 case "$use_openssl" in
543 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
544 If you don't want OpenSSL, use --without-openssl])
547 if test "$use_openssl" = "yes"
549 # User did not specify a path - guess it
550 for d in $openssldirs
552 if test -f $d/include/openssl/opensslv.h
558 if test "$use_openssl" = "yes"
560 AC_MSG_RESULT(not found)
562 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
564 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
566 AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
568 USE_OPENSSL='-DOPENSSL'
569 if test "$use_openssl" = "/usr"
572 DNS_OPENSSL_LIBS="-lcrypto"
574 DST_OPENSSL_INC="-I$use_openssl/include"
577 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
580 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
584 # Apple's ld seaches for serially for dynamic
585 # then static libraries. This means you can't
586 # use -L to override dynamic system libraries
587 # with static ones when linking. Instead
588 # we specify a absolute path.
590 if test -f "$use_openssl/lib/libcrypto.dylib"
592 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
594 DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
598 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
602 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
604 saved_cflags="$CFLAGS"
606 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
607 LIBS="$LIBS $DNS_OPENSSL_LIBS"
608 AC_MSG_CHECKING(whether linking with OpenSSL works)
610 #include <openssl/err.h>
616 [AC_MSG_RESULT(yes)],
618 AC_MSG_ERROR(Could not run test program using OpenSSL from
619 $use_openssl/lib and $use_openssl/include.
620 Please check the argument to --with-openssl and your
621 shared library configuration (e.g., LD_LIBRARY_PATH).)],
622 [AC_MSG_RESULT(assuming it does work on target platform)])
624 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
626 #include <openssl/err.h>],
627 [ DSO_METHOD_dlfcn(); ],
631 #include <openssl/err.h>
632 ],[ DSO_METHOD_dlfcn(); ],
634 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
636 [AC_MSG_RESULT(unknown)
637 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
638 [AC_MSG_RESULT(assuming it does work on target platform)])
640 [AC_MSG_RESULT(assuming it does work on target platform)]
643 AC_ARG_ENABLE(openssl-version-check,
644 [AC_HELP_STRING([--enable-openssl-version-check],
645 [Check OpenSSL Version @<:@default=yes@:>@])])
646 case "$enable_openssl_version_check" in
648 AC_MSG_CHECKING(OpenSSL library version)
651 #include <openssl/opensslv.h>
653 if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
654 OPENSSL_VERSION_NUMBER < 0x00908000L) ||
655 OPENSSL_VERSION_NUMBER >= 0x0090804fL)
657 printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
658 OPENSSL_VERSION_NUMBER);
659 printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
660 "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
665 [AC_MSG_RESULT(not compatible)
668 [AC_MSG_RESULT(assuming target platform has compatible version)])
671 AC_MSG_RESULT(Skipped OpenSSL version check)
675 AC_MSG_CHECKING(for OpenSSL DSA support)
676 if test -f $use_openssl/include/openssl/dsa.h
678 AC_DEFINE(HAVE_OPENSSL_DSA)
683 AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
685 AC_MSG_CHECKING(for OpenSSL GOST support)
688 #include <openssl/conf.h>
689 #include <openssl/engine.h>
691 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
696 OPENSSL_config(NULL);
698 e = ENGINE_by_id("gost");
701 if (ENGINE_init(e) <= 0)
713 [AC_MSG_RESULT(using --with-gost)])
714 AC_ARG_WITH(gost, , with_gost="$withval", with_gost="auto")
718 no) AC_MSG_ERROR([gost not supported]) ;;
727 *) AC_MSG_ERROR([need --with-gost=[[yes or no]]]) ;;
734 AC_DEFINE(HAVE_OPENSSL_GOST, 1,
735 [Define if your OpenSSL version supports GOST.])
740 CFLAGS="$saved_cflags"
742 OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
743 OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
749 # This would include the system openssl path (and linker options to use
750 # it as needed) if it is found.
753 AC_SUBST(USE_OPENSSL)
754 AC_SUBST(DST_OPENSSL_INC)
755 AC_SUBST(OPENSSLLINKOBJS)
756 AC_SUBST(OPENSSLLINKSRCS)
757 AC_SUBST(OPENSSL_GOST)
758 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
761 # Use OpenSSL for hash functions
764 AC_ARG_ENABLE(openssl-hash,
765 [ --enable-openssl-hash use OpenSSL for hash functions [[default=no]]],
766 want_openssl_hash="$enableval", want_openssl_hash="no")
767 case $want_openssl_hash in
769 if test "$USE_OPENSSL" = ""
771 AC_MSG_ERROR([No OpenSSL for hash functions])
773 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
774 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
777 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
781 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
782 AC_SUBST(ISC_OPENSSL_INC)
785 # PKCS11 (aka crypto hardware) support
787 # This works only with the right OpenSSL with PKCS11 engine!
790 AC_MSG_CHECKING(for PKCS11 support)
792 [ --with-pkcs11[=PATH] Build with PKCS11 support [yes|no|path]
793 (PATH is for the PKCS11 provider)],
794 use_pkcs11="$withval", use_pkcs11="no")
796 case "$use_pkcs11" in
798 AC_MSG_RESULT(disabled)
803 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
804 USE_PKCS11='-DUSE_PKCS11'
809 AC_SUBST(PKCS11_TOOLS)
811 AC_MSG_CHECKING(for PKCS11 tools)
812 case "$use_pkcs11" in
814 AC_MSG_RESULT(disabled)
815 PKCS11_PROVIDER="undefined"
818 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
819 PKCS11_PROVIDER="$use_pkcs11"
822 AC_SUBST(PKCS11_PROVIDER)
824 AC_MSG_CHECKING(for GSSAPI library)
826 [ --with-gssapi=PATH Specify path for system-supplied GSSAPI [[default=yes]]],
827 use_gssapi="$withval", use_gssapi="yes")
829 # gssapi is just the framework, we really require kerberos v5, so
830 # look for those headers (the gssapi headers must be there, too)
831 # The problem with this implementation is that it doesn't allow
832 # for the specification of gssapi and krb5 headers in different locations,
833 # which probably ought to be fixed although fixing might raise the issue of
834 # trying to build with incompatible versions of gssapi and krb5.
835 if test "$use_gssapi" = "yes"
837 # first, deal with the obvious
838 if test \( -f /usr/include/kerberosv5/krb5.h -o \
839 -f /usr/include/krb5/krb5.h -o \
840 -f /usr/include/krb5.h \) -a \
841 \( -f /usr/include/gssapi.h -o \
842 -f /usr/include/gssapi/gssapi.h \)
846 krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
849 if test -f $d/include/gssapi/gssapi_krb5.h -o \
852 if test -f $d/include/gssapi/gssapi.h -o \
853 -f $d/include/gssapi.h
864 case "$use_gssapi" in
866 AC_MSG_RESULT(disabled)
870 AC_MSG_ERROR([--with-gssapi must specify a path])
873 AC_MSG_RESULT(looking in $use_gssapi/lib)
874 USE_GSSAPI='-DGSSAPI'
875 saved_cppflags="$CPPFLAGS"
876 CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
877 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
878 [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
880 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
881 AC_MSG_ERROR([gssapi.h not found])
884 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
885 [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"])
887 AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
888 [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
890 if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
891 AC_MSG_ERROR([krb5.h not found])
894 CPPFLAGS="$saved_cppflags"
897 # XXXDCL This probably doesn't work right on all systems.
898 # It will need to be worked on as problems become evident.
900 # Essentially the problems here relate to two different
901 # areas. The first area is building with either KTH
902 # or MIT Kerberos, particularly when both are present on
903 # the machine. The other is static versus dynamic linking.
905 # On the KTH vs MIT issue, Both have libkrb5 that can mess
906 # up the works if one implementation ends up trying to
907 # use the other's krb. This is unfortunately a situation
908 # that very easily arises.
910 # Dynamic linking when the dependency information is built
911 # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
912 # all such problems go away, but when that setup is not
913 # present, because either the dynamic libraries lack
914 # dependencies or static linking is being done, then the
915 # problems start to show up.
919 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
920 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
922 "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
923 "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
926 # Note that this does not include $saved_libs, because
927 # on FreeBSD machines this configure script has added
928 # -L/usr/local/lib to LIBS, which can make the
929 # -lgssapi_krb5 test succeed with shared libraries even
930 # when you are trying to build with KTH in /usr/lib.
931 if test "$use_gssapi" = "/usr"
935 LIBS="-L$use_gssapi/lib $TRY_LIBS"
937 AC_MSG_CHECKING(linking as $TRY_LIBS)
938 AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
939 gssapi_linked=yes, gssapi_linked=no)
940 case $gssapi_linked in
941 yes) AC_MSG_RESULT(yes); break ;;
942 no) AC_MSG_RESULT(no) ;;
946 case $gssapi_linked in
947 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
951 # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
952 # but MIT in /usr/local/lib and trying to build with KTH.
953 # /usr/local/lib can end up earlier on the link lines.
954 # Like most kludges, this one is not only inelegant it
955 # is also likely to be the wrong thing to do at least as
956 # many times as it is the right thing. Something better
959 if test "$use_gssapi" = "/usr" -a \
960 -f /usr/local/lib/libkrb5.a; then
964 case "$FIX_KTH_VS_MIT" in
966 case "$enable_static_linking" in
967 yes) gssapi_lib_suffix=".a" ;;
968 *) gssapi_lib_suffix=".so" ;;
977 sed -e s%^-l%$use_gssapi/lib/lib% \
978 -e s%$%$gssapi_lib_suffix%`
979 NEW_LIBS="$NEW_LIBS $new_lib"
982 AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
990 DST_GSSAPI_INC="-I$use_gssapi/include"
991 DNS_GSSAPI_LIBS="$LIBS"
993 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
998 AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
999 AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
1000 AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
1001 AC_SUBST(ISC_PLATFORM_KRB5HEADER)
1003 AC_SUBST(USE_GSSAPI)
1004 AC_SUBST(DST_GSSAPI_INC)
1005 AC_SUBST(DNS_GSSAPI_LIBS)
1006 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
1009 # Applications linking with libdns also need to link with these libraries.
1012 AC_SUBST(DNS_CRYPTO_LIBS)
1015 # was --with-randomdev specified?
1017 AC_MSG_CHECKING(for random device)
1018 AC_ARG_WITH(randomdev,
1019 [ --with-randomdev=PATH Specify path for random device],
1020 use_randomdev="$withval", use_randomdev="unspec")
1022 case "$use_randomdev" in
1026 devrandom=/dev/arandom
1029 devrandom=/dev/random
1032 AC_MSG_RESULT($devrandom)
1033 AC_CHECK_FILE($devrandom,
1034 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
1038 AC_MSG_ERROR([--with-randomdev must specify a path])
1041 AC_MSG_RESULT(disabled)
1044 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
1045 AC_MSG_RESULT(using "$use_randomdev")
1050 # Do we have arc4random() ?
1052 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1054 sinclude(config.threads.in)dnl
1058 if test "X$GCC" = "Xyes"; then
1062 CCOPT="$CCOPT -pthread"
1063 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1067 CCOPT="$CCOPT -pthread"
1070 LIBS="$LIBS -lthread"
1073 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1080 CCOPT="$CCOPT -pthread"
1087 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1089 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
1091 CCOPT="$CCOPT -Kthread"
1095 CCOPT="$CCOPT -Kpthread"
1099 ALWAYS_DEFINES="-D_REENTRANT"
1100 ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
1101 THREADOPTOBJS='${THREADOPTOBJS}'
1102 THREADOPTSRCS='${THREADOPTSRCS}'
1105 # We'd like to use sigwait() too
1107 AC_CHECK_FUNC(sigwait,
1108 AC_DEFINE(HAVE_SIGWAIT),
1109 AC_CHECK_LIB(c, sigwait,
1110 AC_DEFINE(HAVE_SIGWAIT),
1111 AC_CHECK_LIB(pthread, sigwait,
1112 AC_DEFINE(HAVE_SIGWAIT),
1113 AC_CHECK_LIB(pthread, _Psigwait,
1114 AC_DEFINE(HAVE_SIGWAIT),))))
1116 AC_CHECK_FUNC(pthread_attr_getstacksize,
1117 AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1119 AC_CHECK_FUNC(pthread_attr_setstacksize,
1120 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1123 # Additional OS-specific issues related to pthreads and sigwait.
1127 # One more place to look for sigwait.
1130 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1132 *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1133 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1134 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1137 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1142 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1143 # called before certain pthreads calls. This is deprecated
1146 *-bsdi3.*|*-bsdi4.0*)
1147 AC_DEFINE(NEED_PTHREAD_INIT)
1150 # LinuxThreads requires some changes to the way we
1151 # deal with signals.
1154 AC_DEFINE(HAVE_LINUXTHREADS)
1157 # Ensure the right sigwait() semantics on Solaris and make
1158 # sure we call pthread_setconcurrency.
1161 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1162 AC_CHECK_FUNC(pthread_setconcurrency,
1163 AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1166 # UnixWare does things its own way.
1168 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1169 AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1174 # Look for sysconf to allow detection of the number of processors.
1176 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1179 ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1180 thread_dir=nothreads
1186 AC_SUBST(ALWAYS_DEFINES)
1187 AC_SUBST(ISC_PLATFORM_USETHREADS)
1188 AC_SUBST(THREADOPTOBJS)
1189 AC_SUBST(THREADOPTSRCS)
1190 ISC_THREAD_DIR=$thread_dir
1191 AC_SUBST(ISC_THREAD_DIR)
1194 # was --with-libxml2 specified?
1196 AC_MSG_CHECKING(for libxml2 library)
1197 AC_ARG_WITH(libxml2,
1198 [ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]],
1199 use_libxml2="$withval", use_libxml2="auto")
1201 case "$use_libxml2" in
1206 case X`(xml2-config --version) 2>/dev/null` in
1208 libxml2_libs=`xml2-config --libs`
1209 libxml2_cflags=`xml2-config --cflags`
1218 if test -f "$use_libxml2/bin/xml2-config" ; then
1219 libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
1220 libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
1225 if test "X$libxml2_libs" != "X"
1228 CFLAGS="$CFLAGS $libxml2_cflags"
1229 LIBS="$LIBS $libxml2_libs"
1230 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1236 # In solaris 10, SMF can manage named service
1238 AC_CHECK_LIB(scf, smf_enable_instance)
1241 # flockfile is usually provided by pthreads, but we may want to use it
1242 # even if compiled with --disable-threads. getc_unlocked might also not
1245 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1246 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1249 # Indicate what the final decision was regarding threads.
1251 AC_MSG_CHECKING(whether to build with threads)
1252 if $use_threads; then
1259 # End of pthreads stuff.
1265 AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
1266 want_largefile="yes", want_largefile="no")
1267 case $want_largefile in
1269 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1276 # Additional compiler settings.
1280 IRIX_DNSSEC_WARNINGS_HACK=""
1282 if test "X$GCC" = "Xyes"; then
1283 AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1285 CFLAGS="$CFLAGS -fno-strict-aliasing"
1286 AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1288 if test "$FNOSTRICTALIASING" = "yes"; then
1290 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
1293 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1297 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1309 # The version of the C compiler that constantly warns about
1310 # 'const' as well as alignment issues is unfortunately not
1311 # able to be discerned via the version of the operating
1312 # system, nor does cc have a version flag.
1313 case "`$CC +W 123 2>&1`" in
1318 # Turn off the pointlessly noisy warnings.
1319 STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1322 CCOPT="$CCOPT -Ae -z"
1323 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1324 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1327 STD_CWARNINGS="-fullwarn -woff 1209"
1329 # Silence more than 250 instances of
1330 # "prototyped function redeclared without prototype"
1331 # and 11 instances of
1332 # "variable ... was set but never used"
1333 # from lib/dns/sec/openssl.
1335 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1340 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1348 AC_SUBST(MKDEPCFLAGS)
1350 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1355 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1358 # -lxnet buys us one big porting headache... standards, gotta love 'em.
1360 # AC_CHECK_LIB(xnet, socket, ,
1361 # AC_CHECK_LIB(socket, socket)
1364 # Use this for now, instead:
1372 AC_CHECK_LIB(socket, socket)
1373 AC_CHECK_LIB(nsl, inet_addr)
1378 # Work around Solaris's select() limitations.
1381 *-solaris2.[[89]]|*-solaris2.1?)
1382 AC_DEFINE(FD_SETSIZE, 65536,
1383 [Solaris hack to get select_large_fdset.])
1390 AC_MSG_CHECKING(whether to use purify)
1392 [ --with-purify[=PATH] use Rational purify],
1393 use_purify="$withval", use_purify="no")
1395 case "$use_purify" in
1399 AC_PATH_PROG(purify_path, purify, purify)
1402 purify_path="$use_purify"
1406 case "$use_purify" in
1412 if test -f $purify_path || test $purify_path = purify; then
1413 AC_MSG_RESULT($purify_path)
1414 PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1415 PURIFY="$purify_path $PURIFYFLAGS"
1417 AC_MSG_ERROR([$purify_path not found.
1419 Please choose the proper path with the following command:
1421 configure --with-purify=PATH
1430 AC_ARG_WITH(libtool,
1431 [ --with-libtool use GNU libtool],
1432 use_libtool="$withval", use_libtool="no")
1434 case $use_libtool in
1439 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1440 LIBTOOL_MODE_COMPILE='--mode=compile'
1441 LIBTOOL_MODE_INSTALL='--mode=install'
1442 LIBTOOL_MODE_LINK='--mode=link'
1444 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1447 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1448 *) LIBTOOL_IN_MAIN= ;;
1457 LIBTOOL_MODE_COMPILE=
1458 LIBTOOL_MODE_INSTALL=
1460 LIBTOOL_ALLOW_UNDEFINED=
1466 # enable/disable dumping stack backtrace. Also check if the system supports
1467 # glibc-compatible backtrace() function.
1469 AC_ARG_ENABLE(backtrace,
1470 [ --enable-backtrace log stack backtrace on abort [[default=yes]]],
1471 want_backtrace="$enableval", want_backtrace="yes")
1472 case $want_backtrace in
1474 ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
1475 AC_TRY_LINK([#include <execinfo.h>],
1476 [return (backtrace((void **)0, 0));],
1477 [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
1480 ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1483 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
1485 AC_ARG_ENABLE(symtable,
1486 [ --enable-symtable use internal symbol table for backtrace
1487 [[all|minimal(default)|none]]],
1488 want_symtable="$enableval", want_symtable="minimal")
1489 case $want_symtable in
1490 yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
1491 if test "$PERL" = ""
1493 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
1494 Install perl or explicitly disable the feature by --disable-symtable.])
1496 if test "$use_libtool" = "yes"; then
1497 AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
1499 # we generate the internal symbol table only for those systems
1500 # known to work to avoid unexpected build failure. Also, warn
1501 # about unsupported systems when the feature is enabled
1504 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1505 MKSYMTBL_PROGRAM="$PERL"
1506 if test $want_symtable = all; then
1507 ALWAYS_MAKE_SYMTABLE="yes"
1511 if test $want_symtable = yes -o $want_symtable = all
1513 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1521 AC_SUBST(MKSYMTBL_PROGRAM)
1522 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1525 # File name extension for static archive files, for those few places
1526 # where they are treated differently from dynamic ones.
1533 AC_SUBST(LIBTOOL_MKDEP_SED)
1534 AC_SUBST(LIBTOOL_MODE_COMPILE)
1535 AC_SUBST(LIBTOOL_MODE_INSTALL)
1536 AC_SUBST(LIBTOOL_MODE_LINK)
1537 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1538 AC_SUBST(LIBTOOL_IN_MAIN)
1541 # build exportable DNS library?
1543 AC_ARG_ENABLE(exportlib,
1544 [ --enable-exportlib build exportable library (GNU make required)
1546 case "$enable_exportlib" in
1549 for x in gmake gnumake make; do
1550 if $x --version 2>/dev/null | grep GNU > /dev/null; then
1555 if test -z "$gmake"; then
1556 AC_MSG_ERROR([exportlib requires GNU make. Install it or disable the feature.])
1558 LIBEXPORT=lib/export
1560 BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
1563 BIND9_CO_RULE=".c.$O:"
1566 AC_SUBST(BIND9_CO_RULE)
1568 AC_ARG_WITH(export-libdir,
1569 [ --with-export-libdir[=PATH]
1570 installation directory for the export library
1571 [[EPREFIX/lib/bind9]]],
1572 export_libdir="$withval",)
1573 if test -z "$export_libdir"; then
1574 export_libdir="\${exec_prefix}/lib/bind9/"
1576 AC_SUBST(export_libdir)
1578 AC_ARG_WITH(export-includedir,
1579 [ --with-export-includedir[=PATH]
1580 installation directory for the header files of the
1581 export library [[PREFIX/include/bind9]]],
1582 export_includedir="$withval",)
1583 if test -z "$export_includedir"; then
1584 export_includedir="\${prefix}/include/bind9/"
1586 AC_SUBST(export_includedir)
1589 # Here begins a very long section to determine the system's networking
1590 # capabilities. The order of the tests is significant.
1597 [ --enable-ipv6 use IPv6 [default=autodetect]])
1599 case "$enable_ipv6" in
1601 AC_DEFINE(WANT_IPV6)
1608 # We do the IPv6 compilation checking after libtool so that we can put
1609 # the right suffix on the files.
1611 AC_MSG_CHECKING(for IPv6 structures)
1613 #include <sys/types.h>
1614 #include <sys/socket.h>
1615 #include <netinet/in.h>],
1616 [struct sockaddr_in6 sin6; return (0);],
1623 # See whether IPv6 support is provided via a Kame add-on.
1624 # This is done before other IPv6 linking tests to LIBS is properly set.
1626 AC_MSG_CHECKING(for Kame IPv6 support)
1628 [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
1629 use_kame="$withval", use_kame="no")
1635 kame_path=/usr/local/v6
1638 kame_path="$use_kame"
1647 if test -f $kame_path/lib/libinet6.a; then
1648 AC_MSG_RESULT($kame_path/lib/libinet6.a)
1649 LIBS="-L$kame_path/lib -linet6 $LIBS"
1651 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1653 Please choose the proper path with the following command:
1655 configure --with-kame=PATH
1662 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1663 # Including it on Kame-using platforms is very bad, though, because
1664 # Kame uses #error against direct inclusion. So include it on only
1665 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1666 # This is done before the in6_pktinfo check because that's what
1667 # netinet6/in6.h is needed for.
1672 ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1673 LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1674 isc_netinet6in6_hack="#include <netinet6/in6.h>"
1677 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1678 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1679 isc_netinet6in6_hack=""
1685 # This is similar to the netinet6/in6.h issue.
1688 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1690 ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1691 LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1692 ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1693 isc_netinetin6_hack="#include <netinet/in6.h>"
1696 ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1697 LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1698 ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1699 isc_netinetin6_hack=""
1704 # Now delve deeper into the suitability of the IPv6 support.
1706 case "$found_ipv6" in
1708 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1709 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1711 AC_MSG_CHECKING(for in6_addr)
1713 #include <sys/types.h>
1714 #include <sys/socket.h>
1715 #include <netinet/in.h>
1716 $isc_netinetin6_hack
1717 $isc_netinet6in6_hack
1719 [struct in6_addr in6; return (0);],
1721 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1722 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1723 isc_in_addr6_hack=""],
1725 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1726 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1727 isc_in_addr6_hack="#define in6_addr in_addr6"])
1729 AC_MSG_CHECKING(for in6addr_any)
1731 #include <sys/types.h>
1732 #include <sys/socket.h>
1733 #include <netinet/in.h>
1734 $isc_netinetin6_hack
1735 $isc_netinet6in6_hack
1738 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1740 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1741 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1743 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1744 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1746 AC_MSG_CHECKING(for in6addr_loopback)
1748 #include <sys/types.h>
1749 #include <sys/socket.h>
1750 #include <netinet/in.h>
1751 $isc_netinetin6_hack
1752 $isc_netinet6in6_hack
1755 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1757 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1758 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1760 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1761 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1763 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1765 #include <sys/types.h>
1766 #include <sys/socket.h>
1767 #include <netinet/in.h>
1768 $isc_netinetin6_hack
1769 $isc_netinet6in6_hack
1771 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1773 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1774 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1776 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1777 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1778 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1780 AC_MSG_CHECKING(for in6_pktinfo)
1782 #include <sys/types.h>
1783 #include <sys/socket.h>
1784 #include <netinet/in.h>
1785 $isc_netinetin6_hack
1786 $isc_netinet6in6_hack
1788 [struct in6_pktinfo xyzzy; return (0);],
1790 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1791 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1792 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1795 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1796 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1797 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1798 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1799 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1800 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1801 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1803 ISC_IPV6_O="ipv6.$O"
1804 ISC_ISCIPV6_O="unix/ipv6.$O"
1809 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
1810 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1811 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1812 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1813 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1814 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1815 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1816 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1817 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1818 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1819 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1820 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1821 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1822 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1823 AC_SUBST(ISC_IPV6_H)
1824 AC_SUBST(ISC_IPV6_O)
1825 AC_SUBST(ISC_ISCIPV6_O)
1826 AC_SUBST(ISC_IPV6_C)
1827 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1828 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1830 AC_MSG_CHECKING([for struct if_laddrreq])
1832 #include <sys/types.h>
1833 #include <net/if6.h>
1834 ],[ struct if_laddrreq a; ],
1836 ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1838 ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1839 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1841 AC_MSG_CHECKING([for struct if_laddrconf])
1843 #include <sys/types.h>
1844 #include <net/if6.h>
1845 ],[ struct if_laddrconf a; ],
1847 ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1849 ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1850 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1853 # Check for network functions that are often missing. We do this
1854 # after the libtool checking, so we can put the right suffix on
1855 # the files. It also needs to come after checking for a Kame add-on,
1856 # which provides some (all?) of the desired functions.
1859 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1861 #include <sys/types.h>
1862 #include <sys/socket.h>
1863 #include <netinet/in.h>
1864 #include <arpa/inet.h>
1866 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1868 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1871 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1872 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1873 ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1874 [AC_MSG_RESULT(assuming inet_ntop not needed)
1875 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
1878 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1879 # addresses with less than four octets, like "1.2.3". Also leading
1880 # zeros should also be rejected.
1882 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
1884 #include <sys/types.h>
1885 #include <sys/socket.h>
1886 #include <netinet/in.h>
1887 #include <arpa/inet.h>
1888 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1889 inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
1890 (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1892 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1894 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1895 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1896 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1897 [AC_MSG_RESULT(assuming inet_pton needed)
1898 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1899 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1900 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
1902 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1903 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1906 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1910 # Turn on 4.4BSD style sa_len support.
1911 AC_DEFINE(_SOCKADDR_LEN)
1915 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1917 #include <sys/types.h>
1918 #include <sys/socket.h>],
1919 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1921 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1922 LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1924 ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1925 LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1926 AC_SUBST(ISC_PLATFORM_HAVESALEN)
1927 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
1930 # Look for a 4.4BSD or 4.3BSD struct msghdr
1932 AC_MSG_CHECKING(for struct msghdr flavor)
1934 #include <sys/types.h>
1935 #include <sys/socket.h>],
1936 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1937 [AC_MSG_RESULT(4.4BSD)
1938 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1939 [AC_MSG_RESULT(4.3BSD)
1940 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1941 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1944 # Look for in_port_t.
1946 AC_MSG_CHECKING(for type in_port_t)
1948 #include <sys/types.h>
1949 #include <netinet/in.h>],
1950 [in_port_t port = 25; return (0);],
1952 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1954 ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1955 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1958 # Check for addrinfo
1960 AC_MSG_CHECKING(for struct addrinfo)
1962 #include <netdb.h>],
1963 [struct addrinfo a; return (0);],
1965 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1966 ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
1967 AC_DEFINE(HAVE_ADDRINFO)],
1969 ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
1970 ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
1971 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
1972 AC_SUBST(ISC_IRS_NEEDADDRINFO)
1975 # Check for rrsetinfo
1977 AC_MSG_CHECKING(for struct rrsetinfo)
1979 #include <netdb.h>],
1980 [struct rrsetinfo r; return (0);],
1982 ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1984 ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1985 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1987 AC_MSG_CHECKING(for int sethostent)
1989 #include <netdb.h>],
1990 [int i = sethostent(0); return(0);],
1992 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1994 ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1995 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
1997 AC_MSG_CHECKING(for int endhostent)
1999 #include <netdb.h>],
2000 [int i = endhostent(); return(0);],
2002 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
2004 ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
2005 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
2007 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
2010 struct netent *getnetbyaddr(in_addr_t, int);],
2013 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
2015 ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
2016 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
2018 AC_MSG_CHECKING(for int setnetent)
2020 #include <netdb.h>],
2021 [int i = setnetent(0); return(0);],
2023 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
2025 ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
2026 AC_SUBST(ISC_LWRES_SETNETENTINT)
2028 AC_MSG_CHECKING(for int endnetent)
2030 #include <netdb.h>],
2031 [int i = endnetent(); return(0);],
2033 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
2035 ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
2036 AC_SUBST(ISC_LWRES_ENDNETENTINT)
2038 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
2041 struct hostent *gethostbyaddr(const void *, size_t, int);],
2044 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
2046 ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
2047 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
2049 AC_MSG_CHECKING(for h_errno in netdb.h)
2051 #include <netdb.h>],
2052 [h_errno = 1; return(0);],
2054 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
2056 ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
2057 AC_SUBST(ISC_LWRES_NEEDHERRNO)
2060 # Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
2061 # known variations here:
2063 AC_MSG_CHECKING(for getnameinfo prototype definitions)
2065 #include <sys/types.h>
2066 #include <sys/socket.h>
2068 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2069 socklen_t, char *, socklen_t, unsigned int);],
2071 [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
2072 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
2073 [Define to the buffer length type used by getnameinfo(3).])
2074 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
2075 [Define to the flags type used by getnameinfo(3).])],
2077 #include <sys/types.h>
2078 #include <sys/socket.h>
2080 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2081 size_t, char *, size_t, int);],
2083 [AC_MSG_RESULT(size_t for buflen; int for flags)
2084 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
2085 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
2086 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2087 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
2088 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])
2091 # ...and same for gai_strerror().
2093 AC_MSG_CHECKING(for gai_strerror prototype definitions)
2095 #include <sys/types.h>
2096 #include <sys/socket.h>
2098 char *gai_strerror(int ecode);],
2100 [AC_MSG_RESULT(returning char *)
2101 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
2102 [return type of gai_strerror])],
2103 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2104 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
2106 AC_CHECK_FUNC(getipnodebyname,
2107 [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
2108 [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
2109 AC_CHECK_FUNC(getnameinfo,
2110 [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
2111 [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
2112 AC_CHECK_FUNC(getaddrinfo,
2113 [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
2114 AC_DEFINE(HAVE_GETADDRINFO)],
2115 [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
2116 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
2117 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
2118 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
2119 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
2120 AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
2122 AC_ARG_ENABLE(getifaddrs,
2123 [ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].],
2124 want_getifaddrs="$enableval", want_getifaddrs="yes")
2127 # This interface iteration code for getifaddrs() will fall back to using
2128 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
2131 case $want_getifaddrs in
2133 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2134 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2137 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2144 # Look for a sysctl call to get the list of network interfaces.
2146 case $ac_cv_header_sys_sysctl_h in
2148 AC_MSG_CHECKING(for interface list sysctl)
2149 AC_EGREP_CPP(found_rt_iflist, [
2150 #include <sys/param.h>
2151 #include <sys/sysctl.h>
2152 #include <sys/socket.h>
2153 #ifdef NET_RT_IFLIST
2158 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2159 [AC_MSG_RESULT(no)])
2164 # Check for some other useful functions that are not ever-present.
2167 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
2168 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
2169 # reportedly defines strsep() without declaring it in <string.h> when
2170 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
2171 # AC_CHECK_FUNC() incorrectly succeeds because it declares
2172 # the function itself.
2173 AC_MSG_CHECKING(for correctly declared strsep())
2174 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
2175 [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
2176 [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
2177 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
2179 AC_CHECK_FUNC(memmove,
2180 [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
2181 [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
2182 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
2184 AC_CHECK_FUNC(strtoul,
2185 [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2186 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
2188 [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
2189 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
2190 GENRANDOMLIB='${ISCLIBS}'])
2191 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
2192 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
2193 AC_SUBST(GENRANDOMLIB)
2195 AC_CHECK_FUNC(strlcpy,
2196 [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
2197 [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
2198 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
2200 AC_CHECK_FUNC(strlcat,
2201 [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
2202 [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
2203 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
2207 AC_MSG_CHECKING(sprintf)
2211 [ char buf[2]; return(*sprintf(buf,"x"));],
2213 ISC_PRINT_OBJS="print.$O"
2214 ISC_PRINT_SRCS="print.c"
2215 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
2216 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
2218 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2219 LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2221 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2222 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
2224 AC_CHECK_FUNC(vsnprintf,
2225 [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
2226 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
2227 [ISC_PRINT_OBJS="print.$O"
2228 ISC_PRINT_SRCS="print.c"
2229 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
2230 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
2231 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
2232 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
2233 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
2234 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
2236 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2238 AC_SUBST(ISC_EXTRA_OBJS)
2239 AC_SUBST(ISC_EXTRA_SRCS)
2242 # Use our own SPNEGO implementation?
2244 AC_ARG_ENABLE(isc-spnego,
2245 [ --disable-isc-spnego use SPNEGO from GSSAPI library])
2247 if test -n "$USE_GSSAPI"
2249 case "$enable_isc_spnego" in
2251 USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
2252 DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
2253 DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
2254 AC_MSG_RESULT(using SPNEGO from lib/dns)
2257 AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2262 AC_SUBST(USE_ISC_SPNEGO)
2264 AC_SUBST(DST_EXTRA_OBJS)
2265 AC_SUBST(DST_EXTRA_SRCS)
2267 # Determine the printf format characters to use when printing
2268 # values of type isc_int64_t. This will normally be "ll", but where
2269 # the compiler treats "long long" as a alias for "long" and printf
2270 # doesn't know about "long long" use "l". Hopefully the sprintf
2271 # will produce a inconsistent result in the later case. If the compiler
2272 # fails due to seeing "%lld" we fall back to "l".
2274 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2275 # %ld even for (long long)/
2277 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2278 # configure on Win32.
2280 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2284 long long int j = 0;
2287 sprintf(buf, "%lld", j);
2288 exit((sizeof(long long int) != sizeof(long int))? 0 :
2289 (strcmp(buf, "0") != 0));
2293 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2294 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
2296 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
2297 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
2298 [AC_MSG_RESULT(assuming target platform uses ll)
2299 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2300 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
2301 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
2302 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
2307 # Note it is very recommended to *not* disable chroot(),
2308 # this is only because chroot() was made obsolete by Posix.
2309 AC_ARG_ENABLE(chroot,
2310 [ --disable-chroot disable chroot])
2311 case "$enable_chroot" in
2313 AC_CHECK_FUNCS(chroot)
2318 AC_ARG_ENABLE(linux-caps,
2319 [ --disable-linux-caps disable linux capabilities])
2320 case "$enable_linux_caps" in
2322 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
2323 AC_CHECK_LIB(cap, cap_set_proc)
2328 AC_CHECK_HEADERS(sys/prctl.h)
2330 AC_CHECK_HEADERS(sys/un.h,
2331 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2333 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2335 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2339 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2340 [Define if connect does not honour the permission on the UNIX domain socket.])
2343 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2344 [Define if connect does not honour the permission on the UNIX domain socket.])
2351 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2353 AC_MSG_CHECKING(for optarg declaration)
2358 [AC_MSG_RESULT(yes)],
2360 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2361 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2364 # BSD/OS, and perhaps some others, don't define rlim_t.
2366 AC_MSG_CHECKING(for type rlim_t)
2368 #include <sys/types.h>
2369 #include <sys/time.h>
2370 #include <sys/resource.h>],
2371 [rlim_t rl = 19671212; return (0);],
2373 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2376 AC_MSG_CHECKING(type of rlim_cur)
2378 #include <sys/types.h>
2379 #include <sys/time.h>
2380 #include <sys/resource.h>
2381 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
2383 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
2386 #include <sys/types.h>
2387 #include <sys/time.h>
2388 #include <sys/resource.h>
2389 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
2390 [AC_MSG_RESULT(long int)
2391 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
2394 #include <sys/types.h>
2395 #include <sys/time.h>
2396 #include <sys/resource.h>
2397 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
2398 [AC_MSG_RESULT(long long int)
2399 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
2400 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
2401 ],[AC_MSG_ERROR(this cannot happen)])
2402 ],[AC_MSG_ERROR(this cannot happen)])
2404 AC_ARG_WITH(rlimtype, , rlimtype="$withval", rlimtype="long long int")
2405 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE $rlimtype"
2406 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming $rlimtype)])
2408 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2411 # Older HP-UX doesn't have gettune
2415 AC_CHECK_HEADERS(sys/dyntune.h)
2423 # Compaq TruCluster requires more code for handling cluster IP aliases
2427 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
2428 AC_CHECK_FUNC(clua_getaliasaddress,
2429 AC_DEFINE(HAVE_TRUCLUSTER, 1,
2430 [Define if running under Compaq TruCluster]))
2437 # Some hosts need msg_namelen to match the size of the socket structure.
2438 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
2442 AC_DEFINE(BROKEN_RECVMSG, 1,
2443 [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2448 # Microsoft has their own way of handling shared libraries that requires
2449 # additional qualifiers on extern variables. Unix systems don't need it.
2451 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
2452 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
2453 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
2454 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
2455 AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
2456 IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
2459 # Random remaining OS-specific issues involving compiler warnings.
2460 # XXXDCL print messages to indicate some compensation is being done?
2462 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2463 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2467 hack_shutup_pthreadonceinit=yes
2470 hack_shutup_sputaux=yes
2473 hack_shutup_sigwait=yes
2474 hack_shutup_sputaux=yes
2477 hack_shutup_stdargcast=yes
2480 hack_shutup_pthreadonceinit=yes
2482 *-solaris2.1[[0-9]])
2483 AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
2487 case "$hack_shutup_pthreadonceinit" in
2490 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2492 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2496 case "$hack_shutup_sigwait" in
2499 # Shut up a -Wmissing-prototypes warning for sigwait().
2501 AC_DEFINE(SHUTUP_SIGWAIT)
2505 case "$hack_shutup_sputaux" in
2508 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2510 AC_DEFINE(SHUTUP_SPUTAUX)
2514 case "$hack_shutup_stdargcast" in
2517 # Shut up a -Wcast-qual warning from va_start().
2519 AC_DEFINE(SHUTUP_STDARG_CAST)
2523 AC_CHECK_HEADERS(strings.h,
2524 ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2526 ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2528 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2531 # Check for if_nametoindex() for IPv6 scoped addresses support
2533 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2534 ac_cv_have_if_nametoindex=no)
2535 case $ac_cv_have_if_nametoindex in
2539 AC_CHECK_LIB(ipv6, if_nametoindex,
2540 ac_cv_have_if_nametoindex=yes
2541 LIBS="-lipv6 $LIBS",)
2545 case $ac_cv_have_if_nametoindex in
2547 ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2550 ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2553 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2555 AC_CHECK_FUNCS(nanosleep)
2558 # Machine architecture dependent features
2560 AC_ARG_ENABLE(atomic,
2561 [ --enable-atomic enable machine specific atomic operations
2562 [[default=autodetect]]],
2563 enable_atomic="$enableval",
2564 enable_atomic="autodetect")
2565 case "$enable_atomic" in
2569 if test "X$GCC" = "Xyes"; then
2570 AC_MSG_CHECKING([if asm("isc"); works])
2572 main() { asm("ics"); exit(0); }
2577 saved_cflags="$CFLAGS"
2578 CFLAGS="$CFLAGS -Wa,-many"
2580 main() { asm("ics"); exit(0); }
2582 [AC_MSG_RESULT([yes, required -Wa,-many])
2584 [AC_MSG_RESULT([no, use_atomic disabled])
2585 CFLAGS="$saved_cflags"
2587 [AC_MSG_RESULT([cross compile, assume yes])
2588 CFLAGS="$saved_cflags"
2607 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2608 if test "$use_atomic" = "yes"; then
2609 AC_MSG_CHECKING([architecture type for atomic operations])
2610 have_atomic=yes # set default
2613 # XXX: some old x86 architectures actually do not support
2614 # (some of) these operations. Do we need stricter checks?
2615 AC_CHECK_SIZEOF([void *])
2616 if test $ac_cv_sizeof_void_p = 8; then
2624 AC_CHECK_SIZEOF([void *])
2625 if test $ac_cv_sizeof_void_p = 8; then
2635 powerpc-*|powerpc64-*)
2638 mips-*|mipsel-*|mips64-*|mips64el-*)
2649 AC_MSG_RESULT($arch)
2652 if test "$have_atomic" = "yes"; then
2653 AC_MSG_CHECKING([compiler support for inline assembly code])
2656 # Check whether the compiler supports the assembly syntax we provide.
2657 if test "X$GCC" = "Xyes"; then
2658 # GCC's ASM extension always works
2660 if test $arch = "x86_64"; then
2661 # We can share the same code for gcc with x86_32
2664 if test $arch = "powerpc"; then
2666 # The MacOS (and maybe others) uses "r0" for register
2667 # zero. Under linux/ibm it is "0" for register 0.
2668 # Probe to see if we have a MacOS style assembler.
2670 AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2672 __asm__ volatile ("li r0, 0x0\n"::);
2676 ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2677 ], [AC_MSG_RESULT(no)])
2682 # Tru64 compiler has its own syntax for inline
2686 #error "unexpected compiler"
2698 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2701 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2708 # See if the generic __asm function works. If not,
2709 # we need to disable the atomic operations.
2713 [compiler="standard"
2714 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2715 [compiler="not supported (atomic operations disabled)"
2721 AC_MSG_RESULT($compiler)
2724 if test "$have_atomic" = "yes"; then
2725 ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2726 ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2727 ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2729 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2730 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2731 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2734 if test "$have_xaddq" = "yes"; then
2735 ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
2737 ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
2740 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2741 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
2742 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2743 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2745 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2746 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2747 AC_SUBST(ISC_PLATFORM_USESTDASM)
2748 AC_SUBST(ISC_PLATFORM_USEMACASM)
2751 AC_SUBST(ISC_ARCH_DIR)
2754 # Activate "rrset-order fixed" or not?
2756 AC_ARG_ENABLE(fixed-rrset,
2757 [ --enable-fixed-rrset enable fixed rrset ordering
2759 enable_fixed="$enableval",
2761 case "$enable_fixed" in
2763 AC_DEFINE(DNS_RDATASET_FIXED, 1,
2764 [Define to enable "rrset-order fixed" syntax.])
2773 # Enable response policy rewriting using NS IP addresses
2775 AC_ARG_ENABLE(rpz-nsip,
2776 [ --enable-rpz-nsip enable rpz-nsip rules [[default=no]]],
2777 enable_nsip="$enableval",
2779 case "$enable_nsip" in
2781 AC_DEFINE(ENABLE_RPZ_NSIP, 1,
2782 [Define to enable rpz-nsip rules.])
2791 # Enable response policy rewriting using NS name
2793 AC_ARG_ENABLE(rpz-nsdname,
2794 [ --enable-rpz-nsdname enable rpz-nsdname rules [[default=no]]],
2795 enable_nsdname="$enableval",
2796 enable_nsdname="no")
2797 case "$enable_nsdname" in
2799 AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
2800 [Define to enable rpz-nsdname rules.])
2809 # Activate "filter-aaaa-on-v4" or not?
2811 AC_ARG_ENABLE(filter-aaaa,
2812 [ --enable-filter-aaaa enable filtering of AAAA records over IPv4
2814 enable_filter="$enableval",
2816 case "$enable_filter" in
2818 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
2819 [Define to enable the "filter-aaaa-on-v4" option.])
2828 # The following sets up how non-blocking i/o is established.
2829 # Sunos, cygwin and solaris 2.x (x<5) require special handling.
2832 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2833 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2834 *-solaris2.[[01234]])
2835 AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2836 AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2837 [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2839 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2840 [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2844 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2845 # This prevents the source address being set.
2848 *-solaris2.[[012345]]|*-solaris2.5.1)
2849 AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2850 [Define if you cannot bind() before connect() for TCP sockets.])
2854 # The following sections deal with tools used for formatting
2855 # the documentation. They are all optional, unless you are
2856 # a developer editing the documentation source.
2863 AC_PATH_PROGS(LATEX, latex, latex)
2866 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2873 AC_PATH_PROGS(W3M, w3m, w3m)
2877 # Look for xsltproc (libxslt)
2880 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2884 # Look for xmllint (libxml2)
2887 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2894 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
2898 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2899 # in a number of directories:
2901 # NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2903 # If the file FILENAME is found in one of the DIRECTORIES, the shell
2904 # variable VARIABLE is defined to its absolute pathname. Otherwise,
2905 # it is set to FILENAME, with no directory prefix (that's not terribly
2906 # useful, but looks less confusing in substitutions than leaving it
2907 # empty). The variable VARIABLE will be substituted into output files.
2910 AC_DEFUN(NOM_PATH_FILE, [
2912 AC_MSG_CHECKING(for $2)
2923 if test "X[$]$1" = "X"
2925 AC_MSG_RESULT("not found");
2932 # Look for Docbook-XSL stylesheets. Location probably varies by system.
2933 # If it's not explicitly specified, guess where it might be found, based on
2934 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
2935 # of at the moment).
2937 AC_MSG_CHECKING(for Docbook-XSL path)
2938 AC_ARG_WITH(docbook-xsl,
2939 [ --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
2940 docbook_path="$withval", docbook_path="auto")
2941 case "$docbook_path" in
2944 docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2947 docbook_xsl_trees="$withval"
2948 AC_MSG_RESULT($docbook_xsl_trees)
2953 # Look for stylesheets we need.
2956 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
2957 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
2958 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
2959 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
2960 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
2961 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
2962 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
2963 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
2964 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
2967 # Same dance for db2latex
2969 # No idea where this lives except on FreeBSD.
2972 db2latex_xsl_trees="/usr/local/share"
2975 # Look for stylesheets we need.
2978 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2981 # Look for "admonition" image directory. Can't use NOM_PATH_FILE()
2982 # because it's a directory, so just do the same things, inline.
2985 AC_MSG_CHECKING(for db2latex/xsl/figures)
2986 for d in $db2latex_xsl_trees
2988 dd=$d/db2latex/xsl/figures
2991 XSLT_DB2LATEX_ADMONITIONS=$dd
2996 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2998 AC_MSG_RESULT(not found)
2999 XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
3001 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
3007 [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
3008 use_idn="$withval", use_idn="no")
3011 if test X$prefix = XNONE ; then
3026 AC_ARG_WITH(libiconv,
3027 [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
3028 use_libiconv="$withval", use_libiconv="no")
3029 case "$use_libiconv" in
3031 if test X$prefix = XNONE ; then
3032 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
3034 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
3041 iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
3046 [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
3047 iconvlib="$withval")
3058 [ --with-idnlib=ARG specify libidnkit],
3059 idnlib="$withval", idnlib="no")
3060 if test "$idnlib" = yes; then
3061 AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
3065 if test "$use_idn" != no; then
3066 AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
3067 STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
3068 if test "$idnlib" != no; then
3069 IDNLIBS="$idnlib $iconvlib"
3071 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
3077 # Check whether to build Automated Test Framework unit tests
3080 [ --with-atf=ARG Automated Test Framework support],
3081 atf="$withval", atf="no")
3082 if test "$atf" = yes; then
3086 AC_CONFIG_COMMANDS([atf-config],
3087 [cd unit/atf-src; ${SHELL} ./configure MISSING=: --prefix $atfdir; cd ../..],
3088 [atfdir=`pwd`/unit/atf])
3089 AC_MSG_RESULT(building ATF from bind9/unit/atf-src)
3093 if test "$atf" != no; then
3094 AC_DEFINE(ATF_TEST, 1, [define if ATF unit tests are to be built.])
3095 STD_CINCLUDES="$STD_CINCLUDES -I$atf/include"
3097 ATFLIBS="-L$atf/lib -latf-c"
3104 AC_CHECK_HEADERS(locale.h)
3105 AC_CHECK_FUNCS(setlocale)
3110 AC_SUBST(BIND9_TOP_BUILDDIR)
3111 BIND9_TOP_BUILDDIR=`pwd`
3113 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
3114 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
3115 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
3116 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
3117 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
3118 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
3119 if test "X$srcdir" != "X"; then
3120 BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
3121 BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
3122 BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
3123 BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
3124 BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
3125 BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
3127 BIND9_ISC_BUILDINCLUDE=""
3128 BIND9_ISCCC_BUILDINCLUDE=""
3129 BIND9_ISCCFG_BUILDINCLUDE=""
3130 BIND9_DNS_BUILDINCLUDE=""
3131 BIND9_LWRES_BUILDINCLUDE=""
3132 BIND9_BIND9_BUILDINCLUDE=""
3135 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
3136 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
3138 AC_SUBST_FILE(BIND9_MAKE_RULES)
3139 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
3142 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}"
3143 AC_SUBST(BIND9_VERSION)
3145 if test -z "$ac_configure_args"; then
3146 BIND9_CONFIGARGS="defaults"
3148 for a in $ac_configure_args
3150 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
3153 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
3154 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
3155 AC_SUBST(BIND9_CONFIGARGS)
3157 AC_SUBST_FILE(LIBISC_API)
3158 LIBISC_API=$srcdir/lib/isc/api
3160 AC_SUBST_FILE(LIBISCCC_API)
3161 LIBISCCC_API=$srcdir/lib/isccc/api
3163 AC_SUBST_FILE(LIBISCCFG_API)
3164 LIBISCCFG_API=$srcdir/lib/isccfg/api
3166 AC_SUBST_FILE(LIBDNS_API)
3167 LIBDNS_API=$srcdir/lib/dns/api
3169 AC_SUBST_FILE(LIBBIND9_API)
3170 LIBBIND9_API=$srcdir/lib/bind9/api
3172 AC_SUBST_FILE(LIBLWRES_API)
3173 LIBLWRES_API=$srcdir/lib/lwres/api
3175 AC_SUBST_FILE(LIBIRS_API)
3176 LIBIRS_API=$srcdir/lib/irs/api
3179 # Configure any DLZ drivers.
3181 # If config.dlz.in selects one or more DLZ drivers, it will set
3182 # CONTRIB_DLZ to a non-empty value, which will be our clue to
3183 # build DLZ drivers in contrib.
3185 # This section has to come after the libtool stuff because it needs to
3186 # know how to name the driver object files.
3190 DLZ_DRIVER_INCLUDES=""
3197 # Configure support for building a shared library object
3199 # Even when libtool is available it can't always be relied upon
3200 # to build an object that can be dlopen()'ed, but this is necessary
3201 # for building the dlzexternal system test, so we'll try it the
3202 # old-fashioned way.
3210 [ --with-dlopen=ARG Support dynamically loadable DLZ drivers],
3211 dlopen="$withval", dlopen="yes")
3213 if test "$dlopen" = "yes"; then
3214 AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
3215 if test "$have_dl" = "yes"; then
3218 AC_CHECK_FUNCS(dlopen dlclose dlsym,,dlopen=no)
3221 if test "$dlopen" = "yes"; then
3225 if test "$have_dl" = "yes"
3227 SO_LD="${CC} -shared"
3232 *-freebsd*|*-openbsd*|*-netbsd*)
3234 SO_LD="ld -Bshareable -x"
3238 SO_LD="ld -G -z text"
3250 if test "X$GCC" = "Xyes"; then
3252 test -n "$SO_LD" || SO_LD="${CC} -shared"
3255 # If we still don't know how to make shared objects, don't make any.
3256 if test -n "$SO_LD"; then
3257 SO_TARGETS="\${SO_TARGETS}"
3258 AC_DEFINE(ISC_DLZ_DLOPEN, 1,
3259 [Define to allow building of objects for dlopen().])
3266 AC_SUBST(SO_TARGETS)
3268 sinclude(contrib/dlz/config.dlz.in)
3269 AC_MSG_CHECKING(contributed DLZ drivers)
3271 if test -n "$CONTRIB_DLZ"
3274 DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3275 AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3278 DLZ_DRIVER_RULES=/dev/null
3281 AC_SUBST(CONTRIB_DLZ)
3282 AC_SUBST(DLZ_DRIVER_INCLUDES)
3283 AC_SUBST(DLZ_DRIVER_LIBS)
3284 AC_SUBST(DLZ_DRIVER_SRCS)
3285 AC_SUBST(DLZ_DRIVER_OBJS)
3286 AC_SUBST(DLZ_SYSTEM_TEST)
3287 AC_SUBST_FILE(DLZ_DRIVER_RULES)
3289 if test "$cross_compiling" = "yes"; then
3290 if test -z "$BUILD_CC"; then
3291 AC_ERROR([BUILD_CC not set])
3293 BUILD_CFLAGS="$BUILD_CFLAGS"
3294 BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3295 BUILD_LDFLAGS="$BUILD_LDFLAGS"
3296 BUILD_LIBS="$BUILD_LIBS"
3299 BUILD_CFLAGS="$CFLAGS"
3300 BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3301 BUILD_LDFLAGS="$LDFLAGS"
3306 for e in $BUILD_LDFLAGS ; do
3311 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3312 NEWFLAGS="$NEWFLAGS $e $ee"
3315 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3316 NEWFLAGS="$NEWFLAGS $e $ee"
3319 ee=`echo $e | sed -e 's%^-L%-R%'`
3320 NEWFLAGS="$NEWFLAGS $e $ee"
3323 NEWFLAGS="$NEWFLAGS $e"
3328 NEWFLAGS="$NEWFLAGS $e"
3332 BUILD_LDFLAGS="$NEWFLAGS"
3335 for e in $DNS_GSSAPI_LIBS ; do
3340 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3341 NEWFLAGS="$NEWFLAGS $e $ee"
3344 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3345 NEWFLAGS="$NEWFLAGS $e $ee"
3348 ee=`echo $e | sed -e 's%^-L%-R%'`
3349 NEWFLAGS="$NEWFLAGS $e $ee"
3352 NEWFLAGS="$NEWFLAGS $e"
3357 NEWFLAGS="$NEWFLAGS $e"
3361 DNS_GSSAPI_LIBS="$NEWFLAGS"
3364 for e in $DNS_CRYPTO_LIBS ; do
3369 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3370 NEWFLAGS="$NEWFLAGS $e $ee"
3373 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3374 NEWFLAGS="$NEWFLAGS $e $ee"
3377 ee=`echo $e | sed -e 's%^-L%-R%'`
3378 NEWFLAGS="$NEWFLAGS $e $ee"
3381 NEWFLAGS="$NEWFLAGS $e"
3386 NEWFLAGS="$NEWFLAGS $e"
3390 DNS_CRYPTO_LIBS="$NEWFLAGS"
3393 AC_SUBST(BUILD_CFLAGS)
3394 AC_SUBST(BUILD_CPPFLAGS)
3395 AC_SUBST(BUILD_LDFLAGS)
3396 AC_SUBST(BUILD_LIBS)
3399 # Commands to run at the end of config.status.
3400 # Don't just put these into configure, it won't work right if somebody
3401 # runs config.status directly (which autoconf allows).
3406 [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
3409 # Files to configure. These are listed here because we used to
3410 # specify them as arguments to AC_OUTPUT. It's (now) ok to move these
3411 # elsewhere if there's a good reason for doing so.
3420 bin/confgen/Makefile
3421 bin/confgen/unix/Makefile
3425 bin/named/unix/Makefile
3426 bin/nsupdate/Makefile
3430 bin/tests/atomic/Makefile
3431 bin/tests/db/Makefile
3432 bin/tests/dst/Makefile
3433 bin/tests/hashes/Makefile
3434 bin/tests/headerdep_test.sh
3435 bin/tests/master/Makefile
3436 bin/tests/mem/Makefile
3437 bin/tests/names/Makefile
3438 bin/tests/net/Makefile
3439 bin/tests/rbt/Makefile
3440 bin/tests/resolver/Makefile
3441 bin/tests/sockaddr/Makefile
3442 bin/tests/system/Makefile
3443 bin/tests/system/conf.sh
3444 bin/tests/system/dlz/prereq.sh
3445 bin/tests/system/dlzexternal/Makefile
3446 bin/tests/system/dlzexternal/ns1/named.conf
3447 bin/tests/system/filter-aaaa/Makefile
3448 bin/tests/system/gost/prereq.sh
3449 bin/tests/system/lwresd/Makefile
3450 bin/tests/system/rpz/Makefile
3451 bin/tests/system/tkey/Makefile
3452 bin/tests/system/tsiggss/Makefile
3453 bin/tests/tasks/Makefile
3454 bin/tests/timers/Makefile
3455 bin/tests/virtual-time/Makefile
3456 bin/tests/virtual-time/conf.sh
3458 contrib/check-secure-delegation.pl
3459 contrib/zone-edit.sh
3462 doc/doxygen/Doxyfile
3463 doc/doxygen/Makefile
3464 doc/doxygen/doxygen-input-filter
3467 doc/xsl/isc-docbook-chunk.xsl
3468 doc/xsl/isc-docbook-html.xsl
3469 doc/xsl/isc-docbook-latex.xsl
3470 doc/xsl/isc-manpage.xsl
3474 lib/bind9/include/Makefile
3475 lib/bind9/include/bind9/Makefile
3477 lib/dns/include/Makefile
3478 lib/dns/include/dns/Makefile
3479 lib/dns/include/dst/Makefile
3480 lib/dns/tests/Makefile
3482 lib/export/dns/Makefile
3483 lib/export/dns/include/Makefile
3484 lib/export/dns/include/dns/Makefile
3485 lib/export/dns/include/dst/Makefile
3486 lib/export/irs/Makefile
3487 lib/export/irs/include/Makefile
3488 lib/export/irs/include/irs/Makefile
3489 lib/export/isc/$thread_dir/Makefile
3490 lib/export/isc/$thread_dir/include/Makefile
3491 lib/export/isc/$thread_dir/include/isc/Makefile
3492 lib/export/isc/Makefile
3493 lib/export/isc/include/Makefile
3494 lib/export/isc/include/isc/Makefile
3495 lib/export/isc/nls/Makefile
3496 lib/export/isc/unix/Makefile
3497 lib/export/isc/unix/include/Makefile
3498 lib/export/isc/unix/include/isc/Makefile
3499 lib/export/isccfg/Makefile
3500 lib/export/isccfg/include/Makefile
3501 lib/export/isccfg/include/isccfg/Makefile
3502 lib/export/samples/Makefile
3503 lib/export/samples/Makefile-postinstall
3505 lib/irs/include/Makefile
3506 lib/irs/include/irs/Makefile
3507 lib/irs/include/irs/netdb.h
3508 lib/irs/include/irs/platform.h
3509 lib/isc/$arch/Makefile
3510 lib/isc/$arch/include/Makefile
3511 lib/isc/$arch/include/isc/Makefile
3512 lib/isc/$thread_dir/Makefile
3513 lib/isc/$thread_dir/include/Makefile
3514 lib/isc/$thread_dir/include/isc/Makefile
3516 lib/isc/include/Makefile
3517 lib/isc/include/isc/Makefile
3518 lib/isc/include/isc/platform.h
3519 lib/isc/tests/Makefile
3520 lib/isc/nls/Makefile
3521 lib/isc/unix/Makefile
3522 lib/isc/unix/include/Makefile
3523 lib/isc/unix/include/isc/Makefile
3525 lib/isccc/include/Makefile
3526 lib/isccc/include/isccc/Makefile
3528 lib/isccfg/include/Makefile
3529 lib/isccfg/include/isccfg/Makefile
3531 lib/lwres/include/Makefile
3532 lib/lwres/include/lwres/Makefile
3533 lib/lwres/include/lwres/netdb.h
3534 lib/lwres/include/lwres/platform.h
3535 lib/lwres/man/Makefile
3536 lib/lwres/unix/Makefile
3537 lib/lwres/unix/include/Makefile
3538 lib/lwres/unix/include/lwres/Makefile
3540 lib/tests/include/Makefile
3541 lib/tests/include/tests/Makefile
3553 # Now that the Makefiles exist we can ensure that everything is rebuilt.
3555 AC_ARG_WITH(make-clean,
3556 [ --with-make-clean Run "make clean" at end of configure [[yes|no]].],
3557 make_clean="$withval", make_clean="yes")
3558 case "$make_clean" in
3564 if test "X$USE_OPENSSL" = "X"; then
3566 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
3570 if test "X$OPENSSL_WARNING" != "X"; then
3572 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3573 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3575 WARNING Your OpenSSL crypto library may be vulnerable to WARNING
3576 WARNING one or more of the the following known security WARNING
3577 WARNING flaws: WARNING
3579 WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
3580 WARNING CVE-2006-2940. WARNING
3582 WARNING It is recommended that you upgrade to OpenSSL WARNING
3583 WARNING version 0.9.8d/0.9.7l (or greater). WARNING
3585 WARNING You can disable this warning by specifying: WARNING
3587 WARNING --disable-openssl-version-check WARNING
3589 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3590 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3594 # Tell Emacs to edit this file in shell mode.