1 # Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 1998-2003 Internet Software Consortium.
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
18 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
21 AC_REVISION($Revision: 1.512.8.15 $)
23 AC_INIT(lib/dns/name.c)
26 AC_CONFIG_HEADER(config.h)
37 # Just set the maximum command line length for sunos as it otherwise
38 # takes a exceptionally long time to work it out. Required for libtool.
40 lt_cv_sys_max_cmd_len=4096;
48 AC_SUBST(STD_CINCLUDES)
49 AC_SUBST(STD_CDEFINES)
50 AC_SUBST(STD_CWARNINGS)
53 # Warn if the user specified libbind, which is now deprecated
54 AC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
56 case "$enable_libbind" in
58 AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
59 It is available from http://www.isc.org as a separate download.])
65 AC_ARG_ENABLE(developer, [ --enable-developer enable developer build settings])
66 case "$enable_developer" in
68 test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
69 test "${with_atf+set}" = set || with_atf=yes
70 test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
71 test "${enable_rpz_nsip+set}" = set || enable_rpz_nsip=yes
72 test "${enable_rpz_nsdname+set}" = set || enable_rpz_nsdname=yes
73 test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
76 test "${enable_exportlib+set}" = set || enable_exportlib=yes
79 test "${enable_exportlib+set}" = set || enable_exportlib=yes
85 # Make very sure that these are the first files processed by
86 # config.status, since we use the processed output as the input for
87 # AC_SUBST_FILE() substitutions in other files.
89 AC_CONFIG_FILES([make/rules make/includes])
96 # The POSIX ln(1) program. Non-POSIX systems may substitute
97 # "copy" or something.
104 ar program not found. Please fix your PATH to include the directory in
105 which ar resides, or set AR in the environment with the full path to ar.
114 AC_PATH_PROGS(ETAGS, etags emacs-etags)
117 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
118 # GNU emacs etags, and it requires the -L flag.
120 if test "X$ETAGS" != "X"; then
121 AC_MSG_CHECKING(for Exuberant Ctags etags)
122 if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
132 # Perl is optional; it is used only by some of the system test scripts.
133 # Note: the backtrace feature (see below) uses perl to build the symbol table,
134 # but it still compiles without perl, in which case an empty table will be used.
136 AC_PATH_PROGS(PERL, perl5 perl)
140 # Special processing of paths depending on whether --prefix,
141 # --sysconfdir or --localstatedir arguments were given. What's
142 # desired is some compatibility with the way previous versions
143 # of BIND built; they defaulted to /usr/local for most parts of
144 # the installation, but named.boot/named.conf was in /etc
145 # and named.pid was in /var/run.
147 # So ... if none of --prefix, --sysconfdir or --localstatedir are
148 # specified, set things up that way. If --prefix is given, use
149 # it for sysconfdir and localstatedir the way configure normally
150 # would. To change the prefix for everything but leave named.conf
151 # in /etc or named.pid in /var/run, then do this the usual configure way:
152 # ./configure --prefix=/somewhere --sysconfdir=/etc
153 # ./configure --prefix=/somewhere --localstatedir=/var
155 # To put named.conf and named.pid in /usr/local with everything else,
156 # set the prefix explicitly to /usr/local even though that's the default:
157 # ./configure --prefix=/usr/local
161 case "$sysconfdir" in
166 case "$localstatedir" in
175 # Make sure INSTALL uses an absolute path, else it will be wrong in all
176 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
177 # configure based on the location of the file where it is substituted.
178 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
179 # subdirectory of install-sh, This relative path will be wrong for all
180 # directories more than one level down from install-sh.
187 # Not all systems have dirname.
190 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
193 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
194 test "$ac_dir" = "$ac_prog" && ac_dir=.
195 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
196 INSTALL="$ac_dir/$ac_prog"
201 # On these hosts, we really want to use cc, not gcc, even if it is
202 # found. The gcc that these systems have will not correctly handle
205 # However, if the user sets $CC to be something, let that override
208 if test "X$CC" = "X" ; then
214 # Use Sun's cc if it is available, but watch
215 # out for /usr/ucb/cc; it will never be the right
218 # If setting CC here fails, the AC_PROG_CC done
219 # below might still find gcc.
220 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
221 for ac_dir in $PATH; do
222 test -z "$ac_dir" && ac_dir=.
228 if test -f "$ac_dir/cc"; then
249 # gcc's optimiser is broken at -02 for ultrasparc
251 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
260 # OS dependent CC flags
263 # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
264 # -D_XOPEN_SOURCE_EXTENDED.
266 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
267 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
269 #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
271 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
272 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
275 # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
277 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
278 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
280 # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
281 # parts of the IPv6 Advanced Socket API as a result. This is stupid
282 # as it breaks how the two halves (Basic and Advanced) of the IPv6
283 # Socket API were designed to be used but we have to live with it.
284 # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
285 *-linux* | *-kfreebsd*-gnu)
286 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
287 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
290 # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
291 # Setting this is sufficient to select the correct behavior for BIND 9.
294 STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
295 CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
301 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,,,
302 [$ac_includes_default
303 #ifdef HAVE_SYS_PARAM_H
304 # include <sys/param.h>
311 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
312 AC_C_FLEXIBLE_ARRAY_MEMBER
315 # Older versions of HP/UX don't define seteuid() and setegid()
317 AC_CHECK_FUNCS(seteuid setresuid)
318 AC_CHECK_FUNCS(setegid setresgid)
321 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
322 # is reported to not support "static inline" (RT #1212).
324 AC_MSG_CHECKING(for static inline breakage)
329 static inline int foo1() {
333 static inline int foo2() {
338 AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
341 AC_CHECK_TYPE(ssize_t, int)
342 AC_CHECK_TYPE(uintptr_t,unsigned long)
343 AC_CHECK_TYPE(socklen_t,
344 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
348 #include <sys/types.h>
349 #include <sys/socket.h>
350 int getsockname(int, struct sockaddr *, size_t *);
352 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
353 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
356 #include <sys/types.h>
357 #include <sys/socket.h>
359 AC_SUBST(ISC_SOCKADDR_LEN_T)
361 AC_MSG_CHECKING(for long long)
362 AC_TRY_COMPILE([],[long long i = 0; return (0);],
364 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
366 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
367 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
370 # check for GCC noreturn attribute
372 AC_MSG_CHECKING(for GCC noreturn attribute)
373 AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
375 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
376 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
378 ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
379 ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
380 AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
381 AC_SUBST(ISC_PLATFORM_NORETURN_POST)
384 # check if we have lifconf
386 AC_MSG_CHECKING(for struct lifconf)
388 #include <sys/types.h>
389 #include <sys/socket.h>
393 struct lifconf lifconf;
394 lifconf.lifc_len = 0;
398 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
400 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
401 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
404 # check if we have kqueue
406 AC_ARG_ENABLE(kqueue,
407 [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
408 want_kqueue="$enableval", want_kqueue="yes")
411 AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
412 case $ac_cv_have_kqueue in
414 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
417 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
422 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
425 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
428 # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
429 # so we need to try running the code, not just test its existence.
432 [ --enable-epoll use Linux epoll when available [[default=auto]]],
433 want_epoll="$enableval", want_epoll="auto")
436 AC_MSG_CHECKING(epoll support)
438 #include <sys/epoll.h>
440 if (epoll_create(1) < 0)
446 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
448 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
451 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
454 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
457 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
460 # check if we support /dev/poll
462 AC_ARG_ENABLE(devpoll,
463 [ --enable-devpoll use /dev/poll when available [[default=yes]]],
464 want_devpoll="$enableval", want_devpoll="yes")
465 case $want_devpoll in
467 AC_CHECK_HEADERS(sys/devpoll.h devpoll.h,
468 ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
470 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
474 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
477 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
480 # check if we need to #include sys/select.h explicitly
482 case $ac_cv_header_unistd_h in
484 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
486 #include <sys/types.h> /* Ultrix */
487 #include <unistd.h>],
488 [fd_set read_set; return (0);],
490 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
491 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
493 case $ac_cv_header_sys_select_h in
495 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
496 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
499 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
505 case $ac_cv_header_sys_select_h in
507 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
508 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
511 AC_MSG_ERROR([need either unistd.h or sys/select.h])
516 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
517 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
520 # Find the machine's endian flavor.
525 # was --with-openssl specified?
528 AC_MSG_CHECKING(for OpenSSL library)
530 [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
531 (Required for DNSSEC)],
532 use_openssl="$withval", use_openssl="auto")
534 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
535 if test "$use_openssl" = "auto"
537 for d in $openssldirs
539 if test -f $d/include/openssl/opensslv.h
547 case "$use_openssl" in
561 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
562 If you don't want OpenSSL, use --without-openssl])
565 if test "$use_openssl" = "yes"
567 # User did not specify a path - guess it
568 for d in $openssldirs
570 if test -f $d/include/openssl/opensslv.h
576 if test "$use_openssl" = "yes"
578 AC_MSG_RESULT(not found)
580 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
582 elif ! test -f "$use_openssl"/include/openssl/opensslv.h
584 AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
586 USE_OPENSSL='-DOPENSSL'
587 if test "$use_openssl" = "/usr"
590 DNS_OPENSSL_LIBS="-lcrypto"
592 DST_OPENSSL_INC="-I$use_openssl/include"
595 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
598 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
602 # Apple's ld seaches for serially for dynamic
603 # then static libraries. This means you can't
604 # use -L to override dynamic system libraries
605 # with static ones when linking. Instead
606 # we specify a absolute path.
608 if test -f "$use_openssl/lib/libcrypto.dylib"
610 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
612 DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
616 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
620 AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
622 saved_cflags="$CFLAGS"
624 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
625 LIBS="$LIBS $DNS_OPENSSL_LIBS"
626 AC_MSG_CHECKING(whether linking with OpenSSL works)
628 #include <openssl/err.h>
634 [AC_MSG_RESULT(yes)],
636 AC_MSG_ERROR(Could not run test program using OpenSSL from
637 $use_openssl/lib and $use_openssl/include.
638 Please check the argument to --with-openssl and your
639 shared library configuration (e.g., LD_LIBRARY_PATH).)],
640 [AC_MSG_RESULT(assuming it does work on target platform)])
642 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
644 #include <openssl/err.h>],
645 [ DSO_METHOD_dlfcn(); ],
649 #include <openssl/err.h>
650 ],[ DSO_METHOD_dlfcn(); ],
652 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
654 [AC_MSG_RESULT(unknown)
655 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
656 [AC_MSG_RESULT(assuming it does work on target platform)])
658 [AC_MSG_RESULT(assuming it does work on target platform)]
661 AC_ARG_ENABLE(openssl-version-check,
662 [AC_HELP_STRING([--enable-openssl-version-check],
663 [Check OpenSSL Version @<:@default=yes@:>@])])
664 case "$enable_openssl_version_check" in
666 AC_MSG_CHECKING(OpenSSL library version)
669 #include <openssl/opensslv.h>
671 if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
672 OPENSSL_VERSION_NUMBER < 0x00908000L) ||
673 OPENSSL_VERSION_NUMBER >= 0x0090804fL)
675 printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
676 OPENSSL_VERSION_NUMBER);
677 printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
678 "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
683 [AC_MSG_RESULT(not compatible)
686 [AC_MSG_RESULT(assuming target platform has compatible version)])
689 AC_MSG_RESULT(Skipped OpenSSL version check)
693 AC_MSG_CHECKING(for OpenSSL DSA support)
694 if test -f $use_openssl/include/openssl/dsa.h
696 AC_DEFINE(HAVE_OPENSSL_DSA)
701 AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
703 AC_MSG_CHECKING(for OpenSSL GOST support)
706 #include <openssl/conf.h>
707 #include <openssl/engine.h>
709 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
714 OPENSSL_config(NULL);
716 e = ENGINE_by_id("gost");
719 if (ENGINE_init(e) <= 0)
731 [AC_MSG_RESULT(using --with-gost)])
732 AC_ARG_WITH(gost, , with_gost="$withval", with_gost="auto")
736 no) AC_MSG_ERROR([gost not supported]) ;;
745 *) AC_MSG_ERROR([need --with-gost=[[yes or no]]]) ;;
752 AC_DEFINE(HAVE_OPENSSL_GOST, 1,
753 [Define if your OpenSSL version supports GOST.])
758 CFLAGS="$saved_cflags"
760 OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
761 OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
767 # This would include the system openssl path (and linker options to use
768 # it as needed) if it is found.
771 AC_SUBST(USE_OPENSSL)
772 AC_SUBST(DST_OPENSSL_INC)
773 AC_SUBST(OPENSSLLINKOBJS)
774 AC_SUBST(OPENSSLLINKSRCS)
775 AC_SUBST(OPENSSL_GOST)
776 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
779 # Use OpenSSL for hash functions
782 AC_ARG_ENABLE(openssl-hash,
783 [ --enable-openssl-hash use OpenSSL for hash functions [[default=no]]],
784 want_openssl_hash="$enableval", want_openssl_hash="no")
785 case $want_openssl_hash in
787 if test "$USE_OPENSSL" = ""
789 AC_MSG_ERROR([No OpenSSL for hash functions])
791 ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
792 ISC_OPENSSL_INC="$DST_OPENSSL_INC"
795 ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
799 AC_SUBST(ISC_PLATFORM_OPENSSLHASH)
800 AC_SUBST(ISC_OPENSSL_INC)
803 # PKCS11 (aka crypto hardware) support
805 # This works only with the right OpenSSL with PKCS11 engine!
808 AC_MSG_CHECKING(for PKCS11 support)
810 [ --with-pkcs11[=PATH] Build with PKCS11 support [yes|no|path]
811 (PATH is for the PKCS11 provider)],
812 use_pkcs11="$withval", use_pkcs11="no")
814 case "$use_pkcs11" in
816 AC_MSG_RESULT(disabled)
821 AC_MSG_RESULT(using OpenSSL with PKCS11 support)
822 USE_PKCS11='-DUSE_PKCS11'
827 AC_SUBST(PKCS11_TOOLS)
829 AC_MSG_CHECKING(for PKCS11 tools)
830 case "$use_pkcs11" in
832 AC_MSG_RESULT(disabled)
833 PKCS11_PROVIDER="undefined"
836 AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
837 PKCS11_PROVIDER="$use_pkcs11"
840 AC_SUBST(PKCS11_PROVIDER)
842 AC_MSG_CHECKING(for GSSAPI library)
844 [ --with-gssapi=PATH Specify path for system-supplied GSSAPI [[default=yes]]],
845 use_gssapi="$withval", use_gssapi="yes")
847 # gssapi is just the framework, we really require kerberos v5, so
848 # look for those headers (the gssapi headers must be there, too)
849 # The problem with this implementation is that it doesn't allow
850 # for the specification of gssapi and krb5 headers in different locations,
851 # which probably ought to be fixed although fixing might raise the issue of
852 # trying to build with incompatible versions of gssapi and krb5.
853 if test "$use_gssapi" = "yes"
855 # first, deal with the obvious
856 if test \( -f /usr/include/kerberosv5/krb5.h -o \
857 -f /usr/include/krb5/krb5.h -o \
858 -f /usr/include/krb5.h \) -a \
859 \( -f /usr/include/gssapi.h -o \
860 -f /usr/include/gssapi/gssapi.h \)
864 krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
867 if test -f $d/include/gssapi/gssapi_krb5.h -o \
870 if test -f $d/include/gssapi/gssapi.h -o \
871 -f $d/include/gssapi.h
882 case "$use_gssapi" in
884 AC_MSG_RESULT(disabled)
888 AC_MSG_ERROR([--with-gssapi must specify a path])
891 AC_MSG_RESULT(looking in $use_gssapi/lib)
892 USE_GSSAPI='-DGSSAPI'
893 saved_cppflags="$CPPFLAGS"
894 CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
895 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
896 [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
898 if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
899 AC_MSG_ERROR([gssapi.h not found])
902 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
903 [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"])
905 AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
906 [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
908 if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
909 AC_MSG_ERROR([krb5.h not found])
912 CPPFLAGS="$saved_cppflags"
915 # XXXDCL This probably doesn't work right on all systems.
916 # It will need to be worked on as problems become evident.
918 # Essentially the problems here relate to two different
919 # areas. The first area is building with either KTH
920 # or MIT Kerberos, particularly when both are present on
921 # the machine. The other is static versus dynamic linking.
923 # On the KTH vs MIT issue, Both have libkrb5 that can mess
924 # up the works if one implementation ends up trying to
925 # use the other's krb. This is unfortunately a situation
926 # that very easily arises.
928 # Dynamic linking when the dependency information is built
929 # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
930 # all such problems go away, but when that setup is not
931 # present, because either the dynamic libraries lack
932 # dependencies or static linking is being done, then the
933 # problems start to show up.
937 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
938 "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
940 "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
941 "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
944 # Note that this does not include $saved_libs, because
945 # on FreeBSD machines this configure script has added
946 # -L/usr/local/lib to LIBS, which can make the
947 # -lgssapi_krb5 test succeed with shared libraries even
948 # when you are trying to build with KTH in /usr/lib.
949 if test "$use_gssapi" = "/usr"
953 LIBS="-L$use_gssapi/lib $TRY_LIBS"
955 AC_MSG_CHECKING(linking as $TRY_LIBS)
956 AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
957 gssapi_linked=yes, gssapi_linked=no)
958 case $gssapi_linked in
959 yes) AC_MSG_RESULT(yes); break ;;
960 no) AC_MSG_RESULT(no) ;;
964 case $gssapi_linked in
965 no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
969 # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
970 # but MIT in /usr/local/lib and trying to build with KTH.
971 # /usr/local/lib can end up earlier on the link lines.
972 # Like most kludges, this one is not only inelegant it
973 # is also likely to be the wrong thing to do at least as
974 # many times as it is the right thing. Something better
977 if test "$use_gssapi" = "/usr" -a \
978 -f /usr/local/lib/libkrb5.a; then
982 case "$FIX_KTH_VS_MIT" in
984 case "$enable_static_linking" in
985 yes) gssapi_lib_suffix=".a" ;;
986 *) gssapi_lib_suffix=".so" ;;
995 sed -e s%^-l%$use_gssapi/lib/lib% \
996 -e s%$%$gssapi_lib_suffix%`
997 NEW_LIBS="$NEW_LIBS $new_lib"
1000 AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
1008 DST_GSSAPI_INC="-I$use_gssapi/include"
1009 DNS_GSSAPI_LIBS="$LIBS"
1011 AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
1016 AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
1017 AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
1018 AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
1019 AC_SUBST(ISC_PLATFORM_KRB5HEADER)
1021 AC_SUBST(USE_GSSAPI)
1022 AC_SUBST(DST_GSSAPI_INC)
1023 AC_SUBST(DNS_GSSAPI_LIBS)
1024 DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
1027 # Applications linking with libdns also need to link with these libraries.
1030 AC_SUBST(DNS_CRYPTO_LIBS)
1033 # was --with-randomdev specified?
1035 AC_MSG_CHECKING(for random device)
1036 AC_ARG_WITH(randomdev,
1037 [ --with-randomdev=PATH Specify path for random device],
1038 use_randomdev="$withval", use_randomdev="unspec")
1040 case "$use_randomdev" in
1044 devrandom=/dev/arandom
1047 devrandom=/dev/random
1050 AC_MSG_RESULT($devrandom)
1051 AC_CHECK_FILE($devrandom,
1052 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
1056 AC_MSG_ERROR([--with-randomdev must specify a path])
1059 AC_MSG_RESULT(disabled)
1062 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
1063 AC_MSG_RESULT(using "$use_randomdev")
1068 # Do we have arc4random() ?
1070 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1072 sinclude(config.threads.in)dnl
1076 if test "X$GCC" = "Xyes"; then
1080 CCOPT="$CCOPT -pthread"
1081 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1085 CCOPT="$CCOPT -pthread"
1088 LIBS="$LIBS -lthread"
1091 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1098 CCOPT="$CCOPT -pthread"
1105 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
1107 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
1109 CCOPT="$CCOPT -Kthread"
1113 CCOPT="$CCOPT -Kpthread"
1117 ALWAYS_DEFINES="-D_REENTRANT"
1118 ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
1119 THREADOPTOBJS='${THREADOPTOBJS}'
1120 THREADOPTSRCS='${THREADOPTSRCS}'
1123 # We'd like to use sigwait() too
1125 AC_CHECK_FUNC(sigwait,
1126 AC_DEFINE(HAVE_SIGWAIT),
1127 AC_CHECK_LIB(c, sigwait,
1128 AC_DEFINE(HAVE_SIGWAIT),
1129 AC_CHECK_LIB(pthread, sigwait,
1130 AC_DEFINE(HAVE_SIGWAIT),
1131 AC_CHECK_LIB(pthread, _Psigwait,
1132 AC_DEFINE(HAVE_SIGWAIT),))))
1134 AC_CHECK_FUNC(pthread_attr_getstacksize,
1135 AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
1137 AC_CHECK_FUNC(pthread_attr_setstacksize,
1138 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
1141 # Additional OS-specific issues related to pthreads and sigwait.
1145 # One more place to look for sigwait.
1148 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
1150 *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
1151 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
1152 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1155 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
1160 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
1161 # called before certain pthreads calls. This is deprecated
1164 *-bsdi3.*|*-bsdi4.0*)
1165 AC_DEFINE(NEED_PTHREAD_INIT)
1168 # LinuxThreads requires some changes to the way we
1169 # deal with signals.
1172 AC_DEFINE(HAVE_LINUXTHREADS)
1175 # Ensure the right sigwait() semantics on Solaris and make
1176 # sure we call pthread_setconcurrency.
1179 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1180 AC_CHECK_FUNC(pthread_setconcurrency,
1181 AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
1184 # UnixWare does things its own way.
1186 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1187 AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
1192 # Look for sysconf to allow detection of the number of processors.
1194 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
1197 ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
1198 thread_dir=nothreads
1204 AC_SUBST(ALWAYS_DEFINES)
1205 AC_SUBST(ISC_PLATFORM_USETHREADS)
1206 AC_SUBST(THREADOPTOBJS)
1207 AC_SUBST(THREADOPTSRCS)
1208 ISC_THREAD_DIR=$thread_dir
1209 AC_SUBST(ISC_THREAD_DIR)
1212 # was --with-libxml2 specified?
1214 AC_MSG_CHECKING(for libxml2 library)
1215 AC_ARG_WITH(libxml2,
1216 [ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]],
1217 use_libxml2="$withval", use_libxml2="auto")
1219 case "$use_libxml2" in
1224 case X`(xml2-config --version) 2>/dev/null` in
1226 libxml2_libs=`xml2-config --libs`
1227 libxml2_cflags=`xml2-config --cflags`
1236 if test -f "$use_libxml2/bin/xml2-config" ; then
1237 libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
1238 libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
1243 if test "X$libxml2_libs" != "X"
1246 CFLAGS="$CFLAGS $libxml2_cflags"
1247 LIBS="$LIBS $libxml2_libs"
1248 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
1254 # In solaris 10, SMF can manage named service
1256 AC_CHECK_LIB(scf, smf_enable_instance)
1259 # flockfile is usually provided by pthreads, but we may want to use it
1260 # even if compiled with --disable-threads. getc_unlocked might also not
1263 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
1264 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
1267 # Indicate what the final decision was regarding threads.
1269 AC_MSG_CHECKING(whether to build with threads)
1270 if $use_threads; then
1277 # End of pthreads stuff.
1283 AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
1284 want_largefile="yes", want_largefile="no")
1285 case $want_largefile in
1287 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1294 # Additional compiler settings.
1298 IRIX_DNSSEC_WARNINGS_HACK=""
1300 if test "X$GCC" = "Xyes"; then
1301 AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
1303 CFLAGS="$CFLAGS -fno-strict-aliasing"
1304 AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
1306 if test "$FNOSTRICTALIASING" = "yes"; then
1308 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
1311 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
1315 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1327 # The version of the C compiler that constantly warns about
1328 # 'const' as well as alignment issues is unfortunately not
1329 # able to be discerned via the version of the operating
1330 # system, nor does cc have a version flag.
1331 case "`$CC +W 123 2>&1`" in
1336 # Turn off the pointlessly noisy warnings.
1337 STD_CWARNINGS="+w1 +W 474,530,2193,2236"
1340 CCOPT="$CCOPT -Ae -z"
1341 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
1342 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
1345 STD_CWARNINGS="-fullwarn -woff 1209"
1347 # Silence more than 250 instances of
1348 # "prototyped function redeclared without prototype"
1349 # and 11 instances of
1350 # "variable ... was set but never used"
1351 # from lib/dns/sec/openssl.
1353 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
1358 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1366 AC_SUBST(MKDEPCFLAGS)
1368 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
1373 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
1376 # -lxnet buys us one big porting headache... standards, gotta love 'em.
1378 # AC_CHECK_LIB(xnet, socket, ,
1379 # AC_CHECK_LIB(socket, socket)
1382 # Use this for now, instead:
1390 AC_CHECK_LIB(socket, socket)
1391 AC_CHECK_LIB(nsl, inet_addr)
1396 # Work around Solaris's select() limitations.
1399 *-solaris2.[[89]]|*-solaris2.1?)
1400 AC_DEFINE(FD_SETSIZE, 65536,
1401 [Solaris hack to get select_large_fdset.])
1408 AC_MSG_CHECKING(whether to use purify)
1410 [ --with-purify[=PATH] use Rational purify],
1411 use_purify="$withval", use_purify="no")
1413 case "$use_purify" in
1417 AC_PATH_PROG(purify_path, purify, purify)
1420 purify_path="$use_purify"
1424 case "$use_purify" in
1430 if test -f $purify_path || test $purify_path = purify; then
1431 AC_MSG_RESULT($purify_path)
1432 PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1433 PURIFY="$purify_path $PURIFYFLAGS"
1435 AC_MSG_ERROR([$purify_path not found.
1437 Please choose the proper path with the following command:
1439 configure --with-purify=PATH
1448 AC_ARG_WITH(libtool,
1449 [ --with-libtool use GNU libtool],
1450 use_libtool="$withval", use_libtool="no")
1452 case $use_libtool in
1457 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1458 LIBTOOL_MODE_COMPILE='--mode=compile --tag=CC'
1459 LIBTOOL_MODE_INSTALL='--mode=install --tag=CC'
1460 LIBTOOL_MODE_LINK='--mode=link --tag=CC'
1462 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1465 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1466 *) LIBTOOL_IN_MAIN= ;;
1475 LIBTOOL_MODE_COMPILE=
1476 LIBTOOL_MODE_INSTALL=
1478 LIBTOOL_ALLOW_UNDEFINED=
1484 # enable/disable dumping stack backtrace. Also check if the system supports
1485 # glibc-compatible backtrace() function.
1487 AC_ARG_ENABLE(backtrace,
1488 [ --enable-backtrace log stack backtrace on abort [[default=yes]]],
1489 want_backtrace="$enableval", want_backtrace="yes")
1490 case $want_backtrace in
1492 ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
1493 AC_TRY_LINK([#include <execinfo.h>],
1494 [return (backtrace((void **)0, 0));],
1495 [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
1498 ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
1501 AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
1503 AC_ARG_ENABLE(symtable,
1504 [ --enable-symtable use internal symbol table for backtrace
1505 [[all|minimal(default)|none]]],
1506 want_symtable="$enableval", want_symtable="minimal")
1507 case $want_symtable in
1508 yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
1509 if test "$PERL" = ""
1511 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
1512 Install perl or explicitly disable the feature by --disable-symtable.])
1514 if test "$use_libtool" = "yes"; then
1515 AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
1517 # we generate the internal symbol table only for those systems
1518 # known to work to avoid unexpected build failure. Also, warn
1519 # about unsupported systems when the feature is enabled
1522 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
1523 MKSYMTBL_PROGRAM="$PERL"
1524 if test $want_symtable = all; then
1525 ALWAYS_MAKE_SYMTABLE="yes"
1529 if test $want_symtable = yes -o $want_symtable = all
1531 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
1539 AC_SUBST(MKSYMTBL_PROGRAM)
1540 AC_SUBST(ALWAYS_MAKE_SYMTABLE)
1543 # File name extension for static archive files, for those few places
1544 # where they are treated differently from dynamic ones.
1551 AC_SUBST(LIBTOOL_MKDEP_SED)
1552 AC_SUBST(LIBTOOL_MODE_COMPILE)
1553 AC_SUBST(LIBTOOL_MODE_INSTALL)
1554 AC_SUBST(LIBTOOL_MODE_LINK)
1555 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1556 AC_SUBST(LIBTOOL_IN_MAIN)
1559 # build exportable DNS library?
1561 AC_ARG_ENABLE(exportlib,
1562 [ --enable-exportlib build exportable library (GNU make required)
1564 case "$enable_exportlib" in
1567 for x in gmake gnumake make; do
1568 if $x --version 2>/dev/null | grep GNU > /dev/null; then
1573 if test -z "$gmake"; then
1574 AC_MSG_ERROR([exportlib requires GNU make. Install it or disable the feature.])
1576 LIBEXPORT=lib/export
1578 BIND9_CO_RULE="%.$O: \${srcdir}/%.c"
1581 BIND9_CO_RULE=".c.$O:"
1584 AC_SUBST(BIND9_CO_RULE)
1586 AC_ARG_WITH(export-libdir,
1587 [ --with-export-libdir[=PATH]
1588 installation directory for the export library
1589 [[EPREFIX/lib/bind9]]],
1590 export_libdir="$withval",)
1591 if test -z "$export_libdir"; then
1592 export_libdir="\${exec_prefix}/lib/bind9/"
1594 AC_SUBST(export_libdir)
1596 AC_ARG_WITH(export-includedir,
1597 [ --with-export-includedir[=PATH]
1598 installation directory for the header files of the
1599 export library [[PREFIX/include/bind9]]],
1600 export_includedir="$withval",)
1601 if test -z "$export_includedir"; then
1602 export_includedir="\${prefix}/include/bind9/"
1604 AC_SUBST(export_includedir)
1607 # Here begins a very long section to determine the system's networking
1608 # capabilities. The order of the tests is significant.
1615 [ --enable-ipv6 use IPv6 [default=autodetect]])
1617 case "$enable_ipv6" in
1619 AC_DEFINE(WANT_IPV6)
1626 # We do the IPv6 compilation checking after libtool so that we can put
1627 # the right suffix on the files.
1629 AC_MSG_CHECKING(for IPv6 structures)
1631 #include <sys/types.h>
1632 #include <sys/socket.h>
1633 #include <netinet/in.h>],
1634 [struct sockaddr_in6 sin6; return (0);],
1641 # See whether IPv6 support is provided via a Kame add-on.
1642 # This is done before other IPv6 linking tests to LIBS is properly set.
1644 AC_MSG_CHECKING(for Kame IPv6 support)
1646 [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
1647 use_kame="$withval", use_kame="no")
1653 kame_path=/usr/local/v6
1656 kame_path="$use_kame"
1665 if test -f $kame_path/lib/libinet6.a; then
1666 AC_MSG_RESULT($kame_path/lib/libinet6.a)
1667 LIBS="-L$kame_path/lib -linet6 $LIBS"
1669 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1671 Please choose the proper path with the following command:
1673 configure --with-kame=PATH
1680 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1681 # Including it on Kame-using platforms is very bad, though, because
1682 # Kame uses #error against direct inclusion. So include it on only
1683 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1684 # This is done before the in6_pktinfo check because that's what
1685 # netinet6/in6.h is needed for.
1690 ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1691 LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1692 isc_netinet6in6_hack="#include <netinet6/in6.h>"
1695 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1696 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1697 isc_netinet6in6_hack=""
1703 # This is similar to the netinet6/in6.h issue.
1706 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1708 ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1709 LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1710 ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1711 isc_netinetin6_hack="#include <netinet/in6.h>"
1714 ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1715 LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1716 ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1717 isc_netinetin6_hack=""
1722 # Now delve deeper into the suitability of the IPv6 support.
1724 case "$found_ipv6" in
1726 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1727 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1729 AC_MSG_CHECKING(for in6_addr)
1731 #include <sys/types.h>
1732 #include <sys/socket.h>
1733 #include <netinet/in.h>
1734 $isc_netinetin6_hack
1735 $isc_netinet6in6_hack
1737 [struct in6_addr in6; return (0);],
1739 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1740 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1741 isc_in_addr6_hack=""],
1743 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1744 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1745 isc_in_addr6_hack="#define in6_addr in_addr6"])
1747 AC_MSG_CHECKING(for in6addr_any)
1749 #include <sys/types.h>
1750 #include <sys/socket.h>
1751 #include <netinet/in.h>
1752 $isc_netinetin6_hack
1753 $isc_netinet6in6_hack
1756 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1758 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1759 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1761 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1762 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1764 AC_MSG_CHECKING(for in6addr_loopback)
1766 #include <sys/types.h>
1767 #include <sys/socket.h>
1768 #include <netinet/in.h>
1769 $isc_netinetin6_hack
1770 $isc_netinet6in6_hack
1773 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1775 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1776 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1778 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1779 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1781 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1783 #include <sys/types.h>
1784 #include <sys/socket.h>
1785 #include <netinet/in.h>
1786 $isc_netinetin6_hack
1787 $isc_netinet6in6_hack
1789 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1791 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1792 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1794 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1795 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1796 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1798 AC_MSG_CHECKING(for in6_pktinfo)
1800 #include <sys/types.h>
1801 #include <sys/socket.h>
1802 #include <netinet/in.h>
1803 $isc_netinetin6_hack
1804 $isc_netinet6in6_hack
1806 [struct in6_pktinfo xyzzy; return (0);],
1808 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1809 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1810 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1813 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1814 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1815 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1816 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1817 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1818 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1819 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1821 ISC_IPV6_O="ipv6.$O"
1822 ISC_ISCIPV6_O="unix/ipv6.$O"
1827 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
1828 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1829 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1830 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1831 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1832 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1833 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1834 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1835 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1836 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1837 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1838 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1839 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1840 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1841 AC_SUBST(ISC_IPV6_H)
1842 AC_SUBST(ISC_IPV6_O)
1843 AC_SUBST(ISC_ISCIPV6_O)
1844 AC_SUBST(ISC_IPV6_C)
1845 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1846 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1848 AC_MSG_CHECKING([for struct if_laddrreq])
1850 #include <sys/types.h>
1851 #include <net/if6.h>
1852 ],[ struct if_laddrreq a; ],
1854 ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1856 ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1857 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1859 AC_MSG_CHECKING([for struct if_laddrconf])
1861 #include <sys/types.h>
1862 #include <net/if6.h>
1863 ],[ struct if_laddrconf a; ],
1865 ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1867 ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1868 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1871 # Check for network functions that are often missing. We do this
1872 # after the libtool checking, so we can put the right suffix on
1873 # the files. It also needs to come after checking for a Kame add-on,
1874 # which provides some (all?) of the desired functions.
1877 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1879 #include <sys/types.h>
1880 #include <sys/socket.h>
1881 #include <netinet/in.h>
1882 #include <arpa/inet.h>
1884 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1886 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1889 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1890 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1891 ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1892 [AC_MSG_RESULT(assuming inet_ntop not needed)
1893 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
1896 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1897 # addresses with less than four octets, like "1.2.3". Also leading
1898 # zeros should also be rejected.
1900 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
1902 #include <sys/types.h>
1903 #include <sys/socket.h>
1904 #include <netinet/in.h>
1905 #include <arpa/inet.h>
1906 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1907 inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
1908 (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1910 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1912 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1913 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1914 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1915 [AC_MSG_RESULT(assuming inet_pton needed)
1916 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1917 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1918 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
1920 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1921 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1924 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1928 # Turn on 4.4BSD style sa_len support.
1929 AC_DEFINE(_SOCKADDR_LEN)
1933 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1935 #include <sys/types.h>
1936 #include <sys/socket.h>],
1937 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1939 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1940 LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1942 ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1943 LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1944 AC_SUBST(ISC_PLATFORM_HAVESALEN)
1945 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
1948 # Look for a 4.4BSD or 4.3BSD struct msghdr
1950 AC_MSG_CHECKING(for struct msghdr flavor)
1952 #include <sys/types.h>
1953 #include <sys/socket.h>],
1954 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1955 [AC_MSG_RESULT(4.4BSD)
1956 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1957 [AC_MSG_RESULT(4.3BSD)
1958 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1959 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1962 # Look for in_port_t.
1964 AC_MSG_CHECKING(for type in_port_t)
1966 #include <sys/types.h>
1967 #include <netinet/in.h>],
1968 [in_port_t port = 25; return (0);],
1970 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1972 ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1973 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1976 # Check for addrinfo
1978 AC_MSG_CHECKING(for struct addrinfo)
1980 #include <netdb.h>],
1981 [struct addrinfo a; return (0);],
1983 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1984 ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
1985 AC_DEFINE(HAVE_ADDRINFO)],
1987 ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
1988 ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
1989 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
1990 AC_SUBST(ISC_IRS_NEEDADDRINFO)
1993 # Check for rrsetinfo
1995 AC_MSG_CHECKING(for struct rrsetinfo)
1997 #include <netdb.h>],
1998 [struct rrsetinfo r; return (0);],
2000 ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
2002 ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
2003 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
2005 AC_MSG_CHECKING(for int sethostent)
2007 #include <netdb.h>],
2008 [int i = sethostent(0); return(0);],
2010 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
2012 ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
2013 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
2015 AC_MSG_CHECKING(for int endhostent)
2017 #include <netdb.h>],
2018 [int i = endhostent(); return(0);],
2020 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
2022 ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
2023 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
2025 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
2028 struct netent *getnetbyaddr(in_addr_t, int);],
2031 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
2033 ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
2034 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
2036 AC_MSG_CHECKING(for int setnetent)
2038 #include <netdb.h>],
2039 [int i = setnetent(0); return(0);],
2041 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
2043 ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
2044 AC_SUBST(ISC_LWRES_SETNETENTINT)
2046 AC_MSG_CHECKING(for int endnetent)
2048 #include <netdb.h>],
2049 [int i = endnetent(); return(0);],
2051 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
2053 ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
2054 AC_SUBST(ISC_LWRES_ENDNETENTINT)
2056 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
2059 struct hostent *gethostbyaddr(const void *, size_t, int);],
2062 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
2064 ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
2065 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
2067 AC_MSG_CHECKING(for h_errno in netdb.h)
2069 #include <netdb.h>],
2070 [h_errno = 1; return(0);],
2072 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
2074 ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
2075 AC_SUBST(ISC_LWRES_NEEDHERRNO)
2078 # Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
2079 # known variations here:
2081 AC_MSG_CHECKING(for getnameinfo prototype definitions)
2083 #include <sys/types.h>
2084 #include <sys/socket.h>
2086 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2087 socklen_t, char *, socklen_t, unsigned int);],
2089 [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
2090 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
2091 [Define to the buffer length type used by getnameinfo(3).])
2092 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
2093 [Define to the flags type used by getnameinfo(3).])],
2095 #include <sys/types.h>
2096 #include <sys/socket.h>
2098 int getnameinfo(const struct sockaddr *, socklen_t, char *,
2099 size_t, char *, size_t, int);],
2101 [AC_MSG_RESULT(size_t for buflen; int for flags)
2102 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
2103 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
2104 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2105 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
2106 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])
2109 # ...and same for gai_strerror().
2111 AC_MSG_CHECKING(for gai_strerror prototype definitions)
2113 #include <sys/types.h>
2114 #include <sys/socket.h>
2116 char *gai_strerror(int ecode);],
2118 [AC_MSG_RESULT(returning char *)
2119 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
2120 [return type of gai_strerror])],
2121 [AC_MSG_RESULT(not match any subspecies; assume standard definition)
2122 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
2124 AC_CHECK_FUNC(getipnodebyname,
2125 [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
2126 [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
2127 AC_CHECK_FUNC(getnameinfo,
2128 [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
2129 [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
2130 AC_CHECK_FUNC(getaddrinfo,
2131 [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
2132 AC_DEFINE(HAVE_GETADDRINFO)],
2133 [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
2134 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
2135 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
2136 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
2137 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
2138 AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
2140 AC_ARG_ENABLE(getifaddrs,
2141 [ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].],
2142 want_getifaddrs="$enableval", want_getifaddrs="yes")
2145 # This interface iteration code for getifaddrs() will fall back to using
2146 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
2149 case $want_getifaddrs in
2151 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
2152 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2155 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
2162 # Look for a sysctl call to get the list of network interfaces.
2164 case $ac_cv_header_sys_sysctl_h in
2166 AC_MSG_CHECKING(for interface list sysctl)
2167 AC_EGREP_CPP(found_rt_iflist, [
2168 #include <sys/param.h>
2169 #include <sys/sysctl.h>
2170 #include <sys/socket.h>
2171 #ifdef NET_RT_IFLIST
2176 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
2177 [AC_MSG_RESULT(no)])
2182 # Check for some other useful functions that are not ever-present.
2185 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
2186 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
2187 # reportedly defines strsep() without declaring it in <string.h> when
2188 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
2189 # AC_CHECK_FUNC() incorrectly succeeds because it declares
2190 # the function itself.
2191 AC_MSG_CHECKING(for correctly declared strsep())
2192 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
2193 [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
2194 [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
2195 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
2197 AC_CHECK_FUNC(memmove,
2198 [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
2199 [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
2200 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
2202 AC_CHECK_FUNC(strtoul,
2203 [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
2204 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
2206 [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
2207 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
2208 GENRANDOMLIB='${ISCLIBS}'])
2209 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
2210 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
2211 AC_SUBST(GENRANDOMLIB)
2213 AC_CHECK_FUNC(strlcpy,
2214 [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
2215 [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
2216 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
2218 AC_CHECK_FUNC(strlcat,
2219 [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
2220 [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
2221 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
2225 AC_MSG_CHECKING(sprintf)
2229 [ char buf[2]; return(*sprintf(buf,"x"));],
2231 ISC_PRINT_OBJS="print.$O"
2232 ISC_PRINT_SRCS="print.c"
2233 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
2234 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
2236 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
2237 LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
2239 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
2240 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
2242 AC_CHECK_FUNC(vsnprintf,
2243 [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
2244 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
2245 [ISC_PRINT_OBJS="print.$O"
2246 ISC_PRINT_SRCS="print.c"
2247 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
2248 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
2249 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
2250 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
2251 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
2252 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
2254 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
2256 AC_SUBST(ISC_EXTRA_OBJS)
2257 AC_SUBST(ISC_EXTRA_SRCS)
2260 # Use our own SPNEGO implementation?
2262 AC_ARG_ENABLE(isc-spnego,
2263 [ --disable-isc-spnego use SPNEGO from GSSAPI library])
2265 if test -n "$USE_GSSAPI"
2267 case "$enable_isc_spnego" in
2269 USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
2270 DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
2271 DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
2272 AC_MSG_RESULT(using SPNEGO from lib/dns)
2275 AC_MSG_RESULT(using SPNEGO from GSSAPI library)
2280 AC_SUBST(USE_ISC_SPNEGO)
2282 AC_SUBST(DST_EXTRA_OBJS)
2283 AC_SUBST(DST_EXTRA_SRCS)
2285 # Determine the printf format characters to use when printing
2286 # values of type isc_int64_t. This will normally be "ll", but where
2287 # the compiler treats "long long" as a alias for "long" and printf
2288 # doesn't know about "long long" use "l". Hopefully the sprintf
2289 # will produce a inconsistent result in the later case. If the compiler
2290 # fails due to seeing "%lld" we fall back to "l".
2292 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
2293 # %ld even for (long long)/
2295 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
2296 # configure on Win32.
2298 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
2302 long long int j = 0;
2305 sprintf(buf, "%lld", j);
2306 exit((sizeof(long long int) != sizeof(long int))? 0 :
2307 (strcmp(buf, "0") != 0));
2311 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2312 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
2314 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
2315 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
2316 [AC_MSG_RESULT(assuming target platform uses ll)
2317 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
2318 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
2319 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
2320 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
2325 # Note it is very recommended to *not* disable chroot(),
2326 # this is only because chroot() was made obsolete by Posix.
2327 AC_ARG_ENABLE(chroot,
2328 [ --disable-chroot disable chroot])
2329 case "$enable_chroot" in
2331 AC_CHECK_FUNCS(chroot)
2336 AC_ARG_ENABLE(linux-caps,
2337 [ --disable-linux-caps disable linux capabilities])
2338 case "$enable_linux_caps" in
2340 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
2341 AC_CHECK_LIB(cap, cap_set_proc)
2346 AC_CHECK_HEADERS(sys/prctl.h)
2348 AC_CHECK_HEADERS(sys/un.h,
2349 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
2351 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
2353 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
2357 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2358 [Define if connect does not honour the permission on the UNIX domain socket.])
2361 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
2362 [Define if connect does not honour the permission on the UNIX domain socket.])
2369 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
2371 AC_MSG_CHECKING(for optarg declaration)
2376 [AC_MSG_RESULT(yes)],
2378 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2379 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2382 # BSD/OS, and perhaps some others, don't define rlim_t.
2384 AC_MSG_CHECKING(for type rlim_t)
2386 #include <sys/types.h>
2387 #include <sys/time.h>
2388 #include <sys/resource.h>],
2389 [rlim_t rl = 19671212; return (0);],
2391 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
2394 AC_MSG_CHECKING(type of rlim_cur)
2396 #include <sys/types.h>
2397 #include <sys/time.h>
2398 #include <sys/resource.h>
2399 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
2401 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
2404 #include <sys/types.h>
2405 #include <sys/time.h>
2406 #include <sys/resource.h>
2407 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
2408 [AC_MSG_RESULT(long int)
2409 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
2412 #include <sys/types.h>
2413 #include <sys/time.h>
2414 #include <sys/resource.h>
2415 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
2416 [AC_MSG_RESULT(long long int)
2417 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
2418 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
2419 ],[AC_MSG_ERROR(this cannot happen)])
2420 ],[AC_MSG_ERROR(this cannot happen)])
2422 AC_ARG_WITH(rlimtype, , rlimtype="$withval", rlimtype="long long int")
2423 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE $rlimtype"
2424 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming $rlimtype)])
2426 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
2429 # Older HP-UX doesn't have gettune
2433 AC_CHECK_HEADERS(sys/dyntune.h)
2441 # Compaq TruCluster requires more code for handling cluster IP aliases
2445 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
2446 AC_CHECK_FUNC(clua_getaliasaddress,
2447 AC_DEFINE(HAVE_TRUCLUSTER, 1,
2448 [Define if running under Compaq TruCluster]))
2455 # Some hosts need msg_namelen to match the size of the socket structure.
2456 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
2460 AC_DEFINE(BROKEN_RECVMSG, 1,
2461 [Define if recvmsg() does not meet all of the BSD socket API specifications.])
2466 # Microsoft has their own way of handling shared libraries that requires
2467 # additional qualifiers on extern variables. Unix systems don't need it.
2469 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
2470 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
2471 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
2472 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
2473 AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
2474 IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
2477 # Random remaining OS-specific issues involving compiler warnings.
2478 # XXXDCL print messages to indicate some compensation is being done?
2480 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
2481 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
2485 hack_shutup_pthreadonceinit=yes
2488 hack_shutup_sputaux=yes
2491 hack_shutup_sigwait=yes
2492 hack_shutup_sputaux=yes
2495 hack_shutup_stdargcast=yes
2498 hack_shutup_pthreadonceinit=yes
2500 *-solaris2.1[[0-9]])
2501 AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
2505 case "$hack_shutup_pthreadonceinit" in
2508 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
2510 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
2514 case "$hack_shutup_sigwait" in
2517 # Shut up a -Wmissing-prototypes warning for sigwait().
2519 AC_DEFINE(SHUTUP_SIGWAIT)
2523 case "$hack_shutup_sputaux" in
2526 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
2528 AC_DEFINE(SHUTUP_SPUTAUX)
2532 case "$hack_shutup_stdargcast" in
2535 # Shut up a -Wcast-qual warning from va_start().
2537 AC_DEFINE(SHUTUP_STDARG_CAST)
2541 AC_CHECK_HEADERS(strings.h,
2542 ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
2544 ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2546 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2549 # Check for if_nametoindex() for IPv6 scoped addresses support
2551 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2552 ac_cv_have_if_nametoindex=no)
2553 case $ac_cv_have_if_nametoindex in
2557 AC_CHECK_LIB(ipv6, if_nametoindex,
2558 ac_cv_have_if_nametoindex=yes
2559 LIBS="-lipv6 $LIBS",)
2563 case $ac_cv_have_if_nametoindex in
2565 ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2568 ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2571 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2573 AC_CHECK_FUNCS(nanosleep)
2576 # Machine architecture dependent features
2578 AC_ARG_ENABLE(atomic,
2579 [ --enable-atomic enable machine specific atomic operations
2580 [[default=autodetect]]],
2581 enable_atomic="$enableval",
2582 enable_atomic="autodetect")
2583 case "$enable_atomic" in
2587 if test "X$GCC" = "Xyes"; then
2588 AC_MSG_CHECKING([if asm("isc"); works])
2590 main() { asm("ics"); exit(0); }
2595 saved_cflags="$CFLAGS"
2596 CFLAGS="$CFLAGS -Wa,-many"
2598 main() { asm("ics"); exit(0); }
2600 [AC_MSG_RESULT([yes, required -Wa,-many])
2602 [AC_MSG_RESULT([no, use_atomic disabled])
2603 CFLAGS="$saved_cflags"
2605 [AC_MSG_RESULT([cross compile, assume yes])
2606 CFLAGS="$saved_cflags"
2625 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2626 if test "$use_atomic" = "yes"; then
2627 AC_MSG_CHECKING([architecture type for atomic operations])
2628 have_atomic=yes # set default
2631 # XXX: some old x86 architectures actually do not support
2632 # (some of) these operations. Do we need stricter checks?
2633 AC_CHECK_SIZEOF([void *])
2634 if test $ac_cv_sizeof_void_p = 8; then
2642 AC_CHECK_SIZEOF([void *])
2643 if test $ac_cv_sizeof_void_p = 8; then
2653 powerpc-*|powerpc64-*)
2656 mips-*|mipsel-*|mips64-*|mips64el-*)
2667 AC_MSG_RESULT($arch)
2670 if test "$have_atomic" = "yes"; then
2671 AC_MSG_CHECKING([compiler support for inline assembly code])
2674 # Check whether the compiler supports the assembly syntax we provide.
2675 if test "X$GCC" = "Xyes"; then
2676 # GCC's ASM extension always works
2678 if test $arch = "x86_64"; then
2679 # We can share the same code for gcc with x86_32
2682 if test $arch = "powerpc"; then
2684 # The MacOS (and maybe others) uses "r0" for register
2685 # zero. Under linux/ibm it is "0" for register 0.
2686 # Probe to see if we have a MacOS style assembler.
2688 AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2690 __asm__ volatile ("li r0, 0x0\n"::);
2694 ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2695 ], [AC_MSG_RESULT(no)])
2700 # Tru64 compiler has its own syntax for inline
2704 #error "unexpected compiler"
2716 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2719 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2726 # See if the generic __asm function works. If not,
2727 # we need to disable the atomic operations.
2731 [compiler="standard"
2732 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2733 [compiler="not supported (atomic operations disabled)"
2739 AC_MSG_RESULT($compiler)
2742 if test "$have_atomic" = "yes"; then
2743 ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2744 ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2745 ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2747 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2748 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2749 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2752 if test "$have_xaddq" = "yes"; then
2753 ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
2755 ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
2758 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2759 AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
2760 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2761 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2763 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2764 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2765 AC_SUBST(ISC_PLATFORM_USESTDASM)
2766 AC_SUBST(ISC_PLATFORM_USEMACASM)
2769 AC_SUBST(ISC_ARCH_DIR)
2772 # Activate "rrset-order fixed" or not?
2774 AC_ARG_ENABLE(fixed-rrset,
2775 [ --enable-fixed-rrset enable fixed rrset ordering
2777 enable_fixed="$enableval",
2779 case "$enable_fixed" in
2781 AC_DEFINE(DNS_RDATASET_FIXED, 1,
2782 [Define to enable "rrset-order fixed" syntax.])
2791 # Enable response policy rewriting using NS IP addresses
2793 AC_ARG_ENABLE(rpz-nsip,
2794 [ --enable-rpz-nsip enable rpz-nsip rules [[default=no]]],
2795 enable_nsip="$enableval",
2797 case "$enable_nsip" in
2799 AC_DEFINE(ENABLE_RPZ_NSIP, 1,
2800 [Define to enable rpz-nsip rules.])
2809 # Enable response policy rewriting using NS name
2811 AC_ARG_ENABLE(rpz-nsdname,
2812 [ --enable-rpz-nsdname enable rpz-nsdname rules [[default=no]]],
2813 enable_nsdname="$enableval",
2814 enable_nsdname="no")
2815 case "$enable_nsdname" in
2817 AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
2818 [Define to enable rpz-nsdname rules.])
2827 # Activate "filter-aaaa-on-v4" or not?
2829 AC_ARG_ENABLE(filter-aaaa,
2830 [ --enable-filter-aaaa enable filtering of AAAA records over IPv4
2832 enable_filter="$enableval",
2834 case "$enable_filter" in
2836 AC_DEFINE(ALLOW_FILTER_AAAA_ON_V4, 1,
2837 [Define to enable the "filter-aaaa-on-v4" option.])
2846 # The following sets up how non-blocking i/o is established.
2847 # Sunos, cygwin and solaris 2.x (x<5) require special handling.
2850 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2851 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2852 *-solaris2.[[01234]])
2853 AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2854 AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2855 [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2857 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2858 [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2862 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2863 # This prevents the source address being set.
2866 *-solaris2.[[012345]]|*-solaris2.5.1)
2867 AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2868 [Define if you cannot bind() before connect() for TCP sockets.])
2872 # The following sections deal with tools used for formatting
2873 # the documentation. They are all optional, unless you are
2874 # a developer editing the documentation source.
2881 AC_PATH_PROGS(LATEX, latex, latex)
2884 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2891 AC_PATH_PROGS(W3M, w3m, w3m)
2895 # Look for xsltproc (libxslt)
2898 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2902 # Look for xmllint (libxml2)
2905 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2912 AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
2916 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2917 # in a number of directories:
2919 # NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2921 # If the file FILENAME is found in one of the DIRECTORIES, the shell
2922 # variable VARIABLE is defined to its absolute pathname. Otherwise,
2923 # it is set to FILENAME, with no directory prefix (that's not terribly
2924 # useful, but looks less confusing in substitutions than leaving it
2925 # empty). The variable VARIABLE will be substituted into output files.
2928 AC_DEFUN(NOM_PATH_FILE, [
2930 AC_MSG_CHECKING(for $2)
2941 if test "X[$]$1" = "X"
2943 AC_MSG_RESULT("not found");
2950 # Look for Docbook-XSL stylesheets. Location probably varies by system.
2951 # If it's not explicitly specified, guess where it might be found, based on
2952 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
2953 # of at the moment).
2955 AC_MSG_CHECKING(for Docbook-XSL path)
2956 AC_ARG_WITH(docbook-xsl,
2957 [ --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
2958 docbook_path="$withval", docbook_path="auto")
2959 case "$docbook_path" in
2962 docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2965 docbook_xsl_trees="$withval"
2966 AC_MSG_RESULT($docbook_xsl_trees)
2971 # Look for stylesheets we need.
2974 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
2975 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
2976 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
2977 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
2978 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
2979 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
2980 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
2981 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
2982 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
2985 # Same dance for db2latex
2987 # No idea where this lives except on FreeBSD.
2990 db2latex_xsl_trees="/usr/local/share"
2993 # Look for stylesheets we need.
2996 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2999 # Look for "admonition" image directory. Can't use NOM_PATH_FILE()
3000 # because it's a directory, so just do the same things, inline.
3003 AC_MSG_CHECKING(for db2latex/xsl/figures)
3004 for d in $db2latex_xsl_trees
3006 dd=$d/db2latex/xsl/figures
3009 XSLT_DB2LATEX_ADMONITIONS=$dd
3014 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
3016 AC_MSG_RESULT(not found)
3017 XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
3019 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
3025 [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
3026 use_idn="$withval", use_idn="no")
3029 if test X$prefix = XNONE ; then
3044 AC_ARG_WITH(libiconv,
3045 [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
3046 use_libiconv="$withval", use_libiconv="no")
3047 case "$use_libiconv" in
3049 if test X$prefix = XNONE ; then
3050 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
3052 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
3059 iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
3064 [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
3065 iconvlib="$withval")
3076 [ --with-idnlib=ARG specify libidnkit],
3077 idnlib="$withval", idnlib="no")
3078 if test "$idnlib" = yes; then
3079 AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
3083 if test "$use_idn" != no; then
3084 AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
3085 STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
3086 if test "$idnlib" != no; then
3087 IDNLIBS="$idnlib $iconvlib"
3089 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
3095 # Check whether to build Automated Test Framework unit tests
3098 [ --with-atf=ARG Automated Test Framework support],
3099 atf="$withval", atf="no")
3100 if test "$atf" = yes; then
3104 AC_CONFIG_COMMANDS([atf-config],
3105 [cd unit/atf-src; ${SHELL} ./configure MISSING=: --prefix $atfdir; cd ../..],
3106 [atfdir=`pwd`/unit/atf])
3107 AC_MSG_RESULT(building ATF from bind9/unit/atf-src)
3111 if test "$atf" != no; then
3112 AC_DEFINE(ATF_TEST, 1, [define if ATF unit tests are to be built.])
3113 STD_CINCLUDES="$STD_CINCLUDES -I$atf/include"
3115 ATFLIBS="-L$atf/lib -latf-c"
3122 AC_CHECK_HEADERS(locale.h)
3123 AC_CHECK_FUNCS(setlocale)
3128 AC_SUBST(BIND9_TOP_BUILDDIR)
3129 BIND9_TOP_BUILDDIR=`pwd`
3131 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
3132 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
3133 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
3134 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
3135 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
3136 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
3137 if test "X$srcdir" != "X"; then
3138 BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
3139 BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
3140 BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
3141 BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
3142 BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
3143 BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
3145 BIND9_ISC_BUILDINCLUDE=""
3146 BIND9_ISCCC_BUILDINCLUDE=""
3147 BIND9_ISCCFG_BUILDINCLUDE=""
3148 BIND9_DNS_BUILDINCLUDE=""
3149 BIND9_LWRES_BUILDINCLUDE=""
3150 BIND9_BIND9_BUILDINCLUDE=""
3153 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
3154 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
3156 AC_SUBST_FILE(BIND9_MAKE_RULES)
3157 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
3160 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}"
3161 AC_SUBST(BIND9_VERSION)
3163 if test -z "$ac_configure_args"; then
3164 BIND9_CONFIGARGS="defaults"
3166 for a in $ac_configure_args
3168 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
3171 BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
3172 BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
3173 AC_SUBST(BIND9_CONFIGARGS)
3175 AC_SUBST_FILE(LIBISC_API)
3176 LIBISC_API=$srcdir/lib/isc/api
3178 AC_SUBST_FILE(LIBISCCC_API)
3179 LIBISCCC_API=$srcdir/lib/isccc/api
3181 AC_SUBST_FILE(LIBISCCFG_API)
3182 LIBISCCFG_API=$srcdir/lib/isccfg/api
3184 AC_SUBST_FILE(LIBDNS_API)
3185 LIBDNS_API=$srcdir/lib/dns/api
3187 AC_SUBST_FILE(LIBBIND9_API)
3188 LIBBIND9_API=$srcdir/lib/bind9/api
3190 AC_SUBST_FILE(LIBLWRES_API)
3191 LIBLWRES_API=$srcdir/lib/lwres/api
3193 AC_SUBST_FILE(LIBIRS_API)
3194 LIBIRS_API=$srcdir/lib/irs/api
3197 # Configure any DLZ drivers.
3199 # If config.dlz.in selects one or more DLZ drivers, it will set
3200 # CONTRIB_DLZ to a non-empty value, which will be our clue to
3201 # build DLZ drivers in contrib.
3203 # This section has to come after the libtool stuff because it needs to
3204 # know how to name the driver object files.
3208 DLZ_DRIVER_INCLUDES=""
3215 # Configure support for building a shared library object
3217 # Even when libtool is available it can't always be relied upon
3218 # to build an object that can be dlopen()'ed, but this is necessary
3219 # for building the dlzexternal system test, so we'll try it the
3220 # old-fashioned way.
3228 [ --with-dlopen=ARG Support dynamically loadable DLZ drivers],
3229 dlopen="$withval", dlopen="yes")
3231 if test "$dlopen" = "yes"; then
3232 AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
3233 if test "$have_dl" = "yes"; then
3236 AC_CHECK_FUNCS(dlopen dlclose dlsym,,dlopen=no)
3239 if test "$dlopen" = "yes"; then
3243 if test "$have_dl" = "yes"
3245 SO_LD="${CC} -shared"
3250 *-freebsd*|*-openbsd*|*-netbsd*)
3252 SO_LD="ld -Bshareable -x"
3256 SO_LD="ld -G -z text"
3268 if test "X$GCC" = "Xyes"; then
3270 test -n "$SO_LD" || SO_LD="${CC} -shared"
3273 # If we still don't know how to make shared objects, don't make any.
3274 if test -n "$SO_LD"; then
3275 SO_TARGETS="\${SO_TARGETS}"
3276 AC_DEFINE(ISC_DLZ_DLOPEN, 1,
3277 [Define to allow building of objects for dlopen().])
3284 AC_SUBST(SO_TARGETS)
3286 sinclude(contrib/dlz/config.dlz.in)
3287 AC_MSG_CHECKING(contributed DLZ drivers)
3289 if test -n "$CONTRIB_DLZ"
3292 DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
3293 AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
3296 DLZ_DRIVER_RULES=/dev/null
3299 AC_SUBST(CONTRIB_DLZ)
3300 AC_SUBST(DLZ_DRIVER_INCLUDES)
3301 AC_SUBST(DLZ_DRIVER_LIBS)
3302 AC_SUBST(DLZ_DRIVER_SRCS)
3303 AC_SUBST(DLZ_DRIVER_OBJS)
3304 AC_SUBST(DLZ_SYSTEM_TEST)
3305 AC_SUBST_FILE(DLZ_DRIVER_RULES)
3307 if test "$cross_compiling" = "yes"; then
3308 if test -z "$BUILD_CC"; then
3309 AC_ERROR([BUILD_CC not set])
3311 BUILD_CFLAGS="$BUILD_CFLAGS"
3312 BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
3313 BUILD_LDFLAGS="$BUILD_LDFLAGS"
3314 BUILD_LIBS="$BUILD_LIBS"
3317 BUILD_CFLAGS="$CFLAGS"
3318 BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
3319 BUILD_LDFLAGS="$LDFLAGS"
3324 for e in $BUILD_LDFLAGS ; do
3329 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3330 NEWFLAGS="$NEWFLAGS $e $ee"
3333 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3334 NEWFLAGS="$NEWFLAGS $e $ee"
3337 ee=`echo $e | sed -e 's%^-L%-R%'`
3338 NEWFLAGS="$NEWFLAGS $e $ee"
3341 NEWFLAGS="$NEWFLAGS $e"
3346 NEWFLAGS="$NEWFLAGS $e"
3350 BUILD_LDFLAGS="$NEWFLAGS"
3353 for e in $DNS_GSSAPI_LIBS ; do
3358 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3359 NEWFLAGS="$NEWFLAGS $e $ee"
3362 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3363 NEWFLAGS="$NEWFLAGS $e $ee"
3366 ee=`echo $e | sed -e 's%^-L%-R%'`
3367 NEWFLAGS="$NEWFLAGS $e $ee"
3370 NEWFLAGS="$NEWFLAGS $e"
3375 NEWFLAGS="$NEWFLAGS $e"
3379 DNS_GSSAPI_LIBS="$NEWFLAGS"
3382 for e in $DNS_CRYPTO_LIBS ; do
3387 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3388 NEWFLAGS="$NEWFLAGS $e $ee"
3391 ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
3392 NEWFLAGS="$NEWFLAGS $e $ee"
3395 ee=`echo $e | sed -e 's%^-L%-R%'`
3396 NEWFLAGS="$NEWFLAGS $e $ee"
3399 NEWFLAGS="$NEWFLAGS $e"
3404 NEWFLAGS="$NEWFLAGS $e"
3408 DNS_CRYPTO_LIBS="$NEWFLAGS"
3411 AC_SUBST(BUILD_CFLAGS)
3412 AC_SUBST(BUILD_CPPFLAGS)
3413 AC_SUBST(BUILD_LDFLAGS)
3414 AC_SUBST(BUILD_LIBS)
3417 # Commands to run at the end of config.status.
3418 # Don't just put these into configure, it won't work right if somebody
3419 # runs config.status directly (which autoconf allows).
3424 [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
3427 # Files to configure. These are listed here because we used to
3428 # specify them as arguments to AC_OUTPUT. It's (now) ok to move these
3429 # elsewhere if there's a good reason for doing so.
3438 bin/confgen/Makefile
3439 bin/confgen/unix/Makefile
3443 bin/named/unix/Makefile
3444 bin/nsupdate/Makefile
3448 bin/tests/atomic/Makefile
3449 bin/tests/db/Makefile
3450 bin/tests/dst/Makefile
3451 bin/tests/hashes/Makefile
3452 bin/tests/headerdep_test.sh
3453 bin/tests/master/Makefile
3454 bin/tests/mem/Makefile
3455 bin/tests/names/Makefile
3456 bin/tests/net/Makefile
3457 bin/tests/rbt/Makefile
3458 bin/tests/resolver/Makefile
3459 bin/tests/sockaddr/Makefile
3460 bin/tests/system/Makefile
3461 bin/tests/system/conf.sh
3462 bin/tests/system/dlz/prereq.sh
3463 bin/tests/system/dlzexternal/Makefile
3464 bin/tests/system/dlzexternal/ns1/named.conf
3465 bin/tests/system/filter-aaaa/Makefile
3466 bin/tests/system/gost/prereq.sh
3467 bin/tests/system/lwresd/Makefile
3468 bin/tests/system/rpz/Makefile
3469 bin/tests/system/tkey/Makefile
3470 bin/tests/system/tsiggss/Makefile
3471 bin/tests/tasks/Makefile
3472 bin/tests/timers/Makefile
3473 bin/tests/virtual-time/Makefile
3474 bin/tests/virtual-time/conf.sh
3476 contrib/check-secure-delegation.pl
3477 contrib/zone-edit.sh
3480 doc/doxygen/Doxyfile
3481 doc/doxygen/Makefile
3482 doc/doxygen/doxygen-input-filter
3485 doc/xsl/isc-docbook-chunk.xsl
3486 doc/xsl/isc-docbook-html.xsl
3487 doc/xsl/isc-docbook-latex.xsl
3488 doc/xsl/isc-manpage.xsl
3492 lib/bind9/include/Makefile
3493 lib/bind9/include/bind9/Makefile
3495 lib/dns/include/Makefile
3496 lib/dns/include/dns/Makefile
3497 lib/dns/include/dst/Makefile
3498 lib/dns/tests/Makefile
3500 lib/export/dns/Makefile
3501 lib/export/dns/include/Makefile
3502 lib/export/dns/include/dns/Makefile
3503 lib/export/dns/include/dst/Makefile
3504 lib/export/irs/Makefile
3505 lib/export/irs/include/Makefile
3506 lib/export/irs/include/irs/Makefile
3507 lib/export/isc/$thread_dir/Makefile
3508 lib/export/isc/$thread_dir/include/Makefile
3509 lib/export/isc/$thread_dir/include/isc/Makefile
3510 lib/export/isc/Makefile
3511 lib/export/isc/include/Makefile
3512 lib/export/isc/include/isc/Makefile
3513 lib/export/isc/nls/Makefile
3514 lib/export/isc/unix/Makefile
3515 lib/export/isc/unix/include/Makefile
3516 lib/export/isc/unix/include/isc/Makefile
3517 lib/export/isccfg/Makefile
3518 lib/export/isccfg/include/Makefile
3519 lib/export/isccfg/include/isccfg/Makefile
3520 lib/export/samples/Makefile
3521 lib/export/samples/Makefile-postinstall
3523 lib/irs/include/Makefile
3524 lib/irs/include/irs/Makefile
3525 lib/irs/include/irs/netdb.h
3526 lib/irs/include/irs/platform.h
3527 lib/isc/$arch/Makefile
3528 lib/isc/$arch/include/Makefile
3529 lib/isc/$arch/include/isc/Makefile
3530 lib/isc/$thread_dir/Makefile
3531 lib/isc/$thread_dir/include/Makefile
3532 lib/isc/$thread_dir/include/isc/Makefile
3534 lib/isc/include/Makefile
3535 lib/isc/include/isc/Makefile
3536 lib/isc/include/isc/platform.h
3537 lib/isc/tests/Makefile
3538 lib/isc/nls/Makefile
3539 lib/isc/unix/Makefile
3540 lib/isc/unix/include/Makefile
3541 lib/isc/unix/include/isc/Makefile
3543 lib/isccc/include/Makefile
3544 lib/isccc/include/isccc/Makefile
3546 lib/isccfg/include/Makefile
3547 lib/isccfg/include/isccfg/Makefile
3549 lib/lwres/include/Makefile
3550 lib/lwres/include/lwres/Makefile
3551 lib/lwres/include/lwres/netdb.h
3552 lib/lwres/include/lwres/platform.h
3553 lib/lwres/man/Makefile
3554 lib/lwres/unix/Makefile
3555 lib/lwres/unix/include/Makefile
3556 lib/lwres/unix/include/lwres/Makefile
3558 lib/tests/include/Makefile
3559 lib/tests/include/tests/Makefile
3571 # Now that the Makefiles exist we can ensure that everything is rebuilt.
3573 AC_ARG_WITH(make-clean,
3574 [ --with-make-clean Run "make clean" at end of configure [[yes|no]].],
3575 make_clean="$withval", make_clean="yes")
3576 case "$make_clean" in
3582 if test "X$USE_OPENSSL" = "X"; then
3584 BIND is being built without OpenSSL. This means it will not have DNSSEC support.
3588 if test "X$OPENSSL_WARNING" != "X"; then
3590 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3591 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3593 WARNING Your OpenSSL crypto library may be vulnerable to WARNING
3594 WARNING one or more of the the following known security WARNING
3595 WARNING flaws: WARNING
3597 WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
3598 WARNING CVE-2006-2940. WARNING
3600 WARNING It is recommended that you upgrade to OpenSSL WARNING
3601 WARNING version 0.9.8d/0.9.7l (or greater). WARNING
3603 WARNING You can disable this warning by specifying: WARNING
3605 WARNING --disable-openssl-version-check WARNING
3607 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3608 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3612 # Tell Emacs to edit this file in shell mode.