configure.in revision 9ac79ef3f89b23d80f9649abf71fdc65bb7a8b62
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl Permission to use, copy, modify, and distribute this software for any
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl purpose with or without fee is hereby granted, provided that the above
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl copyright notice and this permission notice appear in all copies.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdnl SOFTWARE.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_REVISION($Revision: 1.108 $)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PREREQ(2.13)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_INIT(lib/dns/name.c)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CONFIG_HEADER(config.h)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CANONICAL_HOST
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PROG_MAKE_SET
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PROG_RANLIB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PROG_INSTALL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsSTD_CINCLUDES=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsSTD_CDEFINES=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsSTD_CWARNINGS=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(STD_CINCLUDES)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(STD_CDEFINES)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(STD_CWARNINGS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PATH_PROG(AR, ar)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsARFLAGS="cruv"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(AR)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ARFLAGS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PATH_PROGS(ETAGS, etags emacs-etags)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ETAGS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Special processing of paths depending on whether --prefix,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# --sysconfdir or --localstatedir arguments were given. What's
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# desired is some compatability with the way previous versions
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# of BIND built; they defaulted to /usr/local for most parts of
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# the installation, but named.boot/named.conf was in /etc
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# and named.pid was in /var/run.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# So ... if none of --prefix, --sysconfdir or --localstatedir are
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# specified, set things up that way. If --prefix is given, use
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# it for sysconfdir and localstatedir the way configure normally
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# would. To change the prefix for everything but leave named.conf
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# in /etc or named.pid in /var/run, then do this the usual configure way:
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# ./configure --prefix=/somewhere --sysconfdir=/etc
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# ./configure --prefix=/somewhere --localstatedir=/var
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# To put named.conf and named.pid in /usr/local with everything else,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# set the prefix explicitly to /usr/local even though that's the default:
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# ./configure --prefix=/usr/local
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$prefix" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews NONE)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$sysconfdir" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews '${prefix}/etc')
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews sysconfdir=/etc
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$localstatedir" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews '${prefix}/var')
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews localstatedir=/var
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Make sure INSTALL uses an absolute path, else it will be wrong in all
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# configure based on the location of the file where it is substituted.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# subdirectory of install-sh, This relative path will be wrong for all
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# directories more than one level down from install-sh.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$INSTALL" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews /*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # Not all systems have dirname.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews changequote({, })
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews changequote([, ])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews test "$ac_dir" = "$ac_prog" && ac_dir=.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews INSTALL="$ac_dir/$ac_prog"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# On these hosts, we really want to use cc, not gcc, even if it is
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# found. The gcc that these systems have will not correctly handle
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# pthreads.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# However, if the user sets $CC to be something, let that override
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# our change.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsif test "X$CC" = "X" ; then
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-dec-osf*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="cc"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-solaris*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # Use Sun's cc if it is available, but watch
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # out for /usr/ucb/cc; it will never be the right
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # compiler to use.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # If setting CC here fails, the AC_PROG_CC done
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # below might still find gcc.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews for ac_dir in $PATH; do
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews test -z "$ac_dir" && ac_dir=.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$ac_dir" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews /usr/ucb)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # exclude
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if test -f "$ac_dir/cc"; then
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$ac_dir/cc"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews break
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews fi
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews done
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews IFS="$ac_save_ifs"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-hp-hpux*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="cc"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews mips-sgi-irix*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="cc"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsfi
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# NetBSD has two alternative pthreads implementations. Make the
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# user choose one by saying --with-mit-pthreads or --with-ptl2
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# if necessary.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-netbsd*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="gcc"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_CHECKING(which thread library to use)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_ARG_WITH(mit-pthreads,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ --with-mit-pthreads use the mit-pthreads thread library],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews use_mit_pthreads="$withval", use_mit_pthreads="no")
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_ARG_WITH(ptl2,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ --with-ptl2 use the ptl2 thread library],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews use_ptl2="$withval", use_ptl2="no")
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews : ${LOCALBASE:=/usr/pkg}
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # If user did not choose a thread library explicitly,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # try to choose one automatically. This will work when
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # exactly one library is installed.
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$use_mit_pthreads+$use_ptl2" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews no+no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if test -d $LOCALBASE/pthreads
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews then
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews use_mit_pthreads="yes"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews fi
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if test -d $LOCALBASE/PTL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews then
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews use_ptl2="yes"
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews fi
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$use_mit_pthreads+$use_ptl2" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews yes+no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_RESULT(mit-pthreads)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews pkg="$LOCALBASE/pthreads"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews lib1="-L$pkg/lib -Wl,-R$pkg/lib"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews lib2="-lpthread -lm -lgcc -lpthread"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LIBS="$lib1 $lib2 $LIBS"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CPPFLAGS="-I$pkg/include $CPPFLAGS"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews STD_CINCLUDES="-I$pkg/include"
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews no+yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_RESULT(PTL2)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# pkg="$LOCALBASE/PTL"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# LIBS="-L$LOCALBASE/lib -lPTL $LIBS"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# STD_CINCLUDES="-nostdinc -idirafter $pkg/include"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC=ptlgcc
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_ERROR([no thread library.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsPlease choose a thread library using one of
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews configure --with-mit-pthreads
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews configure --with-ptl2
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PROG_CC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PROG_YACC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_HEADER_STDC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h netinet6/in6.h)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# HAVE_NETINET6_IN6_H needs to go in platform.h.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$ac_cv_header_netinet6_in6_h" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsyes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_HAVENETINET6IN6H="#define ISC_PLATFORM_HAVENETINET6IN6H 1"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LWRES_PLATFORM_HAVENETINET6IN6H="#define LWRES_PLATFORM_HAVENETINET6IN6H 1"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsno)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_HAVENETINET6IN6H="#undef ISC_PLATFORM_HAVENETINET6IN6H"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LWRES_PLATFORM_HAVENETINET6IN6H="#undef LWRES_PLATFORM_HAVENETINET6IN6H"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVENETINET6IN6H)
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark AndrewsAC_SUBST(LWRES_PLATFORM_HAVENETINET6IN6H)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_C_CONST
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_C_INLINE
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TYPE_SIZE_T
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_HEADER_TIME
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_LIB(pthread, pthread_create,,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(pthread, __pthread_create)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(pthread, __pthread_create_system)
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# We'd like to use sigwait() too
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_LIB(c, sigwait,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(HAVE_SIGWAIT),
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(pthread, sigwait,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(HAVE_SIGWAIT),
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(pthread, _Psigwait,
dc64df4479df5e7cb3ed1dead21888b5af98f67eMark Andrews AC_DEFINE(HAVE_SIGWAIT),))
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Additional OS-specific issues related to pthreads.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # One more place to look for sigwait.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-freebsd*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # BSDI 3.1 through 4.0.1 needs pthread_init() to be called before
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # certain pthreads calls. This is deprecated in BSD/OS 4.1.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-bsdi3.1*|*-bsdi4.0*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(NEED_PTHREAD_INIT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # LinuxThreads requires some changes to the way we deal with signals.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-linux*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(HAVE_LINUXTHREADS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # Ensure the right sigwait() semantics on Solaris.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews #
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-solaris*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# NLS
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# -lxnet buys us one big porting headache... standards, gotta love 'em.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# AC_CHECK_LIB(xnet, socket, ,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# AC_CHECK_LIB(socket, socket)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# AC_CHECK_LIB(nsl, inet_ntoa)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# )
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Use this for now, instead:
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews mips-sgi-irix*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(socket, socket)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_CHECK_LIB(nsl, inet_ntoa)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsMKDEPCC="$CC"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsMKDEPCFLAGS="-M"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsif test "X$GCC" = "Xyes"; then
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-freebsd*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$CC -pthread"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-openbsd*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$CC -pthread"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-solaris*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LIBS="$LIBS -lthread"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewselse
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews case "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-dec-osf*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$CC -std -pthread"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews MKDEPCC="$CC"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-solaris*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$CC -mt"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews MKDEPCC="$CC"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews MKDEPCFLAGS="-xM"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-hp-hpux*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews CC="$CC -Ae -z +w1"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews esac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsfi
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(MKDEPCC)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(MKDEPCFLAGS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(MKDEPPROG)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Networking specifics.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase "$host" in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *-dec-osf*)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews # Turn on 4.4BSD style sa_len support.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(_SOCKADDR_LEN)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ;;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsesac
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Look for a 4.4BSD-style sa_len member in struct sockaddr.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for sa_len in struct sockaddr)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/types.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/socket.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[struct sockaddr sa; sa.sa_len = 0; return (0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVESALEN)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(LWRES_PLATFORM_HAVESALEN)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Look for a 4.4BSD or 4.3BSD struct msghdr
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for struct msghdr flavor)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/types.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/socket.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[struct msghdr msg; msg.msg_flags = 0; return (0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(4.4BSD)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(4.3BSD)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Look for in_port_t.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for type in_port_t)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/types.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netinet/in.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[in_port_t port = 25; return (0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDPORTT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Check for addrinfo
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for struct addrinfo)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[struct addrinfo a; return (0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_NEEDADDRINFO)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for int sethostent)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[int i = sethostent(0); return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_SETHOSTENTINT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for int endhostent)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[int i = endhostent(); return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsstruct netent *getnetbyaddr(in_addr_t, int);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for int setnetent)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[int i = setnetent(0); return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_SETNETENTINT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for int endnetent)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[int i = endnetent(); return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_ENDNETENTINT)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for gethostbyadd(const void *, size_t, ...))
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsstruct hostent *gethostbyaddr(const void *, size_t, int);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for h_errno in netdb.h)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_TRY_COMPILE([
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <netdb.h>],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews[h_errno = 1; return(0);],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_NEEDHERRNO)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_FUNC(getipnodebyname,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_FUNC(getnameinfo,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CHECK_FUNC(getaddrinfo,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Look for a sysctl call to get the list of network interfaces.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_MSG_CHECKING(for interface list sysctl)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_EGREP_CPP(found_rt_iflist, [
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/param.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/sysctl.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <sys/socket.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef NET_RT_IFLIST
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsfound_rt_iflist
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_DEFINE(HAVE_IFLIST_SYSCTL)],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [AC_MSG_RESULT(no)])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# GNU libtool support
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_ARG_WITH(libtool,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews [ --with-libtool use GNU libtool],
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews use_libtool="$withval", use_libtool="no")
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewscase $use_libtool in
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews yes)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AM_PROG_LIBTOOL
O=lo
A=la
;;
*)
O=o
A=a
LIBTOOL=
AC_SUBST(LIBTOOL)
;;
esac
# File name extension for static archive files, for those few places
# where they are treated differently from dynamic ones.
SA=a
AC_SUBST(O)
AC_SUBST(A)
AC_SUBST(SA)
#
# IPv6
#
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 use IPv6 [default=autodetect]])
#
# We do the IPv6 compilation checking after libtool so that we can put
# the right suffix on the files.
#
case "$enable_ipv6" in
yes|''|autodetect)
AC_MSG_CHECKING(for IPv6 structures)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[struct sockaddr_in6 sin6; return (0);],
[AC_MSG_RESULT(yes)
found_ipv6=yes],
[AC_MSG_RESULT(no)
found_ipv6=no])
;;
no)
found_ipv6=no
;;
esac
case "$found_ipv6" in
yes)
ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
AC_MSG_CHECKING(for in6addr_any)
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[struct in6_addr in6; in6 = in6addr_any; return (0);],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"])
;;
no)
ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
ISC_IPV6_H="ipv6.h"
ISC_IPV6_O="ipv6.$O"
ISC_ISCIPV6_O="unix/ipv6.$O"
ISC_IPV6_C="ipv6.c"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEIPV6)
AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
AC_SUBST(ISC_IPV6_H)
AC_SUBST(ISC_IPV6_O)
AC_SUBST(ISC_ISCIPV6_O)
AC_SUBST(ISC_IPV6_C)
#
# IPv6 support provided via Kame
#
AC_MSG_CHECKING(for Kame IPv6 support)
AC_ARG_WITH(kame,
[ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
use_kame="$withval", use_kame="no")
case "$use_kame" in
no)
;;
yes)
kame_path=/usr/local/v6
;;
*)
kame_path="$use_kame"
;;
esac
case "$use_kame" in
no)
AC_MSG_RESULT(no)
;;
*)
if test -f $kame_path/lib/libinet6.a; then
AC_MSG_RESULT($kame_path/lib/libinet6.a)
LIBS="-L$kame_path/lib -linet6 $LIBS"
else
AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
Please choose the proper path with the following command:
configure --with-kame=PATH
])
fi
;;
esac
#
# Check for network functions that are often missing. We do this
# after the libtool checking, so we can put the right suffix on
# the files.
#
AC_CHECK_FUNC(inet_ntop,
[ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
[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_CHECK_FUNC(inet_pton,
[ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
[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_CHECK_FUNC(inet_aton,
[ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
[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_CHECK_FUNC(strsep,
[ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS strsep.$O"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS strsep.c"
ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
AC_CHECK_FUNC(vsnprintf,
[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"],
[ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"])
AC_SUBST(ISC_PLATFORM_NEEDNTOP)
AC_SUBST(ISC_PLATFORM_NEEDPTON)
AC_SUBST(ISC_PLATFORM_NEEDATON)
AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
AC_SUBST(ISC_EXTRA_OBJS)
AC_SUBST(ISC_EXTRA_SRCS)
AC_MSG_CHECKING(for sizeof(long long int) == sizeof(long int))
AC_TRY_RUN([main() { exit(!(sizeof(long long int) == sizeof(long int))); }],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_LONGLONGEQUALLONG="#undef ISC_PLATFORM_LONGLONGEQUALLONG"],
[AC_MSG_RESULT(default yes)
ISC_PLATFORM_LONGLONGEQUALLONG="#define ISC_PLATFORM_LONGLONGEQUALLONG 1"])
AC_SUBST(ISC_PLATFORM_LONGLONGEQUALLONG)
#
# Security Stuff
#
AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
AC_CHECK_HEADERS(linux/capability.h)
#
# Substitutions
#
AC_SUBST(BIND9_TOP_BUILDDIR)
BIND9_TOP_BUILDDIR=`pwd`
AC_SUBST(BIND9_ISC_BUILDINCLUDE)
AC_SUBST(BIND9_DNS_BUILDINCLUDE)
AC_SUBST(BIND9_OMAPI_BUILDINCLUDE)
AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
if test "X$srcdir" != "X"; then
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"
else
BIND9_ISC_BUILDINCLUDE=""
BIND9_DNS_BUILDINCLUDE=""
BIND9_OMAPI_BUILDINCLUDE=""
BIND9_LWRES_BUILDINCLUDE=""
fi
AC_SUBST_FILE(BIND9_INCLUDES)
BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
AC_SUBST_FILE(BIND9_MAKE_RULES)
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
AC_SUBST_FILE(BIND9_VERSION)
BIND9_VERSION=$srcdir/version
AC_SUBST_FILE(LIBISC_API)
LIBISC_API=$srcdir/lib/isc/api
AC_SUBST_FILE(LIBDNS_API)
LIBDNS_API=$srcdir/lib/dns/api
AC_SUBST_FILE(LIBLWRES_API)
LIBLWRES_API=$srcdir/lib/lwres/api
AC_SUBST_FILE(LIBOMAPI_API)
LIBOMAPI_API=$srcdir/lib/omapi/api
AC_OUTPUT(
make/rules
make/includes
Makefile
make/Makefile
make/mkdep
lib/Makefile
lib/isc/Makefile
lib/isc/include/Makefile
lib/isc/include/isc/Makefile
lib/isc/include/isc/platform.h
lib/isc/unix/Makefile
lib/isc/unix/include/Makefile
lib/isc/unix/include/isc/Makefile
lib/isc/nls/Makefile
lib/isc/pthreads/Makefile
lib/isc/pthreads/include/Makefile
lib/isc/pthreads/include/isc/Makefile
lib/dns/Makefile
lib/dns/include/Makefile
lib/dns/include/dns/Makefile
lib/dns/sec/Makefile
lib/dns/sec/openssl/Makefile
lib/dns/sec/openssl/include/Makefile
lib/dns/sec/openssl/include/openssl/Makefile
lib/dns/sec/dnssafe/Makefile
lib/dns/sec/dst/Makefile
lib/dns/sec/dst/include/Makefile
lib/dns/sec/dst/include/dst/Makefile
lib/dns/config/Makefile
lib/lwres/Makefile
lib/lwres/include/Makefile
lib/lwres/include/lwres/Makefile
lib/lwres/include/lwres/netdb.h
lib/lwres/include/lwres/platform.h
lib/omapi/Makefile
lib/omapi/include/Makefile
lib/omapi/include/omapi/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
bin/Makefile
bin/named/Makefile
bin/named/unix/Makefile
bin/lwresd/Makefile
bin/rndc/Makefile
bin/tests/Makefile
bin/tests/names/Makefile
bin/tests/master/Makefile
bin/tests/rbt/Makefile
bin/tests/db/Makefile
bin/tests/tasks/Makefile
bin/tests/timers/Makefile
bin/tests/dst/Makefile
bin/tests/mem/Makefile
bin/tests/sockaddr/Makefile
)