1 # Copyright (C) 2004-2014 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 -e 's/^/# /' -e '/Portions of this code/,$d' COPYRIGHT])dnl
21 AC_INIT(BIND, [9.9], [bind9-bugs@isc.org], [], [https://www.isc.org/downloads/BIND/])
24 AC_CONFIG_HEADER(config.h)
25 AC_CONFIG_MACRO_DIR([libtool.m4])
36 # Just set the maximum command line length for sunos as it otherwise
37 # takes a exceptionally long time to work it out. Required for libtool.
39 lt_cv_sys_max_cmd_len=4096;
47 AC_SUBST(STD_CINCLUDES)
48 AC_SUBST(STD_CDEFINES)
49 AC_SUBST(STD_CWARNINGS)
52 AC_SUBST(BACKTRACECFLAGS)
54 # Warn if the user specified libbind, which is now deprecated
55 AC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
57 case "$enable_libbind" in
59 AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
60 It is available from http://www.isc.org as a separate download.])
66 AC_ARG_ENABLE(warn_error, [ --enable-warn-error turn on -Werror when compiling])
68 AC_ARG_ENABLE(developer, [ --enable-developer enable developer build settings])
69 case "$enable_developer" in
71 STD_CDEFINES="$STD_CDEFINES -DISC_LIST_CHECKINIT=1"
72 test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
73 test "${with_atf+set}" = set || with_atf=yes
74 test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
75 test "${enable_rrl+set}" = set || enable_rrl=yes
76 test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
79 test "${enable_exportlib+set}" = set || enable_exportlib=yes
82 test "${enable_exportlib+set}" = set || enable_exportlib=yes
85 test "${enable_symtable+set}" = set || enable_symtable=all
86 test "${enable_warn_error+set}" = set || enable_warn_error=yes
90 # Make very sure that these are the first files processed by
91 # config.status, since we use the processed output as the input for
92 # AC_SUBST_FILE() substitutions in other files.
94 AC_CONFIG_FILES([make/rules make/includes])
101 # The POSIX ln(1) program. Non-POSIX systems may substitute
102 # "copy" or something.
109 ar program not found. Please fix your PATH to include the directory in
110 which ar resides, or set AR in the environment with the full path to ar.
119 AC_PATH_PROGS(ETAGS, etags emacs-etags)
122 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
123 # GNU emacs etags, and it requires the -L flag.
125 if test "X$ETAGS" != "X"; then
126 AC_MSG_CHECKING(for Exuberant Ctags etags)
127 if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
137 # Perl is optional; it is used only by some of the system test scripts.
138 # Note: the backtrace feature (see below) uses perl to build the symbol table,
139 # but it still compiles without perl, in which case an empty table will be used.
141 AC_PATH_PROGS(PERL, perl5 perl)
145 # Python is also optional; it is used by the tools in bin/python.
146 # If python is unavailable, we simply don't build those.
149 [ --with-python=PATH Specify path to python interpreter],
150 use_python="$withval", use_python="unspec")
152 python="python python3 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4"
153 testscript='try: import argparse
155 case "$use_python" in
157 AC_MSG_CHECKING([for python support])
158 AC_MSG_RESULT(disabled)
161 case "$use_python" in
165 AC_PATH_PROGS(PYTHON, $p)
166 if test "X$PYTHON" == "X"; then
169 AC_MSG_CHECKING([python module 'argparse'])
170 if ${PYTHON:-false} -c "$testscript"; then
171 AC_MSG_RESULT([found, using $PYTHON])
174 AC_MSG_RESULT([not found])
175 unset ac_cv_path_PYTHON
178 if test "X$PYTHON" == "X"
180 AC_MSG_CHECKING([for python support])
181 case "$use_python" in
183 AC_MSG_RESULT(disabled)
186 AC_MSG_ERROR([missing python])
192 case "$use_python" in
197 AC_PATH_PROGS(PYTHON, $use_python)
200 AC_MSG_CHECKING([python module 'argparse'])
201 if ${PYTHON:-false} -c "$testscript"; then
202 AC_MSG_RESULT([found, using $PYTHON])
205 AC_MSG_ERROR([not found])
215 if test "X$PYTHON" != "X"; then
222 AC_SUBST(PYTHON_TOOLS)
225 # Special processing of paths depending on whether --prefix,
226 # --sysconfdir or --localstatedir arguments were given. What's
227 # desired is some compatibility with the way previous versions
228 # of BIND built; they defaulted to /usr/local for most parts of
229 # the installation, but named.boot/named.conf was in /etc
230 # and named.pid was in /var/run.
232 # So ... if none of --prefix, --sysconfdir or --localstatedir are
233 # specified, set things up that way. If --prefix is given, use
234 # it for sysconfdir and localstatedir the way configure normally
235 # would. To change the prefix for everything but leave named.conf
236 # in /etc or named.pid in /var/run, then do this the usual configure way:
237 # ./configure --prefix=/somewhere --sysconfdir=/etc
238 # ./configure --prefix=/somewhere --localstatedir=/var
240 # To put named.conf and named.pid in /usr/local with everything else,
241 # set the prefix explicitly to /usr/local even though that's the default:
242 # ./configure --prefix=/usr/local
246 case "$sysconfdir" in
251 case "$localstatedir" in
260 # Make sure INSTALL uses an absolute path, else it will be wrong in all
261 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
262 # configure based on the location of the file where it is substituted.
263 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
264 # subdirectory of install-sh, This relative path will be wrong for all
265 # directories more than one level down from install-sh.
272 # Not all systems have dirname.
275 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
278 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
279 test "$ac_dir" = "$ac_prog" && ac_dir=.
280 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
281 INSTALL="$ac_dir/$ac_prog"
286 # On these hosts, we really want to use cc, not gcc, even if it is
287 # found. The gcc that these systems have will not correctly handle
290 # However, if the user sets $CC to be something, let that override
293 if test "X$CC" = "X" ; then
299 # Use Sun's cc if it is available, but watch
300 # out for /usr/ucb/cc; it will never be the right
303 # If setting CC here fails, the AC_PROG_CC done
304 # below might still find gcc.
305 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
306 for ac_dir in $PATH; do
307 test -z "$ac_dir" && ac_dir=.
313 if test -f "$ac_dir/cc"; then
334 # gcc's optimiser is broken at -02 for ultrasparc
336 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
345 # OS dependent CC flags
348 # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
349 # -D_XOPEN_SOURCE_EXTENDED.
351 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
352 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
354 #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
356 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
357 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
360 # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
362 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
363 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
365 # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
366 # parts of the IPv6 Advanced Socket API as a result. This is stupid
367 # as it breaks how the two halves (Basic and Advanced) of the IPv6
368 # Socket API were designed to be used but we have to live with it.
369 # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
370 *-linux* | *-kfreebsd*-gnu*)
371 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
372 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
375 # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
376 # Setting this is sufficient to select the correct behavior for BIND 9.
379 STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
380 CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
385 # CCNOOPT defaults to -O0 on gcc and disables optimization when is last
387 if test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
393 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,,,
394 [$ac_includes_default
395 #ifdef HAVE_SYS_PARAM_H
396 # include <sys/param.h>
403 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
404 AC_C_FLEXIBLE_ARRAY_MEMBER
407 # Older versions of HP/UX don't define seteuid() and setegid()
409 AC_CHECK_FUNCS(seteuid setresuid)
410 AC_CHECK_FUNCS(setegid setresgid)
413 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
414 # is reported to not support "static inline" (RT #1212).
416 AC_MSG_CHECKING(for static inline breakage)
418 static inline int foo1() {
422 static inline int foo2() {
428 AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
431 AC_CHECK_TYPE(ssize_t, int)
432 AC_CHECK_TYPE(uintptr_t,unsigned long)
433 AC_CHECK_TYPE(socklen_t,
434 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
438 #include <sys/types.h>
439 #include <sys/socket.h>
440 int getsockname(int, struct sockaddr *, size_t *);
442 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
443 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
446 #include <sys/types.h>
447 #include <sys/socket.h>
449 AC_SUBST(ISC_SOCKADDR_LEN_T)
451 AC_MSG_CHECKING(for long long)
452 AC_TRY_COMPILE([],[long long i = 0; return (0);],
454 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
456 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
457 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
460 # check for GCC noreturn attribute
462 AC_MSG_CHECKING(for GCC noreturn attribute)
463 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
465 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
466 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
468 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
469 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
470 AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
471 AC_SUBST(ISC_PLATFORM_NORETURN_POST)
474 # check if we have lifconf
476 AC_MSG_CHECKING(for struct lifconf)
478 #include <sys/types.h>
479 #include <sys/socket.h>
483 struct lifconf lifconf;
484 lifconf.lifc_len = 0;
488 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
490 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
491 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
494 # check if we want the new statistics
496 AC_ARG_ENABLE(newstats,
497 [ --enable-newstats use the new statistics])
498 case "$enable_newstats" in
500 AC_DEFINE(NEWSTATS, 1, [Use the new XML schema for statistics])
507 # check if we want DNS RRL
510 [ --enable-rrl use DNS Response Rate Limiting])
511 case "$enable_rrl" in
513 AC_DEFINE(USE_RRL, 1, [Enable DNS Response Rate Limiting])
514 RRLLINKOBJS='${RRLOBJS}'
515 RRLLINKSRCS='${RRLSRCS}'
522 AC_SUBST(RRLLINKOBJS)
523 AC_SUBST(RRLLINKSRCS)
526 # check if we have kqueue
528 AC_ARG_ENABLE(kqueue,
529 [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
530 want_kqueue="$enableval", want_kqueue="yes")
533 AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
534 case $ac_cv_have_kqueue in
536 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
539 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
544 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
547 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
550 # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
551 # so we need to try running the code, not just test its existence.
554 [ --enable-epoll use Linux epoll when available [[default=auto]]],
555 want_epoll="$enableval", want_epoll="auto")
558 AC_MSG_CHECKING(epoll support)
560 #include <sys/epoll.h>
562 if (epoll_create(1) < 0)
568 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
570 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"],
572 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
575 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
578 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
581 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
584 # check if we support /dev/poll
586 AC_ARG_ENABLE(devpoll,
587 [ --enable-devpoll use /dev/poll when available [[default=yes]]],
588 want_devpoll="$enableval", want_devpoll="yes")
589 case $want_devpoll in
591 AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
592 ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
594 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
598 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
601 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
604 # check if we need to #include sys/select.h explicitly
606 case $ac_cv_header_unistd_h in
608 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
610 #include <sys/types.h> /* Ultrix */
611 #include <unistd.h>],
612 [fd_set read_set; return (0);],
614 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
615 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
617 case $ac_cv_header_sys_select_h in
619 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
620 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
623 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
629 case $ac_cv_header_sys_select_h in
631 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
632 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
635 AC_MSG_ERROR([need either unistd.h or sys/select.h])
640 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
641 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
644 # Find the machine's endian flavor.
649 # was --with-openssl specified?
652 AC_MSG_CHECKING(for OpenSSL library)
654 [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
655 (Required for DNSSEC)],
656 use_openssl="$withval", use_openssl="auto")
658 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
659 if test "$use_openssl" = "auto"
661 for d in $openssldirs
663 if test -f $d/include/openssl/opensslv.h
672 case "$use_openssl" in
677 OPENSSLGOSTLINKOBJS=""
678 OPENSSLGOSTLINKSRS=""
685 OPENSSLGOSTLINKOBJS=""
686 OPENSSLGOSTLINKSRS=""
690 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
691 If you don't want OpenSSL, use --without-openssl])
694 if test "$use_openssl" = "yes"
696 # User did not specify a path - guess it
697 for d in $openssldirs
699 if test -f $d/include/openssl/opensslv.h
705 if test "$use_openssl" = "yes"
707 AC_MSG_RESULT(not found)
709 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
711 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
713 AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
715 USE_OPENSSL='-DOPENSSL'
716 if test "$use_openssl" = "/usr"
719 DNS_OPENSSL_LIBS="-lcrypto"
721 DST_OPENSSL_INC="-I$use_openssl/include"
724 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
727 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
731 # Apple's ld seaches for serially for dynamic
732 # then static libraries. This means you can't
733 # use -L to override dynamic system libraries
734 # with static ones when linking. Instead
735 # we specify a absolute path.
737 if test -f "$use_openssl/lib/libcrypto.dylib"
739 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
741 DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
745 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
749 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
751 saved_cflags="$CFLAGS"
753 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
754 LIBS="$LIBS $DNS_OPENSSL_LIBS"
755 AC_MSG_CHECKING(whether linking with OpenSSL works)
757 #include <openssl/err.h>
763 [AC_MSG_RESULT(yes)],
765 AC_MSG_ERROR(Could not run test program using OpenSSL from
766 $use_openssl/lib and $use_openssl/include.
767 Please check the argument to --with-openssl and your
768 shared library configuration (e.g., LD_LIBRARY_PATH).)],
769 [AC_MSG_RESULT(assuming it does work on target platform)])
771 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
773 #include <openssl/err.h>],
774 [ DSO_METHOD_dlfcn(); ],
778 #include <openssl/err.h>
779 ],[ DSO_METHOD_dlfcn(); ],
781 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
783 [AC_MSG_RESULT(unknown)
784 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
785 [AC_MSG_RESULT(assuming it does work on target platform)])
787 [AC_MSG_RESULT(assuming it does work on target platform)]
790 AC_ARG_ENABLE(openssl-version-check,
791 [AC_HELP_STRING([--enable-openssl-version-check],
792 [Check OpenSSL Version @<:@default=yes@:>@])])
793 case "$enable_openssl_version_check" in
795 AC_MSG_CHECKING(OpenSSL library version)
798 #include <openssl/opensslv.h>
800 if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
801 OPENSSL_VERSION_NUMBER < 0x00908000L) ||
802 OPENSSL_VERSION_NUMBER >= 0x0090804fL)
804 printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
805 OPENSSL_VERSION_NUMBER);
806 printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
807 "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
812 [AC_MSG_RESULT(not compatible)
815 [AC_MSG_RESULT(assuming target platform has compatible version)])
818 AC_MSG_RESULT(Skipped OpenSSL version check)
822 AC_MSG_CHECKING(for OpenSSL DSA support)
823 if test -f $use_openssl/include/openssl/dsa.h
825 AC_DEFINE(HAVE_OPENSSL_DSA)
831 AC_CHECK_FUNCS(EVP_sha256 EVP_sha384 EVP_sha512)
833 AC_MSG_CHECKING(for OpenSSL ECDSA support)
837 #include <openssl/ecdsa.h>
838 #include <openssl/objects.h>
840 EC_KEY *ec256, *ec384;
842 #if !defined(HAVE_EVP_SHA256) || !defined(HAVE_EVP_SHA384)
845 ec256 = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
846 ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
847 if (ec256 == NULL || ec384 == NULL)
856 [AC_MSG_RESULT(using --with-ecdsa)])
857 AC_ARG_WITH(ecdsa, [ --with-ecdsa OpenSSL ECDSA],
858 with_ecdsa="$withval", with_ecdsa="auto")
859 case "$with_ecdsa" in
861 case "$have_ecdsa" in
862 no) AC_MSG_ERROR([ecdsa not supported]) ;;
869 case "$have_ecdsa" in
871 *) AC_MSG_ERROR([need --with-ecdsa=[[yes or no]]]) ;;
878 AC_DEFINE(HAVE_OPENSSL_ECDSA, 1,
879 [Define if your OpenSSL version supports ECDSA.])
885 AC_MSG_CHECKING(for OpenSSL GOST support)
888 #include <openssl/conf.h>
889 #include <openssl/engine.h>
891 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
896 OPENSSL_config(NULL);
898 e = ENGINE_by_id("gost");
901 if (ENGINE_init(e) <= 0)
913 [AC_MSG_RESULT(using --with-gost)])
914 AC_ARG_WITH(gost, [ --with-gost OpenSSL GOST],
915 with_gost="$withval", with_gost="auto")
919 no) AC_MSG_ERROR([gost not supported]) ;;
928 *) AC_MSG_ERROR([need --with-gost=[[yes or no]]]) ;;
935 OPENSSLGOSTLINKOBJS='${OPENSSLGOSTLINKOBJS}'
936 OPENSSLGOSTLINKSRCS='${OPENSSLGOSTLINKSRCS}'
937 AC_DEFINE(HAVE_OPENSSL_GOST, 1,
938 [Define if your OpenSSL version supports GOST.])
943 CFLAGS="$saved_cflags"
945 OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
946 OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
952 # This would include the system openssl path (and linker options to use
953 # it as needed) if it is found.
956 AC_SUBST(USE_OPENSSL)
957 AC_SUBST(DST_OPENSSL_INC)
958 AC_SUBST(OPENSSLGOSTLINKOBJS)
959 AC_SUBST(OPENSSLGOSTLINKSRCS)
960 AC_SUBST(OPENSSLLINKOBJS)
961 AC_SUBST(OPENSSLLINKSRCS)
962 AC_SUBST(OPENSSL_ECDSA)
963 AC_SUBST(OPENSSL_GOST)
965 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
968 # Use OpenSSL for hash functions
971 AC_ARG_ENABLE(openssl-hash,
972 [ --enable-openssl-hash use OpenSSL for hash functions [[default=no]]],
973 want_openssl_hash="$enableval", want_openssl_hash="no")
974 case $want_openssl_hash in
976 if test "$USE_OPENSSL" = ""
978 AC_MSG_ERROR([No OpenSSL for hash functions])
980 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
981 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
984 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
988 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
989 AC_SUBST(ISC_OPENSSL_INC)
992 # PKCS11 (aka crypto hardware) support
994 # This works only with the right OpenSSL with PKCS11 engine!
997 AC_MSG_CHECKING(for PKCS11 support)
999 [ --with-pkcs11[=PATH] Build with PKCS11 support [yes|no|path]
1000 (PATH is for the PKCS11 provider)],
1001 use_pkcs11="$withval", use_pkcs11="no")
1003 case "$use_pkcs11" in
1005 AC_MSG_RESULT(disabled)
1010 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
1011 USE_PKCS11='-DUSE_PKCS11'
1015 AC_SUBST(USE_PKCS11)
1016 AC_SUBST(PKCS11_TOOLS)
1018 AC_MSG_CHECKING(for PKCS11 tools)
1019 case "$use_pkcs11" in
1021 AC_MSG_RESULT(disabled)
1022 PKCS11_PROVIDER="undefined"
1025 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
1026 PKCS11_PROVIDER="$use_pkcs11"
1029 AC_SUBST(PKCS11_PROVIDER)
1031 AC_MSG_CHECKING(for GSSAPI library)
1033 [ --with-gssapi=PATH Specify path for system-supplied GSSAPI [[default=yes]]],
1034 use_gssapi="$withval", use_gssapi="yes")
1036 # gssapi is just the framework, we really require kerberos v5, so
1037 # look for those headers (the gssapi headers must be there, too)
1038 # The problem with this implementation is that it doesn't allow
1039 # for the specification of gssapi and krb5 headers in different locations,
1040 # which probably ought to be fixed although fixing might raise the issue of
1041 # trying to build with incompatible versions of gssapi and krb5.
1042 if test "$use_gssapi" = "yes"
1044 # first, deal with the obvious
1045 if test \( -f /usr/include/kerberosv5/krb5.h -o \
1046 -f /usr/include/krb5/krb5.h -o \
1047 -f /usr/include/krb5.h \) -a \
1048 \( -f /usr/include/gssapi.h -o \
1049 -f /usr/include/gssapi/gssapi.h \)
1053 krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
1056 if test -f $d/include/gssapi/gssapi_krb5.h -o \
1057 -f $d/include/krb5.h
1059 if test -f $d/include/gssapi/gssapi.h -o \
1060 -f $d/include/gssapi.h
1071 case "$use_gssapi" in
1073 AC_MSG_RESULT(disabled)
1077 AC_MSG_ERROR([--with-gssapi must specify a path])
1080 AC_MSG_RESULT(looking in $use_gssapi/lib)
1081 USE_GSSAPI='-DGSSAPI'
1082 saved_cppflags="$CPPFLAGS"
1083 CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
1084 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
1085 [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
1086 gssapi_hack="#include <$ac_header>"])
1088 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
1089 AC_MSG_ERROR([gssapi.h not found])
1092 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
1093 [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
1094 gssapi_krb5_hack="#include <$ac_header>"])
1096 AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
1097 [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
1098 krb5_hack="#include <$ac_header>"])
1100 if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
1101 AC_MSG_ERROR([krb5.h not found])
1105 # XXXDCL This probably doesn't work right on all systems.
1106 # It will need to be worked on as problems become evident.
1108 # Essentially the problems here relate to two different
1109 # areas. The first area is building with either KTH
1110 # or MIT Kerberos, particularly when both are present on
1111 # the machine. The other is static versus dynamic linking.
1113 # On the KTH vs MIT issue, Both have libkrb5 that can mess
1114 # up the works if one implementation ends up trying to
1115 # use the other's krb. This is unfortunately a situation
1116 # that very easily arises.
1118 # Dynamic linking when the dependency information is built
1119 # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
1120 # all such problems go away, but when that setup is not
1121 # present, because either the dynamic libraries lack
1122 # dependencies or static linking is being done, then the
1123 # problems start to show up.
1127 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
1128 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
1130 "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
1131 "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
1132 "-lgssapi -lkrb5 -lgssapi_krb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
1133 "-lgssapi -lkrb5 -lhx509 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
1136 # Note that this does not include $saved_libs, because
1137 # on FreeBSD machines this configure script has added
1138 # -L/usr/local/lib to LIBS, which can make the
1139 # -lgssapi_krb5 test succeed with shared libraries even
1140 # when you are trying to build with KTH in /usr/lib.
1141 if test "$use_gssapi" = "/usr"
1145 LIBS="-L$use_gssapi/lib $TRY_LIBS"
1147 AC_MSG_CHECKING(linking as $TRY_LIBS)
1149 #include <sys/types.h>
1153 ] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
1154 #if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
1155 gsskrb5_register_acceptor_identity(NULL);
1157 gssapi_linked=yes, gssapi_linked=no)
1158 case $gssapi_linked in
1159 yes) AC_MSG_RESULT(yes); break ;;
1160 no) AC_MSG_RESULT(no) ;;
1164 CPPFLAGS="$saved_cppflags"
1166 case $gssapi_linked in
1167 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
1171 # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
1172 # but MIT in /usr/local/lib and trying to build with KTH.
1173 # /usr/local/lib can end up earlier on the link lines.
1174 # Like most kludges, this one is not only inelegant it
1175 # is also likely to be the wrong thing to do at least as
1176 # many times as it is the right thing. Something better
1179 if test "$use_gssapi" = "/usr" -a \
1180 -f /usr/local/lib/libkrb5.a; then
1184 case "$FIX_KTH_VS_MIT" in
1186 case "$enable_static_linking" in
1187 yes) gssapi_lib_suffix=".a" ;;
1188 *) gssapi_lib_suffix=".so" ;;
1191 for lib in $LIBS; do
1196 new_lib=`echo $lib |
1197 sed -e s%^-l%$use_gssapi/lib/lib% \
1198 -e s%$%$gssapi_lib_suffix%`
1199 NEW_LIBS="$NEW_LIBS $new_lib"
1202 AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
1210 DST_GSSAPI_INC="-I$use_gssapi/include"
1211 DNS_GSSAPI_LIBS="$LIBS"
1213 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
1218 AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
1219 AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
1220 AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
1221 AC_SUBST(ISC_PLATFORM_KRB5HEADER)
1223 AC_SUBST(USE_GSSAPI)
1224 AC_SUBST(DST_GSSAPI_INC)
1225 AC_SUBST(DNS_GSSAPI_LIBS)
1226 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
1229 # Applications linking with libdns also need to link with these libraries.
1232 AC_SUBST(DNS_CRYPTO_LIBS)
1235 # was --with-randomdev specified?
1237 AC_MSG_CHECKING(for random device)
1238 AC_ARG_WITH(randomdev,
1239 [ --with-randomdev=PATH Specify path for random device],
1240 use_randomdev="$withval", use_randomdev="unspec")
1242 case "$use_randomdev" in
1244 case "$cross_compiling" in
1246 AC_MSG_RESULT(unspecified)
1247 AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
1251 devrandom=/dev/arandom
1254 devrandom=/dev/random
1257 AC_MSG_RESULT($devrandom)
1258 AC_CHECK_FILE($devrandom,
1259 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
1264 AC_MSG_ERROR([--with-randomdev must specify a path])
1267 AC_MSG_RESULT(disabled)
1270 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
1271 AC_MSG_RESULT(using "$use_randomdev")
1276 # Only check dsa signature generation on these platforms when performing
1280 if grep "#define PATH_RANDOMDEV " confdefs.h > /dev/null
1291 # Do we have arc4random(), etc ? arc4random_addrandom() has been removed
1292 # from OpenBSD 5.5 onwards.
1294 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1295 AC_CHECK_FUNC(arc4random_addrandom, AC_DEFINE(HAVE_ARC4RANDOM_ADDRANDOM))
1297 sinclude(config.threads.in)dnl
1301 if test "X$GCC" = "Xyes"; then
1305 CCOPT="$CCOPT -pthread"
1306 CCNOOPT="$CCNOOPT -pthread"
1307 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1311 CCOPT="$CCOPT -pthread"
1312 CCNOOPT="$CCNOOPT -pthread"
1315 LIBS="$LIBS -lthread"
1318 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1325 CCOPT="$CCOPT -pthread"
1326 CCNOOPT="$CCNOOPT -pthread"
1331 CCNOOPT="$CCNOOPT -mt"
1334 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1336 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
1338 CCOPT="$CCOPT -Kthread"
1339 CCNOOPT="$CCNOOPT -Kthread"
1343 CCOPT="$CCOPT -Kpthread"
1344 CCNOOPT="$CCNOOPT -Kpthread"
1348 ALWAYS_DEFINES="-D_REENTRANT"
1349 ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
1350 THREADOPTOBJS='${THREADOPTOBJS}'
1351 THREADOPTSRCS='${THREADOPTSRCS}'
1354 # We'd like to use sigwait() too
1356 AC_CHECK_FUNC(sigwait,
1357 AC_DEFINE(HAVE_SIGWAIT),
1358 AC_CHECK_LIB(c, sigwait,
1359 AC_DEFINE(HAVE_SIGWAIT),
1360 AC_CHECK_LIB(pthread, sigwait,
1361 AC_DEFINE(HAVE_SIGWAIT),
1362 AC_CHECK_LIB(pthread, _Psigwait,
1363 AC_DEFINE(HAVE_SIGWAIT),))))
1365 AC_CHECK_FUNC(pthread_attr_getstacksize,
1366 AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1368 AC_CHECK_FUNC(pthread_attr_setstacksize,
1369 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1371 AC_CHECK_HEADERS(sched.h)
1375 AC_CHECK_LIB(rt, sched_yield)
1379 AC_CHECK_FUNCS(sched_yield pthread_yield pthread_yield_np)
1382 # Additional OS-specific issues related to pthreads and sigwait.
1386 # One more place to look for sigwait.
1389 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1391 *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1392 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1393 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1396 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1401 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1402 # called before certain pthreads calls. This is deprecated
1405 *-bsdi3.*|*-bsdi4.0*)
1406 AC_DEFINE(NEED_PTHREAD_INIT)
1409 # LinuxThreads requires some changes to the way we
1410 # deal with signals.
1413 AC_DEFINE(HAVE_LINUXTHREADS)
1416 # Ensure the right sigwait() semantics on Solaris and make
1417 # sure we call pthread_setconcurrency.
1420 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1421 AC_CHECK_FUNC(pthread_setconcurrency,
1422 AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1425 # UnixWare does things its own way.
1427 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1428 AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1433 # Look for sysconf to allow detection of the number of processors.
1435 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1437 ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1438 thread_dir=nothreads
1444 AC_SUBST(ALWAYS_DEFINES)
1445 AC_SUBST(ISC_PLATFORM_USETHREADS)
1446 AC_SUBST(THREADOPTOBJS)
1447 AC_SUBST(THREADOPTSRCS)
1448 ISC_THREAD_DIR=$thread_dir
1449 AC_SUBST(ISC_THREAD_DIR)
1452 # was --with-libxml2 specified?
1454 AC_MSG_CHECKING(for libxml2 library)
1455 AC_ARG_WITH(libxml2,
1456 [ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]],
1457 use_libxml2="$withval", use_libxml2="auto")
1459 case "$use_libxml2" in
1464 case X`(xml2-config --version) 2>/dev/null` in
1466 libxml2_libs=`xml2-config --libs`
1467 libxml2_cflags=`xml2-config --cflags`
1476 if test -f "$use_libxml2/bin/xml2-config" ; then
1477 libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
1478 libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
1483 if test "X$libxml2_libs" != "X"
1485 CFLAGS="$CFLAGS $libxml2_cflags"
1486 LIBS="$LIBS $libxml2_libs"
1488 # Sanity check xml2-config output.
1490 AC_TRY_LINK([#include <libxml/xmlwriter.h>],
1491 [return(xmlTextWriterStartElement(NULL, NULL));],
1493 AC_MSG_ERROR(xml2-config returns badness))
1494 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1500 # In solaris 10, SMF can manage named service
1502 AC_CHECK_LIB(scf, smf_enable_instance)
1505 # flockfile is usually provided by pthreads, but we may want to use it
1506 # even if compiled with --disable-threads. getc_unlocked might also not
1509 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1510 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1513 # Indicate what the final decision was regarding threads.
1515 AC_MSG_CHECKING(whether to build with threads)
1516 if $use_threads; then
1523 # End of pthreads stuff.
1529 AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
1530 want_largefile="yes", want_largefile="no")
1531 case $want_largefile in
1533 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1540 # Additional compiler settings.
1544 IRIX_DNSSEC_WARNINGS_HACK=""
1546 if test "X$GCC" = "Xyes"; then
1547 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1548 AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1549 SAVE_CFLAGS="$CFLAGS"
1550 CFLAGS="$CFLAGS -fno-strict-aliasing"
1551 AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1552 CFLAGS="$SAVE_CFLAGS"
1553 if test "$FNOSTRICTALIASING" = "yes"; then
1555 STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"
1560 # turn off delete null pointer checks
1562 AC_MSG_CHECKING(if "$CC" supports -fno-delete-null-pointer-checks)
1563 SAVE_CFLAGS="$CFLAGS"
1564 CFLAGS="$CFLAGS -fno-delete-null-pointer-checks"
1565 AC_TRY_COMPILE(,, [FNODELETENULLPOINTERCHECKS=yes],
1566 [FNODELETENULLPOINTERCHECKS=no])
1567 CFLAGS="$SAVE_CFLAGS"
1568 if test "$FNODELETENULLPOINTERCHECKS" = "yes"; then
1570 STD_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"
1576 CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
1577 BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
1580 if test "X$enable_warn_error" = Xyes; then
1581 STD_CWARNINGS="$STD_CWARNINGS -Werror"
1588 CCNOOPT="$CCNOOPT -std"
1593 # The version of the C compiler that constantly warns about
1594 # 'const' as well as alignment issues is unfortunately not
1595 # able to be discerned via the version of the operating
1596 # system, nor does cc have a version flag.
1597 case "`$CC +W 123 2>&1`" in
1602 # Turn off the pointlessly noisy warnings.
1603 STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1606 CCOPT="$CCOPT -Ae -z"
1607 CCNOOPT="$CCNOOPT -Ae -z"
1608 CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
1609 BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
1610 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1613 STD_CWARNINGS="-fullwarn -woff 1209"
1615 # Silence more than 250 instances of
1616 # "prototyped function redeclared without prototype"
1617 # and 11 instances of
1618 # "variable ... was set but never used"
1619 # from lib/dns/sec/openssl.
1621 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1626 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1634 AC_SUBST(MKDEPCFLAGS)
1636 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1641 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1644 # -lxnet buys us one big porting headache... standards, gotta love 'em.
1646 # AC_CHECK_LIB(xnet, socket, ,
1647 # AC_CHECK_LIB(socket, socket)
1650 # Use this for now, instead:
1658 AC_CHECK_LIB(socket, socket)
1659 AC_CHECK_LIB(nsl, inet_addr)
1664 # Work around Solaris's select() limitations.
1667 *-solaris2.[[89]]|*-solaris2.1?)
1668 AC_DEFINE(FD_SETSIZE, 65536,
1669 [Solaris hack to get select_large_fdset.])
1676 AC_MSG_CHECKING(whether to use purify)
1678 [ --with-purify[=PATH] use Rational purify],
1679 use_purify="$withval", use_purify="no")
1681 case "$use_purify" in
1685 AC_PATH_PROG(purify_path, purify, purify)
1688 purify_path="$use_purify"
1692 case "$use_purify" in
1698 if test -f $purify_path || test $purify_path = purify; then
1699 AC_MSG_RESULT($purify_path)
1700 PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1701 PURIFY="$purify_path $PURIFYFLAGS"
1703 AC_MSG_ERROR([$purify_path not found.
1705 Please choose the proper path with the following command:
1707 configure --with-purify=PATH
1715 AC_ARG_WITH(libtool,
1716 [ --with-libtool use GNU libtool],
1717 use_libtool="$withval", use_libtool="no")
1719 case $use_libtool in
1724 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1725 LIBTOOL_MODE_COMPILE='--mode=compile --tag=CC'
1726 LIBTOOL_MODE_INSTALL='--mode=install --tag=CC'
1727 LIBTOOL_MODE_LINK='--mode=link --tag=CC'
1728 INSTALL_LIBRARY='${INSTALL_PROGRAM}'
1730 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1733 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1734 *) LIBTOOL_IN_MAIN= ;;
1743 LIBTOOL_MODE_COMPILE=
1744 LIBTOOL_MODE_INSTALL=
1746 LIBTOOL_ALLOW_UNDEFINED=
1748 INSTALL_LIBRARY='${INSTALL_DATA}'
1751 AC_SUBST(INSTALL_LIBRARY)
1754 # enable/disable dumping stack backtrace. Also check if the system supports
1755 # glibc-compatible backtrace() function.
1757 AC_ARG_ENABLE(backtrace,
1758 [ --enable-backtrace log stack backtrace on abort [[default=yes]]],
1759 want_backtrace="$enableval", want_backtrace="yes")
1760 case $want_backtrace in
1762 ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
1763 AC_TRY_LINK([#include <execinfo.h>],
1764 [return (backtrace((void **)0, 0));],
1765 [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
1768 ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1771 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
1773 AC_ARG_ENABLE(symtable,
1774 [ --enable-symtable use internal symbol table for backtrace
1775 [[all|minimal(default)|none]]],
1776 want_symtable="$enableval", want_symtable="minimal")
1777 case $want_symtable in
1778 yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
1779 if test "$PERL" = ""
1781 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
1782 Install perl or explicitly disable the feature by --disable-symtable.])
1784 if test "$use_libtool" = "yes"; then
1785 AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
1787 # we generate the internal symbol table only for those systems
1788 # known to work to avoid unexpected build failure. Also, warn
1789 # about unsupported systems when the feature is enabled
1792 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1793 MKSYMTBL_PROGRAM="$PERL"
1794 if test $want_symtable = all; then
1795 ALWAYS_MAKE_SYMTABLE="yes"
1799 if test $want_symtable = yes -o $want_symtable = all
1801 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1809 AC_SUBST(MKSYMTBL_PROGRAM)
1810 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1813 # File name extension for static archive files, for those few places
1814 # where they are treated differently from dynamic ones.
1821 AC_SUBST(LIBTOOL_MKDEP_SED)
1822 AC_SUBST(LIBTOOL_MODE_COMPILE)
1823 AC_SUBST(LIBTOOL_MODE_INSTALL)
1824 AC_SUBST(LIBTOOL_MODE_LINK)
1825 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1826 AC_SUBST(LIBTOOL_IN_MAIN)
1829 # build exportable DNS library?
1831 AC_ARG_ENABLE(exportlib,
1832 [ --enable-exportlib build exportable library (GNU make required)
1834 case "$enable_exportlib" in
1837 for x in gmake gnumake make; do
1838 if $x --version 2>/dev/null | grep GNU > /dev/null; then
1843 if test -z "$gmake"; then
1844 AC_MSG_ERROR([exportlib requires GNU make. Install it or disable the feature.])
1846 LIBEXPORT=lib/export
1848 BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
1851 BIND9_CO_RULE=".c.$O:"
1854 AC_SUBST(BIND9_CO_RULE)
1856 AC_ARG_WITH(export-libdir,
1857 [ --with-export-libdir[=PATH]
1858 installation directory for the export library
1859 [[EPREFIX/lib/bind9]]],
1860 export_libdir="$withval",)
1861 if test -z "$export_libdir"; then
1862 export_libdir="\${exec_prefix}/lib/bind9/"
1864 AC_SUBST(export_libdir)
1866 AC_ARG_WITH(export-includedir,
1867 [ --with-export-includedir[=PATH]
1868 installation directory for the header files of the
1869 export library [[PREFIX/include/bind9]]],
1870 export_includedir="$withval",)
1871 if test -z "$export_includedir"; then
1872 export_includedir="\${prefix}/include/bind9/"
1874 AC_SUBST(export_includedir)
1877 # Here begins a very long section to determine the system's networking
1878 # capabilities. The order of the tests is significant.
1885 [ --enable-ipv6 use IPv6 [default=autodetect]])
1887 case "$enable_ipv6" in
1889 AC_DEFINE(WANT_IPV6)
1896 # We do the IPv6 compilation checking after libtool so that we can put
1897 # the right suffix on the files.
1899 AC_MSG_CHECKING(for IPv6 structures)
1901 #include <sys/types.h>
1902 #include <sys/socket.h>
1903 #include <netinet/in.h>],
1904 [struct sockaddr_in6 sin6; return (0);],
1911 # See whether IPv6 support is provided via a Kame add-on.
1912 # This is done before other IPv6 linking tests to LIBS is properly set.
1914 AC_MSG_CHECKING(for Kame IPv6 support)
1916 [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
1917 use_kame="$withval", use_kame="no")
1923 kame_path=/usr/local/v6
1926 kame_path="$use_kame"
1935 if test -f $kame_path/lib/libinet6.a; then
1936 AC_MSG_RESULT($kame_path/lib/libinet6.a)
1937 LIBS="-L$kame_path/lib -linet6 $LIBS"
1939 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1941 Please choose the proper path with the following command:
1943 configure --with-kame=PATH
1950 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1951 # Including it on Kame-using platforms is very bad, though, because
1952 # Kame uses #error against direct inclusion. So include it on only
1953 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1954 # This is done before the in6_pktinfo check because that's what
1955 # netinet6/in6.h is needed for.
1960 ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1961 LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1962 isc_netinet6in6_hack="#include <netinet6/in6.h>"
1965 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1966 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1967 isc_netinet6in6_hack=""
1973 # This is similar to the netinet6/in6.h issue.
1976 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1978 ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1979 LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1980 ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1981 isc_netinetin6_hack="#include <netinet/in6.h>"
1984 ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1985 LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1986 ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1987 isc_netinetin6_hack=""
1992 # Now delve deeper into the suitability of the IPv6 support.
1994 case "$found_ipv6" in
1996 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1997 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1999 AC_MSG_CHECKING(for in6_addr)
2001 #include <sys/types.h>
2002 #include <sys/socket.h>
2003 #include <netinet/in.h>
2004 $isc_netinetin6_hack
2005 $isc_netinet6in6_hack
2007 [struct in6_addr in6; return (0);],
2009 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
2010 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
2011 isc_in_addr6_hack=""],
2013 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
2014 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
2015 isc_in_addr6_hack="#define in6_addr in_addr6"])
2017 AC_MSG_CHECKING(for in6addr_any)
2019 #include <sys/types.h>
2020 #include <sys/socket.h>
2021 #include <netinet/in.h>
2022 $isc_netinetin6_hack
2023 $isc_netinet6in6_hack
2026 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
2028 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
2029 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
2031 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
2032 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
2034 AC_MSG_CHECKING(for in6addr_loopback)
2036 #include <sys/types.h>
2037 #include <sys/socket.h>
2038 #include <netinet/in.h>
2039 $isc_netinetin6_hack
2040 $isc_netinet6in6_hack
2043 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
2045 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
2046 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
2048 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
2049 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
2051 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
2053 #include <sys/types.h>
2054 #include <sys/socket.h>
2055 #include <netinet/in.h>
2056 $isc_netinetin6_hack
2057 $isc_netinet6in6_hack
2059 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
2061 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
2062 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
2064 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
2065 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
2066 LWRES_HAVE_SIN6_SCOPE_ID="$result"
2068 AC_MSG_CHECKING(for in6_pktinfo)
2070 #include <sys/types.h>
2071 #include <sys/socket.h>
2072 #include <netinet/in.h>
2073 $isc_netinetin6_hack
2074 $isc_netinet6in6_hack
2076 [struct in6_pktinfo xyzzy; return (0);],
2078 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
2079 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
2080 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
2083 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
2084 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
2085 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
2086 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
2087 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
2088 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
2089 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
2091 ISC_IPV6_O="ipv6.$O"
2092 ISC_ISCIPV6_O="unix/ipv6.$O"
2097 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
2098 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
2099 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
2100 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
2101 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
2102 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
2103 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
2104 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
2105 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
2106 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
2107 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
2108 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
2109 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
2110 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
2111 AC_SUBST(ISC_IPV6_H)
2112 AC_SUBST(ISC_IPV6_O)
2113 AC_SUBST(ISC_ISCIPV6_O)
2114 AC_SUBST(ISC_IPV6_C)
2115 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
2116 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
2118 AC_MSG_CHECKING([for struct if_laddrreq])
2120 #include <sys/types.h>
2121 #include <net/if6.h>
2122 ],[ struct if_laddrreq a; ],
2124 ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
2126 ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
2127 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
2129 AC_MSG_CHECKING([for struct if_laddrconf])
2131 #include <sys/types.h>
2132 #include <net/if6.h>
2133 ],[ struct if_laddrconf a; ],
2135 ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
2137 ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
2138 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
2141 # Check for network functions that are often missing. We do this
2142 # after the libtool checking, so we can put the right suffix on
2143 # the files. It also needs to come after checking for a Kame add-on,
2144 # which provides some (all?) of the desired functions.
2147 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
2149 #include <sys/types.h>
2150 #include <sys/socket.h>
2151 #include <netinet/in.h>
2152 #include <arpa/inet.h>
2154 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
2156 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
2159 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
2160 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
2161 ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
2162 [AC_MSG_RESULT(assuming inet_ntop not needed)
2163 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
2166 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
2167 # addresses with less than four octets, like "1.2.3". Also leading
2168 # zeros should also be rejected.
2170 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
2172 #include <sys/types.h>
2173 #include <sys/socket.h>
2174 #include <netinet/in.h>
2175 #include <arpa/inet.h>
2176 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
2177 inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
2178 (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
2180 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
2182 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
2183 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
2184 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
2185 [AC_MSG_RESULT(assuming inet_pton needed)
2186 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
2187 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
2188 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
2190 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
2191 AC_SUBST(ISC_PLATFORM_NEEDPTON)
2194 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
2198 # Turn on 4.4BSD style sa_len support.
2199 AC_DEFINE(_SOCKADDR_LEN)
2203 AC_MSG_CHECKING(for sa_len in struct sockaddr)
2205 #include <sys/types.h>
2206 #include <sys/socket.h>],
2207 [struct sockaddr sa; sa.sa_len = 0; return (0);],
2209 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
2210 LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
2212 ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
2213 LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
2214 AC_SUBST(ISC_PLATFORM_HAVESALEN)
2215 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
2218 # Look for a 4.4BSD or 4.3BSD struct msghdr
2220 AC_MSG_CHECKING(for struct msghdr flavor)
2222 #include <sys/types.h>
2223 #include <sys/socket.h>],
2224 [struct msghdr msg; msg.msg_flags = 0; return (0);],
2225 [AC_MSG_RESULT(4.4BSD)
2226 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
2227 [AC_MSG_RESULT(4.3BSD)
2228 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
2229 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
2232 # Look for in_port_t.
2234 AC_MSG_CHECKING(for type in_port_t)
2236 #include <sys/types.h>
2237 #include <netinet/in.h>],
2238 [in_port_t port = 25; return (0);],
2240 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
2242 ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
2243 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
2246 # Check for addrinfo
2248 AC_MSG_CHECKING(for struct addrinfo)
2250 #include <netdb.h>],
2251 [struct addrinfo a; return (0);],
2253 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
2254 ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
2255 AC_DEFINE(HAVE_ADDRINFO)],
2257 ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
2258 ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
2259 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
2260 AC_SUBST(ISC_IRS_NEEDADDRINFO)
2263 # Check for rrsetinfo
2265 AC_MSG_CHECKING(for struct rrsetinfo)
2267 #include <netdb.h>],
2268 [struct rrsetinfo r; return (0);],
2270 ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
2272 ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
2273 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
2275 AC_MSG_CHECKING(for int sethostent)
2277 #include <netdb.h>],
2278 [int i = sethostent(0); return(0);],
2280 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
2282 ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
2283 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
2285 AC_MSG_CHECKING(for int endhostent)
2287 #include <netdb.h>],
2288 [int i = endhostent(); return(0);],
2290 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
2292 ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
2293 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
2295 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
2298 struct netent *getnetbyaddr(in_addr_t, int);],
2301 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
2303 ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
2304 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
2306 AC_MSG_CHECKING(for int setnetent)
2308 #include <netdb.h>],
2309 [int i = setnetent(0); return(0);],
2311 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
2313 ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
2314 AC_SUBST(ISC_LWRES_SETNETENTINT)
2316 AC_MSG_CHECKING(for int endnetent)
2318 #include <netdb.h>],
2319 [int i = endnetent(); return(0);],
2321 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
2323 ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
2324 AC_SUBST(ISC_LWRES_ENDNETENTINT)
2326 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
2329 struct hostent *gethostbyaddr(const void *, size_t, int);],
2332 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
2334 ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
2335 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
2337 AC_MSG_CHECKING(for h_errno in netdb.h)
2339 #include <netdb.h>],
2340 [h_errno = 1; return(0);],
2342 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
2344 ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
2345 AC_SUBST(ISC_LWRES_NEEDHERRNO)
2348 # Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
2349 # known variations here:
2351 AC_MSG_CHECKING(for getnameinfo prototype definitions)
2353 #include <sys/types.h>
2354 #include <sys/socket.h>
2356 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2357 socklen_t, char *, socklen_t, unsigned int);],
2359 [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
2360 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
2361 [Define to the buffer length type used by getnameinfo(3).])
2362 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
2363 [Define to the flags type used by getnameinfo(3).])],
2365 #include <sys/types.h>
2366 #include <sys/socket.h>
2368 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2369 size_t, char *, size_t, int);],
2371 [AC_MSG_RESULT(size_t for buflen; int for flags)
2372 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
2373 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
2374 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2375 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
2376 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])
2379 # ...and same for gai_strerror().
2381 AC_MSG_CHECKING(for gai_strerror prototype definitions)
2383 #include <sys/types.h>
2384 #include <sys/socket.h>
2386 char *gai_strerror(int ecode);],
2388 [AC_MSG_RESULT(returning char *)
2389 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
2390 [return type of gai_strerror])],
2391 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2392 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
2394 AC_CHECK_FUNC(getipnodebyname,
2395 [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
2396 [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
2397 AC_CHECK_FUNC(getnameinfo,
2398 [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
2399 [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
2400 AC_CHECK_FUNC(getaddrinfo,
2401 [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
2402 AC_DEFINE(HAVE_GETADDRINFO)],
2403 [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
2404 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
2405 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
2406 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
2407 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
2408 AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
2410 AC_ARG_ENABLE(getifaddrs,
2411 [ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].],
2412 want_getifaddrs="$enableval", want_getifaddrs="yes")
2415 # This interface iteration code for getifaddrs() will fall back to using
2416 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
2419 case $want_getifaddrs in
2421 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2422 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2425 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2432 # Look for a sysctl call to get the list of network interfaces.
2434 case $ac_cv_header_sys_sysctl_h in
2436 AC_MSG_CHECKING(for interface list sysctl)
2437 AC_EGREP_CPP(found_rt_iflist, [
2438 #include <sys/param.h>
2439 #include <sys/sysctl.h>
2440 #include <sys/socket.h>
2441 #ifdef NET_RT_IFLIST
2446 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2447 [AC_MSG_RESULT(no)])
2452 # Check for some other useful functions that are not ever-present.
2455 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
2456 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
2457 # reportedly defines strsep() without declaring it in <string.h> when
2458 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
2459 # AC_CHECK_FUNC() incorrectly succeeds because it declares
2460 # the function itself.
2461 AC_MSG_CHECKING(for correctly declared strsep())
2462 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
2463 [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
2464 [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
2465 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
2467 AC_CHECK_FUNC(memmove,
2468 [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
2469 [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
2470 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
2472 AC_CHECK_FUNC(strtoul,
2473 [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2474 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
2476 [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
2477 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
2478 GENRANDOMLIB='${ISCLIBS}'])
2479 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
2480 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
2481 AC_SUBST(GENRANDOMLIB)
2483 AC_CHECK_FUNC(strlcpy,
2484 [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"
2485 LWRES_PLATFORM_NEEDSTRLCPY="#undef LWRES_PLATFORM_NEEDSTRLCPY"],
2486 [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"
2487 LWRES_PLATFORM_NEEDSTRLCPY="#define LWRES_PLATFORM_NEEDSTRLCPY 1"])
2488 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
2489 AC_SUBST(LWRES_PLATFORM_NEEDSTRLCPY)
2491 AC_CHECK_FUNC(strlcat,
2492 [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
2493 [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
2494 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
2496 AC_CHECK_FUNC(strcasestr,
2497 [ISC_PLATFORM_NEEDSTRCASESTR="#undef ISC_PLATFORM_NEEDSTRCASESTR"],
2498 [ISC_PLATFORM_NEEDSTRCASESTR="#define ISC_PLATFORM_NEEDSTRCASESTR 1"])
2499 AC_SUBST(ISC_PLATFORM_NEEDSTRCASESTR)
2501 AC_SUBST(READLINE_LIB)
2502 AC_ARG_WITH(readline,
2503 [ --with-readline[=LIBSPEC] specify readline library [default -lreadline]],
2504 readline="$withval", readline="-lreadline")
2508 if test "x$readline" = "xyes"
2514 AC_CHECK_FUNCS(readline)
2515 if test "$ac_cv_func_readline" = "yes"
2517 READLINE_LIB="$readline"
2525 AC_MSG_CHECKING(sprintf)
2529 [ char buf[2]; return(*sprintf(buf,"x"));],
2531 ISC_PRINT_OBJS="print.$O"
2532 ISC_PRINT_SRCS="print.c"
2533 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
2534 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
2536 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2537 LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2539 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2540 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
2542 AC_CHECK_FUNC(vsnprintf,
2543 [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
2544 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
2545 [ISC_PRINT_OBJS="print.$O"
2546 ISC_PRINT_SRCS="print.c"
2547 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
2548 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
2549 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
2550 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
2551 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
2552 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
2554 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2556 AC_SUBST(ISC_EXTRA_OBJS)
2557 AC_SUBST(ISC_EXTRA_SRCS)
2560 # Use our own SPNEGO implementation?
2562 AC_ARG_ENABLE(isc-spnego,
2563 [ --disable-isc-spnego use SPNEGO from GSSAPI library])
2565 if test -n "$USE_GSSAPI"
2567 case "$enable_isc_spnego" in
2569 USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
2570 DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
2571 DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
2572 AC_MSG_RESULT(using SPNEGO from lib/dns)
2575 AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2580 AC_SUBST(USE_ISC_SPNEGO)
2582 AC_SUBST(DST_EXTRA_OBJS)
2583 AC_SUBST(DST_EXTRA_SRCS)
2585 # Determine the printf format characters to use when printing
2586 # values of type isc_int64_t. This will normally be "ll", but where
2587 # the compiler treats "long long" as a alias for "long" and printf
2588 # doesn't know about "long long" use "l". Hopefully the sprintf
2589 # will produce a inconsistent result in the later case. If the compiler
2590 # fails due to seeing "%lld" we fall back to "l".
2592 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2593 # %ld even for (long long)/
2595 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2596 # configure on Win32.
2598 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2602 long long int j = 0;
2605 sprintf(buf, "%lld", j);
2606 exit((sizeof(long long int) != sizeof(long int))? 0 :
2607 (strcmp(buf, "0") != 0));
2611 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2612 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
2614 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
2615 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
2616 [AC_MSG_RESULT(assuming target platform uses ll)
2617 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2618 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
2619 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
2620 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
2625 # Note it is very recommended to *not* disable chroot(),
2626 # this is only because chroot() was made obsolete by Posix.
2627 AC_ARG_ENABLE(chroot,
2628 [ --disable-chroot disable chroot])
2629 case "$enable_chroot" in
2631 AC_CHECK_FUNCS(chroot)
2636 AC_ARG_ENABLE(linux-caps,
2637 [ --disable-linux-caps disable linux capabilities])
2638 case "$enable_linux_caps" in
2640 AC_CHECK_HEADERS(linux/types.h)
2641 AC_CHECK_HEADERS([sys/capability.h])
2642 AC_CHECK_HEADERS([linux/capability.h], [], [],
2643 [#ifdef HAVE_LINUX_TYPES_H
2644 #include <linux/types.h>
2647 AC_CHECK_LIB(cap, cap_set_proc)
2652 AC_CHECK_HEADERS(sys/prctl.h)
2654 AC_CHECK_HEADERS(sys/un.h,
2655 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2657 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2659 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2663 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2664 [Define if connect does not honour the permission on the UNIX domain socket.])
2667 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2668 [Define if connect does not honour the permission on the UNIX domain socket.])
2675 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2677 AC_MSG_CHECKING(for optarg declaration)
2682 [AC_MSG_RESULT(yes)],
2684 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2685 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2688 # BSD/OS, and perhaps some others, don't define rlim_t.
2690 AC_MSG_CHECKING(for type rlim_t)
2692 #include <sys/types.h>
2693 #include <sys/time.h>
2694 #include <sys/resource.h>],
2695 [rlim_t rl = 19671212; return (0);],
2697 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2700 AC_MSG_CHECKING(type of rlim_cur)
2702 #include <sys/types.h>
2703 #include <sys/time.h>
2704 #include <sys/resource.h>
2705 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
2707 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
2710 #include <sys/types.h>
2711 #include <sys/time.h>
2712 #include <sys/resource.h>
2713 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
2714 [AC_MSG_RESULT(long int)
2715 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
2718 #include <sys/types.h>
2719 #include <sys/time.h>
2720 #include <sys/resource.h>
2721 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
2722 [AC_MSG_RESULT(long long int)
2723 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
2724 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
2725 ],[AC_MSG_ERROR(this cannot happen)])
2726 ],[AC_MSG_ERROR(this cannot happen)])
2728 AC_ARG_WITH(rlimtype, , rlimtype="$withval", rlimtype="long long int")
2729 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE $rlimtype"
2730 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming $rlimtype)])
2732 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2735 # Older HP-UX doesn't have gettune
2739 AC_CHECK_HEADERS(sys/dyntune.h)
2747 # Compaq TruCluster requires more code for handling cluster IP aliases
2751 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
2752 AC_CHECK_FUNC(clua_getaliasaddress,
2753 AC_DEFINE(HAVE_TRUCLUSTER, 1,
2754 [Define if running under Compaq TruCluster]))
2761 # Some hosts need msg_namelen to match the size of the socket structure.
2762 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
2766 AC_DEFINE(BROKEN_RECVMSG, 1,
2767 [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2772 # Microsoft has their own way of handling shared libraries that requires
2773 # additional qualifiers on extern variables. Unix systems don't need it.
2775 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
2776 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
2777 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
2778 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
2779 AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
2780 IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
2783 # Random remaining OS-specific issues involving compiler warnings.
2784 # XXXDCL print messages to indicate some compensation is being done?
2786 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2787 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2791 hack_shutup_pthreadonceinit=yes
2794 hack_shutup_sputaux=yes
2797 hack_shutup_sigwait=yes
2798 hack_shutup_sputaux=yes
2801 hack_shutup_stdargcast=yes
2804 hack_shutup_pthreadonceinit=yes
2806 *-solaris2.1[[0-9]])
2807 AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
2811 case "$hack_shutup_pthreadonceinit" in
2814 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2816 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2820 case "$hack_shutup_sigwait" in
2823 # Shut up a -Wmissing-prototypes warning for sigwait().
2825 AC_DEFINE(SHUTUP_SIGWAIT)
2829 case "$hack_shutup_sputaux" in
2832 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2834 AC_DEFINE(SHUTUP_SPUTAUX)
2838 case "$hack_shutup_stdargcast" in
2841 # Shut up a -Wcast-qual warning from va_start().
2843 AC_DEFINE(SHUTUP_STDARG_CAST)
2847 AC_CHECK_HEADERS(strings.h,
2848 ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2850 ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2852 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2855 # Check for if_nametoindex() for IPv6 scoped addresses support
2857 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2858 ac_cv_have_if_nametoindex=no)
2859 case $ac_cv_have_if_nametoindex in
2863 AC_CHECK_LIB(ipv6, if_nametoindex,
2864 ac_cv_have_if_nametoindex=yes
2865 LIBS="-lipv6 $LIBS",)
2869 case $ac_cv_have_if_nametoindex in
2871 ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2872 AC_DEFINE(HAVE_IF_NAMETOINDEX, 1)
2875 ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2878 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2880 AC_CHECK_FUNCS(nanosleep usleep)
2883 # Machine architecture dependent features
2885 AC_ARG_ENABLE(atomic,
2886 [ --enable-atomic enable machine specific atomic operations
2887 [[default=autodetect]]],
2888 enable_atomic="$enableval",
2889 enable_atomic="autodetect")
2890 case "$enable_atomic" in
2894 if test "X$GCC" = "Xyes"; then
2895 AC_MSG_CHECKING([if asm("isc"); works])
2897 main() { asm("ics"); exit(0); }
2902 saved_cflags="$CFLAGS"
2903 CFLAGS="$CFLAGS -Wa,-many"
2905 main() { asm("ics"); exit(0); }
2907 [AC_MSG_RESULT([yes, required -Wa,-many])
2909 [AC_MSG_RESULT([no, use_atomic disabled])
2910 CFLAGS="$saved_cflags"
2912 [AC_MSG_RESULT([cross compile, assume yes])
2913 CFLAGS="$saved_cflags"
2932 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2933 if test "$use_atomic" = "yes"; then
2934 AC_MSG_CHECKING([architecture type for atomic operations])
2935 have_atomic=yes # set default
2938 # XXX: some old x86 architectures actually do not support
2939 # (some of) these operations. Do we need stricter checks?
2940 AC_CHECK_SIZEOF([void *])
2941 if test $ac_cv_sizeof_void_p = 8; then
2949 AC_CHECK_SIZEOF([void *])
2950 if test $ac_cv_sizeof_void_p = 8; then
2960 powerpc-*|powerpc64-*)
2963 mips-*|mipsel-*|mips64-*|mips64el-*)
2974 AC_MSG_RESULT($arch)
2977 if test "$have_atomic" = "yes"; then
2978 AC_MSG_CHECKING([compiler support for inline assembly code])
2981 # Check whether the compiler supports the assembly syntax we provide.
2982 if test "X$GCC" = "Xyes"; then
2983 # GCC's ASM extension always works
2985 if test $arch = "x86_64"; then
2986 # We can share the same code for gcc with x86_32
2989 if test $arch = "powerpc"; then
2991 # The MacOS (and maybe others) uses "r0" for register
2992 # zero. Under linux/ibm it is "0" for register 0.
2993 # Probe to see if we have a MacOS style assembler.
2995 AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2997 __asm__ volatile ("li r0, 0x0\n"::);
3001 ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
3002 ], [AC_MSG_RESULT(no)])
3007 # Tru64 compiler has its own syntax for inline
3011 #error "unexpected compiler"
3023 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
3026 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
3033 # See if the generic __asm function works. If not,
3034 # we need to disable the atomic operations.
3038 [compiler="standard"
3039 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
3040 [compiler="not supported (atomic operations disabled)"
3046 AC_MSG_RESULT($compiler)
3049 if test "$have_atomic" = "yes"; then
3050 ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
3051 ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
3052 ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
3054 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
3055 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
3056 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
3059 if test "$have_xaddq" = "yes"; then
3060 ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
3062 ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
3065 AC_SUBST(ISC_PLATFORM_HAVEXADD)
3066 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
3067 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
3068 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
3070 AC_SUBST(ISC_PLATFORM_USEGCCASM)
3071 AC_SUBST(ISC_PLATFORM_USEOSFASM)
3072 AC_SUBST(ISC_PLATFORM_USESTDASM)
3073 AC_SUBST(ISC_PLATFORM_USEMACASM)
3076 AC_SUBST(ISC_ARCH_DIR)
3079 # Activate "rrset-order fixed" or not?
3081 AC_ARG_ENABLE(fixed-rrset,
3082 [ --enable-fixed-rrset enable fixed rrset ordering
3084 enable_fixed="$enableval",
3086 case "$enable_fixed" in
3088 AC_DEFINE(DNS_RDATASET_FIXED, 1,
3089 [Define to enable "rrset-order fixed" syntax.])
3098 # Enable response policy rewriting using NS IP addresses
3100 AC_ARG_ENABLE(rpz-nsip,
3101 [ --disable-rpz-nsip disable rpz-nsip rules [[default=enabled]]],
3102 enable_nsip="$enableval",
3104 case "$enable_nsip" in
3106 AC_DEFINE(ENABLE_RPZ_NSIP, 1,
3107 [Define to enable rpz-nsip rules.])
3116 # Enable response policy rewriting using NS name
3118 AC_ARG_ENABLE(rpz-nsdname,
3119 [ --disable-rpz-nsdname disable rpz-nsdname rules [[default=enabled]]],
3120 enable_nsdname="$enableval",
3121 enable_nsdname="yes")
3122 case "$enable_nsdname" in
3124 AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
3125 [Define to enable rpz-nsdname rules.])
3134 # Activate "filter-aaaa-on-v4" or not?
3136 AC_ARG_ENABLE(filter-aaaa,
3137 [ --enable-filter-aaaa enable filtering of AAAA records over IPv4
3139 enable_filter="$enableval",
3141 case "$enable_filter" in
3143 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
3144 [Define to enable the "filter-aaaa-on-v4" option.])
3153 # The following sets up how non-blocking i/o is established.
3154 # Sunos, cygwin and solaris 2.x (x<5) require special handling.
3157 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
3158 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
3159 *-solaris2.[[01234]])
3160 AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
3161 AC_DEFINE(USE_FIONBIO_IOCTL, 1,
3162 [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
3164 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
3165 [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
3169 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
3170 # This prevents the source address being set.
3173 *-solaris2.[[012345]]|*-solaris2.5.1)
3174 AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
3175 [Define if you cannot bind() before connect() for TCP sockets.])
3179 # The following sections deal with tools used for formatting
3180 # the documentation. They are all optional, unless you are
3181 # a developer editing the documentation source.
3188 AC_PATH_PROGS(LATEX, latex, latex)
3191 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
3198 AC_PATH_PROGS(W3M, w3m, w3m)
3202 # Look for xsltproc (libxslt)
3205 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
3209 # Look for xmllint (libxml2)
3212 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
3219 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
3223 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
3224 # in a number of directories:
3226 # NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
3228 # If the file FILENAME is found in one of the DIRECTORIES, the shell
3229 # variable VARIABLE is defined to its absolute pathname. Otherwise,
3230 # it is set to FILENAME, with no directory prefix (that's not terribly
3231 # useful, but looks less confusing in substitutions than leaving it
3232 # empty). The variable VARIABLE will be substituted into output files.
3235 AC_DEFUN(NOM_PATH_FILE, [
3237 AC_MSG_CHECKING(for $2)
3248 if test "X[$]$1" = "X"
3250 AC_MSG_RESULT("not found");
3257 # Look for Docbook-XSL stylesheets. Location probably varies by system.
3258 # If it's not explicitly specified, guess where it might be found, based on
3259 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
3260 # of at the moment).
3262 AC_MSG_CHECKING(for Docbook-XSL path)
3263 AC_ARG_WITH(docbook-xsl,
3264 [ --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
3265 docbook_path="$withval", docbook_path="auto")
3266 case "$docbook_path" in
3269 docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook /opt/local/share/xsl/docbook-xsl"
3272 docbook_xsl_trees="$withval"
3273 AC_MSG_RESULT($docbook_xsl_trees)
3278 # Look for stylesheets we need.
3281 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
3282 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
3283 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
3284 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
3285 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
3286 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
3287 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
3288 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
3289 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
3292 # Same dance for db2latex
3294 # No idea where this lives except on FreeBSD.
3297 db2latex_xsl_trees="/usr/local/share"
3300 # Look for stylesheets we need.
3303 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
3306 # Look for "admonition" image directory. Can't use NOM_PATH_FILE()
3307 # because it's a directory, so just do the same things, inline.
3310 AC_MSG_CHECKING(for db2latex/xsl/figures)
3311 for d in $db2latex_xsl_trees
3313 dd=$d/db2latex/xsl/figures
3316 XSLT_DB2LATEX_ADMONITIONS=$dd
3321 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
3323 AC_MSG_RESULT(not found)
3324 XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
3326 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
3332 [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
3333 use_idn="$withval", use_idn="no")
3336 if test X$prefix = XNONE ; then
3351 AC_ARG_WITH(libiconv,
3352 [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
3353 use_libiconv="$withval", use_libiconv="no")
3354 case "$use_libiconv" in
3356 if test X$prefix = XNONE ; then
3357 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
3359 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
3366 iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
3371 [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
3372 iconvlib="$withval")
3383 [ --with-idnlib=ARG specify libidnkit],
3384 idnlib="$withval", idnlib="no")
3385 if test "$idnlib" = yes; then
3386 AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
3390 if test "$use_idn" != no; then
3391 AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
3392 STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
3393 if test "$idnlib" != no; then
3394 IDNLIBS="$idnlib $iconvlib"
3396 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
3402 # Check whether to build Automated Test Framework unit tests
3405 [ --with-atf=ARG Automated Test Framework support],
3406 atf="$withval", atf="no")
3407 if test "$atf" = yes; then
3411 AC_CONFIG_COMMANDS([atf-config],
3413 mkdir -p unit/atf-src;
3417 *) srcdir="../../$srcdir";;
3419 ${SHELL} "${srcdir}${srcdir:+/unit/atf-src/}./configure" --enable-tools --disable-shared MISSING=: --prefix $atfdir;
3421 [atfdir=`pwd`/unit/atf])
3422 AC_MSG_RESULT(building ATF from bind9/unit/atf-src)
3426 if test "$atf" != no; then
3427 AC_DEFINE(ATF_TEST, 1, [define if ATF unit tests are to be built.])
3428 STD_CINCLUDES="$STD_CINCLUDES -I$atf/include"
3430 ATFLIBS="-L$atf/lib -latf-c"
3431 if test "$want_openssl_hash" = yes; then
3432 ATFLIBS="-L$atf/lib -latf-c $DNS_CRYPTO_LIBS"
3440 AC_CHECK_HEADERS(locale.h)
3441 AC_CHECK_FUNCS(setlocale)
3446 AC_SUBST(BIND9_TOP_BUILDDIR)
3447 BIND9_TOP_BUILDDIR=`pwd`
3449 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
3450 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
3451 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
3452 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
3453 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
3454 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
3455 if test "X$srcdir" != "X"; then
3456 BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
3457 BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
3458 BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
3459 BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
3460 BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
3461 BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
3463 BIND9_ISC_BUILDINCLUDE=""
3464 BIND9_ISCCC_BUILDINCLUDE=""
3465 BIND9_ISCCFG_BUILDINCLUDE=""
3466 BIND9_DNS_BUILDINCLUDE=""
3467 BIND9_LWRES_BUILDINCLUDE=""
3468 BIND9_BIND9_BUILDINCLUDE=""
3471 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
3472 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
3474 AC_SUBST_FILE(BIND9_MAKE_RULES)
3475 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
3478 BIND9_PRODUCT="PRODUCT=\"${PRODUCT}\""
3479 AC_SUBST(BIND9_PRODUCT)
3480 BIND9_DESCRIPTION="DESCRIPTION=\"${DESCRIPTION}\""
3481 AC_SUBST(BIND9_DESCRIPTION)
3482 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
3483 AC_SUBST(BIND9_VERSION)
3485 BIND9_SRCID="SRCID=unset"
3486 if test -f "${srcdir}/srcid"; then
3488 BIND9_SRCID="SRCID=$SRCID"
3489 elif test -d "${srcdir}/.git"; then
3490 BIND9_SRCID="SRCID="`(cd "${srcdir}";git rev-parse --short HEAD)`
3493 AC_SUBST(BIND9_SRCID)
3495 if test -z "$ac_configure_args"; then
3496 BIND9_CONFIGARGS="defaults"
3498 for a in $ac_configure_args
3500 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
3503 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
3504 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
3505 AC_SUBST(BIND9_CONFIGARGS)
3507 AC_SUBST_FILE(LIBISC_API)
3508 LIBISC_API="$srcdir/lib/isc/api"
3510 AC_SUBST_FILE(LIBISCCC_API)
3511 LIBISCCC_API="$srcdir/lib/isccc/api"
3513 AC_SUBST_FILE(LIBISCCFG_API)
3514 LIBISCCFG_API="$srcdir/lib/isccfg/api"
3516 AC_SUBST_FILE(LIBDNS_API)
3517 LIBDNS_API="$srcdir/lib/dns/api"
3519 AC_SUBST_FILE(LIBBIND9_API)
3520 LIBBIND9_API="$srcdir/lib/bind9/api"
3522 AC_SUBST_FILE(LIBLWRES_API)
3523 LIBLWRES_API="$srcdir/lib/lwres/api"
3525 AC_SUBST_FILE(LIBIRS_API)
3526 LIBIRS_API="$srcdir/lib/irs/api"
3529 # Configure any DLZ drivers.
3531 # If config.dlz.in selects one or more DLZ drivers, it will set
3532 # CONTRIB_DLZ to a non-empty value, which will be our clue to
3533 # build DLZ drivers in contrib.
3535 # This section has to come after the libtool stuff because it needs to
3536 # know how to name the driver object files.
3540 DLZ_DRIVER_INCLUDES=""
3547 # Configure support for building a shared library object
3549 # Even when libtool is available it can't always be relied upon
3550 # to build an object that can be dlopen()'ed, but this is necessary
3551 # for building the dlzexternal system test, so we'll try it the
3552 # old-fashioned way.
3561 [ --with-dlopen=ARG Support dynamically loadable DLZ drivers],
3562 dlopen="$withval", dlopen="yes")
3565 *-sunos*) dlopen="no"
3569 if test "$dlopen" = "yes"; then
3570 AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
3571 if test "$have_dl" = "yes"; then
3574 AC_CHECK_FUNCS(dlopen dlclose dlsym,,dlopen=no)
3577 if test "$dlopen" = "yes"; then
3582 if test "$have_dl" = "yes"
3584 if test "$use_libtool" = "yes"; then
3585 SO_LDFLAGS="-Xcompiler -shared"
3588 SO_LDFLAGS="-shared"
3592 SO_LDFLAGS="-shared"
3596 *-freebsd*|*-openbsd*|*-netbsd*)
3598 SO_LDFLAGS="-Bshareable -x"
3603 SO_LDFLAGS="-G -z text"
3609 SO_LDFLAGS="-b +vnocompatwarnings"
3617 if test "X$GCC" = "Xyes"; then
3621 if test "$use_libtool" = "yes"; then
3622 SO_LDFLAGS="-Xcompiler -shared"
3625 SO_LDFLAGS="-shared"
3631 # If we still don't know how to make shared objects, don't make any.
3632 if test -n "$SO_LD"; then
3633 SO_TARGETS="\${SO_TARGETS}"
3634 AC_DEFINE(ISC_DLZ_DLOPEN, 1,
3635 [Define to allow building of objects for dlopen().])
3641 AC_SUBST(SO_LDFLAGS)
3643 AC_SUBST(SO_TARGETS)
3645 sinclude(contrib/dlz/config.dlz.in)
3646 AC_MSG_CHECKING(contributed DLZ drivers)
3648 if test -n "$CONTRIB_DLZ"
3651 DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3652 AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3655 DLZ_DRIVER_RULES=/dev/null
3658 AC_SUBST(CONTRIB_DLZ)
3659 AC_SUBST(DLZ_DRIVER_INCLUDES)
3660 AC_SUBST(DLZ_DRIVER_LIBS)
3661 AC_SUBST(DLZ_DRIVER_SRCS)
3662 AC_SUBST(DLZ_DRIVER_OBJS)
3663 AC_SUBST(DLZ_SYSTEM_TEST)
3664 AC_SUBST_FILE(DLZ_DRIVER_RULES)
3666 if test "$cross_compiling" = "yes"; then
3667 if test -z "$BUILD_CC"; then
3668 AC_MSG_ERROR([BUILD_CC not set])
3670 BUILD_CFLAGS="$BUILD_CFLAGS"
3671 BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3672 BUILD_LDFLAGS="$BUILD_LDFLAGS"
3673 BUILD_LIBS="$BUILD_LIBS"
3676 BUILD_CFLAGS="$CFLAGS"
3677 BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3678 BUILD_LDFLAGS="$LDFLAGS"
3683 for e in $BUILD_LDFLAGS ; do
3688 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3689 NEWFLAGS="$NEWFLAGS $e $ee"
3692 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3693 NEWFLAGS="$NEWFLAGS $e $ee"
3696 ee=`echo $e | sed -e 's%^-L%-R%'`
3697 NEWFLAGS="$NEWFLAGS $e $ee"
3700 NEWFLAGS="$NEWFLAGS $e"
3705 NEWFLAGS="$NEWFLAGS $e"
3709 BUILD_LDFLAGS="$NEWFLAGS"
3712 for e in $DNS_GSSAPI_LIBS ; do
3717 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3718 NEWFLAGS="$NEWFLAGS $e $ee"
3721 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3722 NEWFLAGS="$NEWFLAGS $e $ee"
3725 ee=`echo $e | sed -e 's%^-L%-R%'`
3726 NEWFLAGS="$NEWFLAGS $e $ee"
3729 NEWFLAGS="$NEWFLAGS $e"
3734 NEWFLAGS="$NEWFLAGS $e"
3738 DNS_GSSAPI_LIBS="$NEWFLAGS"
3741 for e in $DNS_CRYPTO_LIBS ; do
3746 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3747 NEWFLAGS="$NEWFLAGS $e $ee"
3750 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3751 NEWFLAGS="$NEWFLAGS $e $ee"
3754 ee=`echo $e | sed -e 's%^-L%-R%'`
3755 NEWFLAGS="$NEWFLAGS $e $ee"
3758 NEWFLAGS="$NEWFLAGS $e"
3763 NEWFLAGS="$NEWFLAGS $e"
3767 DNS_CRYPTO_LIBS="$NEWFLAGS"
3770 AC_SUBST(BUILD_CFLAGS)
3771 AC_SUBST(BUILD_CPPFLAGS)
3772 AC_SUBST(BUILD_LDFLAGS)
3773 AC_SUBST(BUILD_LIBS)
3776 # Commands to run at the end of config.status.
3777 # Don't just put these into configure, it won't work right if somebody
3778 # runs config.status directly (which autoconf allows).
3783 [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
3786 # Files to configure. These are listed here because we used to
3787 # specify them as arguments to AC_OUTPUT. It's (now) ok to move these
3788 # elsewhere if there's a good reason for doing so.
3797 bin/confgen/Makefile
3798 bin/confgen/unix/Makefile
3802 bin/named/unix/Makefile
3803 bin/nsupdate/Makefile
3806 bin/python/dnssec-checkds.py
3807 bin/python/dnssec-coverage.py
3810 bin/tests/atomic/Makefile
3811 bin/tests/db/Makefile
3812 bin/tests/dst/Makefile
3813 bin/tests/dst/Kdh.+002+18602.key
3814 bin/tests/dst/Kdh.+002+18602.private
3815 bin/tests/dst/Kdh.+002+48957.key
3816 bin/tests/dst/Kdh.+002+48957.private
3817 bin/tests/dst/Ktest.+001+00002.key
3818 bin/tests/dst/Ktest.+001+54622.key
3819 bin/tests/dst/Ktest.+001+54622.private
3820 bin/tests/dst/Ktest.+003+23616.key
3821 bin/tests/dst/Ktest.+003+23616.private
3822 bin/tests/dst/Ktest.+003+49667.key
3823 bin/tests/dst/dst_2_data
3824 bin/tests/dst/t2_data_1
3825 bin/tests/dst/t2_data_2
3826 bin/tests/dst/t2_dsasig
3827 bin/tests/dst/t2_rsasig
3828 bin/tests/hashes/Makefile
3829 bin/tests/headerdep_test.sh
3830 bin/tests/master/Makefile
3831 bin/tests/mem/Makefile
3832 bin/tests/names/Makefile
3833 bin/tests/net/Makefile
3834 bin/tests/rbt/Makefile
3835 bin/tests/resolver/Makefile
3836 bin/tests/sockaddr/Makefile
3837 bin/tests/system/Makefile
3838 bin/tests/system/conf.sh
3839 bin/tests/system/builtin/Makefile
3840 bin/tests/system/dlz/prereq.sh
3841 bin/tests/system/dlzexternal/Makefile
3842 bin/tests/system/dlzexternal/ns1/named.conf
3843 bin/tests/system/filter-aaaa/Makefile
3844 bin/tests/system/inline/checkdsa.sh
3845 bin/tests/system/lwresd/Makefile
3846 bin/tests/system/rpz/Makefile
3847 bin/tests/system/rrl/Makefile
3848 bin/tests/system/rsabigexponent/Makefile
3849 bin/tests/system/tkey/Makefile
3850 bin/tests/system/tsiggss/Makefile
3851 bin/tests/tasks/Makefile
3852 bin/tests/timers/Makefile
3853 bin/tests/virtual-time/Makefile
3854 bin/tests/virtual-time/conf.sh
3856 contrib/check-secure-delegation.pl
3857 contrib/zone-edit.sh
3860 doc/doxygen/Doxyfile
3861 doc/doxygen/Makefile
3862 doc/doxygen/doxygen-input-filter
3865 doc/xsl/isc-docbook-chunk.xsl
3866 doc/xsl/isc-docbook-html.xsl
3867 doc/xsl/isc-docbook-latex.xsl
3868 doc/xsl/isc-manpage.xsl
3872 lib/bind9/include/Makefile
3873 lib/bind9/include/bind9/Makefile
3875 lib/dns/include/Makefile
3876 lib/dns/include/dns/Makefile
3877 lib/dns/include/dst/Makefile
3878 lib/dns/tests/Makefile
3880 lib/export/dns/Makefile
3881 lib/export/dns/include/Makefile
3882 lib/export/dns/include/dns/Makefile
3883 lib/export/dns/include/dst/Makefile
3884 lib/export/irs/Makefile
3885 lib/export/irs/include/Makefile
3886 lib/export/irs/include/irs/Makefile
3887 lib/export/isc/$thread_dir/Makefile
3888 lib/export/isc/$thread_dir/include/Makefile
3889 lib/export/isc/$thread_dir/include/isc/Makefile
3890 lib/export/isc/Makefile
3891 lib/export/isc/include/Makefile
3892 lib/export/isc/include/isc/Makefile
3893 lib/export/isc/nls/Makefile
3894 lib/export/isc/unix/Makefile
3895 lib/export/isc/unix/include/Makefile
3896 lib/export/isc/unix/include/isc/Makefile
3897 lib/export/isccfg/Makefile
3898 lib/export/isccfg/include/Makefile
3899 lib/export/isccfg/include/isccfg/Makefile
3900 lib/export/samples/Makefile
3901 lib/export/samples/Makefile-postinstall
3903 lib/irs/include/Makefile
3904 lib/irs/include/irs/Makefile
3905 lib/irs/include/irs/netdb.h
3906 lib/irs/include/irs/platform.h
3907 lib/isc/$arch/Makefile
3908 lib/isc/$arch/include/Makefile
3909 lib/isc/$arch/include/isc/Makefile
3910 lib/isc/$thread_dir/Makefile
3911 lib/isc/$thread_dir/include/Makefile
3912 lib/isc/$thread_dir/include/isc/Makefile
3914 lib/isc/include/Makefile
3915 lib/isc/include/isc/Makefile
3916 lib/isc/include/isc/platform.h
3917 lib/isc/tests/Makefile
3918 lib/isc/nls/Makefile
3919 lib/isc/unix/Makefile
3920 lib/isc/unix/include/Makefile
3921 lib/isc/unix/include/isc/Makefile
3923 lib/isccc/include/Makefile
3924 lib/isccc/include/isccc/Makefile
3926 lib/isccfg/include/Makefile
3927 lib/isccfg/include/isccfg/Makefile
3929 lib/lwres/include/Makefile
3930 lib/lwres/include/lwres/Makefile
3931 lib/lwres/include/lwres/netdb.h
3932 lib/lwres/include/lwres/platform.h
3933 lib/lwres/man/Makefile
3934 lib/lwres/tests/Makefile
3935 lib/lwres/unix/Makefile
3936 lib/lwres/unix/include/Makefile
3937 lib/lwres/unix/include/lwres/Makefile
3939 lib/tests/include/Makefile
3940 lib/tests/include/tests/Makefile
3952 # Now that the Makefiles exist we can ensure that everything is rebuilt.
3954 AC_ARG_WITH(make-clean,
3955 [ --with-make-clean Run "make clean" at end of configure [[yes|no]].],
3956 make_clean="$withval", make_clean="yes")
3957 case "$make_clean" in
3963 AC_ARG_ENABLE(full-report,
3964 [ --enable-full-report report values of all configure options])
3966 echo "========================================================================"
3967 echo "Configuration summary:"
3968 echo "------------------------------------------------------------------------"
3969 echo "Optional features enabled:"
3970 $use_threads && echo " Multiprocessing support (--enable-threads)"
3972 test "$enable_rrl" = "yes" && \
3973 echo " Response Rate Limiting (--enable-rrl)"
3974 test "$use_gssapi" = "no" || echo " GSS-API (--with-gssapi)"
3975 test "$use_pkcs11" = "no" || echo " PKCS#11/Cryptoki support (--with-pkcs11)"
3976 test "$enable_newstats" = "yes" && \
3977 echo " New statistics (--enable-newstats)"
3978 test "$enable_fixed" = "yes" && \
3979 echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
3980 test "$enable_filter" = "yes" && \
3981 echo " AAAA filtering (--enable-filter-aaaa)"
3982 test "$want_backtrace" = "yes" && \
3983 echo " Print backtrace on crash (--enable-backtrace)"
3984 test "$want_symtable" = "minimal" && \
3985 echo " Use symbol table for backtrace, named only (--enable-symtable)"
3986 test "$want_symtable" = "yes" -o "$want_symtable" = "all" && \
3987 echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
3988 test "$atf" = "no" || echo " Automated Testing Framework (--with-atf)"
3990 # these lines are only printed if run with --enable-full-report
3991 if test "$enable_full_report" = "yes"; then
3992 test "$enable_ipv6" = "no" -o "$found_ipv6" = "no" || \
3993 echo " IPv6 support (--enable-ipv6)"
3994 test "X$USE_OPENSSL" = "X" || \
3995 echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
3996 test "$OPENSSL_GOST" != "yes" || \
3997 echo " GOST algorithm support (--with-gost)"
3998 test "$OPENSSL_ECDSA" != "yes" || \
3999 echo " ECDSA algorithm support (--with-ecdsa)"
4000 test "X$PYTHON" = "X" || echo " Python tools (--with-python)"
4001 test "X$libxml2_libs" = "X" || echo " XML statistics (--with-libxml2)"
4004 echo " Dynamically loadable zone (DLZ) drivers:"
4005 test "$use_dlz_bdb" = "no" || \
4006 echo " Berkeley DB (--with-dlz-bdb)"
4007 test "$use_dlz_ldap" = "no" || \
4008 echo " LDAP (--with-dlz-ldap)"
4009 test "$use_dlz_mysql" = "no" || \
4010 echo " MySQL (--with-dlz-mysql)"
4011 test "$use_dlz_odbc" = "no" || \
4012 echo " ODBC (--with-dlz-odbc)"
4013 test "$use_dlz_postgres" = "no" || \
4014 echo " Postgres (--with-dlz-postgres)"
4015 test "$use_dlz_filesystem" = "no" || \
4016 echo " Filesystem (--with-dlz-filesystem)"
4017 test "$use_dlz_stub" = "no" || \
4018 echo " Stub (--with-dlz-stub)"
4019 test "$use_dlz_bdb $use_dlz_ldap $use_dlz_mysql $use_dlz_odbc $use_dlz_postgres $use_dlz_filesystem $use_dlz_stub" = "no no no no no no no" && echo " None"
4022 echo "Features disabled or unavailable on this platform:"
4023 $use_threads || echo " Multiprocessing support (--enable-threads)"
4024 test "$enable_ipv6" = "no" -o "$found_ipv6" = "no" && \
4025 echo " IPv6 support (--enable-ipv6)"
4026 test "$enable_rrl" = "yes" || \
4027 echo " Response Rate Limiting (--enable-rrl)"
4028 test "$use_gssapi" = "no" && echo " GSS-API (--with-gssapi)"
4029 test "$use_pkcs11" = "no" && echo " PKCS#11/Cryptoki support (--with-pkcs11)"
4030 test "X$enable_newstats" = "X" && echo " New statistics (--enable-newstats)"
4031 test "$enable_fixed" = "yes" || \
4032 echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
4033 test "$want_backtrace" = "yes" || \
4034 echo " Print backtrace on crash (--enable-backtrace)"
4035 test "$atf" = "no" && echo " Automated Testing Framework (--with-atf)"
4036 test "X$USE_OPENSSL" = "X" && \
4037 echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
4038 test "X$USE_OPENSSL" != "X" -a "$OPENSSL_GOST" != "yes" && \
4039 echo " GOST algorithm support (--with-gost)"
4040 test "X$USE_OPENSSL" != "X" -a "$OPENSSL_ECDSA" != "yes" && \
4041 echo " ECDSA algorithm support (--with-ecdsa)"
4042 test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
4043 test "X$libxml2_libs" = "X" && echo " XML statistics (--with-libxml2)"
4045 if test "X$ac_unrecognized_opts" != "X"; then
4047 echo "Unrecognized options:"
4048 echo " $ac_unrecognized_opts"
4050 echo "========================================================================"
4052 if test "X$USE_OPENSSL" = "X"; then
4054 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
4058 if test "X$OPENSSL_WARNING" != "X"; then
4060 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4061 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4063 WARNING Your OpenSSL crypto library may be vulnerable to WARNING
4064 WARNING one or more of the the following known security WARNING
4065 WARNING flaws: WARNING
4067 WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
4068 WARNING CVE-2006-2940. WARNING
4070 WARNING It is recommended that you upgrade to OpenSSL WARNING
4071 WARNING version 0.9.8d/0.9.7l (or greater). WARNING
4073 WARNING You can disable this warning by specifying: WARNING
4075 WARNING --disable-openssl-version-check WARNING
4077 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4078 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4082 # Tell Emacs to edit this file in shell mode.