configure.in revision d11097cf86e789c8dbb7df86753491b30add2f5a
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl Permission to use, copy, modify, and distribute this software for any
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl purpose with or without fee is hereby granted, provided that the above
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl copyright notice and this permission notice appear in all copies.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdnl SOFTWARE.
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_REVISION($Revision: 1.153 $)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PREREQ(2.13)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_CONFIG_HEADER(config.h)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_CANONICAL_HOST
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PROG_MAKE_SET
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PROG_RANLIB
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PROG_INSTALL
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(STD_CINCLUDES)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(STD_CDEFINES)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(STD_CWARNINGS)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PATH_PROG(AR, ar)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntARFLAGS="cruv"
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(ARFLAGS)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# The POSIX ln(1) program. Non-POSIX systems may substitute
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# "copy" or something.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntcase "$AR" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_MSG_ERROR([
351b62535d4c4f89883bfdba025999dd32490266Evan Huntar program not found. Please fix your PATH to include the directory in
351b62535d4c4f89883bfdba025999dd32490266Evan Huntwhich ar resides, or set AR in the environment with the full path to ar.
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PATH_PROGS(ETAGS, etags emacs-etags)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(ETAGS)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# Perl is optional; it is used only by some of the system test scripts.
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_PATH_PROGS(PERL, perl5 perl)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(PERL)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# Special processing of paths depending on whether --prefix,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# --sysconfdir or --localstatedir arguments were given. What's
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# desired is some compatability with the way previous versions
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# of BIND built; they defaulted to /usr/local for most parts of
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# the installation, but named.boot/named.conf was in /etc
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# So ... if none of --prefix, --sysconfdir or --localstatedir are
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# specified, set things up that way. If --prefix is given, use
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# it for sysconfdir and localstatedir the way configure normally
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# would. To change the prefix for everything but leave named.conf
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# in /etc or named.pid in /var/run, then do this the usual configure way:
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# ./configure --prefix=/somewhere --sysconfdir=/etc
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# ./configure --prefix=/somewhere --localstatedir=/var
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# To put named.conf and named.pid in /usr/local with everything else,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# set the prefix explicitly to /usr/local even though that's the default:
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# ./configure --prefix=/usr/local
351b62535d4c4f89883bfdba025999dd32490266Evan Huntcase "$prefix" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt case "$sysconfdir" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt '${prefix}/etc')
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt sysconfdir=/etc
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt case "$localstatedir" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt '${prefix}/var')
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt localstatedir=/var
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# Make sure INSTALL uses an absolute path, else it will be wrong in all
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# configure based on the location of the file where it is substituted.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# subdirectory of install-sh, This relative path will be wrong for all
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# directories more than one level down from install-sh.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntcase "$INSTALL" in
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater # Not all systems have dirname.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt changequote({, })
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt changequote([, ])
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt test "$ac_dir" = "$ac_prog" && ac_dir=.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt INSTALL="$ac_dir/$ac_prog"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# On these hosts, we really want to use cc, not gcc, even if it is
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# found. The gcc that these systems have will not correctly handle
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# However, if the user sets $CC to be something, let that override
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# our change.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntif test "X$CC" = "X" ; then
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt case "$host" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt # Use Sun's cc if it is available, but watch
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt # out for /usr/ucb/cc; it will never be the right
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt # compiler to use.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt # If setting CC here fails, the AC_PROG_CC done
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt # below might still find gcc.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt for ac_dir in $PATH; do
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt test -z "$ac_dir" && ac_dir=.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt case "$ac_dir" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt if test -f "$ac_dir/cc"; then
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater IFS="$ac_save_ifs"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt mips-sgi-irix*)
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater# Find the machine's endian flavor.
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater# If the user didn't specify where openssl is, and we didn't find or it
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater# is imcompatible with our code, use our internal one.
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater# XXXMLG Implement this check!
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic UpdaterAC_MSG_CHECKING(for compatible OpenSSL library)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntDST_PRIVATEOPENSSL='-DDST_USE_PRIVATE_OPENSSL'
351b62535d4c4f89883bfdba025999dd32490266Evan Huntdst_privateopenssl='openssl'
351b62535d4c4f89883bfdba025999dd32490266Evan HuntDST_OPENSSL_INC='-I${srcdir}/../openssl/include'
351b62535d4c4f89883bfdba025999dd32490266Evan HuntDST_OPENSSL_LIB=''
351b62535d4c4f89883bfdba025999dd32490266Evan HuntDST_OPENSSL_OBJS='${OPENSSLOBJS}'
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_MSG_RESULT(using private library)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(DST_PRIVATEOPENSSL)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(dst_privateopenssl)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(DST_OPENSSL_INC)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(DST_OPENSSL_LIB)
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(DST_OPENSSL_OBJS)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# This would include the system openssl path (and linker options to use
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# it as needed) if it is found.
351b62535d4c4f89883bfdba025999dd32490266Evan HuntDNS_OPENSSL_LIBS=""
351b62535d4c4f89883bfdba025999dd32490266Evan HuntAC_SUBST(DNS_OPENSSL_LIBS)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# testing with alternate openssl libraries... XXXMLG
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# DNS_OPENSSL_LIBS="-L/usr/pkg/lib -lssl -lcrypto"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# DST_PRIVATEOPENSSL=''
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# dst_privateopenssl=''
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# DST_OPENSSL_INC='-I/usr/pkg/include'
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# DST_OPENSSL_LIB=''
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# NetBSD has multiple pthreads implementations. The recommended
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# one to use is "unproven-pthreads". The older "mit-pthreads"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# may also work on some NetBSD versions. The PTL2 thread
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# library does not currently work with bind9, but can be
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# chosen with the --with-ptl2 option for those who wish to
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt# experiment with it.
351b62535d4c4f89883bfdba025999dd32490266Evan Huntcase "$host" in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_MSG_CHECKING(which NetBSD thread library to use)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_ARG_WITH(ptl2,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt[ --with-ptl2 on NetBSD, use the ptl2 thread library (experimental)],
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt use_ptl2="$withval", use_ptl2="no")
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater : ${LOCALBASE:=/usr/pkg}
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt if test "X$use_ptl2" = "Xyes"
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_MSG_RESULT(PTL2)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_MSG_WARN(
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt[linking with PTL2 is highly experimental and not expected to work])
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt AC_MSG_ERROR([no thread library found.
351b62535d4c4f89883bfdba025999dd32490266Evan HuntPlease install the devel/unproven-pthreads package and rerun configure.
pkg="$LOCALBASE/pthreads"
CPPFLAGS="$CPPFLAGS -I$pkg/include"
STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
# certain pthreads calls. This is deprecated in BSD/OS 4.1.
MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
# from lib/dns/sec/{dnssafe,openssl}.
#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr sa; sa.sa_len = 0; return (0);],
#include <sys/types.h>
#include <sys/socket.h>],
[struct msghdr msg; msg.msg_flags = 0; return (0);],
#include <sys/types.h>
#include <netinet/in.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>
AC_MSG_CHECKING(for h_errno in netdb.h)
#include <netdb.h>],
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
kame_path=/usr/local/v6
if test -f $kame_path/lib/libinet6.a; then
AC_MSG_RESULT($kame_path/lib/libinet6.a)
LIBS="-L$kame_path/lib -linet6 $LIBS"
AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
# netinet6/in6.h is needed for.
isc_netinet6in6_hack="#include <netinet6/in6.h>"
# This is similar to the netinet6/in6.h issue.
isc_netinetin6_hack="#include <netinet/in6.h>"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
ISC_IPV6_H="ipv6.h"
ISC_ISCIPV6_O="unix/ipv6.$O"
ISC_IPV6_C="ipv6.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>],
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
AC_CHECK_HEADERS(linux/capability.h)
AC_CHECK_HEADERS(linux/prctl.h)
# Shut up a -Wmissing-prototypes warning from <stdio.h>.
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
BIND9_OMAPI_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/omapi/include"
BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
LIBISC_API=$srcdir/lib/isc/api
LIBDNS_API=$srcdir/lib/dns/api
LIBLWRES_API=$srcdir/lib/lwres/api
LIBOMAPI_API=$srcdir/lib/omapi/api