1 # Copyright (C) 2004-2008 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.355.18.85 $)
23 AC_INIT(lib/dns/name.c)
26 AC_CONFIG_HEADER(config.h)
27 AC_CONFIG_SUBDIRS(lib/bind)
36 AC_SUBST(STD_CINCLUDES)
37 AC_SUBST(STD_CDEFINES)
38 AC_SUBST(STD_CWARNINGS)
42 # Make very sure that these are the first files processed by
43 # config.status, since we use the processed output as the input for
44 # AC_SUBST_FILE() subsitutions in other files.
46 AC_CONFIG_FILES([make/rules make/includes])
53 # The POSIX ln(1) program. Non-POSIX systems may substitute
54 # "copy" or something.
61 ar program not found. Please fix your PATH to include the directory in
62 which ar resides, or set AR in the environment with the full path to ar.
71 AC_PATH_PROGS(ETAGS, etags emacs-etags)
74 # Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
75 # GNU emacs etags, and it requires the -L flag.
77 if test "X$ETAGS" != "X"; then
78 AC_MSG_CHECKING(for Exuberant Ctags etags)
79 if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
89 # Perl is optional; it is used only by some of the system test scripts.
91 AC_PATH_PROGS(PERL, perl5 perl)
95 # Special processing of paths depending on whether --prefix,
96 # --sysconfdir or --localstatedir arguments were given. What's
97 # desired is some compatibility with the way previous versions
98 # of BIND built; they defaulted to /usr/local for most parts of
99 # the installation, but named.boot/named.conf was in /etc
100 # and named.pid was in /var/run.
102 # So ... if none of --prefix, --sysconfdir or --localstatedir are
103 # specified, set things up that way. If --prefix is given, use
104 # it for sysconfdir and localstatedir the way configure normally
105 # would. To change the prefix for everything but leave named.conf
106 # in /etc or named.pid in /var/run, then do this the usual configure way:
107 # ./configure --prefix=/somewhere --sysconfdir=/etc
108 # ./configure --prefix=/somewhere --localstatedir=/var
110 # To put named.conf and named.pid in /usr/local with everything else,
111 # set the prefix explicitly to /usr/local even though that's the default:
112 # ./configure --prefix=/usr/local
116 case "$sysconfdir" in
121 case "$localstatedir" in
130 # Make sure INSTALL uses an absolute path, else it will be wrong in all
131 # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
132 # configure based on the location of the file where it is substituted.
133 # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
134 # subdirectory of install-sh, This relative path will be wrong for all
135 # directories more than one level down from install-sh.
142 # Not all systems have dirname.
145 ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
148 ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
149 test "$ac_dir" = "$ac_prog" && ac_dir=.
150 test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
151 INSTALL="$ac_dir/$ac_prog"
156 # On these hosts, we really want to use cc, not gcc, even if it is
157 # found. The gcc that these systems have will not correctly handle
160 # However, if the user sets $CC to be something, let that override
163 if test "X$CC" = "X" ; then
169 # Use Sun's cc if it is available, but watch
170 # out for /usr/ucb/cc; it will never be the right
173 # If setting CC here fails, the AC_PROG_CC done
174 # below might still find gcc.
175 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
176 for ac_dir in $PATH; do
177 test -z "$ac_dir" && ac_dir=.
183 if test -f "$ac_dir/cc"; then
204 # gcc's optimiser is broken at -02 for ultrasparc
206 if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
215 # OS dependent CC flags
218 # OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or
219 # -D_XOPEN_SOURCE_EXTENDED.
221 STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
222 CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
224 #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
226 STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
227 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
230 # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
232 STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
233 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
235 # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
236 # parts of the IPv6 Advanced Socket API as a result. This is stupid
237 # as it breaks how the two halves (Basic and Advanced) of the IPv6
238 # Socket API were designed to be used but we have to live with it.
239 # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
241 STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
242 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
248 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
249 [$ac_includes_default
250 #ifdef HAVE_SYS_PARAM_H
251 # include <sys/param.h>
258 AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
261 # UnixWare 7.1.1 with the feature supplement to the UDK compiler
262 # is reported to not support "static inline" (RT #1212).
264 AC_MSG_CHECKING(for static inline breakage)
269 static inline int foo1() {
273 static inline int foo2() {
278 AC_DEFINE(inline, )])
281 AC_CHECK_TYPE(ssize_t, int)
282 AC_CHECK_TYPE(uintptr_t,unsigned long)
283 AC_CHECK_TYPE(socklen_t,
284 [AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
288 #include <sys/types.h>
289 #include <sys/socket.h>
290 int getsockname(int, struct sockaddr *, size_t *);
292 [AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
293 [AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
296 #include <sys/types.h>
297 #include <sys/socket.h>
299 AC_SUBST(ISC_SOCKADDR_LEN_T)
301 AC_MSG_CHECKING(for long long)
302 AC_TRY_COMPILE([],[long long i = 0; return (0);],
304 ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
306 ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
307 AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
310 # check if we have lifconf
312 AC_MSG_CHECKING(for struct lifconf)
314 #include <sys/types.h>
315 #include <sys/socket.h>
319 struct lifconf lifconf;
320 lifconf.lifc_len = 0;
324 ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
326 ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
327 AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
330 # check if we have kqueue
332 AC_ARG_ENABLE(kqueue,
333 [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
334 want_kqueue="$enableval", want_kqueue="yes")
337 AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
338 case $ac_cv_have_kqueue in
340 ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
343 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
348 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
351 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
354 # check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
355 # so we need to try running the code, not just test its existence.
358 [ --enable-epoll use Linux epoll when available [[default=yes]]],
359 want_epoll="$enableval", want_epoll="yes")
362 AC_MSG_CHECKING(epoll support)
364 #include <sys/epoll.h>
366 if (epoll_create(1) < 0)
372 ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
374 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
377 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
380 AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
383 # check if we support /dev/poll
385 AC_ARG_ENABLE(devpoll,
386 [ --enable-devpoll use /dev/poll when available [[default=yes]]],
387 want_devpoll="$enableval", want_devpoll="yes")
388 case $want_devpoll in
390 AC_CHECK_HEADERS(sys/devpoll.h,
391 ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
393 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
397 ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
400 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
403 # check if we need to #include sys/select.h explicitly
405 case $ac_cv_header_unistd_h in
407 AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
409 #include <sys/types.h> /* Ultrix */
410 #include <unistd.h>],
411 [fd_set read_set; return (0);],
413 ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
414 LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
416 case $ac_cv_header_sys_select_h in
418 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
419 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
422 AC_MSG_ERROR([need either working unistd.h or sys/select.h])
428 case $ac_cv_header_sys_select_h in
430 ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
431 LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
434 AC_MSG_ERROR([need either unistd.h or sys/select.h])
439 AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
440 AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
443 # Find the machine's endian flavor.
449 # was --with-openssl specified?
452 AC_MSG_CHECKING(for OpenSSL library)
454 [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
455 (Required for DNSSEC)],
456 use_openssl="$withval", use_openssl="auto")
458 openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
459 if test "$use_openssl" = "auto"
461 for d in $openssldirs
463 if test -f $d/include/openssl/opensslv.h
470 case "$use_openssl" in
479 AC_MSG_RESULT(not found)
482 if test "$use_openssl" = "yes"
484 # User did not specify a path - guess it
485 for d in $openssldirs
487 if test -f $d/include/openssl/opensslv.h
493 if test "$use_openssl" = "yes"
495 AC_MSG_RESULT(not found)
497 [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
500 USE_OPENSSL='-DOPENSSL'
501 if test "$use_openssl" = "/usr"
504 DNS_OPENSSL_LIBS="-lcrypto"
506 DST_OPENSSL_INC="-I$use_openssl/include"
509 DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
512 DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
516 # Apple's ld seaches for serially for dynamic
517 # then static libraries. This means you can't
518 # use -L to override dynamic system libraries
519 # with static ones when linking. Instead
520 # we specify a absolute path.
522 if test -f "$use_openssl/lib/libcrypto.dylib"
524 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
526 DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
530 DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
534 AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
536 saved_cflags="$CFLAGS"
538 CFLAGS="$CFLAGS $DST_OPENSSL_INC"
539 LIBS="$LIBS $DNS_OPENSSL_LIBS"
540 AC_MSG_CHECKING(whether linking with OpenSSL works)
542 #include <openssl/err.h>
548 [AC_MSG_RESULT(yes)],
550 AC_MSG_ERROR(Could not run test program using OpenSSL from
551 $use_openssl/lib and $use_openssl/include.
552 Please check the argument to --with-openssl and your
553 shared library configuration (e.g., LD_LIBRARY_PATH).)],
554 [AC_MSG_RESULT(assuming it does work on target platform)])
556 AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
558 #include <openssl/err.h>],
559 [ DSO_METHOD_dlfcn(); ],
563 #include <openssl/err.h>
564 ],[ DSO_METHOD_dlfcn(); ],
566 DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
568 [AC_MSG_RESULT(unknown)
569 AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
570 [AC_MSG_RESULT(assuming it does work on target platform)])
572 [AC_MSG_RESULT(assuming it does work on target platform)]
575 AC_ARG_ENABLE(openssl-version-check,
576 [AC_HELP_STRING([--enable-openssl-version-check],
577 [Check OpenSSL Version @<:@default=yes@:>@])])
578 case "$enable_openssl_version_check" in
580 AC_MSG_CHECKING(OpenSSL library version)
583 #include <openssl/opensslv.h>
585 if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
586 OPENSSL_VERSION_NUMBER < 0x00908000L) ||
587 OPENSSL_VERSION_NUMBER >= 0x0090804fL)
589 printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
590 OPENSSL_VERSION_NUMBER);
591 printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
592 "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
597 [AC_MSG_RESULT(not compatible)
600 [AC_MSG_RESULT(assuming target platform has compatible version)])
603 AC_MSG_RESULT(Skipped OpenSSL version check)
607 AC_MSG_CHECKING(for OpenSSL DSA support)
608 if test -f $use_openssl/include/openssl/dsa.h
610 AC_DEFINE(HAVE_OPENSSL_DSA)
615 CFLAGS="$saved_cflags"
621 # This would include the system openssl path (and linker options to use
622 # it as needed) if it is found.
625 AC_SUBST(USE_OPENSSL)
626 AC_SUBST(DST_OPENSSL_INC)
627 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
630 # was --with-gssapi specified?
632 #AC_MSG_CHECKING(for GSSAPI library)
634 #[ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
635 # use_gssapi="$withval", use_gssapi="no")
637 #case "$use_gssapi" in
642 # AC_MSG_RESULT(not specified)
645 # AC_MSG_ERROR([--with-gssapi must specify a path])
648 # USE_GSSAPI='-DGSSAPI'
649 # DST_GSSAPI_INC="-I$use_gssapi/include"
650 # DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
651 # AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
660 AC_SUBST(DST_GSSAPI_INC)
661 DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS"
664 # Applications linking with libdns also need to link with these libraries.
667 AC_SUBST(DNS_CRYPTO_LIBS)
670 # was --with-randomdev specified?
672 AC_MSG_CHECKING(for random device)
673 AC_ARG_WITH(randomdev,
674 [ --with-randomdev=PATH Specify path for random device],
675 use_randomdev="$withval", use_randomdev="unspec")
677 case "$use_randomdev" in
681 devrandom=/dev/arandom
684 devrandom=/dev/random
687 AC_MSG_RESULT($devrandom)
688 AC_CHECK_FILE($devrandom,
689 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
693 AC_MSG_ERROR([--with-randomdev must specify a path])
696 AC_MSG_RESULT(disabled)
699 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
700 AC_MSG_RESULT(using "$use_randomdev")
705 # Do we have arc4random() ?
707 AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
709 sinclude(config.threads.in)dnl
713 if test "X$GCC" = "Xyes"; then
717 CCOPT="$CCOPT -pthread"
718 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
722 CCOPT="$CCOPT -pthread"
725 LIBS="$LIBS -lthread"
728 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
735 CCOPT="$CCOPT -pthread"
742 STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
744 *-sco-sysv*uw*|*-*-sysv*UnixWare*)
746 CCOPT="$CCOPT -Kthread"
750 CCOPT="$CCOPT -Kpthread"
754 ALWAYS_DEFINES="-D_REENTRANT"
755 ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
758 # We'd like to use sigwait() too
760 AC_CHECK_FUNC(sigwait,
761 AC_DEFINE(HAVE_SIGWAIT),
762 AC_CHECK_LIB(c, sigwait,
763 AC_DEFINE(HAVE_SIGWAIT),
764 AC_CHECK_LIB(pthread, sigwait,
765 AC_DEFINE(HAVE_SIGWAIT),
766 AC_CHECK_LIB(pthread, _Psigwait,
767 AC_DEFINE(HAVE_SIGWAIT),))))
769 AC_CHECK_FUNC(pthread_attr_getstacksize,
770 AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
772 AC_CHECK_FUNC(pthread_attr_setstacksize,
773 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
776 # Additional OS-specific issues related to pthreads and sigwait.
780 # One more place to look for sigwait.
783 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
785 *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
786 *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
787 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
790 AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
795 # BSDI 3.0 through 4.0.1 needs pthread_init() to be
796 # called before certain pthreads calls. This is deprecated
799 *-bsdi3.*|*-bsdi4.0*)
800 AC_DEFINE(NEED_PTHREAD_INIT)
803 # LinuxThreads requires some changes to the way we
807 AC_DEFINE(HAVE_LINUXTHREADS)
810 # Ensure the right sigwait() semantics on Solaris and make
811 # sure we call pthread_setconcurrency.
814 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
815 AC_CHECK_FUNC(pthread_setconcurrency,
816 AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
819 # UnixWare does things its own way.
821 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
822 AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
827 # Look for sysconf to allow detection of the number of processors.
829 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
832 ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
837 AC_SUBST(ALWAYS_DEFINES)
838 AC_SUBST(ISC_PLATFORM_USETHREADS)
839 ISC_THREAD_DIR=$thread_dir
840 AC_SUBST(ISC_THREAD_DIR)
843 # In solaris 10, SMF can manage named service
845 AC_CHECK_LIB(scf, smf_enable_instance)
848 # flockfile is usually provided by pthreads, but we may want to use it
849 # even if compiled with --disable-threads. getc_unlocked might also not
852 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
853 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
856 # Indicate what the final decision was regarding threads.
858 AC_MSG_CHECKING(whether to build with threads)
859 if $use_threads; then
866 # End of pthreads stuff.
872 AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
873 want_largefile="yes", want_largefile="no")
874 case $want_largefile in
876 ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
883 # Additional compiler settings.
887 IRIX_DNSSEC_WARNINGS_HACK=""
889 if test "X$GCC" = "Xyes"; then
890 AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
892 CFLAGS=-fno-strict-aliasing
893 AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
895 if test "$FNOSTRICTALIASING" = "yes"; then
897 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
900 STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
904 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
916 # The version of the C compiler that constantly warns about
917 # 'const' as well as alignment issues is unfortunately not
918 # able to be discerned via the version of the operating
919 # system, nor does cc have a version flag.
920 case "`$CC +W 123 2>&1`" in
925 # Turn off the pointlessly noisy warnings.
926 STD_CWARNINGS="+w1 +W 474,530,2193,2236"
929 CCOPT="$CCOPT -Ae -z"
930 LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
931 MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
934 STD_CWARNINGS="-fullwarn -woff 1209"
936 # Silence more than 250 instances of
937 # "prototyped function redeclared without prototype"
938 # and 11 instances of
939 # "variable ... was set but never used"
940 # from lib/dns/sec/openssl.
942 IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
947 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
955 AC_SUBST(MKDEPCFLAGS)
957 AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
962 AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
965 # -lxnet buys us one big porting headache... standards, gotta love 'em.
967 # AC_CHECK_LIB(xnet, socket, ,
968 # AC_CHECK_LIB(socket, socket)
969 # AC_CHECK_LIB(nsl, inet_ntoa)
972 # Use this for now, instead:
978 AC_CHECK_LIB(socket, socket)
979 AC_CHECK_LIB(nsl, inet_ntoa)
984 # Work around Solaris's select() limitations.
987 *-solaris2.[[89]]|*-solaris2.1?)
988 AC_DEFINE(FD_SETSIZE, 65536,
989 [Solaris hack to get select_large_fdset.])
996 AC_MSG_CHECKING(whether to use purify)
998 [ --with-purify[=PATH] use Rational purify],
999 use_purify="$withval", use_purify="no")
1001 case "$use_purify" in
1005 AC_PATH_PROG(purify_path, purify, purify)
1008 purify_path="$use_purify"
1012 case "$use_purify" in
1018 if test -f $purify_path || test $purify_path = purify; then
1019 AC_MSG_RESULT($purify_path)
1020 PURIFYFLAGS="`echo $PURIFYOPTIONS`"
1021 PURIFY="$purify_path $PURIFYFLAGS"
1023 AC_MSG_ERROR([$purify_path not found.
1025 Please choose the proper path with the following command:
1027 configure --with-purify=PATH
1036 # GNU libtool support
1040 # Just set the maximum command line length for sunos as it otherwise
1041 # takes a exceptionally long time to work it out. Required for libtool.
1042 lt_cv_sys_max_cmd_len=4096;
1046 AC_ARG_WITH(libtool,
1047 [ --with-libtool use GNU libtool (following indented options supported)],
1048 use_libtool="$withval", use_libtool="no")
1050 case $use_libtool in
1055 LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
1056 LIBTOOL_MODE_COMPILE='--mode=compile'
1057 LIBTOOL_MODE_INSTALL='--mode=install'
1058 LIBTOOL_MODE_LINK='--mode=link'
1060 *) LIBTOOL_ALLOW_UNDEFINED= ;;
1063 *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
1064 *) LIBTOOL_IN_MAIN= ;;
1073 LIBTOOL_MODE_COMPILE=
1074 LIBTOOL_MODE_INSTALL=
1076 LIBTOOL_ALLOW_UNDEFINED=
1082 # File name extension for static archive files, for those few places
1083 # where they are treated differently from dynamic ones.
1090 AC_SUBST(LIBTOOL_MKDEP_SED)
1091 AC_SUBST(LIBTOOL_MODE_COMPILE)
1092 AC_SUBST(LIBTOOL_MODE_INSTALL)
1093 AC_SUBST(LIBTOOL_MODE_LINK)
1094 AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
1095 AC_SUBST(LIBTOOL_IN_MAIN)
1100 AC_ARG_ENABLE(libbind,
1101 [ --enable-libbind build libbind [default=no]])
1103 case "$enable_libbind" in
1114 # Here begins a very long section to determine the system's networking
1115 # capabilities. The order of the tests is signficant.
1122 [ --enable-ipv6 use IPv6 [default=autodetect]])
1124 case "$enable_ipv6" in
1126 AC_DEFINE(WANT_IPV6)
1133 # We do the IPv6 compilation checking after libtool so that we can put
1134 # the right suffix on the files.
1136 AC_MSG_CHECKING(for IPv6 structures)
1138 #include <sys/types.h>
1139 #include <sys/socket.h>
1140 #include <netinet/in.h>],
1141 [struct sockaddr_in6 sin6; return (0);],
1148 # See whether IPv6 support is provided via a Kame add-on.
1149 # This is done before other IPv6 linking tests to LIBS is properly set.
1151 AC_MSG_CHECKING(for Kame IPv6 support)
1153 [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
1154 use_kame="$withval", use_kame="no")
1160 kame_path=/usr/local/v6
1163 kame_path="$use_kame"
1172 if test -f $kame_path/lib/libinet6.a; then
1173 AC_MSG_RESULT($kame_path/lib/libinet6.a)
1174 LIBS="-L$kame_path/lib -linet6 $LIBS"
1176 AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
1178 Please choose the proper path with the following command:
1180 configure --with-kame=PATH
1187 # Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
1188 # Including it on Kame-using platforms is very bad, though, because
1189 # Kame uses #error against direct inclusion. So include it on only
1190 # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
1191 # This is done before the in6_pktinfo check because that's what
1192 # netinet6/in6.h is needed for.
1197 ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
1198 LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
1199 isc_netinet6in6_hack="#include <netinet6/in6.h>"
1202 ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
1203 LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
1204 isc_netinet6in6_hack=""
1210 # This is similar to the netinet6/in6.h issue.
1213 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
1215 ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
1216 LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
1217 ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
1218 isc_netinetin6_hack="#include <netinet/in6.h>"
1221 ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
1222 LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
1223 ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
1224 isc_netinetin6_hack=""
1229 # Now delve deeper into the suitability of the IPv6 support.
1231 case "$found_ipv6" in
1233 ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
1234 LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
1236 AC_MSG_CHECKING(for in6_addr)
1238 #include <sys/types.h>
1239 #include <sys/socket.h>
1240 #include <netinet/in.h>
1241 $isc_netinetin6_hack
1242 $isc_netinet6in6_hack
1244 [struct in6_addr in6; return (0);],
1246 ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
1247 LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
1248 isc_in_addr6_hack=""],
1250 ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
1251 LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
1252 isc_in_addr6_hack="#define in6_addr in_addr6"])
1254 AC_MSG_CHECKING(for in6addr_any)
1256 #include <sys/types.h>
1257 #include <sys/socket.h>
1258 #include <netinet/in.h>
1259 $isc_netinetin6_hack
1260 $isc_netinet6in6_hack
1263 [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
1265 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1266 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1268 ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
1269 LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
1271 AC_MSG_CHECKING(for in6addr_loopback)
1273 #include <sys/types.h>
1274 #include <sys/socket.h>
1275 #include <netinet/in.h>
1276 $isc_netinetin6_hack
1277 $isc_netinet6in6_hack
1280 [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
1282 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
1283 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
1285 ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
1286 LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
1288 AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
1290 #include <sys/types.h>
1291 #include <sys/socket.h>
1292 #include <netinet/in.h>
1293 $isc_netinetin6_hack
1294 $isc_netinet6in6_hack
1296 [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
1298 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1299 result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
1301 ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
1302 result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
1303 LWRES_HAVE_SIN6_SCOPE_ID="$result"
1305 AC_MSG_CHECKING(for in6_pktinfo)
1307 #include <sys/types.h>
1308 #include <sys/socket.h>
1309 #include <netinet/in.h>
1310 $isc_netinetin6_hack
1311 $isc_netinet6in6_hack
1313 [struct in6_pktinfo xyzzy; return (0);],
1315 ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
1316 [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
1317 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
1320 ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
1321 LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
1322 ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
1323 LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
1324 ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
1325 LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
1326 ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
1328 ISC_IPV6_O="ipv6.$O"
1329 ISC_ISCIPV6_O="unix/ipv6.$O"
1334 AC_SUBST(ISC_PLATFORM_HAVEIPV6)
1335 AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
1336 AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
1337 AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
1338 AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
1339 AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
1340 AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
1341 AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
1342 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
1343 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
1344 AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
1345 AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
1346 AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
1347 AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
1348 AC_SUBST(ISC_IPV6_H)
1349 AC_SUBST(ISC_IPV6_O)
1350 AC_SUBST(ISC_ISCIPV6_O)
1351 AC_SUBST(ISC_IPV6_C)
1352 AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
1353 AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
1355 AC_MSG_CHECKING([for struct if_laddrreq])
1357 #include <sys/types.h>
1358 #include <net/if6.h>
1359 ],[ struct if_laddrreq a; ],
1361 ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
1363 ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
1364 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
1366 AC_MSG_CHECKING([for struct if_laddrconf])
1368 #include <sys/types.h>
1369 #include <net/if6.h>
1370 ],[ struct if_laddrconf a; ],
1372 ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
1374 ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
1375 AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
1378 # Check for network functions that are often missing. We do this
1379 # after the libtool checking, so we can put the right suffix on
1380 # the files. It also needs to come after checking for a Kame add-on,
1381 # which provides some (all?) of the desired functions.
1384 AC_MSG_CHECKING([for inet_ntop with IPv6 support])
1386 #include <sys/types.h>
1387 #include <sys/socket.h>
1388 #include <netinet/in.h>
1389 #include <arpa/inet.h>
1391 char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
1393 ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
1396 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1397 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1398 ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
1399 [AC_MSG_RESULT(assuming inet_ntop needed)
1400 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
1401 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
1402 ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
1405 # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
1406 # addresses with less than four octets, like "1.2.3". Also leading
1407 # zeros should also be rejected.
1409 AC_MSG_CHECKING([for working inet_pton with IPv6 support])
1411 #include <sys/types.h>
1412 #include <sys/socket.h>
1413 #include <netinet/in.h>
1414 #include <arpa/inet.h>
1415 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
1416 inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
1417 (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
1419 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1421 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1422 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1423 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1424 [AC_MSG_RESULT(assuming target platform has working inet_pton)
1425 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
1426 [AC_MSG_RESULT(assuming inet_pton needed)
1427 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
1428 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
1429 ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
1430 [AC_MSG_RESULT(assuming target platform has working inet_pton)
1431 ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
1433 AC_MSG_CHECKING([for inet_aton])
1435 #include <sys/types.h>
1436 #include <netinet/in.h>
1437 #include <arpa/inet.h>],
1438 [struct in_addr in; inet_aton(0, &in); return (0);],
1440 ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
1443 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
1444 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
1445 ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
1447 AC_SUBST(ISC_PLATFORM_NEEDNTOP)
1448 AC_SUBST(ISC_PLATFORM_NEEDPTON)
1449 AC_SUBST(ISC_PLATFORM_NEEDATON)
1452 # Look for a 4.4BSD-style sa_len member in struct sockaddr.
1456 # Turn on 4.4BSD style sa_len support.
1457 AC_DEFINE(_SOCKADDR_LEN)
1461 AC_MSG_CHECKING(for sa_len in struct sockaddr)
1463 #include <sys/types.h>
1464 #include <sys/socket.h>],
1465 [struct sockaddr sa; sa.sa_len = 0; return (0);],
1467 ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
1468 LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
1470 ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
1471 LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
1472 AC_SUBST(ISC_PLATFORM_HAVESALEN)
1473 AC_SUBST(LWRES_PLATFORM_HAVESALEN)
1476 # Look for a 4.4BSD or 4.3BSD struct msghdr
1478 AC_MSG_CHECKING(for struct msghdr flavor)
1480 #include <sys/types.h>
1481 #include <sys/socket.h>],
1482 [struct msghdr msg; msg.msg_flags = 0; return (0);],
1483 [AC_MSG_RESULT(4.4BSD)
1484 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
1485 [AC_MSG_RESULT(4.3BSD)
1486 ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
1487 AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
1490 # Look for in_port_t.
1492 AC_MSG_CHECKING(for type in_port_t)
1494 #include <sys/types.h>
1495 #include <netinet/in.h>],
1496 [in_port_t port = 25; return (0);],
1498 ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
1500 ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
1501 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
1504 # Check for addrinfo
1506 AC_MSG_CHECKING(for struct addrinfo)
1508 #include <netdb.h>],
1509 [struct addrinfo a; return (0);],
1511 ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
1512 AC_DEFINE(HAVE_ADDRINFO)],
1514 ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
1515 AC_SUBST(ISC_LWRES_NEEDADDRINFO)
1518 # Check for rrsetinfo
1520 AC_MSG_CHECKING(for struct rrsetinfo)
1522 #include <netdb.h>],
1523 [struct rrsetinfo r; return (0);],
1525 ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
1527 ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
1528 AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
1530 AC_MSG_CHECKING(for int sethostent)
1532 #include <netdb.h>],
1533 [int i = sethostent(0); return(0);],
1535 ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
1537 ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
1538 AC_SUBST(ISC_LWRES_SETHOSTENTINT)
1540 AC_MSG_CHECKING(for int endhostent)
1542 #include <netdb.h>],
1543 [int i = endhostent(); return(0);],
1545 ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
1547 ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
1548 AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
1550 AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
1553 struct netent *getnetbyaddr(in_addr_t, int);],
1556 ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
1558 ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
1559 AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
1561 AC_MSG_CHECKING(for int setnetent)
1563 #include <netdb.h>],
1564 [int i = setnetent(0); return(0);],
1566 ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
1568 ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
1569 AC_SUBST(ISC_LWRES_SETNETENTINT)
1571 AC_MSG_CHECKING(for int endnetent)
1573 #include <netdb.h>],
1574 [int i = endnetent(); return(0);],
1576 ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
1578 ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
1579 AC_SUBST(ISC_LWRES_ENDNETENTINT)
1581 AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
1584 struct hostent *gethostbyaddr(const void *, size_t, int);],
1587 ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
1589 ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
1590 AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
1592 AC_MSG_CHECKING(for h_errno in netdb.h)
1594 #include <netdb.h>],
1595 [h_errno = 1; return(0);],
1597 ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
1599 ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
1600 AC_SUBST(ISC_LWRES_NEEDHERRNO)
1602 AC_CHECK_FUNC(getipnodebyname,
1603 [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
1604 [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
1605 AC_CHECK_FUNC(getnameinfo,
1606 [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
1607 [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
1608 AC_CHECK_FUNC(getaddrinfo,
1609 [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
1610 AC_DEFINE(HAVE_GETADDRINFO)],
1611 [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
1612 AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
1613 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
1614 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
1615 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
1617 AC_ARG_ENABLE(getifaddrs,
1618 [ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no|glibc]].
1619 glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
1620 want_getifaddrs="$enableval", want_getifaddrs="yes")
1622 case $want_getifaddrs in
1625 # Do we have getifaddrs() ?
1629 # Some recent versions of glibc support getifaddrs() which does not
1630 # provide AF_INET6 addresses while the function provided by the USAGI
1631 # project handles the AF_INET6 case correctly. We need to avoid
1632 # using the former but prefer the latter unless overridden by
1633 # --enable-getifaddrs=glibc.
1634 if test $want_getifaddrs = glibc
1636 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1639 LIBS="-L/usr/local/v6/lib $LIBS"
1640 AC_CHECK_LIB(inet6, getifaddrs,
1641 LIBS="$LIBS -linet6"
1642 AC_DEFINE(HAVE_GETIFADDRS),
1647 AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
1656 # Look for a sysctl call to get the list of network interfaces.
1658 case $ac_cv_header_sys_sysctl_h in
1660 AC_MSG_CHECKING(for interface list sysctl)
1661 AC_EGREP_CPP(found_rt_iflist, [
1662 #include <sys/param.h>
1663 #include <sys/sysctl.h>
1664 #include <sys/socket.h>
1665 #ifdef NET_RT_IFLIST
1670 AC_DEFINE(HAVE_IFLIST_SYSCTL)],
1671 [AC_MSG_RESULT(no)])
1676 # Check for some other useful functions that are not ever-present.
1679 # We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
1680 # because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
1681 # reportedly defines strsep() without declaring it in <string.h> when
1682 # -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
1683 # AC_CHECK_FUNC() incorrectly succeeds because it declares
1684 # the function itself.
1685 AC_MSG_CHECKING(for correctly declared strsep())
1686 AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
1687 [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
1688 [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
1689 AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
1691 AC_CHECK_FUNC(memmove,
1692 [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
1693 [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
1694 AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
1696 AC_CHECK_FUNC(strtoul,
1697 [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
1698 LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
1700 [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
1701 LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
1702 GENRANDOMLIB='${ISCLIBS}'])
1703 AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
1704 AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
1705 AC_SUBST(GENRANDOMLIB)
1707 AC_CHECK_FUNC(strlcpy,
1708 [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
1709 [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
1710 AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
1712 AC_CHECK_FUNC(strlcat,
1713 [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
1714 [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
1715 AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
1719 AC_MSG_CHECKING(sprintf)
1723 [ char buf[2]; return(*sprintf(buf,"x"));],
1725 ISC_PRINT_OBJS="print.$O"
1726 ISC_PRINT_SRCS="print.c"
1727 ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
1728 LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
1730 [ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
1731 LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
1733 AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
1734 AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
1736 AC_CHECK_FUNC(vsnprintf,
1737 [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
1738 LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
1739 [ISC_PRINT_OBJS="print.$O"
1740 ISC_PRINT_SRCS="print.c"
1741 ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
1742 LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
1743 AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
1744 AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
1745 ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
1746 ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
1748 AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
1750 AC_SUBST(ISC_EXTRA_OBJS)
1751 AC_SUBST(ISC_EXTRA_SRCS)
1753 # Determine the printf format characters to use when printing
1754 # values of type isc_int64_t. This will normally be "ll", but where
1755 # the compiler treats "long long" as a alias for "long" and printf
1756 # doesn't know about "long long" use "l". Hopefully the sprintf
1757 # will produce a inconsistant result in the later case. If the compiler
1758 # fails due to seeing "%lld" we fall back to "l".
1760 # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
1761 # %ld even for (long long)/
1763 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
1764 # configure on Win32.
1766 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
1770 long long int j = 0;
1773 sprintf(buf, "%lld", j);
1774 exit((sizeof(long long int) != sizeof(long int))? 0 :
1775 (strcmp(buf, "0") != 0));
1779 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1780 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
1782 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
1783 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
1784 [AC_MSG_RESULT(assuming target platform uses ll)
1785 ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
1786 LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
1787 AC_SUBST(ISC_PLATFORM_QUADFORMAT)
1788 AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
1793 AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
1794 AC_ARG_ENABLE(linux-caps,
1795 [ --disable-linux-caps disable linux capabilities])
1796 case "$enable_linux_caps" in
1798 AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
1799 AC_CHECK_FUNCS(capset)
1804 AC_CHECK_HEADERS(sys/prctl.h)
1806 AC_CHECK_HEADERS(sys/un.h,
1807 ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
1809 ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
1811 AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
1815 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1816 [Define if connect does not honour the permission on the UNIX domain socket.])
1819 AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1820 [Define if connect does not honour the permission on the UNIX domain socket.])
1827 AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
1829 AC_MSG_CHECKING(for optarg decarartion)
1834 [AC_MSG_RESULT(yes)],
1836 GEN_NEED_OPTARG="-DNEED_OPTARG=1"
1837 AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
1840 # BSD/OS, and perhaps some others, don't define rlim_t.
1842 AC_MSG_CHECKING(for type rlim_t)
1844 #include <sys/types.h>
1845 #include <sys/time.h>
1846 #include <sys/resource.h>],
1847 [rlim_t rl = 19671212; return (0);],
1849 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
1852 AC_MSG_CHECKING(type of rlim_cur)
1854 #include <sys/types.h>
1855 #include <sys/time.h>
1856 #include <sys/resource.h>
1857 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
1859 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
1862 #include <sys/types.h>
1863 #include <sys/time.h>
1864 #include <sys/resource.h>
1865 main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
1866 [AC_MSG_RESULT(long int)
1867 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
1870 #include <sys/types.h>
1871 #include <sys/time.h>
1872 #include <sys/resource.h>
1873 main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
1874 [AC_MSG_RESULT(long long int)
1875 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
1876 [AC_MSG_ERROR([unable to determine sizeof rlim_cur])
1877 ],[AC_MSG_ERROR(this cannot happen)])
1878 ],[AC_MSG_ERROR(this cannot happen)])
1880 ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
1881 AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
1883 AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
1886 # Older HP-UX doesn't have gettune
1890 AC_CHECK_HEADERS(sys/dyntune.h)
1898 # Compaq TruCluster requires more code for handling cluster IP aliases
1902 AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
1903 AC_CHECK_FUNC(clua_getaliasaddress,
1904 AC_DEFINE(HAVE_TRUCLUSTER, 1,
1905 [Define if running under Compaq TruCluster]))
1912 # Some hosts need msg_namelen to match the size of the socket structure.
1913 # Some hosts don't set msg_namelen appropriately on return from recvmsg().
1917 AC_DEFINE(BROKEN_RECVMSG, 1,
1918 [Define if recvmsg() does not meet all of the BSD socket API specifications.])
1923 # Microsoft has their own way of handling shared libraries that requires
1924 # additional qualifiers on extern variables. Unix systems don't need it.
1926 AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
1927 ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
1928 AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
1929 LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
1932 # Random remaining OS-specific issues involving compiler warnings.
1933 # XXXDCL print messages to indicate some compensation is being done?
1935 AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
1936 ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
1940 hack_shutup_pthreadonceinit=yes
1943 hack_shutup_sputaux=yes
1946 hack_shutup_sigwait=yes
1947 hack_shutup_sputaux=yes
1950 hack_shutup_stdargcast=yes
1953 hack_shutup_pthreadonceinit=yes
1955 *-solaris2.1[[0-9]])
1956 hack_shutup_pthreadonceinit=yes
1960 case "$hack_shutup_pthreadonceinit" in
1963 # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
1965 ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
1969 case "$hack_shutup_sigwait" in
1972 # Shut up a -Wmissing-prototypes warning for sigwait().
1974 AC_DEFINE(SHUTUP_SIGWAIT)
1978 case "$hack_shutup_sputaux" in
1981 # Shut up a -Wmissing-prototypes warning from <stdio.h>.
1983 AC_DEFINE(SHUTUP_SPUTAUX)
1987 case "$hack_shutup_stdargcast" in
1990 # Shut up a -Wcast-qual warning from va_start().
1992 AC_DEFINE(SHUTUP_STDARG_CAST)
1996 AC_CHECK_HEADERS(strings.h,
1997 ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
1999 ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
2001 AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
2004 # Check for if_nametoindex() for IPv6 scoped addresses support
2006 AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
2007 ac_cv_have_if_nametoindex=no)
2008 case $ac_cv_have_if_nametoindex in
2012 AC_CHECK_LIB(ipv6, if_nametoindex,
2013 ac_cv_have_if_nametoindex=yes
2014 LIBS="-lipv6 $LIBS",)
2018 case $ac_cv_have_if_nametoindex in
2020 ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
2023 ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
2026 AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
2029 # Machine architecture dependent features
2031 AC_ARG_ENABLE(atomic,
2032 [ --enable-atomic enable machine specific atomic operations
2033 [[default=autodetect]]],
2034 enable_atomic="$enableval",
2035 enable_atomic="autodetect")
2036 case "$enable_atomic" in
2046 ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
2047 if test "$use_atomic" = "yes"; then
2048 AC_MSG_CHECKING([architecture type for atomic operations])
2049 have_atomic=yes # set default
2052 # XXX: some old x86 architectures actually do not support
2053 # (some of) these operations. Do we need stricter checks?
2056 exit((sizeof(void *) == 8) ? 0 : 1);
2072 mips-*|mipsel-*|mips64-*|mips64el-*)
2083 AC_MSG_RESULT($arch)
2086 if test "$have_atomic" = "yes"; then
2087 AC_MSG_CHECKING([compiler support for inline assembly code])
2090 # Check whether the compiler supports the assembly syntax we provide.
2091 if test "X$GCC" = "Xyes"; then
2092 # GCC's ASM extension always works
2094 if test $arch = "x86_64"; then
2095 # We can share the same code for gcc with x86_32
2098 if test $arch = "powerpc"; then
2100 # The MacOS (and maybe others) uses "r0" for register
2101 # zero. Under linux/ibm it is "0" for register 0.
2102 # Probe to see if we have a MacOS style assembler.
2104 AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
2106 __asm__ volatile ("li r0, 0x0\n"::);
2110 ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
2111 ], [AC_MSG_RESULT(no)])
2116 # Tru64 compiler has its own syntax for inline
2120 #error "unexpected compiler"
2132 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
2135 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
2142 # See if the generic __asm function works. If not,
2143 # we need to disable the atomic operations.
2147 [compiler="standard"
2148 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
2149 [compiler="not supported (atomic operations disabled)"
2155 AC_MSG_RESULT($compiler)
2158 if test "$have_atomic" = "yes"; then
2159 ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
2160 ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
2161 ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2163 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
2164 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
2165 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
2168 AC_SUBST(ISC_PLATFORM_HAVEXADD)
2169 AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
2170 AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
2172 AC_SUBST(ISC_PLATFORM_USEGCCASM)
2173 AC_SUBST(ISC_PLATFORM_USEOSFASM)
2174 AC_SUBST(ISC_PLATFORM_USESTDASM)
2175 AC_SUBST(ISC_PLATFORM_USEMACASM)
2178 AC_SUBST(ISC_ARCH_DIR)
2181 # The following sets up how non-blocking i/o is established.
2182 # Sunos, cygwin and solaris 2.x (x<5) require special handling.
2185 *-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2186 *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2187 *-solaris2.[[01234]])
2188 AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
2189 AC_DEFINE(USE_FIONBIO_IOCTL, 1,
2190 [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
2192 *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
2193 [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2197 # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2198 # This prevents the source address being set.
2201 *-solaris2.[[012345]]|*-solaris2.5.1)
2202 AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2203 [Define if you cannot bind() before connect() for TCP sockets.])
2207 # The following sections deal with tools used for formatting
2208 # the documentation. They are all optional, unless you are
2209 # a developer editing the documentation source.
2216 AC_PATH_PROGS(LATEX, latex, latex)
2219 AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
2226 AC_PATH_PROGS(W3M, w3m, w3m)
2230 # Look for xsltproc (libxslt)
2233 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
2237 # Look for xmllint (libxml2)
2240 AC_PATH_PROG(XMLLINT, xmllint, xmllint)
2244 # Subroutine for searching for an ordinary file (e.g., a stylesheet)
2245 # in a number of directories:
2247 # NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
2249 # If the file FILENAME is found in one of the DIRECTORIES, the shell
2250 # variable VARIABLE is defined to its absolute pathname. Otherwise,
2251 # it is set to FILENAME, with no directory prefix (that's not terribly
2252 # useful, but looks less confusing in substitutions than leaving it
2253 # empty). The variable VARIABLE will be substituted into output files.
2256 AC_DEFUN(NOM_PATH_FILE, [
2258 AC_MSG_CHECKING(for $2)
2269 if test "X[$]$1" = "X"
2271 AC_MSG_RESULT("not found");
2278 # Look for Docbook-XSL stylesheets. Location probably varies by system.
2279 # If it's not explicitly specified, guess where it might be found, based on
2280 # where SGML stuff lives on some systems (FreeBSD is the only one we're sure
2281 # of at the moment).
2283 AC_MSG_CHECKING(for Docbook-XSL path)
2284 AC_ARG_WITH(docbook-xsl,
2285 [ --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
2286 docbook_path="$withval", docbook_path="auto")
2287 case "$docbook_path" in
2290 docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
2293 docbook_xsl_trees="$withval"
2294 AC_MSG_RESULT($docbook_xsl_trees)
2299 # Look for stylesheets we need.
2302 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
2303 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
2304 NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
2305 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
2306 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
2307 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
2308 NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
2309 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
2310 NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
2313 # Same dance for db2latex
2315 # No idea where this lives except on FreeBSD.
2318 db2latex_xsl_trees="/usr/local/share"
2321 # Look for stylesheets we need.
2324 NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
2327 # Look for "admonition" image directory. Can't use NOM_PATH_FILE()
2328 # because it's a directory, so just do the same things, inline.
2331 AC_MSG_CHECKING(for db2latex/xsl/figures)
2332 for d in $db2latex_xsl_trees
2334 dd=$d/db2latex/xsl/figures
2337 XSLT_DB2LATEX_ADMONITIONS=$dd
2342 if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
2344 AC_MSG_RESULT(not found)
2345 XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
2347 AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
2353 [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
2354 use_idn="$withval", use_idn="no")
2357 if test X$prefix = XNONE ; then
2372 AC_ARG_WITH(libiconv,
2373 [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
2374 use_libiconv="$withval", use_libiconv="no")
2375 case "$use_libiconv" in
2377 if test X$prefix = XNONE ; then
2378 iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
2380 iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
2387 iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
2392 [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
2393 iconvlib="$withval")
2404 [ --with-idnlib=ARG specify libidnkit],
2405 idnlib="$withval", idnlib="no")
2406 if test "$idnlib" = yes; then
2407 AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
2411 if test "$use_idn" != no; then
2412 AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
2413 STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
2414 if test "$idnlib" != no; then
2415 IDNLIBS="$idnlib $iconvlib"
2417 IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
2422 AC_CHECK_HEADERS(locale.h)
2423 AC_CHECK_FUNCS(setlocale)
2428 AC_SUBST(BIND9_TOP_BUILDDIR)
2429 BIND9_TOP_BUILDDIR=`pwd`
2431 AC_SUBST(BIND9_ISC_BUILDINCLUDE)
2432 AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2433 AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
2434 AC_SUBST(BIND9_DNS_BUILDINCLUDE)
2435 AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
2436 AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2437 if test "X$srcdir" != "X"; then
2438 BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2439 BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2440 BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
2441 BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2442 BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
2443 BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2445 BIND9_ISC_BUILDINCLUDE=""
2446 BIND9_ISCCC_BUILDINCLUDE=""
2447 BIND9_ISCCFG_BUILDINCLUDE=""
2448 BIND9_DNS_BUILDINCLUDE=""
2449 BIND9_LWRES_BUILDINCLUDE=""
2450 BIND9_BIND9_BUILDINCLUDE=""
2453 AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
2454 BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
2456 AC_SUBST_FILE(BIND9_MAKE_RULES)
2457 BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
2460 BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
2461 AC_SUBST(BIND9_VERSION)
2463 AC_SUBST_FILE(LIBISC_API)
2464 LIBISC_API=$srcdir/lib/isc/api
2466 AC_SUBST_FILE(LIBISCCC_API)
2467 LIBISCCC_API=$srcdir/lib/isccc/api
2469 AC_SUBST_FILE(LIBISCCFG_API)
2470 LIBISCCFG_API=$srcdir/lib/isccfg/api
2472 AC_SUBST_FILE(LIBDNS_API)
2473 LIBDNS_API=$srcdir/lib/dns/api
2475 AC_SUBST_FILE(LIBBIND9_API)
2476 LIBBIND9_API=$srcdir/lib/bind9/api
2478 AC_SUBST_FILE(LIBLWRES_API)
2479 LIBLWRES_API=$srcdir/lib/lwres/api
2482 # Configure any DLZ drivers.
2484 # If config.dlz.in selects one or more DLZ drivers, it will set
2485 # USE_DLZ to a non-empty value, which will be our clue to
2486 # enable the DLZ core functions.
2488 # This section has to come after the libtool stuff because it needs to
2489 # know how to name the driver object files.
2493 DLZ_DRIVER_INCLUDES=""
2498 sinclude(contrib/dlz/config.dlz.in)
2500 AC_MSG_CHECKING(for DLZ)
2502 if test -n "$USE_DLZ"
2505 USE_DLZ="-DDLZ $USE_DLZ"
2506 DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
2507 AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
2510 DLZ_DRIVER_RULES=/dev/null
2514 AC_SUBST(DLZ_DRIVER_INCLUDES)
2515 AC_SUBST(DLZ_DRIVER_LIBS)
2516 AC_SUBST(DLZ_DRIVER_SRCS)
2517 AC_SUBST(DLZ_DRIVER_OBJS)
2518 AC_SUBST_FILE(DLZ_DRIVER_RULES)
2520 if test "$cross_compiling" = "yes"; then
2521 if test -z "$BUILD_CC"; then
2522 AC_ERROR([BUILD_CC not set])
2524 BUILD_CFLAGS="$BUILD_CFLAGS"
2525 BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
2526 BUILD_LDFLAGS="$BUILD_LDFLAGS"
2527 BUILD_LIBS="$BUILD_LIBS"
2530 BUILD_CFLAGS="$CFLAGS"
2531 BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
2532 BUILD_LDFLAGS="$LDFLAGS"
2537 AC_SUBST(BUILD_CFLAGS)
2538 AC_SUBST(BUILD_CPPFLAGS)
2539 AC_SUBST(BUILD_LDFLAGS)
2540 AC_SUBST(BUILD_LIBS)
2543 # Commands to run at the end of config.status.
2544 # Don't just put these into configure, it won't work right if somebody
2545 # runs config.status directly (which autoconf allows).
2550 [chmod a+x isc-config.sh])
2553 # Files to configure. These are listed here because we used to
2554 # specify them as arguments to AC_OUTPUT. It's (now) ok to move these
2555 # elsewhere if there's a good reason for doing so.
2564 lib/isc/include/Makefile
2565 lib/isc/include/isc/Makefile
2566 lib/isc/include/isc/platform.h
2567 lib/isc/unix/Makefile
2568 lib/isc/unix/include/Makefile
2569 lib/isc/unix/include/isc/Makefile
2570 lib/isc/nls/Makefile
2571 lib/isc/$thread_dir/Makefile
2572 lib/isc/$thread_dir/include/Makefile
2573 lib/isc/$thread_dir/include/isc/Makefile
2574 lib/isc/$arch/Makefile
2575 lib/isc/$arch/include/Makefile
2576 lib/isc/$arch/include/isc/Makefile
2578 lib/isccc/include/Makefile
2579 lib/isccc/include/isccc/Makefile
2581 lib/isccfg/include/Makefile
2582 lib/isccfg/include/isccfg/Makefile
2584 lib/dns/include/Makefile
2585 lib/dns/include/dns/Makefile
2586 lib/dns/include/dst/Makefile
2588 lib/bind9/include/Makefile
2589 lib/bind9/include/bind9/Makefile
2591 lib/lwres/include/Makefile
2592 lib/lwres/include/lwres/Makefile
2593 lib/lwres/include/lwres/netdb.h
2594 lib/lwres/include/lwres/platform.h
2595 lib/lwres/man/Makefile
2596 lib/lwres/unix/Makefile
2597 lib/lwres/unix/include/Makefile
2598 lib/lwres/unix/include/lwres/Makefile
2600 lib/tests/include/Makefile
2601 lib/tests/include/tests/Makefile
2605 bin/named/unix/Makefile
2607 bin/rndc/unix/Makefile
2609 bin/nsupdate/Makefile
2611 bin/tests/names/Makefile
2612 bin/tests/master/Makefile
2613 bin/tests/rbt/Makefile
2614 bin/tests/db/Makefile
2615 bin/tests/tasks/Makefile
2616 bin/tests/timers/Makefile
2617 bin/tests/dst/Makefile
2618 bin/tests/mem/Makefile
2619 bin/tests/net/Makefile
2620 bin/tests/sockaddr/Makefile
2621 bin/tests/system/Makefile
2622 bin/tests/system/conf.sh
2623 bin/tests/system/lwresd/Makefile
2624 bin/tests/system/tkey/Makefile
2625 bin/tests/headerdep_test.sh
2632 doc/xsl/isc-docbook-chunk.xsl
2633 doc/xsl/isc-docbook-html.xsl
2634 doc/xsl/isc-docbook-latex.xsl
2635 doc/xsl/isc-manpage.xsl
2644 if test "X$OPENSSL_WARNING" != "X"; then
2646 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2647 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2649 WARNING Your OpenSSL crypto library may be vulnerable to WARNING
2650 WARNING one or more of the the following known security WARNING
2651 WARNING flaws: WARNING
2653 WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
2654 WARNING CVE-2006-2940. WARNING
2656 WARNING It is recommended that you upgrade to OpenSSL WARNING
2657 WARNING version 0.9.8d/0.9.7l (or greater). WARNING
2659 WARNING You can disable this warning by specifying: WARNING
2661 WARNING --disable-openssl-version-check WARNING
2663 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2664 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2668 # Tell Emacs to edit this file in shell mode.