configure.in revision 712bf9b0cc4ed34f4bf33b437f8b0e45853b93ce
6ea1b817e31b89a627e146fe69e23ea0a64c89ecBob Halley# Copyright (C) 1998-2001 Internet Software Consortium.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# Permission to use, copy, modify, and distribute this software for any
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# purpose with or without fee is hereby granted, provided that the above
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# copyright notice and this permission notice appear in all copies.
6ea1b817e31b89a627e146fe69e23ea0a64c89ecBob Halley# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinesyscmd([sed "s/^/# /" COPYRIGHT])dnl
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_DIVERT_POP()dnl
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_REVISION($Revision: 1.310 $)
9a5087bf58f651bfff841192aba5afd06760d6ceTinderbox UserAC_PREREQ(2.13)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_CONFIG_HEADER(config.h)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_CONFIG_SUBDIRS(lib/bind)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_CANONICAL_HOST
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_PROG_MAKE_SET
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_PROG_RANLIB
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_PROG_INSTALL
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_SUBST(STD_CINCLUDES)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_SUBST(STD_CDEFINES)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_SUBST(STD_CWARNINGS)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_SUBST(CCOPT)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_PATH_PROG(AR, ar)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinARFLAGS="cruv"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_SUBST(ARFLAGS)
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# The POSIX ln(1) program. Non-POSIX systems may substitute
9fbbfb5757a1e3e86d7dea62c4e63ffc2303ca2bAutomatic Updater# "copy" or something.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein AC_MSG_ERROR([
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userar program not found. Please fix your PATH to include the directory in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinwhich ar resides, or set AR in the environment with the full path to ar.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox UserAC_PATH_PROGS(ETAGS, etags emacs-etags)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# GNU emacs etags, and it requires the -L flag.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userif test "X$ETAGS" != "X"; then
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User AC_MSG_CHECKING(for Exuberant Ctags etags)
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User AC_MSG_RESULT(yes)
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews ETAGS="$ETAGS -L"
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews AC_MSG_RESULT(no)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_SUBST(ETAGS)
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Perl is optional; it is used only by some of the system test scripts.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark AndrewsAC_PATH_PROGS(PERL, perl5 perl)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_SUBST(PERL)
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Special processing of paths depending on whether --prefix,
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# --sysconfdir or --localstatedir arguments were given. What's
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater# desired is some compatability with the way previous versions
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# of BIND built; they defaulted to /usr/local for most parts of
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the installation, but named.boot/named.conf was in /etc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# So ... if none of --prefix, --sysconfdir or --localstatedir are
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# specified, set things up that way. If --prefix is given, use
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater# it for sysconfdir and localstatedir the way configure normally
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# would. To change the prefix for everything but leave named.conf
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# in /etc or named.pid in /var/run, then do this the usual configure way:
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# ./configure --prefix=/somewhere --sysconfdir=/etc
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ./configure --prefix=/somewhere --localstatedir=/var
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# To put named.conf and named.pid in /usr/local with everything else,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# set the prefix explicitly to /usr/local even though that's the default:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ./configure --prefix=/usr/local
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeincase "$prefix" in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein case "$sysconfdir" in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User '${prefix}/etc')
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein sysconfdir=/etc
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews case "$localstatedir" in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User '${prefix}/var')
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews localstatedir=/var
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Make sure INSTALL uses an absolute path, else it will be wrong in all
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# configure based on the location of the file where it is substituted.
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User# subdirectory of install-sh, This relative path will be wrong for all
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# directories more than one level down from install-sh.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usercase "$INSTALL" in
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User # Not all systems have dirname.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein changequote({, })
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User changequote([, ])
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein test "$ac_dir" = "$ac_prog" && ac_dir=.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein INSTALL="$ac_dir/$ac_prog"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# On these hosts, we really want to use cc, not gcc, even if it is
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# found. The gcc that these systems have will not correctly handle
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# However, if the user sets $CC to be something, let that override
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# our change.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userif test "X$CC" = "X" ; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein case "$host" in
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # Use Sun's cc if it is available, but watch
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # out for /usr/ucb/cc; it will never be the right
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # compiler to use.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # If setting CC here fails, the AC_PROG_CC done
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # below might still find gcc.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein for ac_dir in $PATH; do
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User test -z "$ac_dir" && ac_dir=.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein case "$ac_dir" in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if test -f "$ac_dir/cc"; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein IFS="$ac_save_ifs"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User mips-sgi-irix*)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_HEADER_STDC
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/sysctl.h net/if6.h)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# UnixWare 7.1.1 with the feature supplement to the UDK compiler
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# is reported to not support "static inline" (RT #1212).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinAC_MSG_CHECKING(for static inline breakage)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAC_TRY_COMPILE(, [
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User static inline int foo1() {
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein static inline int foo2() {
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User return foo1();
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein [AC_MSG_RESULT(no)],
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
lifconf.lifc_len = 0;
# check if we need to #include sys/select.h explicitly
AC_MSG_CHECKING(if unistd.h defines fd_set)
#include <unistd.h>],
if test -f $d/include/openssl/opensslv.h
DST_OPENSSL_INC="-I$use_openssl/include"
DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
#include <stdio.h>
#include <openssl/opensslv.h>
# DST_GSSAPI_INC="-I$use_gssapi/include"
# DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
devrandom=/dev/srandom
devrandom=/dev/random
: ${LOCALBASE:=/usr/pkg}
if test ! -d $LOCALBASE/pthreads
AC_MSG_RESULT(mit-pthreads/unproven-pthreads)
pkg="$LOCALBASE/pthreads"
CPPFLAGS="$CPPFLAGS -I$pkg/include"
STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
# in BSD/OS 4.1.
MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
# from lib/dns/sec/openssl.
LIBBIND=lib/bind
#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>
#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 <net/if6.h>
#include <sys/types.h>
#include <net/if6.h>
#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 <sys/socket.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"
#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>],
#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>
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
AC_CHECK_HEADERS(linux/capability.h)
AC_CHECK_HEADERS(sys/prctl.h)
# BSD/OS, and perhaps some others, don't define rlim_t.
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
# Shut up a -Wmissing-prototypes warning from <stdio.h>.
# Subroutine for searching for an ordinary file (e.g., a stylesheet)
# Look for the HTML stylesheet html/docbook.dsl, used for
# NetBSD /usr/pkg/share/docbook/dsssl/modular/
# FreeBSD /usr/local/share/docbook/dsssl/modular/
# Linux /usr/local/share/dsssl/docbook/
# Ditto for the print stylesheet print/docbook.dsl.
NOM_PATH_FILE(HTMLSTYLE, html/docbook.dsl, $stylepath)
NOM_PATH_FILE(PRINTSTYLE, print/docbook.dsl, $stylepath)
NOM_PATH_FILE(XMLDCL, docbook/dsssl/modular/dtds/decls/xml.dcl, $sgmltrees)
# Look for docbook2man-spec.pl
NOM_PATH_FILE(DOCBOOK2MANSPEC, docbook2X/docbook2man-spec.pl, $sgmltrees)
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
LIBISC_API=$srcdir/lib/isc/api
LIBISCCC_API=$srcdir/lib/isccc/api
LIBISCCFG_API=$srcdir/lib/isccfg/api
LIBDNS_API=$srcdir/lib/dns/api
LIBBIND9_API=$srcdir/lib/bind9/api
LIBLWRES_API=$srcdir/lib/lwres/api
chmod a+x isc-config.sh