diff options
Diffstat (limited to 'contrib/bind9/configure.in')
-rw-r--r-- | contrib/bind9/configure.in | 719 |
1 files changed, 521 insertions, 198 deletions
diff --git a/contrib/bind9/configure.in b/contrib/bind9/configure.in index 6320b6a..6ebdfdd 100644 --- a/contrib/bind9/configure.in +++ b/contrib/bind9/configure.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -18,18 +18,17 @@ AC_DIVERT_PUSH(1)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.355.18.85 $) +AC_REVISION($Revision: 1.457.26.9 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.59) AC_CONFIG_HEADER(config.h) -AC_CONFIG_SUBDIRS(lib/bind) AC_CANONICAL_HOST AC_PROG_MAKE_SET -AC_PROG_RANLIB +AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_LN_S @@ -38,10 +37,23 @@ AC_SUBST(STD_CDEFINES) AC_SUBST(STD_CWARNINGS) AC_SUBST(CCOPT) +# Warn if the user specified libbind, which is now deprecated +AC_ARG_ENABLE(libbind, [ --enable-libbind deprecated]) + +case "$enable_libbind" in + yes) + AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution. +It is available from http://www.isc.org as a separate download.]) + ;; + no|'') + ;; +esac + + # # Make very sure that these are the first files processed by # config.status, since we use the processed output as the input for -# AC_SUBST_FILE() subsitutions in other files. +# AC_SUBST_FILE() substitutions in other files. # AC_CONFIG_FILES([make/rules make/includes]) @@ -112,18 +124,18 @@ AC_SUBST(PERL) # ./configure --prefix=/usr/local # case "$prefix" in - NONE) - case "$sysconfdir" in - '${prefix}/etc') - sysconfdir=/etc - ;; - esac - case "$localstatedir" in - '${prefix}/var') - localstatedir=/var - ;; - esac - ;; + NONE) + case "$sysconfdir" in + '${prefix}/etc') + sysconfdir=/etc + ;; + esac + case "$localstatedir" in + '${prefix}/var') + localstatedir=/var + ;; + esac + ;; esac # @@ -136,20 +148,20 @@ esac # case "$INSTALL" in /*) - ;; - *) - # - # Not all systems have dirname. - # - changequote({, }) - ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`" - changequote([, ]) - - ac_prog="`echo $INSTALL | sed 's%.*/%%'`" - test "$ac_dir" = "$ac_prog" && ac_dir=. - test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`" - INSTALL="$ac_dir/$ac_prog" - ;; + ;; + *) + # + # Not all systems have dirname. + # + changequote({, }) + ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`" + changequote([, ]) + + ac_prog="`echo $INSTALL | sed 's%.*/%%'`" + test "$ac_dir" = "$ac_prog" && ac_dir=. + test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`" + INSTALL="$ac_dir/$ac_prog" + ;; esac # @@ -166,12 +178,12 @@ if test "X$CC" = "X" ; then CC="cc" ;; *-solaris*) - # Use Sun's cc if it is available, but watch - # out for /usr/ucb/cc; it will never be the right - # compiler to use. - # - # If setting CC here fails, the AC_PROG_CC done - # below might still find gcc. + # Use Sun's cc if it is available, but watch + # out for /usr/ucb/cc; it will never be the right + # compiler to use. + # + # If setting CC here fails, the AC_PROG_CC done + # below might still find gcc. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. @@ -215,7 +227,7 @@ fi # OS dependent CC flags # case "$host" in - # OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or + # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or # -D_XOPEN_SOURCE_EXTENDED. *-dec-osf*) STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET" @@ -275,7 +287,7 @@ AC_TRY_COMPILE(, [ ], [AC_MSG_RESULT(no)], [AC_MSG_RESULT(yes) - AC_DEFINE(inline, )]) + AC_DEFINE(inline, )]) AC_TYPE_SIZE_T AC_CHECK_TYPE(ssize_t, int) @@ -355,10 +367,10 @@ AC_SUBST(ISC_PLATFORM_HAVEKQUEUE) # so we need to try running the code, not just test its existence. # AC_ARG_ENABLE(epoll, - [ --enable-epoll use Linux epoll when available [[default=yes]]], - want_epoll="$enableval", want_epoll="yes") +[ --enable-epoll use Linux epoll when available [[default=auto]]], + want_epoll="$enableval", want_epoll="auto") case $want_epoll in -yes) +auto) AC_MSG_CHECKING(epoll support) AC_TRY_RUN([ #include <sys/epoll.h> @@ -373,6 +385,9 @@ int main() { [AC_MSG_RESULT(no) ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"]) ;; +yes) + ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1" + ;; *) ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" ;; @@ -415,7 +430,7 @@ AC_TRY_COMPILE([ [AC_MSG_RESULT(no) case $ac_cv_header_sys_select_h in yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" + ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1" ;; no) @@ -427,7 +442,7 @@ AC_TRY_COMPILE([ no) case $ac_cv_header_sys_select_h in yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" + ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1" ;; no) @@ -452,7 +467,7 @@ OPENSSL_WARNING= AC_MSG_CHECKING(for OpenSSL library) AC_ARG_WITH(openssl, [ --with-openssl[=PATH] Build with OpenSSL [yes|no|path]. - (Required for DNSSEC)], + (Required for DNSSEC)], use_openssl="$withval", use_openssl="auto") openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw" @@ -481,21 +496,24 @@ case "$use_openssl" in *) if test "$use_openssl" = "yes" then - # User did not specify a path - guess it + # User did not specify a path - guess it for d in $openssldirs do if test -f $d/include/openssl/opensslv.h then - use_openssl=$d + use_openssl=$d break fi done if test "$use_openssl" = "yes" then - AC_MSG_RESULT(not found) + AC_MSG_RESULT(not found) AC_MSG_ERROR( [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path]) fi + elif ! test -f "$use_openssl"/include/openssl/opensslv.h + then + AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found]) fi USE_OPENSSL='-DOPENSSL' if test "$use_openssl" = "/usr" @@ -531,7 +549,7 @@ case "$use_openssl" in ;; esac fi - AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include) + AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include) saved_cflags="$CFLAGS" saved_libs="$LIBS" @@ -545,7 +563,7 @@ int main() { return (0); } ], - [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) AC_MSG_ERROR(Could not run test program using OpenSSL from $use_openssl/lib and $use_openssl/include. @@ -574,7 +592,7 @@ shared library configuration (e.g., LD_LIBRARY_PATH).)], AC_ARG_ENABLE(openssl-version-check, [AC_HELP_STRING([--enable-openssl-version-check], - [Check OpenSSL Version @<:@default=yes@:>@])]) + [Check OpenSSL Version @<:@default=yes@:>@])]) case "$enable_openssl_version_check" in yes|'') AC_MSG_CHECKING(OpenSSL library version) @@ -582,20 +600,20 @@ yes|'') #include <stdio.h> #include <openssl/opensslv.h> int main() { - if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL && + if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL && OPENSSL_VERSION_NUMBER < 0x00908000L) || OPENSSL_VERSION_NUMBER >= 0x0090804fL) - return (0); + return (0); printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n", OPENSSL_VERSION_NUMBER); printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n" "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n"); - return (1); + return (1); } ], - [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(ok)], [AC_MSG_RESULT(not compatible) - OPENSSL_WARNING=yes + OPENSSL_WARNING=yes ], [AC_MSG_RESULT(assuming target platform has compatible version)]) ;; @@ -627,38 +645,173 @@ AC_SUBST(DST_OPENSSL_INC) DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS" # -# was --with-gssapi specified? -# -#AC_MSG_CHECKING(for GSSAPI library) -#AC_ARG_WITH(gssapi, -#[ --with-gssapi=PATH Specify path for system-supplied GSSAPI], -# use_gssapi="$withval", use_gssapi="no") -# -#case "$use_gssapi" in -# no) -# USE_GSSAPI='' -# DST_GSSAPI_INC='' -# DNS_GSSAPI_LIBS='' -# AC_MSG_RESULT(not specified) -# ;; -# yes) -# AC_MSG_ERROR([--with-gssapi must specify a path]) -# ;; -# *) -# USE_GSSAPI='-DGSSAPI' -# DST_GSSAPI_INC="-I$use_gssapi/include" -# DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5" -# AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include) -# ;; -#esac - -USE_GSSAPI='' -DST_GSSAPI_INC='' -DNS_GSSAPI_LIBS='' +# PKCS11 (aka crypto hardware) support +# +# This works only with the right OpenSSL with PKCS11 engine! +# + +AC_MSG_CHECKING(for PKCS11 support) +AC_ARG_WITH(pkcs11, +[ --with-pkcs11 Build with PKCS11 support], + use_pkcs11="yes", use_pkcs11="no") + +case "$use_pkcs11" in + no) + AC_MSG_RESULT(disabled) + USE_PKCS11="" + ;; + yes) + AC_MSG_RESULT(using OpenSSL with PKCS11 support) + USE_PKCS11='-DUSE_PKCS11' + ;; +esac + +AC_SUBST(USE_PKCS11) + +AC_MSG_CHECKING(for GSSAPI library) +AC_ARG_WITH(gssapi, +[ --with-gssapi=PATH Specify path for system-supplied GSSAPI], + use_gssapi="$withval", use_gssapi="no") + +gssapidirs="/usr/local /usr/pkg /usr/kerberos /usr" +if test "$use_gssapi" = "yes" +then + for d in $gssapidirs + do + if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h + then + use_gssapi=$d + break + fi + done +fi + +case "$use_gssapi" in + no) + AC_MSG_RESULT(disabled) + USE_GSSAPI='' + ;; + yes) + AC_MSG_ERROR([--with-gssapi must specify a path]) + ;; + *) + AC_MSG_RESULT(looking in $use_gssapi/lib) + USE_GSSAPI='-DGSSAPI' + saved_cppflags="$CPPFLAGS" + CPPFLAGS="-I$use_gssapi/include $CPPFLAGS" + AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h, + [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"]) + + if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then + AC_MSG_ERROR([gssapi.h not found]) + fi + + CPPFLAGS="$saved_cppflags" + + # + # XXXDCL This probably doesn't work right on all systems. + # It will need to be worked on as problems become evident. + # + # Essentially the problems here relate to two different + # areas. The first area is building with either KTH + # or MIT Kerberos, particularly when both are present on + # the machine. The other is static versus dynamic linking. + # + # On the KTH vs MIT issue, Both have libkrb5 that can mess + # up the works if one implementation ends up trying to + # use the other's krb. This is unfortunately a situation + # that very easily arises. + # + # Dynamic linking when the dependency information is built + # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes + # all such problems go away, but when that setup is not + # present, because either the dynamic libraries lack + # dependencies or static linking is being done, then the + # problems start to show up. + saved_libs="$LIBS" + for TRY_LIBS in \ + "-lgssapi_krb5" \ + "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \ + "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \ + "-lgssapi" \ + "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \ + "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \ + "-lgss" + do + # Note that this does not include $saved_libs, because + # on FreeBSD machines this configure script has added + # -L/usr/local/lib to LIBS, which can make the + # -lgssapi_krb5 test succeed with shared libraries even + # when you are trying to build with KTH in /usr/lib. + LIBS="-L$use_gssapi/lib $TRY_LIBS" + AC_MSG_CHECKING(linking as $TRY_LIBS) + AC_TRY_LINK( , [gss_acquire_cred();], + gssapi_linked=yes, gssapi_linked=no) + case $gssapi_linked in + yes) AC_MSG_RESULT(yes); break ;; + no) AC_MSG_RESULT(no) ;; + esac + done + + case $gssapi_linked in + no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;; + esac + + # + # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib + # but MIT in /usr/local/lib and trying to build with KTH. + # /usr/local/lib can end up earlier on the link lines. + # Like most kludges, this one is not only inelegant it + # is also likely to be the wrong thing to do at least as + # many times as it is the right thing. Something better + # needs to be done. + # + if test "$use_gssapi" = "/usr" -a \ + -f /usr/local/lib/libkrb5.a; then + FIX_KTH_VS_MIT=yes + fi + + case "$FIX_KTH_VS_MIT" in + yes) + case "$enable_static_linking" in + yes) gssapi_lib_suffix=".a" ;; + *) gssapi_lib_suffix=".so" ;; + esac + + for lib in $LIBS; do + case $lib in + -L*) + ;; + -l*) + new_lib=`echo $lib | + sed -e s%^-l%$use_gssapi/lib/lib% \ + -e s%$%$gssapi_lib_suffix%` + NEW_LIBS="$NEW_LIBS $new_lib" + ;; + *) + AC_MSG_ERROR([KTH vs MIT Kerberos confusion!]) + ;; + esac + done + LIBS="$NEW_LIBS" + ;; + esac + + DST_GSSAPI_INC="-I$use_gssapi/include" + DNS_GSSAPI_LIBS="$LIBS" + + AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include) + LIBS="$saved_libs" + ;; +esac + +AC_SUBST(ISC_PLATFORM_HAVEGSSAPI) +AC_SUBST(ISC_PLATFORM_GSSAPIHEADER) AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) -DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS" +AC_SUBST(DNS_GSSAPI_LIBS) +DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS" # # Applications linking with libdns also need to link with these libraries. @@ -764,7 +917,7 @@ then AC_CHECK_LIB(pthread, sigwait, AC_DEFINE(HAVE_SIGWAIT), AC_CHECK_LIB(pthread, _Psigwait, - AC_DEFINE(HAVE_SIGWAIT),)))) + AC_DEFINE(HAVE_SIGWAIT),)))) AC_CHECK_FUNC(pthread_attr_getstacksize, AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),) @@ -840,6 +993,48 @@ ISC_THREAD_DIR=$thread_dir AC_SUBST(ISC_THREAD_DIR) # +# was --with-libxml2 specified? +# +AC_MSG_CHECKING(for libxml2 library) +AC_ARG_WITH(libxml2, +[ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]], + use_libxml2="$withval", use_libxml2="auto") + +case "$use_libxml2" in + no) + DST_LIBXML2_INC="" + ;; + auto|yes) + case X`(xml2-config --version) 2>/dev/null` in + X2.[[67]].*) + libxml2_libs=`xml2-config --libs` + libxml2_cflags=`xml2-config --cflags` + ;; + *) + libxml2_libs= + libxml2_cflags= + ;; + esac + ;; + *) + if test -f "$use_libxml2/bin/xml2-config" ; then + libxml2_libs=`$use_libxml2/bin/xml2-config --libs` + libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags` + fi + ;; +esac + +if test "X$libxml2_libs" != "X" +then + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS $libxml2_cflags" + LIBS="$LIBS $libxml2_libs" + AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found]) +else + AC_MSG_RESULT(no) +fi + +# # In solaris 10, SMF can manage named service # AC_CHECK_LIB(scf, smf_enable_instance) @@ -914,9 +1109,9 @@ else *-hp-hpux*) CC="$CC -Ae -z" # The version of the C compiler that constantly warns about - # 'const' as well as alignment issues is unfortunately not - # able to be discerned via the version of the operating - # system, nor does cc have a version flag. + # 'const' as well as alignment issues is unfortunately not + # able to be discerned via the version of the operating + # system, nor does cc have a version flag. case "`$CC +W 123 2>&1`" in *Unknown?option*) STD_CWARNINGS="+w1" @@ -945,7 +1140,7 @@ else MKDEPCFLAGS="-xM" ;; *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) - # UnixWare + # UnixWare CC="$CC -w" ;; esac @@ -966,7 +1161,6 @@ AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),) # # AC_CHECK_LIB(xnet, socket, , # AC_CHECK_LIB(socket, socket) -# AC_CHECK_LIB(nsl, inet_ntoa) # ) # # Use this for now, instead: @@ -974,9 +1168,11 @@ AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),) case "$host" in mips-sgi-irix*) ;; + *-linux*) + ;; *) AC_CHECK_LIB(socket, socket) - AC_CHECK_LIB(nsl, inet_ntoa) + AC_CHECK_LIB(nsl, inet_addr) ;; esac @@ -1095,24 +1291,8 @@ AC_SUBST(LIBTOOL_ALLOW_UNDEFINED) AC_SUBST(LIBTOOL_IN_MAIN) # -# build libbind? -# -AC_ARG_ENABLE(libbind, - [ --enable-libbind build libbind [default=no]]) - -case "$enable_libbind" in - yes) - LIBBIND=lib/bind - AC_SUBST(LIBBIND) - ;; - no|'') - ;; -esac - - -# # Here begins a very long section to determine the system's networking -# capabilities. The order of the tests is signficant. +# capabilities. The order of the tests is significant. # # @@ -1211,16 +1391,16 @@ changequote([, ]) # case "$host" in *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) - # UnixWare + # UnixWare ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1" LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1" - ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1" + ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1" isc_netinetin6_hack="#include <netinet/in6.h>" ;; *) ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H" LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H" - ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR" + ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR" isc_netinetin6_hack="" ;; esac @@ -1389,17 +1569,17 @@ AC_TRY_RUN([ #include <arpa/inet.h> main() { char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"], + [AC_MSG_RESULT(yes) + ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"], - [AC_MSG_RESULT(no) - ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O" - ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c" - ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"], - [AC_MSG_RESULT(assuming inet_ntop needed) - ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O" - ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c" - ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"]) + [AC_MSG_RESULT(no) + ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O" + ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c" + ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"], + [AC_MSG_RESULT(assuming inet_ntop needed) + ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O" + ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c" + ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"]) # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts @@ -1415,38 +1595,23 @@ AC_TRY_RUN([ main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 : inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"], - [AC_MSG_RESULT(no) - ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O" - ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c" - ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"], + [AC_MSG_RESULT(yes) + ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"], + [AC_MSG_RESULT(no) + ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O" + ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c" + ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"], [AC_MSG_RESULT(assuming target platform has working inet_pton) ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"], - [AC_MSG_RESULT(assuming inet_pton needed) - ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O" - ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c" - ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"], - [AC_MSG_RESULT(assuming target platform has working inet_pton) - ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"]) - -AC_MSG_CHECKING([for inet_aton]) -AC_TRY_LINK([ -#include <sys/types.h> -#include <netinet/in.h> -#include <arpa/inet.h>], - [struct in_addr in; inet_aton(0, &in); return (0);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"], - - [AC_MSG_RESULT(no) - ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O" - ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c" - ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"]) + [AC_MSG_RESULT(assuming inet_pton needed) + ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O" + ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c" + ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"], + [AC_MSG_RESULT(assuming target platform has working inet_pton) + ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"]) AC_SUBST(ISC_PLATFORM_NEEDNTOP) AC_SUBST(ISC_PLATFORM_NEEDPTON) -AC_SUBST(ISC_PLATFORM_NEEDATON) # # Look for a 4.4BSD-style sa_len member in struct sockaddr. @@ -1496,7 +1661,7 @@ AC_TRY_COMPILE([ [in_port_t port = 25; return (0);], [AC_MSG_RESULT(yes) ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"], - [AC_MSG_RESULT(no) + [AC_MSG_RESULT(no) ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"]) AC_SUBST(ISC_PLATFORM_NEEDPORTT) @@ -1600,53 +1765,36 @@ AC_TRY_COMPILE([ AC_SUBST(ISC_LWRES_NEEDHERRNO) AC_CHECK_FUNC(getipnodebyname, - [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"], - [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"]) + [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"], + [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"]) AC_CHECK_FUNC(getnameinfo, - [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"], - [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"]) + [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"], + [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"]) AC_CHECK_FUNC(getaddrinfo, - [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO" + [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO" AC_DEFINE(HAVE_GETADDRINFO)], - [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"]) + [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"]) AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR)) AC_SUBST(ISC_LWRES_GETIPNODEPROTO) AC_SUBST(ISC_LWRES_GETADDRINFOPROTO) AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO) AC_ARG_ENABLE(getifaddrs, -[ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no|glibc]]. - glibc: Use getifaddrs() in glibc if you know it supports IPv6.], +[ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].], want_getifaddrs="$enableval", want_getifaddrs="yes") -case $want_getifaddrs in -yes|glibc) -# -# Do we have getifaddrs() ? # -case $host in -*-linux*) - # Some recent versions of glibc support getifaddrs() which does not - # provide AF_INET6 addresses while the function provided by the USAGI - # project handles the AF_INET6 case correctly. We need to avoid - # using the former but prefer the latter unless overridden by - # --enable-getifaddrs=glibc. - if test $want_getifaddrs = glibc - then - AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS)) - else - save_LIBS="$LIBS" - LIBS="-L/usr/local/v6/lib $LIBS" - AC_CHECK_LIB(inet6, getifaddrs, - LIBS="$LIBS -linet6" - AC_DEFINE(HAVE_GETIFADDRS), - LIBS=${save_LIBS}) - fi - ;; -*) - AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS)) - ;; -esac +# This interface iteration code for getifaddrs() will fall back to using +# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6 +# addresses. +# +case $want_getifaddrs in +glibc) +AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required") +AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS)) +;; +yes) +AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS)) ;; no) ;; @@ -1750,11 +1898,37 @@ AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR)) AC_SUBST(ISC_EXTRA_OBJS) AC_SUBST(ISC_EXTRA_SRCS) +# +# Use our own SPNEGO implementation? +# +AC_ARG_ENABLE(isc-spnego, + [ --disable-isc-spnego use SPNEGO from GSSAPI library]) + +if test -n "$USE_GSSAPI" +then + case "$enable_isc_spnego" in + yes|'') + USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO' + DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O" + DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c" + AC_MSG_RESULT(using SPNEGO from lib/dns) + ;; + no) + AC_MSG_RESULT(using SPNEGO from GSSAPI library) + ;; + esac +fi + +AC_SUBST(USE_ISC_SPNEGO) + +AC_SUBST(DST_EXTRA_OBJS) +AC_SUBST(DST_EXTRA_SRCS) + # Determine the printf format characters to use when printing # values of type isc_int64_t. This will normally be "ll", but where # the compiler treats "long long" as a alias for "long" and printf # doesn't know about "long long" use "l". Hopefully the sprintf -# will produce a inconsistant result in the later case. If the compiler +# will produce a inconsistent result in the later case. If the compiler # fails due to seeing "%lld" we fall back to "l". # # Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses @@ -1790,13 +1964,23 @@ AC_SUBST(LWRES_PLATFORM_QUADFORMAT) # # Security Stuff # -AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT)) +# Note it is very recommended to *not* disable chroot(), +# this is only because chroot() was made obsolete by Posix. +AC_ARG_ENABLE(chroot, + [ --disable-chroot disable chroot]) +case "$enable_chroot" in + yes|'') + AC_CHECK_FUNCS(chroot) + ;; + no) + ;; +esac AC_ARG_ENABLE(linux-caps, [ --disable-linux-caps disable linux capabilities]) case "$enable_linux_caps" in yes|'') AC_CHECK_HEADERS(linux/capability.h sys/capability.h) - AC_CHECK_FUNCS(capset) + AC_CHECK_LIB(cap, cap_set_proc) ;; no) ;; @@ -1826,7 +2010,7 @@ esac # AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET)) -AC_MSG_CHECKING(for optarg decarartion) +AC_MSG_CHECKING(for optarg declaration) AC_TRY_COMPILE([ #include <unistd.h> ], @@ -1953,7 +2137,7 @@ case "$host" in hack_shutup_pthreadonceinit=yes ;; *-solaris2.1[[0-9]]) - hack_shutup_pthreadonceinit=yes + AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], ) ;; esac @@ -2008,11 +2192,11 @@ AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes, case $ac_cv_have_if_nametoindex in no) case "$host" in - *-hp-hpux*) - AC_CHECK_LIB(ipv6, if_nametoindex, + *-hp-hpux*) + AC_CHECK_LIB(ipv6, if_nametoindex, ac_cv_have_if_nametoindex=yes LIBS="-lipv6 $LIBS",) - ;; + ;; esac esac case $ac_cv_have_if_nametoindex in @@ -2025,12 +2209,14 @@ yes) esac AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX) +AC_CHECK_FUNCS(nanosleep) + # # Machine architecture dependent features # AC_ARG_ENABLE(atomic, [ --enable-atomic enable machine specific atomic operations - [[default=autodetect]]], + [[default=autodetect]]], enable_atomic="$enableval", enable_atomic="autodetect") case "$enable_atomic" in @@ -2056,11 +2242,13 @@ main() { exit((sizeof(void *) == 8) ? 0 : 1); } ], - [arch=x86_64], + [arch=x86_64 + have_xaddq=yes], [arch=x86_32], - [arch=x86_32]) + [arch=x86_32]) ;; - x86_64-*) + x86_64-*|amd64-*) + have_xaddq=yes arch=x86_64 ;; alpha*-*) @@ -2165,7 +2353,14 @@ else ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE" fi +if test "$have_xaddq" = "yes"; then + ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1" +else + ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ" +fi + AC_SUBST(ISC_PLATFORM_HAVEXADD) +AC_SUBST(ISC_PLATFORM_HAVEXADDQ) AC_SUBST(ISC_PLATFORM_HAVECMPXCHG) AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE) @@ -2178,6 +2373,25 @@ ISC_ARCH_DIR=$arch AC_SUBST(ISC_ARCH_DIR) # +# Activate "rrset-order fixed" or not? +# +AC_ARG_ENABLE(fixed-rrset, + [ --enable-fixed-rrset enable fixed rrset ordering + [[default=no]]], + enable_fixed="$enableval", + enable_fixed="no") +case "$enable_fixed" in + yes) + AC_DEFINE(DNS_RDATASET_FIXED, 1, + [Define to enable "rrset-order fixed" syntax.]) + ;; + no) + ;; + *) + ;; +esac + +# # The following sets up how non-blocking i/o is established. # Sunos, cygwin and solaris 2.x (x<5) require special handling. # @@ -2241,6 +2455,13 @@ AC_PATH_PROG(XMLLINT, xmllint, xmllint) AC_SUBST(XMLLINT) # +# Look for Doxygen +# + +AC_PATH_PROG(DOXYGEN, doxygen, doxygen) +AC_SUBST(DOXYGEN) + +# # Subroutine for searching for an ordinary file (e.g., a stylesheet) # in a number of directories: # @@ -2460,6 +2681,18 @@ BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}" AC_SUBST(BIND9_VERSION) +if test -z "$ac_configure_args"; then + BIND9_CONFIGARGS="defaults" +else + for a in $ac_configure_args + do + BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a" + done +fi +BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`" +BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}" +AC_SUBST(BIND9_CONFIGARGS) + AC_SUBST_FILE(LIBISC_API) LIBISC_API=$srcdir/lib/isc/api @@ -2533,6 +2766,93 @@ else BUILD_LIBS="$LIBS" fi +NEWFLAGS="" +for e in $BUILD_LDFLAGS ; do + case $e in + -L*) + case $host_os in + netbsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + freebsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + solaris*) + ee=`echo $e | sed -e 's%^-L%-R%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac +done +BUILD_LDFLAGS="$NEWFLAGS" + +NEWFLAGS="" +for e in $DNS_GSSAPI_LIBS ; do + case $e in + -L*) + case $host_os in + netbsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + freebsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + solaris*) + ee=`echo $e | sed -e 's%^-L%-R%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac +done +DNS_GSSAPI_LIBS="$NEWFLAGS" + +NEWFLAGS="" +for e in $DNS_CRYPTO_LIBS ; do + case $e in + -L*) + case $host_os in + netbsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + freebsd*) + ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + solaris*) + ee=`echo $e | sed -e 's%^-L%-R%'` + NEWFLAGS="$NEWFLAGS $e $ee" + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac + ;; + *) + NEWFLAGS="$NEWFLAGS $e" + ;; + esac +done +DNS_CRYPTO_LIBS="$NEWFLAGS" + AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CFLAGS) AC_SUBST(BUILD_CPPFLAGS) @@ -2547,7 +2867,7 @@ AC_SUBST(BUILD_LIBS) AC_CONFIG_COMMANDS( [chmod], - [chmod a+x isc-config.sh]) + [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter]) # # Files to configure. These are listed here because we used to @@ -2633,6 +2953,9 @@ AC_CONFIG_FILES([ doc/xsl/isc-docbook-html.xsl doc/xsl/isc-docbook-latex.xsl doc/xsl/isc-manpage.xsl + doc/doxygen/Doxyfile + doc/doxygen/Makefile + doc/doxygen/doxygen-input-filter ]) # |