configure.in revision 31b7a2fed64e388db772a74742a4adc95d1a21e6
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Copyright (C) 1998-2003 Internet Software Consortium.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Permission to use, copy, modify, and/or distribute this software for any
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# purpose with or without fee is hereby granted, provided that the above
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# copyright notice and this permission notice appear in all copies.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# PERFORMANCE OF THIS SOFTWARE.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffdnl
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_DIVERT_PUSH(1)dnl
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesyscmd([sed "s/^/# /" COPYRIGHT])dnl
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_DIVERT_POP()dnl
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_REVISION($Revision: 1.466 $)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_INIT(lib/dns/name.c)
8cdfd17426179ae6f629a9b7475d46a22f535047Bob HalleyAC_PREREQ(2.59)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_CONFIG_HEADER(config.h)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_CANONICAL_HOST
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_PROG_MAKE_SET
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_PROG_LIBTOOL
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_PROG_INSTALL
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_PROG_LN_S
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
058eeac2105c39e7cb31fb75ee0b473717ec3bbcMark AndrewsAC_SUBST(STD_CINCLUDES)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(STD_CDEFINES)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(STD_CWARNINGS)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(CCOPT)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff# Warn if the user specified libbind, which is now deprecated
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael GraffAC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graffcase "$enable_libbind" in
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff yes)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael GraffIt is available from http://www.isc.org as a separate download.])
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
440be4c866f6935ac069db79a414304507a664c2Michael Graff no|'')
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleyesac
e45d323a2a0f4ca08d4b139546e60a5fa7bd3f0cMichael Graff
29f28fe573d4b3b318b3b026d567c1eb86738015Michael Graff
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff#
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff# Make very sure that these are the first files processed by
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff# config.status, since we use the processed output as the input for
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# AC_SUBST_FILE() substitutions in other files.
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_CONFIG_FILES([make/rules make/includes])
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael GraffAC_PATH_PROG(AR, ar)
439c0011e642fb1d26011116144af698125262dbMichael GraffARFLAGS="cruv"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(AR)
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael GraffAC_SUBST(ARFLAGS)
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff# The POSIX ln(1) program. Non-POSIX systems may substitute
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff# "copy" or something.
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael GraffLN=ln
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael GraffAC_SUBST(LN)
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graffcase "$AR" in
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff "")
31fab17bcdbe302592a6c0dc5374ef56333ee879Michael Graff AC_MSG_ERROR([
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffar program not found. Please fix your PATH to include the directory in
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graffwhich ar resides, or set AR in the environment with the full path to ar.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley])
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley#
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley# Etags.
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley#
8cdfd17426179ae6f629a9b7475d46a22f535047Bob HalleyAC_PATH_PROGS(ETAGS, etags emacs-etags)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff#
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff# GNU emacs etags, and it requires the -L flag.
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff#
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graffif test "X$ETAGS" != "X"; then
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff AC_MSG_CHECKING(for Exuberant Ctags etags)
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff AC_MSG_RESULT(yes)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ETAGS="$ETAGS -L"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff else
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley AC_MSG_RESULT(no)
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley fi
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halleyfi
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael GraffAC_SUBST(ETAGS)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff#
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff# Perl is optional; it is used only by some of the system test scripts.
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff#
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_PATH_PROGS(PERL, perl5 perl)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(PERL)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# Special processing of paths depending on whether --prefix,
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# --sysconfdir or --localstatedir arguments were given. What's
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff# desired is some compatibility with the way previous versions
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# of BIND built; they defaulted to /usr/local for most parts of
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# the installation, but named.boot/named.conf was in /etc
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# and named.pid was in /var/run.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff# So ... if none of --prefix, --sysconfdir or --localstatedir are
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# specified, set things up that way. If --prefix is given, use
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# it for sysconfdir and localstatedir the way configure normally
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# would. To change the prefix for everything but leave named.conf
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# in /etc or named.pid in /var/run, then do this the usual configure way:
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# ./configure --prefix=/somewhere --sysconfdir=/etc
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# ./configure --prefix=/somewhere --localstatedir=/var
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# To put named.conf and named.pid in /usr/local with everything else,
439c0011e642fb1d26011116144af698125262dbMichael Graff# set the prefix explicitly to /usr/local even though that's the default:
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff# ./configure --prefix=/usr/local
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graffcase "$prefix" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff NONE)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff case "$sysconfdir" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff '${prefix}/etc')
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley sysconfdir=/etc
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff esac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff case "$localstatedir" in
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff '${prefix}/var')
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff localstatedir=/var
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff esac
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffesac
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff# Make sure INSTALL uses an absolute path, else it will be wrong in all
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# configure based on the location of the file where it is substituted.
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff# subdirectory of install-sh, This relative path will be wrong for all
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff# directories more than one level down from install-sh.
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff#
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halleycase "$INSTALL" in
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley /*)
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff ;;
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff *)
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff #
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff # Not all systems have dirname.
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff #
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff changequote({, })
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff changequote([, ])
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graff test "$ac_dir" = "$ac_prog" && ac_dir=.
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff INSTALL="$ac_dir/$ac_prog"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyesac
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halley#
59c049874bbef182857c57bd9cca292898921c69Bob Halley# On these hosts, we really want to use cc, not gcc, even if it is
59c049874bbef182857c57bd9cca292898921c69Bob Halley# found. The gcc that these systems have will not correctly handle
59c049874bbef182857c57bd9cca292898921c69Bob Halley# pthreads.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# However, if the user sets $CC to be something, let that override
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley# our change.
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley#
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halleyif test "X$CC" = "X" ; then
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley case "$host" in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff *-dec-osf*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CC="cc"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff *-solaris*)
1f90c108282533a23b8362c34bcde4267c1eb4b1Michael Graff # Use Sun's cc if it is available, but watch
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff # out for /usr/ucb/cc; it will never be the right
ebdd11e84734e28ddd64562e82a7c646a58a04f4Michael Graff # compiler to use.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # If setting CC here fails, the AC_PROG_CC done
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff # below might still find gcc.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley for ac_dir in $PATH; do
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff test -z "$ac_dir" && ac_dir=.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff case "$ac_dir" in
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff /usr/ucb)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff # exclude
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ;;
28ab8277a068f273f0a805a83b4811446cb78a5bBob Halley *)
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff if test -f "$ac_dir/cc"; then
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CC="$ac_dir/cc"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff break
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff fi
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ;;
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff esac
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff done
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff IFS="$ac_save_ifs"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ;;
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff *-hp-hpux*)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff CC="cc"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ;;
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley mips-sgi-irix*)
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff CC="cc"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ;;
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley esac
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleyfi
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_PROG_CC
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# gcc's optimiser is broken at -02 for ultrasparc
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff case "$host" in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff sparc-*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CCFLAGS="-g -O1"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff esac
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Grafffi
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff# OS dependent CC flags
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffcase "$host" in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # -D_XOPEN_SOURCE_EXTENDED.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff *-dec-osf*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff *-hp-hpux*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
439c0011e642fb1d26011116144af698125262dbMichael Graff LIBS="-lxnet $LIBS"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff *-solaris*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # parts of the IPv6 Advanced Socket API as a result. This is stupid
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # as it breaks how the two halves (Basic and Advanced) of the IPv6
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff # Socket API were designed to be used but we have to live with it.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff *-linux*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
439c0011e642fb1d26011116144af698125262dbMichael Graff CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffesac
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael GraffAC_HEADER_STDC
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[$ac_includes_default
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#ifdef HAVE_SYS_PARAM_H
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# include <sys/param.h>
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff#endif
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff])
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_C_CONST
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_C_INLINE
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_C_VOLATILE
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graff# UnixWare 7.1.1 with the feature supplement to the UDK compiler
439c0011e642fb1d26011116144af698125262dbMichael Graff# is reported to not support "static inline" (RT #1212).
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff#
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_MSG_CHECKING(for static inline breakage)
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_TRY_COMPILE(, [
439c0011e642fb1d26011116144af698125262dbMichael Graff foo1();
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff }
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff static inline int foo1() {
439c0011e642fb1d26011116144af698125262dbMichael Graff return 0;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff }
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff static inline int foo2() {
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff return foo1();
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(no)],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(yes)
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_DEFINE(inline, )])
439c0011e642fb1d26011116144af698125262dbMichael Graff
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffAC_TYPE_SIZE_T
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_CHECK_TYPE(ssize_t, int)
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_CHECK_TYPE(uintptr_t,unsigned long)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_CHECK_TYPE(socklen_t,
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley[
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_TRY_COMPILE(
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff[
439c0011e642fb1d26011116144af698125262dbMichael Graff#include <sys/types.h>
439c0011e642fb1d26011116144af698125262dbMichael Graff#include <sys/socket.h>
439c0011e642fb1d26011116144af698125262dbMichael Graffint getsockname(int, struct sockaddr *, size_t *);
439c0011e642fb1d26011116144af698125262dbMichael Graff],[],
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff[
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#include <sys/types.h>
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#include <sys/socket.h>
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley])
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffAC_SUBST(ISC_SOCKADDR_LEN_T)
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffAC_HEADER_TIME
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_MSG_CHECKING(for long long)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_TRY_COMPILE([],[long long i = 0; return (0);],
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley [AC_MSG_RESULT(yes)
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff [AC_MSG_RESULT(no)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
651228967966ba4fb2e52f92d1207c790af4b130Michael GraffAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff# check if we have lifconf
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_MSG_CHECKING(for struct lifconf)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_TRY_COMPILE([
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff#include <sys/types.h>
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff#include <sys/socket.h>
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff#include <net/if.h>
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff[
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffstruct lifconf lifconf;
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Grafflifconf.lifc_len = 0;
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff]
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff,
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff [AC_MSG_RESULT(yes)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff [AC_MSG_RESULT(no)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael GraffAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff# check if we have kqueue
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael GraffAC_ARG_ENABLE(kqueue,
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff want_kqueue="$enableval", want_kqueue="yes")
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffcase $want_kqueue in
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffyes)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff case $ac_cv_have_kqueue in
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff yes)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ;;
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff *)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff esac
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff*)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graffesac
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael GraffAC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# so we need to try running the code, not just test its existence.
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael GraffAC_ARG_ENABLE(epoll,
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff[ --enable-epoll use Linux epoll when available [[default=auto]]],
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff want_epoll="$enableval", want_epoll="auto")
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffcase $want_epoll in
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffauto)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff AC_MSG_CHECKING(epoll support)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff AC_TRY_RUN([
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#include <sys/epoll.h>
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffint main() {
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley if (epoll_create(1) < 0)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley return (1);
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley return (0);
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley}
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff],
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff [AC_MSG_RESULT(yes)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff [AC_MSG_RESULT(no)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ;;
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffyes)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ;;
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff*)
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graffesac
78854e02c127f31ab90f56da0531542004b45377Michael GraffAC_SUBST(ISC_PLATFORM_HAVEEPOLL)
78854e02c127f31ab90f56da0531542004b45377Michael Graff
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff# check if we support /dev/poll
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_ARG_ENABLE(devpoll,
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff [ --enable-devpoll use /dev/poll when available [[default=yes]]],
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halley want_devpoll="$enableval", want_devpoll="yes")
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halleycase $want_devpoll in
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graffyes)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff AC_CHECK_HEADERS(sys/devpoll.h,
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ,
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff )
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ;;
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff*)
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ;;
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graffesac
21e7034ec046105c00a0dab86c83732e2e77ad99Michael GraffAC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff#
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff# check if we need to #include sys/select.h explicitly
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff#
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graffcase $ac_cv_header_unistd_h in
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graffyes)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_TRY_COMPILE([
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff#include <sys/types.h> /* Ultrix */
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff#include <unistd.h>],
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff[fd_set read_set; return (0);],
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff [AC_MSG_RESULT(yes)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff [AC_MSG_RESULT(no)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff case $ac_cv_header_sys_select_h in
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff yes)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff ;;
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff no)
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff AC_MSG_ERROR([need either working unistd.h or sys/select.h])
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff ;;
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff esac
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffno)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff case $ac_cv_header_sys_select_h in
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff yes)
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff ;;
f6f4ceece41f040cc43722afa9a5cd1f54a576b6Michael Graff no)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff AC_MSG_ERROR([need either unistd.h or sys/select.h])
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff ;;
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff esac
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff ;;
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graffesac
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael GraffAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff#
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff# Find the machine's endian flavor.
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff#
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael GraffAC_C_BIGENDIAN
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff#
01883602b1e9c0a91f1c3526d80d8ef9db747e92Mark Andrews# was --with-openssl specified?
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff#
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffOPENSSL_WARNING=
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_MSG_CHECKING(for OpenSSL library)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael GraffAC_ARG_WITH(openssl,
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff[ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff (Required for DNSSEC)],
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff use_openssl="$withval", use_openssl="auto")
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graffopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graffif test "$use_openssl" = "auto"
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graffthen
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff for d in $openssldirs
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff do
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff if test -f $d/include/openssl/opensslv.h
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff then
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff use_openssl=$d
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff break
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff fi
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff done
528829aa8ad69238e674cd81078bc14d4199691bMichael Grafffi
528829aa8ad69238e674cd81078bc14d4199691bMichael Graffcase "$use_openssl" in
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff no)
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_MSG_RESULT(no)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff DST_OPENSSL_INC=""
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff USE_OPENSSL=""
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff ;;
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff auto)
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff DST_OPENSSL_INC=""
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff USE_OPENSSL=""
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_MSG_RESULT(not found)
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff ;;
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff *)
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff if test "$use_openssl" = "yes"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley then
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff # User did not specify a path - guess it
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff for d in $openssldirs
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff do
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff if test -f $d/include/openssl/opensslv.h
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff then
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff use_openssl=$d
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff break
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff fi
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff done
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff if test "$use_openssl" = "yes"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff then
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_MSG_RESULT(not found)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff AC_MSG_ERROR(
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff fi
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff fi
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff USE_OPENSSL='-DOPENSSL'
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff if test "$use_openssl" = "/usr"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff then
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff DST_OPENSSL_INC=""
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff DNS_OPENSSL_LIBS="-lcrypto"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff else
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff DST_OPENSSL_INC="-I$use_openssl/include"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff case $host in
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-solaris*)
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff ;;
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff *-hp-hpux*)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff ;;
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff *-apple-darwin*)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff #
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff # Apple's ld seaches for serially for dynamic
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff # then static libraries. This means you can't
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff # use -L to override dynamic system libraries
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff # with static ones when linking. Instead
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff # we specify a absolute path.
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff #
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff if test -f "$use_openssl/lib/libcrypto.dylib"
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff then
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff else
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff fi
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff ;;
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff *)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff ;;
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff esac
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff fi
59c049874bbef182857c57bd9cca292898921c69Bob Halley AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff saved_cflags="$CFLAGS"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff saved_libs="$LIBS"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff CFLAGS="$CFLAGS $DST_OPENSSL_INC"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff LIBS="$LIBS $DNS_OPENSSL_LIBS"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_CHECKING(whether linking with OpenSSL works)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_TRY_RUN([
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#include <openssl/err.h>
59c049874bbef182857c57bd9cca292898921c69Bob Halleyint main() {
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ERR_clear_error();
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff return (0);
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff}
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff],
1ac7292ced16b8469bebf04356d50279eae78d97Bob Halley [AC_MSG_RESULT(yes)],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(no)
78854e02c127f31ab90f56da0531542004b45377Michael Graff AC_MSG_ERROR(Could not run test program using OpenSSL from
288f9443ac447c9c14f3722dd6d32c1faef0f009Michael Graff$use_openssl/lib and $use_openssl/include.
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael GraffPlease check the argument to --with-openssl and your
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffshared library configuration (e.g., LD_LIBRARY_PATH).)],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(assuming it does work on target platform)])
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_TRY_LINK([
59c049874bbef182857c57bd9cca292898921c69Bob Halley#include <openssl/err.h>],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff[ DSO_METHOD_dlfcn(); ],
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff [AC_MSG_RESULT(no)],
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff [LIBS="$LIBS -ldl"
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff AC_TRY_LINK([
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff#include <openssl/err.h>
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff],[ DSO_METHOD_dlfcn(); ],
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff [AC_MSG_RESULT(yes)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(unknown)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(assuming it does work on target platform)])
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(assuming it does work on target platform)]
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff )
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael GraffAC_ARG_ENABLE(openssl-version-check,
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff[AC_HELP_STRING([--enable-openssl-version-check],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [Check OpenSSL Version @<:@default=yes@:>@])])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleycase "$enable_openssl_version_check" in
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffyes|'')
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_CHECKING(OpenSSL library version)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_TRY_RUN([
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#include <stdio.h>
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#include <openssl/opensslv.h>
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffint main() {
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff OPENSSL_VERSION_NUMBER < 0x00908000L) ||
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff OPENSSL_VERSION_NUMBER >= 0x0090804fL)
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff return (0);
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley OPENSSL_VERSION_NUMBER);
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley return (1);
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff}
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(ok)],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(not compatible)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff OPENSSL_WARNING=yes
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff ],
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff [AC_MSG_RESULT(assuming target platform has compatible version)])
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graffno)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_RESULT(Skipped OpenSSL version check)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffesac
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_CHECKING(for OpenSSL DSA support)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff if test -f $use_openssl/include/openssl/dsa.h
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff then
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_DEFINE(HAVE_OPENSSL_DSA)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_RESULT(yes)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff else
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_RESULT(no)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff fi
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff CFLAGS="$saved_cflags"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff LIBS="$saved_libs"
78854e02c127f31ab90f56da0531542004b45377Michael Graff ;;
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graffesac
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff#
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff# This would include the system openssl path (and linker options to use
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff# it as needed) if it is found.
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff#
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael GraffAC_SUBST(USE_OPENSSL)
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael GraffAC_SUBST(DST_OPENSSL_INC)
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael GraffDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff#
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff# PKCS11 (aka crypto hardware) support
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff#
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff# This works only with the right OpenSSL with PKCS11 engine!
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_MSG_CHECKING(for PKCS11 support)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_ARG_WITH(pkcs11,
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff[ --with-pkcs11 Build with PKCS11 support],
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff use_pkcs11="yes", use_pkcs11="no")
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graffcase "$use_pkcs11" in
7ec42e4be45c0486ce80461293f377fb4b904dc0Michael Graff no)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff AC_MSG_RESULT(disabled)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff USE_PKCS11=""
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff yes)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_RESULT(using OpenSSL with PKCS11 support)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley USE_PKCS11='-DUSE_PKCS11'
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graffesac
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(USE_PKCS11)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_MSG_CHECKING(for GSSAPI library)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_ARG_WITH(gssapi,
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff[ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff use_gssapi="$withval", use_gssapi="no")
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffgssapidirs="/usr/local /usr/pkg /usr/kerberos /usr"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffif test "$use_gssapi" = "yes"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffthen
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff for d in $gssapidirs
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff do
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff then
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff use_gssapi=$d
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff break
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff fi
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Graff done
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Grafffi
f788a5704623c1d686b770a0f014fd52834d4a67Michael Graff
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Graffcase "$use_gssapi" in
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff no)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff AC_MSG_RESULT(disabled)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff USE_GSSAPI=''
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff yes)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff AC_MSG_ERROR([--with-gssapi must specify a path])
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff ;;
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff *)
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Graff AC_MSG_RESULT(looking in $use_gssapi/lib)
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Graff USE_GSSAPI='-DGSSAPI'
f788a5704623c1d686b770a0f014fd52834d4a67Michael Graff saved_cppflags="$CPPFLAGS"
93d3a6fd20aceb9998eca4723bba8810243e7689Michael Graff CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_MSG_ERROR([gssapi.h not found])
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley fi
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley CPPFLAGS="$saved_cppflags"
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff # XXXDCL This probably doesn't work right on all systems.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff # It will need to be worked on as problems become evident.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff #
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # Essentially the problems here relate to two different
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # areas. The first area is building with either KTH
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # or MIT Kerberos, particularly when both are present on
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # the machine. The other is static versus dynamic linking.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff #
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # On the KTH vs MIT issue, Both have libkrb5 that can mess
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # up the works if one implementation ends up trying to
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff # use the other's krb. This is unfortunately a situation
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # that very easily arises.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff #
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # Dynamic linking when the dependency information is built
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # all such problems go away, but when that setup is not
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # present, because either the dynamic libraries lack
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # dependencies or static linking is being done, then the
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # problems start to show up.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff saved_libs="$LIBS"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff for TRY_LIBS in \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgssapi_krb5" \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgssapi" \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff "-lgss"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff do
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # Note that this does not include $saved_libs, because
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # on FreeBSD machines this configure script has added
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # -L/usr/local/lib to LIBS, which can make the
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff # -lgssapi_krb5 test succeed with shared libraries even
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff # when you are trying to build with KTH in /usr/lib.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley LIBS="-L$use_gssapi/lib $TRY_LIBS"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_MSG_CHECKING(linking as $TRY_LIBS)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_TRY_LINK( , [gss_acquire_cred();],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley gssapi_linked=yes, gssapi_linked=no)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case $gssapi_linked in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley yes) AC_MSG_RESULT(yes); break ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley no) AC_MSG_RESULT(no) ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley esac
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley done
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case $gssapi_linked in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley esac
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley #
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # but MIT in /usr/local/lib and trying to build with KTH.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # /usr/local/lib can end up earlier on the link lines.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # Like most kludges, this one is not only inelegant it
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # is also likely to be the wrong thing to do at least as
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # many times as it is the right thing. Something better
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # needs to be done.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley #
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley if test "$use_gssapi" = "/usr" -a \
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley -f /usr/local/lib/libkrb5.a; then
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley FIX_KTH_VS_MIT=yes
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley fi
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case "$FIX_KTH_VS_MIT" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley yes)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff case "$enable_static_linking" in
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff yes) gssapi_lib_suffix=".a" ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *) gssapi_lib_suffix=".so" ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff esac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff for lib in $LIBS; do
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff case $lib in
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff -L*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff -l*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff new_lib=`echo $lib |
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff sed -e s%^-l%$use_gssapi/lib/lib% \
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff -e s%$%$gssapi_lib_suffix%`
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff NEW_LIBS="$NEW_LIBS $new_lib"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff *)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff esac
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff done
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff LIBS="$NEW_LIBS"
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff esac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff DST_GSSAPI_INC="-I$use_gssapi/include"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff DNS_GSSAPI_LIBS="$LIBS"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley LIBS="$saved_libs"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halleyesac
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(USE_GSSAPI)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(DST_GSSAPI_INC)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(DNS_GSSAPI_LIBS)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyDNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley# Applications linking with libdns also need to link with these libraries.
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST(DNS_CRYPTO_LIBS)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# was --with-randomdev specified?
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_MSG_CHECKING(for random device)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_ARG_WITH(randomdev,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[ --with-randomdev=PATH Specify path for random device],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley use_randomdev="$withval", use_randomdev="unspec")
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleycase "$use_randomdev" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley unspec)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case "$host" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley *-openbsd*)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley devrandom=/dev/arandom
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley *)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley devrandom=/dev/random
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley esac
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_MSG_RESULT($devrandom)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_FILE($devrandom,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley "$devrandom"),)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley yes)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley AC_MSG_ERROR([--with-randomdev must specify a path])
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley no)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley AC_MSG_RESULT(disabled)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley *)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley AC_MSG_RESULT(using "$use_randomdev")
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halleyesac
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley# Do we have arc4random() ?
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halleysinclude(config.threads.in)dnl
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyif $use_threads
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleythen
fbc09123cd0cac8d513165c441ef2b2ed9b3445cBob Halley if test "X$GCC" = "Xyes"; then
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case "$host" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley *-freebsd*)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley CC="$CC -pthread"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff CCOPT="$CCOPT -pthread"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff *-openbsd*)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley CC="$CC -pthread"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff CCOPT="$CCOPT -pthread"
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff ;;
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff *-solaris*)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff LIBS="$LIBS -lthread"
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley ;;
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley *-ibm-aix*)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley esac
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley else
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff case $host in
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff *-dec-osf*)
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff CC="$CC -pthread"
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley CCOPT="$CCOPT -pthread"
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff ;;
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff *-solaris*)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff CC="$CC -mt"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff CCOPT="$CCOPT -mt"
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ;;
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff *-ibm-aix*)
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff *-sco-sysv*uw*|*-*-sysv*UnixWare*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff CC="$CC -Kthread"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff CCOPT="$CCOPT -Kthread"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *-*-sysv*OpenUNIX*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff CC="$CC -Kpthread"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff CCOPT="$CCOPT -Kpthread"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff esac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff fi
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ALWAYS_DEFINES="-D_REENTRANT"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff thread_dir=pthreads
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff #
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff # We'd like to use sigwait() too
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff #
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_FUNC(sigwait,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_SIGWAIT),
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_LIB(c, sigwait,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_SIGWAIT),
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_LIB(pthread, sigwait,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_SIGWAIT),
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_LIB(pthread, _Psigwait,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_SIGWAIT),))))
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_FUNC(pthread_attr_getstacksize,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_FUNC(pthread_attr_setstacksize,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff #
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff # Additional OS-specific issues related to pthreads and sigwait.
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff #
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff case "$host" in
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff #
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff # One more place to look for sigwait.
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff #
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *-freebsd*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff case $host in
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-freebsd6.*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley esac
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # BSDI 3.0 through 4.0.1 needs pthread_init() to be
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # called before certain pthreads calls. This is deprecated
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # in BSD/OS 4.1.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-bsdi3.*|*-bsdi4.0*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(NEED_PTHREAD_INIT)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # LinuxThreads requires some changes to the way we
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # deal with signals.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-linux*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(HAVE_LINUXTHREADS)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley ;;
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # Ensure the right sigwait() semantics on Solaris and make
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # sure we call pthread_setconcurrency.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-solaris*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_CHECK_FUNC(pthread_setconcurrency,
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # UnixWare does things its own way.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley esac
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley # Look for sysconf to allow detection of the number of processors.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley #
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halleyelse
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley thread_dir=nothreads
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ALWAYS_DEFINES=""
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halleyfi
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_SUBST(ALWAYS_DEFINES)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_SUBST(ISC_PLATFORM_USETHREADS)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyISC_THREAD_DIR=$thread_dir
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_SUBST(ISC_THREAD_DIR)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley#
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley# was --with-libxml2 specified?
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley#
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_MSG_CHECKING(for libxml2 library)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_ARG_WITH(libxml2,
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley[ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]],
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley use_libxml2="$withval", use_libxml2="auto")
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halleycase "$use_libxml2" in
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley no)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley DST_LIBXML2_INC=""
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley auto|yes)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley case X`(xml2-config --version) 2>/dev/null` in
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley X2.[[67]].*)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley libxml2_libs=`xml2-config --libs`
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley libxml2_cflags=`xml2-config --cflags`
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley *)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley libxml2_libs=
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley libxml2_cflags=
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff ;;
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff esac
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff ;;
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff *)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff if test -f "$use_libxml2/bin/xml2-config" ; then
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff fi
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff ;;
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graffesac
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graffif test "X$libxml2_libs" != "X"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graffthen
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff AC_MSG_RESULT(yes)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff CFLAGS="$CFLAGS $libxml2_cflags"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff LIBS="$LIBS $libxml2_libs"
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graffelse
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff AC_MSG_RESULT(no)
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Grafffi
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff# In solaris 10, SMF can manage named service
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_CHECK_LIB(scf, smf_enable_instance)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# flockfile is usually provided by pthreads, but we may want to use it
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff# even if compiled with --disable-threads. getc_unlocked might also not
78854e02c127f31ab90f56da0531542004b45377Michael Graff# be defined.
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael GraffAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
78854e02c127f31ab90f56da0531542004b45377Michael GraffAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
78854e02c127f31ab90f56da0531542004b45377Michael Graff
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# Indicate what the final decision was regarding threads.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_MSG_CHECKING(whether to build with threads)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graffif $use_threads; then
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_RESULT(yes)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graffelse
78854e02c127f31ab90f56da0531542004b45377Michael Graff AC_MSG_RESULT(no)
78854e02c127f31ab90f56da0531542004b45377Michael Grafffi
78854e02c127f31ab90f56da0531542004b45377Michael Graff
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael Graff# End of pthreads stuff.
875e88e734b310976b178dc26a74d86fbebc935cBob Halley#
78854e02c127f31ab90f56da0531542004b45377Michael Graff
875e88e734b310976b178dc26a74d86fbebc935cBob Halley#
78854e02c127f31ab90f56da0531542004b45377Michael Graff# Large File
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael GraffAC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
78854e02c127f31ab90f56da0531542004b45377Michael Graff want_largefile="yes", want_largefile="no")
78854e02c127f31ab90f56da0531542004b45377Michael Graffcase $want_largefile in
875e88e734b310976b178dc26a74d86fbebc935cBob Halley yes)
78854e02c127f31ab90f56da0531542004b45377Michael Graff ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
78854e02c127f31ab90f56da0531542004b45377Michael Graff ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graff *)
78854e02c127f31ab90f56da0531542004b45377Michael Graff ;;
875e88e734b310976b178dc26a74d86fbebc935cBob Halleyesac
78854e02c127f31ab90f56da0531542004b45377Michael Graff
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael Graff# Additional compiler settings.
78854e02c127f31ab90f56da0531542004b45377Michael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael GraffMKDEPCC="$CC"
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael GraffMKDEPCFLAGS="-M"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffIRIX_DNSSEC_WARNINGS_HACK=""
78854e02c127f31ab90f56da0531542004b45377Michael Graff
78854e02c127f31ab90f56da0531542004b45377Michael Graffif test "X$GCC" = "Xyes"; then
78854e02c127f31ab90f56da0531542004b45377Michael Graff AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
78854e02c127f31ab90f56da0531542004b45377Michael Graff SAVE_CFLAGS=$CFLAGS
78854e02c127f31ab90f56da0531542004b45377Michael Graff CFLAGS=-fno-strict-aliasing
78854e02c127f31ab90f56da0531542004b45377Michael Graff AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
78854e02c127f31ab90f56da0531542004b45377Michael Graff CFLAGS=$SAVE_CFLAGS
78854e02c127f31ab90f56da0531542004b45377Michael Graff if test "$FNOSTRICTALIASING" = "yes"; then
78854e02c127f31ab90f56da0531542004b45377Michael Graff AC_MSG_RESULT(yes)
78854e02c127f31ab90f56da0531542004b45377Michael Graff STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff else
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff AC_MSG_RESULT(no)
2a0b8796d46265c078ba7f4dea2979c62ebf5badBob Halley STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
78854e02c127f31ab90f56da0531542004b45377Michael Graff fi
78854e02c127f31ab90f56da0531542004b45377Michael Graff case "$host" in
78854e02c127f31ab90f56da0531542004b45377Michael Graff *-hp-hpux*)
78854e02c127f31ab90f56da0531542004b45377Michael Graff LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
78854e02c127f31ab90f56da0531542004b45377Michael Graff ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graff esac
2a0b8796d46265c078ba7f4dea2979c62ebf5badBob Halleyelse
78854e02c127f31ab90f56da0531542004b45377Michael Graff case $host in
78854e02c127f31ab90f56da0531542004b45377Michael Graff *-dec-osf*)
78854e02c127f31ab90f56da0531542004b45377Michael Graff CC="$CC -std"
78854e02c127f31ab90f56da0531542004b45377Michael Graff CCOPT="$CCOPT -std"
78854e02c127f31ab90f56da0531542004b45377Michael Graff MKDEPCC="$CC"
78854e02c127f31ab90f56da0531542004b45377Michael Graff ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graff *-hp-hpux*)
78854e02c127f31ab90f56da0531542004b45377Michael Graff CC="$CC -Ae -z"
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff # The version of the C compiler that constantly warns about
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff # 'const' as well as alignment issues is unfortunately not
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff # able to be discerned via the version of the operating
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff # system, nor does cc have a version flag.
78854e02c127f31ab90f56da0531542004b45377Michael Graff case "`$CC +W 123 2>&1`" in
78854e02c127f31ab90f56da0531542004b45377Michael Graff *Unknown?option*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff STD_CWARNINGS="+w1"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff *)
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff # Turn off the pointlessly noisy warnings.
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff STD_CWARNINGS="+w1 +W 474,530,2193,2236"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley esac
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley CCOPT="$CCOPT -Ae -z"
59c049874bbef182857c57bd9cca292898921c69Bob Halley LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
59c049874bbef182857c57bd9cca292898921c69Bob Halley MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley *-sgi-irix*)
59c049874bbef182857c57bd9cca292898921c69Bob Halley STD_CWARNINGS="-fullwarn -woff 1209"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley #
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # Silence more than 250 instances of
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # "prototyped function redeclared without prototype"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # and 11 instances of
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # "variable ... was set but never used"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # from lib/dns/sec/openssl.
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley #
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley *-solaris*)
59c049874bbef182857c57bd9cca292898921c69Bob Halley MKDEPCFLAGS="-xM"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
59c049874bbef182857c57bd9cca292898921c69Bob Halley # UnixWare
59c049874bbef182857c57bd9cca292898921c69Bob Halley CC="$CC -w"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley esac
59c049874bbef182857c57bd9cca292898921c69Bob Halleyfi
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(MKDEPCC)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(MKDEPCFLAGS)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(MKDEPPROG)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halley#
59c049874bbef182857c57bd9cca292898921c69Bob Halley# NLS
59c049874bbef182857c57bd9cca292898921c69Bob Halley#
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halley#
59c049874bbef182857c57bd9cca292898921c69Bob Halley# -lxnet buys us one big porting headache... standards, gotta love 'em.
59c049874bbef182857c57bd9cca292898921c69Bob Halley#
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff# AC_CHECK_LIB(xnet, socket, ,
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff# AC_CHECK_LIB(socket, socket)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# )
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# Use this for now, instead:
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graffcase "$host" in
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff mips-sgi-irix*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *-linux*)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff AC_CHECK_LIB(socket, socket)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff AC_CHECK_LIB(nsl, inet_addr)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffesac
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff# Work around Solaris's select() limitations.
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffcase "$host" in
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff *-solaris2.[[89]]|*-solaris2.1?)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff AC_DEFINE(FD_SETSIZE, 65536,
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff [Solaris hack to get select_large_fdset.])
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graffesac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff# Purify support
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_MSG_CHECKING(whether to use purify)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_ARG_WITH(purify,
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff [ --with-purify[=PATH] use Rational purify],
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff use_purify="$withval", use_purify="no")
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halleycase "$use_purify" in
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff no)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff yes)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff AC_PATH_PROG(purify_path, purify, purify)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graff *)
439c0011e642fb1d26011116144af698125262dbMichael Graff purify_path="$use_purify"
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graffesac
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graffcase "$use_purify" in
439c0011e642fb1d26011116144af698125262dbMichael Graff no)
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_RESULT(no)
439c0011e642fb1d26011116144af698125262dbMichael Graff PURIFY=""
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graff *)
439c0011e642fb1d26011116144af698125262dbMichael Graff if test -f $purify_path || test $purify_path = purify; then
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_RESULT($purify_path)
439c0011e642fb1d26011116144af698125262dbMichael Graff PURIFYFLAGS="`echo $PURIFYOPTIONS`"
439c0011e642fb1d26011116144af698125262dbMichael Graff PURIFY="$purify_path $PURIFYFLAGS"
439c0011e642fb1d26011116144af698125262dbMichael Graff else
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_ERROR([$purify_path not found.
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffPlease choose the proper path with the following command:
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff configure --with-purify=PATH
439c0011e642fb1d26011116144af698125262dbMichael Graff])
439c0011e642fb1d26011116144af698125262dbMichael Graff fi
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graffesac
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_SUBST(PURIFY)
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graff# GNU libtool support
439c0011e642fb1d26011116144af698125262dbMichael Graff#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleycase $build_os in
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleysunos*)
439c0011e642fb1d26011116144af698125262dbMichael Graff # Just set the maximum command line length for sunos as it otherwise
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # takes a exceptionally long time to work it out. Required for libtool.
439c0011e642fb1d26011116144af698125262dbMichael Graff lt_cv_sys_max_cmd_len=4096;
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graffesac
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_ARG_WITH(libtool,
439c0011e642fb1d26011116144af698125262dbMichael Graff [ --with-libtool use GNU libtool (following indented options supported)],
439c0011e642fb1d26011116144af698125262dbMichael Graff use_libtool="$withval", use_libtool="no")
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graffcase $use_libtool in
439c0011e642fb1d26011116144af698125262dbMichael Graff yes)
439c0011e642fb1d26011116144af698125262dbMichael Graff AM_PROG_LIBTOOL
439c0011e642fb1d26011116144af698125262dbMichael Graff O=lo
439c0011e642fb1d26011116144af698125262dbMichael Graff A=la
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff LIBTOOL_MODE_COMPILE='--mode=compile'
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LIBTOOL_MODE_INSTALL='--mode=install'
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LIBTOOL_MODE_LINK='--mode=link'
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case "$host" in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *) LIBTOOL_ALLOW_UNDEFINED= ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case "$host" in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *) LIBTOOL_IN_MAIN= ;;
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff esac;
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff ;;
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff *)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff O=o
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley A=a
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff LIBTOOL=
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff AC_SUBST(LIBTOOL)
1f90c108282533a23b8362c34bcde4267c1eb4b1Michael Graff LIBTOOL_MKDEP_SED=
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff LIBTOOL_MODE_COMPILE=
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LIBTOOL_MODE_INSTALL=
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LIBTOOL_MODE_LINK=
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley LIBTOOL_ALLOW_UNDEFINED=
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley LIBTOOL_IN_MAIN=
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff ;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffesac
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff#
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff# File name extension for static archive files, for those few places
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff# where they are treated differently from dynamic ones.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael GraffSA=a
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(O)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(A)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(SA)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_SUBST(LIBTOOL_MKDEP_SED)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(LIBTOOL_MODE_COMPILE)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(LIBTOOL_MODE_INSTALL)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(LIBTOOL_MODE_LINK)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(LIBTOOL_IN_MAIN)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# Here begins a very long section to determine the system's networking
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# capabilities. The order of the tests is significant.
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff# IPv6
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff#
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffAC_ARG_ENABLE(ipv6,
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [ --enable-ipv6 use IPv6 [default=autodetect]])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffcase "$enable_ipv6" in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff yes|''|autodetect)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_DEFINE(WANT_IPV6)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ;;
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff no)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# We do the IPv6 compilation checking after libtool so that we can put
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# the right suffix on the files.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for IPv6 structures)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_COMPILE([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <sys/types.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <sys/socket.h>
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff#include <netinet/in.h>],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff[struct sockaddr_in6 sin6; return (0);],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff found_ipv6=yes],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff found_ipv6=no])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# See whether IPv6 support is provided via a Kame add-on.
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# This is done before other IPv6 linking tests to LIBS is properly set.
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_MSG_CHECKING(for Kame IPv6 support)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_ARG_WITH(kame,
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff use_kame="$withval", use_kame="no")
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffcase "$use_kame" in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff no)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ;;
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff yes)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff kame_path=/usr/local/v6
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff kame_path="$use_kame"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffcase "$use_kame" in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_RESULT(no)
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff *)
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff if test -f $kame_path/lib/libinet6.a; then
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff AC_MSG_RESULT($kame_path/lib/libinet6.a)
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff LIBS="-L$kame_path/lib -linet6 $LIBS"
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff else
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael GraffPlease choose the proper path with the following command:
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff configure --with-kame=PATH
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff fi
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graffesac
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graff# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff# Including it on Kame-using platforms is very bad, though, because
439c0011e642fb1d26011116144af698125262dbMichael Graff# Kame uses #error against direct inclusion. So include it on only
439c0011e642fb1d26011116144af698125262dbMichael Graff# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
439c0011e642fb1d26011116144af698125262dbMichael Graff# This is done before the in6_pktinfo check because that's what
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff# netinet6/in6.h is needed for.
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graffchangequote({, })
439c0011e642fb1d26011116144af698125262dbMichael Graffcase "$host" in
439c0011e642fb1d26011116144af698125262dbMichael Graff*-bsdi4.[01]*)
439c0011e642fb1d26011116144af698125262dbMichael Graff ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
439c0011e642fb1d26011116144af698125262dbMichael Graff LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
439c0011e642fb1d26011116144af698125262dbMichael Graff isc_netinet6in6_hack="#include <netinet6/in6.h>"
439c0011e642fb1d26011116144af698125262dbMichael Graff ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff isc_netinet6in6_hack=""
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffchangequote([, ])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# This is similar to the netinet6/in6.h issue.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffcase "$host" in
439c0011e642fb1d26011116144af698125262dbMichael Graff*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff # UnixWare
97a274369d7d132ae620845a290f14706fd2dff9Bob Halley ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff isc_netinetin6_hack="#include <netinet/in6.h>"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff*)
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff isc_netinetin6_hack=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffesac
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# Now delve deeper into the suitability of the IPv6 support.
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff#
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graffcase "$found_ipv6" in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff yes)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_MSG_CHECKING(for in6_addr)
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_TRY_COMPILE([
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff#include <sys/types.h>
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#include <sys/socket.h>
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#include <netinet/in.h>
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff$isc_netinetin6_hack
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff$isc_netinet6in6_hack
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff],
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff[struct in6_addr in6; return (0);],
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff [AC_MSG_RESULT(yes)
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
3f6a66689410910ef601a4d26f10a24f331ef83cMichael Graff isc_in_addr6_hack=""],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [AC_MSG_RESULT(no)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff isc_in_addr6_hack="#define in6_addr in_addr6"])
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_CHECKING(for in6addr_any)
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff AC_TRY_LINK([
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff#include <sys/types.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <sys/socket.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netinet/in.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff$isc_netinetin6_hack
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff$isc_netinet6in6_hack
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff$isc_in_addr6_hack
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff],
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff [AC_MSG_RESULT(yes)
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
1f90c108282533a23b8362c34bcde4267c1eb4b1Michael Graff [AC_MSG_RESULT(no)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
78854e02c127f31ab90f56da0531542004b45377Michael Graff LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff
d4d2a13916a114879763562db6a19b70b1444ec1Michael Graff AC_MSG_CHECKING(for in6addr_loopback)
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff AC_TRY_LINK([
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff#include <sys/types.h>
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff#include <sys/socket.h>
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff#include <netinet/in.h>
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff$isc_netinetin6_hack
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff$isc_netinet6in6_hack
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff$isc_in_addr6_hack
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff],
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff [AC_MSG_RESULT(yes)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff [AC_MSG_RESULT(no)
519b4a1a27c8b767a57a981dda69a3c6394bd49dMichael Graff ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_TRY_COMPILE([
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff#include <sys/types.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <sys/socket.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netinet/in.h>
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff$isc_netinetin6_hack
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff$isc_netinet6in6_hack
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [AC_MSG_RESULT(yes)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [AC_MSG_RESULT(no)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff LWRES_HAVE_SIN6_SCOPE_ID="$result"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff AC_MSG_CHECKING(for in6_pktinfo)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff AC_TRY_COMPILE([
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff#include <sys/types.h>
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff#include <sys/socket.h>
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff#include <netinet/in.h>
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff$isc_netinetin6_hack
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff$isc_netinet6in6_hack
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [struct in6_pktinfo xyzzy; return (0);],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [AC_MSG_RESULT(yes)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ;;
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff no)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_IPV6_H="ipv6.h"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_IPV6_O="ipv6.$O"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_ISCIPV6_O="unix/ipv6.$O"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ISC_IPV6_C="ipv6.c"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ;;
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graffesac
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_HAVEIPV6)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
5a5b79c5ab0ccdc821dd5498935e5cc7b96d2499Michael GraffAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
5a5b79c5ab0ccdc821dd5498935e5cc7b96d2499Michael GraffAC_SUBST(ISC_IPV6_H)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_IPV6_O)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_ISCIPV6_O)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(ISC_IPV6_C)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING([for struct if_laddrreq])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_LINK([
59c049874bbef182857c57bd9cca292898921c69Bob Halley#include <sys/types.h>
59c049874bbef182857c57bd9cca292898921c69Bob Halley#include <net/if6.h>
59c049874bbef182857c57bd9cca292898921c69Bob Halley],[ struct if_laddrreq a; ],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(yes)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(no)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING([for struct if_laddrconf])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_LINK([
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halley#include <sys/types.h>
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halley#include <net/if6.h>
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halley],[ struct if_laddrconf a; ],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(yes)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(no)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# Check for network functions that are often missing. We do this
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# after the libtool checking, so we can put the right suffix on
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# the files. It also needs to come after checking for a Kame add-on,
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# which provides some (all?) of the desired functions.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING([for inet_ntop with IPv6 support])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_RUN([
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/types.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/socket.h>
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff#include <netinet/in.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <arpa/inet.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleymain() {
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleychar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(yes)
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley [AC_MSG_RESULT(no)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(assuming inet_ntop needed)
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
9af545a6bdb70a31893beaa420cee7557ffa4742Bob Halley# addresses with less than four octets, like "1.2.3". Also leading
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# zeros should also be rejected.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING([for working inet_pton with IPv6 support])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_RUN([
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/types.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/socket.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <netinet/in.h>
e883738546c7c73b761bce8a15e08661863d3ae1Michael Graff#include <arpa/inet.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleymain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(yes)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(no)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(assuming target platform has working inet_pton)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff [AC_MSG_RESULT(assuming inet_pton needed)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(assuming target platform has working inet_pton)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_NEEDNTOP)
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_NEEDPTON)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# Look for a 4.4BSD-style sa_len member in struct sockaddr.
c8b60c24abf816a48691ed8a06281c5a4e35e482Bob Halley#
c8b60c24abf816a48691ed8a06281c5a4e35e482Bob Halleycase "$host" in
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley *-dec-osf*)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley # Turn on 4.4BSD style sa_len support.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley AC_DEFINE(_SOCKADDR_LEN)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ;;
fe14eafefa91fada7cea0a55b09196c01477406cBob Halleyesac
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING(for sa_len in struct sockaddr)
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_COMPILE([
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/types.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/socket.h>],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley[struct sockaddr sa; sa.sa_len = 0; return (0);],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(yes)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(no)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_HAVESALEN)
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(LWRES_PLATFORM_HAVESALEN)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# Look for a 4.4BSD or 4.3BSD struct msghdr
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING(for struct msghdr flavor)
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_TRY_COMPILE([
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/types.h>
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#include <sys/socket.h>],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley[struct msghdr msg; msg.msg_flags = 0; return (0);],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(4.4BSD)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [AC_MSG_RESULT(4.3BSD)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley# Look for in_port_t.
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley#
fe14eafefa91fada7cea0a55b09196c01477406cBob HalleyAC_MSG_CHECKING(for type in_port_t)
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_TRY_COMPILE([
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#include <sys/types.h>
439c0011e642fb1d26011116144af698125262dbMichael Graff#include <netinet/in.h>],
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff[in_port_t port = 25; return (0);],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(yes)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff [AC_MSG_RESULT(no)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_SUBST(ISC_PLATFORM_NEEDPORTT)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# Check for addrinfo
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_MSG_CHECKING(for struct addrinfo)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_TRY_COMPILE([
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#include <netdb.h>],
439c0011e642fb1d26011116144af698125262dbMichael Graff[struct addrinfo a; return (0);],
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff [AC_MSG_RESULT(yes)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_DEFINE(HAVE_ADDRINFO)],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_NEEDADDRINFO)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# Check for rrsetinfo
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for struct rrsetinfo)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_COMPILE([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netdb.h>],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff[struct rrsetinfo r; return (0);],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for int sethostent)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_COMPILE([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netdb.h>],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff[int i = sethostent(0); return(0);],
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff [AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_SETHOSTENTINT)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_MSG_CHECKING(for int endhostent)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_TRY_COMPILE([
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff#include <netdb.h>],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff[int i = endhostent(); return(0);],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff [AC_MSG_RESULT(yes)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff [AC_MSG_RESULT(no)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael GraffAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_TRY_COMPILE([
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff#include <netdb.h>
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graffstruct netent *getnetbyaddr(in_addr_t, int);],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff[],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff [AC_MSG_RESULT(yes)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_MSG_CHECKING(for int setnetent)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_TRY_COMPILE([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netdb.h>],
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff[int i = setnetent(0); return(0);],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_SETNETENTINT)
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for int endnetent)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_TRY_COMPILE([
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff#include <netdb.h>],
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff[int i = endnetent(); return(0);],
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff [AC_MSG_RESULT(yes)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff [AC_MSG_RESULT(no)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_SUBST(ISC_LWRES_ENDNETENTINT)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_COMPILE([
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff#include <netdb.h>
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graffstruct hostent *gethostbyaddr(const void *, size_t, int);],
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff[return(0);],
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff [AC_MSG_RESULT(yes)
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for h_errno in netdb.h)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_COMPILE([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#include <netdb.h>],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff[h_errno = 1; return(0);],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [AC_MSG_RESULT(yes)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [AC_MSG_RESULT(no)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(ISC_LWRES_NEEDHERRNO)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_CHECK_FUNC(getipnodebyname,
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_CHECK_FUNC(getnameinfo,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_CHECK_FUNC(getaddrinfo,
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_DEFINE(HAVE_GETADDRINFO)],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_ARG_ENABLE(getifaddrs,
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff[ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no]].],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff want_getifaddrs="$enableval", want_getifaddrs="yes")
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# This interface iteration code for getifaddrs() will fall back to using
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff# addresses.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffcase $want_getifaddrs in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffglibc)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff;;
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graffyes)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff;;
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graffno)
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff;;
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graffesac
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# Look for a sysctl call to get the list of network interfaces.
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graffcase $ac_cv_header_sys_sysctl_h in
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graffyes)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_MSG_CHECKING(for interface list sysctl)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_EGREP_CPP(found_rt_iflist, [
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#include <sys/param.h>
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff#include <sys/sysctl.h>
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#include <sys/socket.h>
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#ifdef NET_RT_IFLIST
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Grafffound_rt_iflist
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#endif
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff],
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff [AC_MSG_RESULT(yes)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff AC_DEFINE(HAVE_IFLIST_SYSCTL)],
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff [AC_MSG_RESULT(no)])
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff;;
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graffesac
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff#
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff# Check for some other useful functions that are not ever-present.
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# reportedly defines strsep() without declaring it in <string.h> when
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# AC_CHECK_FUNC() incorrectly succeeds because it declares
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff# the function itself.
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_MSG_CHECKING(for correctly declared strsep())
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_CHECK_FUNC(memmove,
439c0011e642fb1d26011116144af698125262dbMichael Graff [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_CHECK_FUNC(strtoul,
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff GENRANDOMLIB=""],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff GENRANDOMLIB='${ISCLIBS}'])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(GENRANDOMLIB)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_CHECK_FUNC(strlcpy,
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_CHECK_FUNC(strlcat,
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffISC_PRINT_OBJS=
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffISC_PRINT_SRCS=
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael GraffAC_MSG_CHECKING(sprintf)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_TRY_COMPILE([
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#include <stdio.h>
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff],
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff[ char buf[2]; return(*sprintf(buf,"x"));],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff[
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffISC_PRINT_OBJS="print.$O"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffISC_PRINT_SRCS="print.c"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff)
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael GraffAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_CHECK_FUNC(vsnprintf,
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ISC_PRINT_OBJS="print.$O"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ISC_PRINT_SRCS="print.c"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael GraffISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
439c0011e642fb1d26011116144af698125262dbMichael GraffISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_SUBST(ISC_EXTRA_OBJS)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_SUBST(ISC_EXTRA_SRCS)
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff#
08d131595373326ec4a3af793b536df8c33115ecMichael Graff# Use our own SPNEGO implementation?
08d131595373326ec4a3af793b536df8c33115ecMichael Graff#
08d131595373326ec4a3af793b536df8c33115ecMichael GraffAC_ARG_ENABLE(isc-spnego,
08d131595373326ec4a3af793b536df8c33115ecMichael Graff [ --disable-isc-spnego use SPNEGO from GSSAPI library])
651228967966ba4fb2e52f92d1207c790af4b130Michael Graff
651228967966ba4fb2e52f92d1207c790af4b130Michael Graffif test -n "$USE_GSSAPI"
08d131595373326ec4a3af793b536df8c33115ecMichael Graffthen
08d131595373326ec4a3af793b536df8c33115ecMichael Graff case "$enable_isc_spnego" in
08d131595373326ec4a3af793b536df8c33115ecMichael Graff yes|'')
08d131595373326ec4a3af793b536df8c33115ecMichael Graff USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
08d131595373326ec4a3af793b536df8c33115ecMichael Graff DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
08d131595373326ec4a3af793b536df8c33115ecMichael Graff DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
08d131595373326ec4a3af793b536df8c33115ecMichael Graff AC_MSG_RESULT(using SPNEGO from lib/dns)
08d131595373326ec4a3af793b536df8c33115ecMichael Graff ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley no)
08d131595373326ec4a3af793b536df8c33115ecMichael Graff AC_MSG_RESULT(using SPNEGO from GSSAPI library)
08d131595373326ec4a3af793b536df8c33115ecMichael Graff ;;
08d131595373326ec4a3af793b536df8c33115ecMichael Graff esac
08d131595373326ec4a3af793b536df8c33115ecMichael Grafffi
08d131595373326ec4a3af793b536df8c33115ecMichael Graff
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(USE_ISC_SPNEGO)
08d131595373326ec4a3af793b536df8c33115ecMichael Graff
08d131595373326ec4a3af793b536df8c33115ecMichael GraffAC_SUBST(DST_EXTRA_OBJS)
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_SUBST(DST_EXTRA_SRCS)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff# Determine the printf format characters to use when printing
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff# values of type isc_int64_t. This will normally be "ll", but where
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff# the compiler treats "long long" as a alias for "long" and printf
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff# doesn't know about "long long" use "l". Hopefully the sprintf
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# will produce a inconsistent result in the later case. If the compiler
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# fails due to seeing "%lld" we fall back to "l".
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# %ld even for (long long)/
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# Win32 uses "%I64d", but that's defined elsewhere since we don't use
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# configure on Win32.
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff#
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffAC_MSG_CHECKING(printf format modifier for 64-bit integers)
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael GraffAC_TRY_RUN([
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff#include <stdio.h>
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graffmain() {
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff long long int j = 0;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley char buf[100];
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley buf[0] = 0;
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff sprintf(buf, "%lld", j);
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff exit((sizeof(long long int) != sizeof(long int))? 0 :
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff (strcmp(buf, "0") != 0));
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff}
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff],
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley [AC_MSG_RESULT(ll)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley [AC_MSG_RESULT(l)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff [AC_MSG_RESULT(assuming target platform uses ll)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_SUBST(ISC_PLATFORM_QUADFORMAT)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# Security Stuff
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# Note it is very recommended to *not* disable chroot(),
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# this is only because chroot() was made obsolete by Posix.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_ARG_ENABLE(chroot,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley [ --disable-chroot disable chroot])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleycase "$enable_chroot" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley yes|'')
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_FUNCS(chroot)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley no)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyesac
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_ARG_ENABLE(linux-caps,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley [ --disable-linux-caps disable linux capabilities])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleycase "$enable_linux_caps" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley yes|'')
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_HEADERS(linux/capability.h sys/capability.h)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_LIB(cap, cap_set_proc)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ;;
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff no)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff ;;
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graffesac
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffAC_CHECK_HEADERS(sys/prctl.h)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffAC_CHECK_HEADERS(sys/un.h,
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff,
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_SUBST(ISC_PLATFORM_HAVESYSUNH)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graffcase "$host" in
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff*-solaris*)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff [Define if connect does not honour the permission on the UNIX domain socket.])
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff ;;
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff*-sunos*)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff [Define if connect does not honour the permission on the UNIX domain socket.])
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff ;;
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graffesac
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# Time Zone Stuff
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_MSG_CHECKING(for optarg declaration)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_TRY_COMPILE([
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#include <unistd.h>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[optarg = 0;],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[AC_MSG_RESULT(yes)],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[AC_MSG_RESULT(no)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyGEN_NEED_OPTARG="-DNEED_OPTARG=1"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# BSD/OS, and perhaps some others, don't define rlim_t.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_MSG_CHECKING(for type rlim_t)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_TRY_COMPILE([
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#include <sys/types.h>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#include <sys/time.h>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley#include <sys/resource.h>],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[rlim_t rl = 19671212; return (0);],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff[AC_MSG_RESULT(yes)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff[AC_MSG_RESULT(no)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_MSG_CHECKING(type of rlim_cur)
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffAC_TRY_RUN([
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#include <sys/types.h>
651228967966ba4fb2e52f92d1207c790af4b130Michael Graff#include <sys/time.h>
651228967966ba4fb2e52f92d1207c790af4b130Michael Graff#include <sys/resource.h>
3ac63b472022ff92691d1fe69ac715a729671965Michael Graffmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff[AC_MSG_RESULT(int)
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff[
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_TRY_RUN([
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff#include <sys/types.h>
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#include <sys/time.h>
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#include <sys/resource.h>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleymain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff[AC_MSG_RESULT(long int)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffAC_TRY_RUN([
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#include <sys/types.h>
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#include <sys/time.h>
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff#include <sys/resource.h>
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleymain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley[AC_MSG_RESULT(long long int)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff],[AC_MSG_ERROR(this cannot happen)])
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff],[AC_MSG_ERROR(this cannot happen)])
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff],[
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael GraffISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff])
3ac63b472022ff92691d1fe69ac715a729671965Michael GraffAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff# Older HP-UX doesn't have gettune
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#
3ac63b472022ff92691d1fe69ac715a729671965Michael Graffcase "$host" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff *-hp-hpux*)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff AC_CHECK_HEADERS(sys/dyntune.h)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff *)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff ;;
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graffesac
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff
08d131595373326ec4a3af793b536df8c33115ecMichael Graff#
08d131595373326ec4a3af793b536df8c33115ecMichael Graff# Compaq TruCluster requires more code for handling cluster IP aliases
08d131595373326ec4a3af793b536df8c33115ecMichael Graff#
3ac63b472022ff92691d1fe69ac715a729671965Michael Graffcase "$host" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff *-dec-osf*)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_CHECK_FUNC(clua_getaliasaddress,
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_DEFINE(HAVE_TRUCLUSTER, 1,
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff [Define if running under Compaq TruCluster]))
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff ;;
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff *)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff ;;
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffesac
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff#
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff# Some hosts need msg_namelen to match the size of the socket structure.
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff# Some hosts don't set msg_namelen appropriately on return from recvmsg().
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graffcase $host in
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff*os2*|*hp-mpeix*)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_DEFINE(BROKEN_RECVMSG, 1,
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff [Define if recvmsg() does not meet all of the BSD socket API specifications.])
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ;;
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graffesac
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff#
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff# Microsoft has their own way of handling shared libraries that requires
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# additional qualifiers on extern variables. Unix systems don't need it.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff#
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
fbcf7bc351f2d42d338cb1fa29e59babd9bee94eMichael GraffLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
11efdeb076d65fa9f0c5fc067dc040e7c99dfba6Michael Graff
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# Random remaining OS-specific issues involving compiler warnings.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# XXXDCL print messages to indicate some compensation is being done?
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff
3ac63b472022ff92691d1fe69ac715a729671965Michael Graffcase "$host" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff *-aix5.[[123]].*)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff hack_shutup_pthreadonceinit=yes
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *-bsdi3.1*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff hack_shutup_sputaux=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *-bsdi4.0*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff hack_shutup_sigwait=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff hack_shutup_sputaux=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [*-bsdi4.[12]*])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff hack_shutup_stdargcast=yes
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff [*-solaris2.[89]])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff hack_shutup_pthreadonceinit=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *-solaris2.1[[0-9]])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffcase "$hack_shutup_pthreadonceinit" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff yes)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff #
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff #
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyesac
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halleycase "$hack_shutup_sigwait" in
59c049874bbef182857c57bd9cca292898921c69Bob Halley yes)
59c049874bbef182857c57bd9cca292898921c69Bob Halley #
59c049874bbef182857c57bd9cca292898921c69Bob Halley # Shut up a -Wmissing-prototypes warning for sigwait().
59c049874bbef182857c57bd9cca292898921c69Bob Halley #
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_DEFINE(SHUTUP_SIGWAIT)
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graffcase "$hack_shutup_sputaux" in
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff #
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff # Shut up a -Wmissing-prototypes warning from <stdio.h>.
651228967966ba4fb2e52f92d1207c790af4b130Michael Graff #
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff AC_DEFINE(SHUTUP_SPUTAUX)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halleycase "$hack_shutup_stdargcast" in
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley yes)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley #
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # Shut up a -Wcast-qual warning from va_start().
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff #
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_DEFINE(SHUTUP_STDARG_CAST)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffesac
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff
3024dbecbac365171bc6de0f3fa04951d6558be3Michael GraffAC_CHECK_HEADERS(strings.h,
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# Check for if_nametoindex() for IPv6 scoped addresses support
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley ac_cv_have_if_nametoindex=no)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleycase $ac_cv_have_if_nametoindex in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyno)
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff case "$host" in
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff *-hp-hpux*)
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff AC_CHECK_LIB(ipv6, if_nametoindex,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ac_cv_have_if_nametoindex=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LIBS="-lipv6 $LIBS",)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffcase $ac_cv_have_if_nametoindex in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffyes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff*)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff ;;
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graffesac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_CHECK_FUNCS(nanosleep)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# Machine architecture dependent features
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffAC_ARG_ENABLE(atomic,
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff [ --enable-atomic enable machine specific atomic operations
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley [[default=autodetect]]],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff enable_atomic="$enableval",
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff enable_atomic="autodetect")
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffcase "$enable_atomic" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff yes|''|autodetect)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff use_atomic=yes
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff no)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff use_atomic=no
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff arch=noatomic
e485d16462b0a66b835107fae04fe9d562e77af0Bob Halley ;;
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graffesac
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael GraffISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
3ac63b472022ff92691d1fe69ac715a729671965Michael Graffif test "$use_atomic" = "yes"; then
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff AC_MSG_CHECKING([architecture type for atomic operations])
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff have_atomic=yes # set default
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff case "$host" in
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff [i[3456]86-*])
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff # XXX: some old x86 architectures actually do not support
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff # (some of) these operations. Do we need stricter checks?
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_TRY_RUN([
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffmain() {
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff exit((sizeof(void *) == 8) ? 0 : 1);
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff}
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [arch=x86_64
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff have_xaddq=yes],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff [arch=x86_32],
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff [arch=x86_32])
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff x86_64-*|amd64-*)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff have_xaddq=yes
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff arch=x86_64
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff ;;
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff alpha*-*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff arch=alpha
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael Graff powerpc-*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff arch=powerpc
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff mips-*|mipsel-*|mips64-*|mips64el-*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff arch=mips
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ia64-*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff arch=ia64
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff have_atomic=no
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff arch=noatomic
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_RESULT($arch)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Grafffi
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graffif test "$have_atomic" = "yes"; then
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff AC_MSG_CHECKING([compiler support for inline assembly code])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley compiler=generic
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # Check whether the compiler supports the assembly syntax we provide.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff if test "X$GCC" = "Xyes"; then
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff # GCC's ASM extension always works
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff compiler=gcc
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff if test $arch = "x86_64"; then
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff # We can share the same code for gcc with x86_32
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff arch=x86_32
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff fi
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff if test $arch = "powerpc"; then
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff #
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff # The MacOS (and maybe others) uses "r0" for register
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff # zero. Under linux/ibm it is "0" for register 0.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff # Probe to see if we have a MacOS style assembler.
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff #
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_TRY_COMPILE(, [
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff __asm__ volatile ("li r0, 0x0\n"::);
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ], [
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff compiler="mac"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ], [AC_MSG_RESULT(no)])
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff fi
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff else
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff case "$host" in
59c049874bbef182857c57bd9cca292898921c69Bob Halley alpha*-dec-osf*)
59c049874bbef182857c57bd9cca292898921c69Bob Halley # Tru64 compiler has its own syntax for inline
59c049874bbef182857c57bd9cca292898921c69Bob Halley # assembly.
59c049874bbef182857c57bd9cca292898921c69Bob Halley AC_TRY_COMPILE(, [
59c049874bbef182857c57bd9cca292898921c69Bob Halley#ifndef __DECC
59c049874bbef182857c57bd9cca292898921c69Bob Halley#error "unexpected compiler"
59c049874bbef182857c57bd9cca292898921c69Bob Halley#endif
59c049874bbef182857c57bd9cca292898921c69Bob Halley return (0);],
59c049874bbef182857c57bd9cca292898921c69Bob Halley [compiler=osf],)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley powerpc-ibm-aix*)
59c049874bbef182857c57bd9cca292898921c69Bob Halley compiler=aix
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley esac
59c049874bbef182857c57bd9cca292898921c69Bob Halley fi
59c049874bbef182857c57bd9cca292898921c69Bob Halley case "$compiler" in
59c049874bbef182857c57bd9cca292898921c69Bob Halley gcc)
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley osf)
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley aix)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley mac)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley ;;
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley *)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # See if the generic __asm function works. If not,
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley # we need to disable the atomic operations.
59c049874bbef182857c57bd9cca292898921c69Bob Halley AC_TRY_LINK(, [
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley __asm("nop")
59c049874bbef182857c57bd9cca292898921c69Bob Halley ],
59c049874bbef182857c57bd9cca292898921c69Bob Halley [compiler="standard"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
59c049874bbef182857c57bd9cca292898921c69Bob Halley [compiler="not supported (atomic operations disabled)"
59c049874bbef182857c57bd9cca292898921c69Bob Halley have_atomic=no
59c049874bbef182857c57bd9cca292898921c69Bob Halley arch=noatomic ]);
59c049874bbef182857c57bd9cca292898921c69Bob Halley ;;
59c049874bbef182857c57bd9cca292898921c69Bob Halley esac
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halley AC_MSG_RESULT($compiler)
59c049874bbef182857c57bd9cca292898921c69Bob Halleyfi
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halleyif test "$have_atomic" = "yes"; then
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halleyelse
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
59c049874bbef182857c57bd9cca292898921c69Bob Halleyfi
59c049874bbef182857c57bd9cca292898921c69Bob Halley
59c049874bbef182857c57bd9cca292898921c69Bob Halleyif test "$have_xaddq" = "yes"; then
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
59c049874bbef182857c57bd9cca292898921c69Bob Halleyelse
59c049874bbef182857c57bd9cca292898921c69Bob Halley ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
59c049874bbef182857c57bd9cca292898921c69Bob Halleyfi
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_SUBST(ISC_PLATFORM_HAVEXADD)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(ISC_PLATFORM_HAVEXADDQ)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
08d131595373326ec4a3af793b536df8c33115ecMichael Graff
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_SUBST(ISC_PLATFORM_USEGCCASM)
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_SUBST(ISC_PLATFORM_USEOSFASM)
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_SUBST(ISC_PLATFORM_USESTDASM)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael GraffAC_SUBST(ISC_PLATFORM_USEMACASM)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyISC_ARCH_DIR=$arch
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(ISC_ARCH_DIR)
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graff# Activate "rrset-order fixed" or not?
439c0011e642fb1d26011116144af698125262dbMichael Graff#
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_ARG_ENABLE(fixed-rrset,
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff [ --enable-fixed-rrset enable fixed rrset ordering
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [[default=no]]],
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley enable_fixed="$enableval",
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff enable_fixed="no")
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffcase "$enable_fixed" in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff yes)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff AC_DEFINE(DNS_RDATASET_FIXED, 1,
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff [Define to enable "rrset-order fixed" syntax.])
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
439c0011e642fb1d26011116144af698125262dbMichael Graff no)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff ;;
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff *)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley ;;
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graffesac
3edb3c8e7da482d00acb35341f44bff6844c3193Michael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff# The following sets up how non-blocking i/o is established.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# Sunos, cygwin and solaris 2.x (x<5) require special handling.
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley#
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graffcase "$host" in
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley*-solaris2.[[01234]])
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff AC_DEFINE(USE_FIONBIO_IOCTL, 1,
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff ;;
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley ;;
439c0011e642fb1d26011116144af698125262dbMichael Graffesac
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff#
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff# This prevents the source address being set.
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graffcase "$host" in
439c0011e642fb1d26011116144af698125262dbMichael Graff*-solaris2.[[012345]]|*-solaris2.5.1)
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff [Define if you cannot bind() before connect() for TCP sockets.])
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff ;;
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graffesac
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff#
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff# The following sections deal with tools used for formatting
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff# the documentation. They are all optional, unless you are
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff# a developer editing the documentation source.
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff#
50b5857f1ad137624a18ce67b26b9941e316b007Michael Graff
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# Look for TeX.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_PATH_PROGS(LATEX, latex, latex)
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_SUBST(LATEX)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(PDFLATEX)
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# Look for w3m
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_PATH_PROGS(W3M, w3m, w3m)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(W3M)
439c0011e642fb1d26011116144af698125262dbMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Graff#
439c0011e642fb1d26011116144af698125262dbMichael Graff# Look for xsltproc (libxslt)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff#
78854e02c127f31ab90f56da0531542004b45377Michael Graff
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(XSLTPROC)
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff# Look for xmllint (libxml2)
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff#
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_PATH_PROG(XMLLINT, xmllint, xmllint)
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael GraffAC_SUBST(XMLLINT)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# Look for Doxygen
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_PATH_PROG(DOXYGEN, doxygen, doxygen)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST(DOXYGEN)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff#
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff# Subroutine for searching for an ordinary file (e.g., a stylesheet)
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff# in a number of directories:
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff# NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff#
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff# If the file FILENAME is found in one of the DIRECTORIES, the shell
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff# variable VARIABLE is defined to its absolute pathname. Otherwise,
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff# it is set to FILENAME, with no directory prefix (that's not terribly
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# useful, but looks less confusing in substitutions than leaving it
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# empty). The variable VARIABLE will be substituted into output files.
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_DEFUN(NOM_PATH_FILE, [
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley$1=""
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_MSG_CHECKING(for $2)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleyfor d in $3
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleydo
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley f=$d/$2
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley if test -f $f
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley then
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley $1=$f
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley AC_MSG_RESULT($f)
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff break
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff fi
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffdone
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graffif test "X[$]$1" = "X"
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffthen
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff AC_MSG_RESULT("not found");
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff $1=$2
14b98cb34eda66c87ce41a207704a2c232280eafMichael Grafffi
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_SUBST($1)
78854e02c127f31ab90f56da0531542004b45377Michael Graff])
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff#
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# Look for Docbook-XSL stylesheets. Location probably varies by system.
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# If it's not explicitly specified, guess where it might be found, based on
f3d059d1155aa016f75a4047a2a15b4b2c5b7e01Michael Graff# where SGML stuff lives on some systems (FreeBSD is the only one we're sure
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# of at the moment).
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_MSG_CHECKING(for Docbook-XSL path)
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_ARG_WITH(docbook-xsl,
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley[ --with-docbook-xsl=PATH Specify path for Docbook-XSL stylesheets],
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley docbook_path="$withval", docbook_path="auto")
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleycase "$docbook_path" in
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleyauto)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley AC_MSG_RESULT(auto)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook /usr/share/xsl/docbook"
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley ;;
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff*)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff docbook_xsl_trees="$withval"
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff AC_MSG_RESULT($docbook_xsl_trees)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff ;;
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halleyesac
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff#
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley# Look for stylesheets we need.
ea6228c9ce45dafa26e4cd79d71629c8ba5cd7c7Michael Graff#
ea6228c9ce45dafa26e4cd79d71629c8ba5cd7c7Michael Graff
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael GraffNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael GraffNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
e883738546c7c73b761bce8a15e08661863d3ae1Michael GraffNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
528829aa8ad69238e674cd81078bc14d4199691bMichael GraffNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
78854e02c127f31ab90f56da0531542004b45377Michael GraffNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
3edb3c8e7da482d00acb35341f44bff6844c3193Michael GraffNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff#
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff# Same dance for db2latex
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# No idea where this lives except on FreeBSD.
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleydb2latex_xsl_trees="/usr/local/share"
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# Look for stylesheets we need.
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyNOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff#
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff# Look for "admonition" image directory. Can't use NOM_PATH_FILE()
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff# because it's a directory, so just do the same things, inline.
daf83a29374c487a2800333d371e98e77e5a0d64Bob Halley#
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley
4a3ad0da975d7115d401700f955814a0dff1adb0Bob HalleyAC_MSG_CHECKING(for db2latex/xsl/figures)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleyfor d in $db2latex_xsl_trees
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleydo
294802790e8030f1c19b6c2c5d5204b6f464c729Michael Graff dd=$d/db2latex/xsl/figures
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley if test -d $dd
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley then
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley XSLT_DB2LATEX_ADMONITIONS=$dd
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_MSG_RESULT($dd)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley break
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley fi
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleydone
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleyif test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
528829aa8ad69238e674cd81078bc14d4199691bMichael Graffthen
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley AC_MSG_RESULT(not found)
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halleyfi
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob HalleyAC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley#
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley# IDN support
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley#
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_ARG_WITH(idn,
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley use_idn="$withval", use_idn="no")
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleycase "$use_idn" in
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halleyyes)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley if test X$prefix = XNONE ; then
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley idn_path=/usr/local
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley else
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley idn_path=$prefix
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley fi
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley ;;
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halleyno)
24a2d84aedbad12fba2ca319c98745e62ef0bc16Bob Halley ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graff*)
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff idn_path="$use_idn"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff ;;
528829aa8ad69238e674cd81078bc14d4199691bMichael Graffesac
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
439c0011e642fb1d26011116144af698125262dbMichael Grafficonvinc=
439c0011e642fb1d26011116144af698125262dbMichael Grafficonvlib=
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffAC_ARG_WITH(libiconv,
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
439c0011e642fb1d26011116144af698125262dbMichael Graff use_libiconv="$withval", use_libiconv="no")
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graffcase "$use_libiconv" in
dec90b6caef758fe2890ee50db148cff6acffb90Michael Graffyes)
5a675fa40aa755b21ab2906e90b1b80e2105291fMichael Graff if test X$prefix = XNONE ; then
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff else
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff fi
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graffno)
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff iconvlib=
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff ;;
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff*)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ;;
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graffesac
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff
517274e709a3c730cd42f37dc1260dde95d1ea38Michael GraffAC_ARG_WITH(iconv,
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff iconvlib="$withval")
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleycase "$iconvlib" in
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleyno)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff iconvlib=
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff ;;
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graffyes)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff iconvlib=-liconv
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff ;;
78854e02c127f31ab90f56da0531542004b45377Michael Graffesac
78854e02c127f31ab90f56da0531542004b45377Michael Graff
6dde125c2f47617ceef1518cf9e5588e8f366b71Michael GraffAC_ARG_WITH(idnlib,
b5492be2c7c3792a1b6c03995fe378703fc814cbMichael Graff [ --with-idnlib=ARG specify libidnkit],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff idnlib="$withval", idnlib="no")
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graffif test "$idnlib" = yes; then
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Grafffi
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael GraffIDNLIBS=
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graffif test "$use_idn" != no; then
5a675fa40aa755b21ab2906e90b1b80e2105291fMichael Graff AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff if test "$idnlib" != no; then
78854e02c127f31ab90f56da0531542004b45377Michael Graff IDNLIBS="$idnlib $iconvlib"
439c0011e642fb1d26011116144af698125262dbMichael Graff else
439c0011e642fb1d26011116144af698125262dbMichael Graff IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff fi
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleyfi
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_SUBST(IDNLIBS)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_CHECK_HEADERS(locale.h)
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_CHECK_FUNCS(setlocale)
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley# Substitutions
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley#
4abed3e3563c7ad346178433130e6d150d3ffeafBob HalleyAC_SUBST(BIND9_TOP_BUILDDIR)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffBIND9_TOP_BUILDDIR=`pwd`
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(BIND9_ISC_BUILDINCLUDE)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
517274e709a3c730cd42f37dc1260dde95d1ea38Michael GraffAC_SUBST(BIND9_DNS_BUILDINCLUDE)
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael GraffAC_SUBST(BIND9_LWRES_BUILDINCLUDE)
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael GraffAC_SUBST(BIND9_BIND9_BUILDINCLUDE)
78854e02c127f31ab90f56da0531542004b45377Michael Graffif test "X$srcdir" != "X"; then
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graffelse
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff BIND9_ISC_BUILDINCLUDE=""
67052fc64487f080489bb5a6d52c3028dc21046eBob Halley BIND9_ISCCC_BUILDINCLUDE=""
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff BIND9_ISCCFG_BUILDINCLUDE=""
439c0011e642fb1d26011116144af698125262dbMichael Graff BIND9_DNS_BUILDINCLUDE=""
439c0011e642fb1d26011116144af698125262dbMichael Graff BIND9_LWRES_BUILDINCLUDE=""
439c0011e642fb1d26011116144af698125262dbMichael Graff BIND9_BIND9_BUILDINCLUDE=""
439c0011e642fb1d26011116144af698125262dbMichael Grafffi
3c5148c4d98af51d6dcb449c6dbd45fe8c645f61Michael Graff
3c5148c4d98af51d6dcb449c6dbd45fe8c645f61Michael GraffAC_SUBST_FILE(BIND9_MAKE_INCLUDES)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffBIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST_FILE(BIND9_MAKE_RULES)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffBIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley. $srcdir/version
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffBIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(BIND9_VERSION)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffif test -z "$ac_configure_args"; then
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff BIND9_CONFIGARGS="defaults"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffelse
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff for a in $ac_configure_args
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff do
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff done
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Grafffi
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffBIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffBIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST(BIND9_CONFIGARGS)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST_FILE(LIBISC_API)
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael GraffLIBISC_API=$srcdir/lib/isc/api
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST_FILE(LIBISCCC_API)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyLIBISCCC_API=$srcdir/lib/isccc/api
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST_FILE(LIBISCCFG_API)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyLIBISCCFG_API=$srcdir/lib/isccfg/api
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST_FILE(LIBDNS_API)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffLIBDNS_API=$srcdir/lib/dns/api
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_SUBST_FILE(LIBBIND9_API)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael GraffLIBBIND9_API=$srcdir/lib/bind9/api
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyAC_SUBST_FILE(LIBLWRES_API)
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob HalleyLIBLWRES_API=$srcdir/lib/lwres/api
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# Configure any DLZ drivers.
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# If config.dlz.in selects one or more DLZ drivers, it will set
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# USE_DLZ to a non-empty value, which will be our clue to
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff# enable the DLZ core functions.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halley# This section has to come after the libtool stuff because it needs to
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# know how to name the driver object files.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff#
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffUSE_DLZ=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffDLZ_DRIVER_INCLUDES=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffDLZ_DRIVER_LIBS=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffDLZ_DRIVER_SRCS=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffDLZ_DRIVER_OBJS=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffsinclude(contrib/dlz/config.dlz.in)
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_MSG_CHECKING(for DLZ)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffif test -n "$USE_DLZ"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffthen
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_RESULT(yes)
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff USE_DLZ="-DDLZ $USE_DLZ"
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graffelse
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff AC_MSG_RESULT(no)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff DLZ_DRIVER_RULES=/dev/null
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafffi
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(USE_DLZ)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(DLZ_DRIVER_INCLUDES)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(DLZ_DRIVER_LIBS)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(DLZ_DRIVER_SRCS)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(DLZ_DRIVER_OBJS)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST_FILE(DLZ_DRIVER_RULES)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffif test "$cross_compiling" = "yes"; then
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff if test -z "$BUILD_CC"; then
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_ERROR([BUILD_CC not set])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff fi
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff BUILD_CFLAGS="$BUILD_CFLAGS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_LDFLAGS="$BUILD_LDFLAGS"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff BUILD_LIBS="$BUILD_LIBS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffelse
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_CC="$CC"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_CFLAGS="$CFLAGS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff BUILD_LDFLAGS="$LDFLAGS"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff BUILD_LIBS="$LIBS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafffi
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffNEWFLAGS=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafffor e in $BUILD_LDFLAGS ; do
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $e in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff -L*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $host_os in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff netbsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff freebsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff solaris*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-R%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graffdone
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffBUILD_LDFLAGS="$NEWFLAGS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffNEWFLAGS=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Grafffor e in $DNS_GSSAPI_LIBS ; do
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $e in
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff -L*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $host_os in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff netbsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff freebsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff solaris*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-R%'`
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff *)
439c0011e642fb1d26011116144af698125262dbMichael Graff NEWFLAGS="$NEWFLAGS $e"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e"
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graff ;;
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff esac
d43c2cc7bc4022701f141e299ea8f3fb1d0640c2Michael Graffdone
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyDNS_GSSAPI_LIBS="$NEWFLAGS"
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Graff
21e7034ec046105c00a0dab86c83732e2e77ad99Michael GraffNEWFLAGS=""
fc4fe6e5e61dbc916707ab2e071ffd22aef9de7fMichael Grafffor e in $DNS_CRYPTO_LIBS ; do
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $e in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff -L*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case $host_os in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff netbsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff freebsd*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff solaris*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ee=`echo $e | sed -e 's%^-L%-R%'`
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e $ee"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff NEWFLAGS="$NEWFLAGS $e"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff esac
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff NEWFLAGS="$NEWFLAGS $e"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff ;;
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff esac
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffdone
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffDNS_CRYPTO_LIBS="$NEWFLAGS"
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_SUBST(BUILD_CC)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_SUBST(BUILD_CFLAGS)
a385f150bb21b8b81f70ed7df545357a83f1da82Michael GraffAC_SUBST(BUILD_CPPFLAGS)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_SUBST(BUILD_LDFLAGS)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_SUBST(BUILD_LIBS)
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Commands to run at the end of config.status.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# Don't just put these into configure, it won't work right if somebody
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff# runs config.status directly (which autoconf allows).
2d083fead27c474feff3a6f79fc3da09d3637a09Andreas Gustafsson#
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael GraffAC_CONFIG_COMMANDS(
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff [chmod],
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff#
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# Files to configure. These are listed here because we used to
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff# specify them as arguments to AC_OUTPUT. It's (now) ok to move these
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff# elsewhere if there's a good reason for doing so.
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffAC_CONFIG_FILES([
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff make/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff make/mkdep
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/isc/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/include/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/isc/include/isc/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/include/isc/platform.h
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/unix/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/unix/include/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/unix/include/isc/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/nls/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/$thread_dir/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/isc/$thread_dir/include/Makefile
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff lib/isc/$thread_dir/include/isc/Makefile
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff lib/isc/$arch/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/isc/$arch/include/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/isc/$arch/include/isc/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/isccc/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/isccc/include/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/isccc/include/isccc/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/isccfg/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/isccfg/include/Makefile
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff lib/isccfg/include/isccfg/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/dns/Makefile
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff lib/dns/include/Makefile
08d131595373326ec4a3af793b536df8c33115ecMichael Graff lib/dns/include/dns/Makefile
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff lib/dns/include/dst/Makefile
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff lib/bind9/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/bind9/include/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/bind9/include/bind9/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/include/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/include/lwres/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/include/lwres/netdb.h
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/include/lwres/platform.h
a44bd6a6edccd4c8e3884a13fcff037e7e2dd868Michael Graff lib/lwres/man/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/unix/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/lwres/unix/include/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/lwres/unix/include/lwres/Makefile
78854e02c127f31ab90f56da0531542004b45377Michael Graff lib/tests/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff lib/tests/include/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff lib/tests/include/tests/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/check/Makefile
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff bin/named/Makefile
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff bin/named/unix/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/rndc/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/rndc/unix/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/dig/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/nsupdate/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/names/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/tests/master/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/rbt/Makefile
a44bd6a6edccd4c8e3884a13fcff037e7e2dd868Michael Graff bin/tests/db/Makefile
a44bd6a6edccd4c8e3884a13fcff037e7e2dd868Michael Graff bin/tests/tasks/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/tests/timers/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/dst/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/tests/mem/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/tests/net/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff bin/tests/sockaddr/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/system/Makefile
a44bd6a6edccd4c8e3884a13fcff037e7e2dd868Michael Graff bin/tests/system/conf.sh
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/system/lwresd/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/system/tkey/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/tests/headerdep_test.sh
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff bin/dnssec/Makefile
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff doc/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff doc/arm/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/misc/Makefile
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff isc-config.sh
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/xsl/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/xsl/isc-docbook-chunk.xsl
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff doc/xsl/isc-docbook-html.xsl
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/xsl/isc-docbook-latex.xsl
78854e02c127f31ab90f56da0531542004b45377Michael Graff doc/xsl/isc-manpage.xsl
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff doc/doxygen/Doxyfile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/doxygen/Makefile
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff doc/doxygen/doxygen-input-filter
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff])
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff#
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff# Do it
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff#
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_OUTPUT
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffif test "X$OPENSSL_WARNING" != "X"; then
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffcat << \EOF
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING Your OpenSSL crypto library may be vulnerable to WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING one or more of the the following known security WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING flaws: WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffWARNING CVE-2006-2940. WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING It is recommended that you upgrade to OpenSSL WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING version 0.9.8d/0.9.7l (or greater). WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING You can disable this warning by specifying: WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING --disable-openssl-version-check WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael GraffEOF
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Grafffi
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff
11e89b9b44862128b46994a87484027b3c7d533aMichael Graff# Tell Emacs to edit this file in shell mode.
11e89b9b44862128b46994a87484027b3c7d533aMichael Graff# Local Variables:
58aaab3687aac838542ee4ef65a9c094a5d34ab0Michael Graff# mode: sh
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# End:
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff