configure.in revision 39b973d8873996c3bfb6e5b4cc69731f6c3b77b5
07dcadc6e24f4572f2b7d7cae7d47d0f5256d129Andreas Gustafsson# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Copyright (C) 1998-2003 Internet Software Consortium.
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence#
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence# Permission to use, copy, modify, and distribute this software for any
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence# purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence#
15a44745412679c30a6d022733925af70a38b715David Lawrence# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence# PERFORMANCE OF THIS SOFTWARE.
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrencednl
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid LawrenceAC_DIVERT_PUSH(1)dnl
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrenceesyscmd([sed "s/^/# /" COPYRIGHT])dnl
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid LawrenceAC_DIVERT_POP()dnl
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence
d906600f7d1e86a4315e65a500f806ca1e4caa9bAndreas GustafssonAC_REVISION($Revision: 1.355 $)
ea31416b4fcdf23732355a8002f93f29e3b3d2dbAndreas Gustafsson
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid LawrenceAC_INIT(lib/dns/name.c)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyAC_PREREQ(2.13)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyAC_CONFIG_HEADER(config.h)
be801b0fdbcf9b55b3a8cc6bf042ff6c86be6b11Mark AndrewsAC_CONFIG_SUBDIRS(lib/bind)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyAC_CANONICAL_HOST
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_PROG_MAKE_SET
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_PROG_RANLIB
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_PROG_INSTALL
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CINCLUDES)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CDEFINES)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CWARNINGS)
3d776d762914d1b675b4fd49728ce353ccf6f77eBrian WellingtonAC_SUBST(CCOPT)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graff
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceAC_PATH_PROG(AR, ar)
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceARFLAGS="cruv"
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceAC_SUBST(AR)
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceAC_SUBST(ARFLAGS)
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid Lawrence
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson# The POSIX ln(1) program. Non-POSIX systems may substitute
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson# "copy" or something.
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas GustafssonLN=ln
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas GustafssonAC_SUBST(LN)
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrencecase "$AR" in
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence "")
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence AC_MSG_ERROR([
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrencear program not found. Please fix your PATH to include the directory in
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrencewhich ar resides, or set AR in the environment with the full path to ar.
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence])
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence ;;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceesac
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley#
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley# Etags.
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley#
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael GraffAC_PATH_PROGS(ETAGS, etags emacs-etags)
ce8c568e0d6106bb87069453505e09bc66754b40Andreas Gustafsson
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley#
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley# GNU emacs etags, and it requires the -L flag.
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley#
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halleyif test "X$ETAGS" != "X"; then
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_CHECKING(for Exuberant Ctags etags)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_RESULT(yes)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley ETAGS="$ETAGS -L"
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley else
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_RESULT(no)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley fi
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halleyfi
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael GraffAC_SUBST(ETAGS)
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael Graff
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson#
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson# Perl is optional; it is used only by some of the system test scripts.
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson#
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas GustafssonAC_PATH_PROGS(PERL, perl5 perl)
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas GustafssonAC_SUBST(PERL)
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Special processing of paths depending on whether --prefix,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# --sysconfdir or --localstatedir arguments were given. What's
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# desired is some compatibility with the way previous versions
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# of BIND built; they defaulted to /usr/local for most parts of
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# the installation, but named.boot/named.conf was in /etc
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# and named.pid was in /var/run.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# So ... if none of --prefix, --sysconfdir or --localstatedir are
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# specified, set things up that way. If --prefix is given, use
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# it for sysconfdir and localstatedir the way configure normally
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# would. To change the prefix for everything but leave named.conf
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# in /etc or named.pid in /var/run, then do this the usual configure way:
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/somewhere --sysconfdir=/etc
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/somewhere --localstatedir=/var
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# To put named.conf and named.pid in /usr/local with everything else,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# set the prefix explicitly to /usr/local even though that's the default:
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/usr/local
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrencecase "$prefix" in
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence NONE)
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence case "$sysconfdir" in
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence '${prefix}/etc')
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence sysconfdir=/etc
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence ;;
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence esac
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence case "$localstatedir" in
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence '${prefix}/var')
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence localstatedir=/var
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence ;;
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence esac
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence ;;
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrenceesac
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Make sure INSTALL uses an absolute path, else it will be wrong in all
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# configure based on the location of the file where it is substituted.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# subdirectory of install-sh, This relative path will be wrong for all
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# directories more than one level down from install-sh.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrencecase "$INSTALL" in
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence /*)
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence ;;
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence *)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence #
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # Not all systems have dirname.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence #
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence changequote({, })
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence changequote([, ])
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence test "$ac_dir" = "$ac_prog" && ac_dir=.
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence INSTALL="$ac_dir/$ac_prog"
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence ;;
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrenceesac
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# On these hosts, we really want to use cc, not gcc, even if it is
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# found. The gcc that these systems have will not correctly handle
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# pthreads.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# However, if the user sets $CC to be something, let that override
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# our change.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graffif test "X$CC" = "X" ; then
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff case "$host" in
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff *-dec-osf*)
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff CC="cc"
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff ;;
1ce985ab3c6670662d555c108b35fed84a6a1001David Lawrence *-solaris*)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # Use Sun's cc if it is available, but watch
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # out for /usr/ucb/cc; it will never be the right
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # compiler to use.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence #
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # If setting CC here fails, the AC_PROG_CC done
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence # below might still find gcc.
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence for ac_dir in $PATH; do
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence test -z "$ac_dir" && ac_dir=.
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence case "$ac_dir" in
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence /usr/ucb)
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence # exclude
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence ;;
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence *)
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence if test -f "$ac_dir/cc"; then
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence CC="$ac_dir/cc"
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence break
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence fi
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence ;;
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence esac
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence done
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence IFS="$ac_save_ifs"
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff ;;
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff *-hp-hpux*)
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff CC="cc"
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff ;;
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff mips-sgi-irix*)
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff CC="cc"
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff ;;
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff esac
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Grafffi
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_PROG_CC
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson# gcc's optimiser is broken at -02 for ultrasparc
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews#
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafssonif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson case "$host" in
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson sparc-*)
c654449ccf403ccd2b81be2038b1013d6fbb06ccMark Andrews CCFLAGS="-g -O1"
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson ;;
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson esac
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafssonfi
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson#
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson# OS dependent CC flags
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington#
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellingtoncase "$host" in
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington # OSF 5.0: recv/send are only avaliable with -D_POSIX_PII_SOCKET or
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington # -D_XOPEN_SOURCE_EXTENDED.
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington *-dec-osf*)
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington ;;
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington *-hp-hpux*)
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson LIBS="-lxnet $LIBS"
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson ;;
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson *-solaris*)
8f3dd8f8e73e4465221a5297819db70e6b383138Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews ;;
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrewsesac
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews
754cca729dd82ae8363917dc00ad44f9d900635bMark AndrewsAC_HEADER_STDC
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews
754cca729dd82ae8363917dc00ad44f9d900635bMark AndrewsAC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews[$ac_includes_default
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#ifdef HAVE_SYS_PARAM_H
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews# include <sys/param.h>
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews#endif
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews])
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_C_CONST
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_C_INLINE
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews#
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews# UnixWare 7.1.1 with the feature supplement to the UDK compiler
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews# is reported to not support "static inline" (RT #1212).
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews#
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_MSG_CHECKING(for static inline breakage)
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_TRY_COMPILE(, [
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews foo1();
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews }
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews static inline int foo1() {
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews return 0;
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews }
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson static inline int foo2() {
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson return foo1();
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson ],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(no)],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(yes)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson AC_DEFINE(inline, )])
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_TYPE_SIZE_T
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_CHECK_TYPE(ssize_t, int)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_HEADER_TIME
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_MSG_CHECKING(for long long)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_TRY_COMPILE([],[long long i = 0; return (0);],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(yes)
a1898260ad19d02e88ab76c1855d33c67add9defMark Andrews ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(no)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson# check if we have lifconf
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_MSG_CHECKING(for struct lifconf)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_TRY_COMPILE([
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#include <sys/types.h>
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson#include <sys/socket.h>
a1898260ad19d02e88ab76c1855d33c67add9defMark Andrews#include <net/if.h>
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson[
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafssonstruct lifconf lifconf;
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafssonlifconf.lifc_len = 0;
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson]
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson,
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(yes)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(no)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff#
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff# check if we need to #include sys/select.h explicitly
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff#
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graffcase $ac_cv_header_unistd_h in
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graffyes)
13faa8b6a2d0d45e0659049983928366252ab3faMichael GraffAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
13faa8b6a2d0d45e0659049983928366252ab3faMichael GraffAC_TRY_COMPILE([
13faa8b6a2d0d45e0659049983928366252ab3faMichael Graff#include <sys/types.h> /* Ultrix */
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson#include <unistd.h>],
13faa8b6a2d0d45e0659049983928366252ab3faMichael Graff[fd_set read_set; return (0);],
61d5bfc06be978ea962b1c64309894ac80351771Mark Andrews [AC_MSG_RESULT(yes)
61d5bfc06be978ea962b1c64309894ac80351771Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
13faa8b6a2d0d45e0659049983928366252ab3faMichael Graff [AC_MSG_RESULT(no)
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington case $ac_cv_header_sys_select_h in
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington yes)
3fcf6b956f47405750724bd84e1b2290b61c9186Brian Wellington ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
3fcf6b956f47405750724bd84e1b2290b61c9186Brian Wellington LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
3fcf6b956f47405750724bd84e1b2290b61c9186Brian Wellington ;;
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington no)
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington AC_MSG_ERROR([need either working unistd.h or sys/select.h])
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson ;;
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson esac
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson ])
a0ad323da3597f942881eb2112a82c21450a9d0dBrian Wellington ;;
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafssonno)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson case $ac_cv_header_sys_select_h in
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson yes)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson ;;
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson no)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson AC_MSG_ERROR([need either unistd.h or sys/select.h])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson ;;
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson esac
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson ;;
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafssonesac
80f323528ac699026a609a5e3b765dc6e88fe37cAndreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas GustafssonAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson
3fcf6b956f47405750724bd84e1b2290b61c9186Brian Wellington#
e4c7b24ab12572b6781d5c545c7b7949cbd2a6f7Brian Wellington# Find the machine's endian flavor.
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington#
5f9e583552f53de12062bfff12e47250abce378fBrian WellingtonAC_C_BIGENDIAN
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson#
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson# was --with-openssl specified?
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson#
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas GustafssonAC_MSG_CHECKING(for OpenSSL library)
bc53aacc6e9302b1f8d01467fc39585584652782Andreas GustafssonAC_ARG_WITH(openssl,
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson[ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson (Required for DNSSEC)],
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson use_openssl="$withval", use_openssl="no")
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson
d906600f7d1e86a4315e65a500f806ca1e4caa9bAndreas Gustafssoncase "$use_openssl" in
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson no)
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson AC_MSG_RESULT(no)
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson DST_OPENSSL_INC=""
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson USE_OPENSSL=""
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson ;;
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson *)
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson if test "$use_openssl" = "yes"
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson then
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson # User did not specify a path - guess it
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg"
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson for d in $openssldirs
919caa020b8f9b856d77b3a72e0c9301dfa495c7Andreas Gustafsson do
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson if test -f $d/include/openssl/opensslv.h
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson then
cb2a4cad76fbda226e7cd9dd3ca017b52521e3d1Andreas Gustafsson use_openssl=$d
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson break
bd1db480f30e025bba719799f910b34848a9a997Mark Andrews fi
bd1db480f30e025bba719799f910b34848a9a997Mark Andrews done
bd1db480f30e025bba719799f910b34848a9a997Mark Andrews if test "$use_openssl" = "yes"
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson then
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson AC_MSG_RESULT(not found)
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson AC_MSG_ERROR(
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson fi
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson fi
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson USE_OPENSSL='-DOPENSSL'
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson DST_OPENSSL_INC="-I$use_openssl/include"
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson case $host in
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington *-solaris*)
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
08a768e82ad64ede97f640c88e02984b59122753Michael Graff ;;
08a768e82ad64ede97f640c88e02984b59122753Michael Graff *)
08a768e82ad64ede97f640c88e02984b59122753Michael Graff DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
08a768e82ad64ede97f640c88e02984b59122753Michael Graff ;;
08a768e82ad64ede97f640c88e02984b59122753Michael Graff esac
08a768e82ad64ede97f640c88e02984b59122753Michael Graff AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include)
3fcf6b956f47405750724bd84e1b2290b61c9186Brian Wellington
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington saved_cflags="$CFLAGS"
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington saved_libs="$LIBS"
08a768e82ad64ede97f640c88e02984b59122753Michael Graff CFLAGS="$CFLAGS $DST_OPENSSL_INC"
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington LIBS="$LIBS $DNS_OPENSSL_LIBS"
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington AC_MSG_CHECKING(whether linking with OpenSSL works)
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington AC_TRY_RUN([
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington#include <openssl/err.h>
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellingtonint main() {
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington ERR_clear_error();
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington return (0);
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington}
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [AC_MSG_RESULT(yes)],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [AC_MSG_RESULT(no)
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington AC_MSG_ERROR(Could not run test program using OpenSSL from
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington$use_openssl/lib and $use_openssl/include.
fee5012c43744322c1785e5c3e0c322443faa304Brian WellingtonPlease check the argument to --with-openssl and your
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellingtonshared library configuration (e.g., LD_LIBRARY_PATH).)],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [AC_MSG_RESULT(assuming it does work on target platform)])
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington AC_TRY_LINK([
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington#include <openssl/err.h>],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington[ DSO_METHOD_dlfcn(); ],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [AC_MSG_RESULT(no)],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [LIBS="$LIBS -ldl"
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington AC_TRY_LINK([
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington#include <openssl/err.h>
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington],[ DSO_METHOD_dlfcn(); ],
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington [AC_MSG_RESULT(yes)
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington ],
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington [AC_MSG_RESULT(unknown)
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington [AC_MSG_RESULT(assuming it does work on target platform)])
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington ],
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington [AC_MSG_RESULT(assuming it does work on target platform)]
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington )
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington#
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington# OpenSSLDie is new with CERT CS-2002-23. If we see it we have may
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington# have a patched library otherwise check that we are greater than
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington# the fixed versions
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington#
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington AC_CHECK_FUNC(OpenSSLDie,
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington AC_MSG_CHECKING(OpenSSL library version)
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington AC_TRY_RUN([
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington#include <stdio.h>
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington#include <openssl/opensslv.h>
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellingtonint main() {
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington if (OPENSSL_VERSION_NUMBER >= 0x0090581fL)
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington return (0);
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington OPENSSL_VERSION_NUMBER);
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington printf("Require OPENSSL_VERSION_NUMBER 0x0090581f or greater\n\n");
af5ad488cbf17988fbd36a25c908737412ccd382Brian Wellington return (1);
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington}
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington],
af5ad488cbf17988fbd36a25c908737412ccd382Brian Wellington [AC_MSG_RESULT(ok)],
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington [AC_MSG_RESULT(not compatible)
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington AC_MSG_ERROR(you need OpenSSL 0.9.5a or newer)],
b495fd2992c63472b3ad2d9517ffe9b50118840aAndreas Gustafsson [AC_MSG_RESULT(assuming target platform has compatible version)])
af5ad488cbf17988fbd36a25c908737412ccd382Brian Wellington ,
f317c00e0d5978f29285ea062b34ec73dc419095Brian Wellington AC_MSG_RESULT(did not find fixes for CERT CA-2002-23)
f317c00e0d5978f29285ea062b34ec73dc419095Brian Wellington AC_MSG_CHECKING(OpenSSL library version)
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington AC_TRY_RUN([
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington#include <stdio.h>
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington#include <openssl/opensslv.h>
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellingtonint main() {
dee520f1be8c59e10a55b6995844395e811c310fBrian Wellington if ((OPENSSL_VERSION_NUMBER >= 0x0090605fL &&
dee520f1be8c59e10a55b6995844395e811c310fBrian Wellington OPENSSL_VERSION_NUMBER < 0x009070000L) ||
dee520f1be8c59e10a55b6995844395e811c310fBrian Wellington OPENSSL_VERSION_NUMBER >= 0x00907003L)
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington return (0);
529ff4b4959fb157194f985394951108ff5286e4Brian Wellington printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington OPENSSL_VERSION_NUMBER);
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington printf("Require OPENSSL_VERSION_NUMBER 0x0090605f or greater (0.9.6e)\n"
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington "Require OPENSSL_VERSION_NUMBER 0x00907003 or greater (0.9.7-beta2)\n\n");
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington return (1);
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence}
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence],
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence [AC_MSG_RESULT(ok)],
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence [AC_MSG_RESULT(not compatible)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_MSG_ERROR(you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23)],
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson [AC_MSG_RESULT(assuming target platform has compatible version)]))
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson CFLAGS="$saved_cflags"
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson LIBS="$saved_libs"
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafssonesac
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# This would include the system openssl path (and linker options to use
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# it as needed) if it is found.
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
7f9bc71eca311843611a4b0cfdeb12eda324b689Mark Andrews
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonAC_SUBST(USE_OPENSSL)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonAC_SUBST(DST_OPENSSL_INC)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
7f9bc71eca311843611a4b0cfdeb12eda324b689Mark Andrews
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# was --with-gssapi specified?
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
6ef891fbe943d6776ed17439ccb8bbb8e314b7d8Andreas Gustafsson#AC_MSG_CHECKING(for GSSAPI library)
6ef891fbe943d6776ed17439ccb8bbb8e314b7d8Andreas Gustafsson#AC_ARG_WITH(gssapi,
6ef891fbe943d6776ed17439ccb8bbb8e314b7d8Andreas Gustafsson#[ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
9d266ed4d7630d8366fea0a4a627d8c3873821c5Brian Wellington# use_gssapi="$withval", use_gssapi="no")
9d266ed4d7630d8366fea0a4a627d8c3873821c5Brian Wellington#
9d266ed4d7630d8366fea0a4a627d8c3873821c5Brian Wellington#case "$use_gssapi" in
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews# no)
967fafd9674da590f605d1cbe5f66dd7ddbeb849David Lawrence# USE_GSSAPI=''
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# DST_GSSAPI_INC=''
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews# DNS_GSSAPI_LIBS=''
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews# AC_MSG_RESULT(not specified)
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews# ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# yes)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# AC_MSG_ERROR([--with-gssapi must specify a path])
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# *)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# USE_GSSAPI='-DGSSAPI'
1c0ff8a9cc1e1edd55acff6802f8811966732653Brian Wellington# DST_GSSAPI_INC="-I$use_gssapi/include"
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# DNS_GSSAPI_LIBS="-L$use_gssapi/lib -lgssapi_krb5"
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# AC_MSG_RESULT(using gssapi from $use_gssapi/lib and $use_gssapi/include)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#esac
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonUSE_GSSAPI=''
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonDST_GSSAPI_INC=''
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonDNS_GSSAPI_LIBS=''
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonAC_SUBST(USE_GSSAPI)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonAC_SUBST(DST_GSSAPI_INC)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS"
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson# Applications linking with libdns also need to link with these libraries.
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas GustafssonAC_SUBST(DNS_CRYPTO_LIBS)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson#
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence# was --with-randomdev specified?
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence#
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_MSG_CHECKING(for random device)
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_ARG_WITH(randomdev,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence[ --with-randomdev=PATH Specify path for random device],
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson use_randomdev="$withval", use_randomdev="unspec")
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafssoncase "$use_randomdev" in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence unspec)
b6cb5907b2159b3e82bfd37d1818f327ca1e7ca0Mark Andrews case "$host" in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-openbsd*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence devrandom=/dev/arandom
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson *)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson devrandom=/dev/random
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson esac
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson AC_MSG_RESULT($devrandom)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson AC_CHECK_FILE($devrandom,
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
9ce476812c93a1bb8b416adbe707ee5000a015f1Andreas Gustafsson "$devrandom"),)
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson ;;
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson yes)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_ERROR([--with-randomdev must specify a path])
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson no)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(disabled)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson *)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(using "$use_randomdev")
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonesac
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson#
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson# Do we have arc4random() ?
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson#
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas GustafssonAC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
1706598239da403b86f4befa4c08175d9e101014Andreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson#
ea31416b4fcdf23732355a8002f93f29e3b3d2dbAndreas Gustafsson# Begin pthreads checking.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson#
971d1fe83172bce09d6319c5735d243d68d8cb47Andreas Gustafsson# First, decide whether to use multithreading or not.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson#
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson# Enable multithreading by default on systems where it is known
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson# to work well, and where debugging of multithreaded programs
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson# is supported.
1706598239da403b86f4befa4c08175d9e101014Andreas Gustafsson#
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas GustafssonAC_MSG_CHECKING(whether to build with thread support)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssoncase $host in
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington*-dec-osf*)
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson use_threads=true ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson[*-solaris2.[0-6]])
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Thread signals are broken on Solaris 2.6; they are sometimes
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington # delivered to the wrong thread.
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington use_threads=false ;;
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington*-solaris*)
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington use_threads=true ;;
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington*-ibm-aix*)
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington use_threads=true ;;
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington*-hp-hpux10*)
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington use_threads=false ;;
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington*-hp-hpux11*)
c356cd618dacb13d47ee9bee78d22a9802d4645eBrian Wellington use_threads=true ;;
1706598239da403b86f4befa4c08175d9e101014Andreas Gustafsson*-sgi-irix*)
566a01eb745d49bd866971062388cd11d525b60dDavid Lawrence use_threads=true ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson*-sco-sysv*uw*|*-*-sysv*UnixWare*)
ce7994d137a013133e874b92604183923267fc94Brian Wellington # UnixWare
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence use_threads=false ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence*-*-sysv*OpenUNIX*)
ce7994d137a013133e874b92604183923267fc94Brian Wellington # UnixWare
ce7994d137a013133e874b92604183923267fc94Brian Wellington use_threads=true ;;
e2b585787f4779f49bd0982562acbbb7d0b65a95Andreas Gustafsson*-netbsd*)
566a01eb745d49bd866971062388cd11d525b60dDavid Lawrence if test -r /usr/lib/libpthread.so ; then
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_threads=true
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington else
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Socket I/O optimizations introduced in 9.2 expose a
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington # bug in unproven-pthreads; see PR #12650
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington use_threads=false
2271edc0b4ba96e69a283eced420b94ffb678beeBrian Wellington fi
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
2271edc0b4ba96e69a283eced420b94ffb678beeBrian Wellington*-openbsd*)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # OpenBSD users have reported that named dumps core on
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # startup when built with threads.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_threads=false ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson*-freebsd*)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_threads=false ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson*-bsdi[234]*)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Thread signals do not work reliably on some versions of BSD/OS.
7005cfed8cd3296d356883dcb414979f22e06b13Brian Wellington use_threads=false ;;
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington*-bsdi5*)
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington use_threads=true ;;
489b76292622f5bc18bf1a18845f8166a73bd797Brian Wellington*-linux*)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Threads are disabled on Linux by default because most
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Linux kernels produce unusable core dumps from multithreaded
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # programs, and because of limitations in setuid().
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson use_threads=false ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson*)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_threads=false ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonesac
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas GustafssonAC_ARG_ENABLE(threads,
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson [ --enable-threads enable multithreading])
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssoncase "$enable_threads" in
fa280ff02ad0c29616a0c3a22ef02cbb3f6db7efDavid Lawrence yes)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_threads=true
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson no)
fa280ff02ad0c29616a0c3a22ef02cbb3f6db7efDavid Lawrence use_threads=false
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson '')
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Use system-dependent default
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson *)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_ERROR([--enable-threads takes yes or no])
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonesac
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonif $use_threads
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonthen
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(yes)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonelse
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(no)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonfi
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonif $use_threads
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafssonthen
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson #
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # Search for / configure pthreads in a system-dependent fashion.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson #
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson case "$host" in
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews *-netbsd*)
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews # NetBSD has multiple pthreads implementations. The
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson # recommended one to use is "unproven-pthreads". The
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # older "mit-pthreads" may also work on some NetBSD
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # versions. The PTL2 thread library does not
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # currently work with bind9, but can be chosen with
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # the --with-ptl2 option for those who wish to
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson # experiment with it.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson CC="gcc"
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_CHECKING(which NetBSD thread library to use)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_ARG_WITH(ptl2,
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson[ --with-ptl2 on NetBSD, use the ptl2 thread library (experimental)],
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson use_ptl2="$withval", use_ptl2="no")
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson : ${LOCALBASE:=/usr/pkg}
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if test "X$use_ptl2" = "Xyes"
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson then
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(PTL2)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_WARN(
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson[linking with PTL2 is highly experimental and not expected to work])
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson CC=ptlgcc
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson else
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if test -r /usr/lib/libpthread.so
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson then
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(native)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson LIBS="-lpthread $LIBS"
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson else
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if test ! -d $LOCALBASE/pthreads
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence then
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_MSG_RESULT(none)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_ERROR("could not find thread libraries")
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson fi
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if $use_threads
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson then
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_MSG_RESULT(mit-pthreads/unproven-pthreads)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson pkg="$LOCALBASE/pthreads"
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson lib1="-L$pkg/lib -Wl,-R$pkg/lib"
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews lib2="-lpthread -lm -lgcc -lpthread"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBS="$lib1 $lib2 $LIBS"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews CPPFLAGS="$CPPFLAGS -I$pkg/include"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews fi
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews fi
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews fi
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews ;;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson *)
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson AC_CHECK_LIB(pthread, pthread_create,,
620de5a4b1f23dc9b4ec30d30c0607ff389be0daBob Halley AC_CHECK_LIB(pthread, __pthread_create,,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_CHECK_LIB(pthread, __pthread_create_system,,
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington AC_CHECK_LIB(c_r, pthread_create,,
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington AC_CHECK_LIB(c, pthread_create,,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_MSG_ERROR("could not find thread libraries"))))))
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington ;;
620de5a4b1f23dc9b4ec30d30c0607ff389be0daBob Halley esac
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafssonfi
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
620de5a4b1f23dc9b4ec30d30c0607ff389be0daBob Halleyif $use_threads
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrencethen
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson #
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington # We'd like to use sigwait() too
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington #
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington AC_CHECK_LIB(c, sigwait,
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington AC_DEFINE(HAVE_SIGWAIT),
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington AC_CHECK_LIB(pthread, sigwait,
64b92523f9333ba053f4b2860335583be455b0b3Brian Wellington AC_DEFINE(HAVE_SIGWAIT),
64b92523f9333ba053f4b2860335583be455b0b3Brian Wellington AC_CHECK_LIB(pthread, _Psigwait,
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington AC_DEFINE(HAVE_SIGWAIT),))
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington )
64b92523f9333ba053f4b2860335583be455b0b3Brian Wellington
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington AC_CHECK_FUNC(pthread_attr_getstacksize,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_CHECK_FUNC(pthread_attr_setstacksize,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # Additional OS-specific issues related to pthreads and sigwait.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence case "$host" in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # One more place to look for sigwait.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-freebsd*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # BSDI 3.0 through 4.0.1 needs pthread_init() to be
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # called before certain pthreads calls. This is deprecated
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # in BSD/OS 4.1.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-bsdi3.*|*-bsdi4.0*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(NEED_PTHREAD_INIT)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # LinuxThreads requires some changes to the way we
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # deal with signals.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-linux*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(HAVE_LINUXTHREADS)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # Ensure the right sigwait() semantics on Solaris and make
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # sure we call pthread_setconcurrency.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-solaris*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_CHECK_FUNC(pthread_setconcurrency,
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # UnixWare does things its own way.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence esac
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # Look for sysconf to allow detection of the number of processors.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence #
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence if test "X$GCC" = "Xyes"; then
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence case "$host" in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-freebsd*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CC="$CC -pthread"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CCOPT="$CCOPT -pthread"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-openbsd*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CC="$CC -pthread"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CCOPT="$CCOPT -pthread"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson *-solaris*)
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBS="$LIBS -lthread"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews ;;
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews *-ibm-aix*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence ;;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence esac
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence else
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence case $host in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *-dec-osf*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CC="$CC -pthread"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CCOPT="$CCOPT -pthread"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence *-solaris*)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence CC="$CC -mt"
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob Halley CCOPT="$CCOPT -mt"
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob Halley ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence *-ibm-aix*)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence *-sco-sysv*uw*|*-*-sysv*UnixWare*)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence CC="$CC -Kthread"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence CCOPT="$CCOPT -Kthread"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence *-*-sysv*OpenUNIX*)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence CC="$CC -Kpthread"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence CCOPT="$CCOPT -Kpthread"
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff ;;
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff esac
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff fi
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff ALWAYS_DEFINES="-D_REENTRANT"
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff thread_dir=pthreads
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graffelse
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
64ba6e4cc3a0ccf8c8c6349fa75b937ca9bad9a6Michael Graff thread_dir=nothreads
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob ALWAYS_DEFINES=""
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobfi
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_SUBST(ALWAYS_DEFINES)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_SUBST(ISC_PLATFORM_USETHREADS)
547f79ea44f0a91442fd942b04c11c1958f75136Andreas Gustafsson
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobISC_THREAD_DIR=$thread_dir
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_SUBST(ISC_THREAD_DIR)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# flockfile is usually provided by pthreads, but we may want to use it
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# even if compiled with --disable-threads. getc_unlocked might also not
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# be defined.
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# Indicate what the final decision was regarding threads.
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_MSG_CHECKING(whether to build with threads)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobif $use_threads; then
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_MSG_RESULT(yes)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobelse
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_MSG_RESULT(no)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobfi
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# End of pthreads stuff.
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# Large File
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob#
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob want_largefile="yes", want_largefile="no")
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobcase $want_largefile in
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob yes)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob ;;
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob *)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrenceesac
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley# Additional compiler settings.
a5cf3cf61e96e0db9ffe433402783e1ddbb2fbc3Michael Graff#
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyMKDEPCC="$CC"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyMKDEPCFLAGS="-M"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyIRIX_DNSSEC_WARNINGS_HACK=""
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halleyif test "X$GCC" = "Xyes"; then
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halleyelse
c64aeaf419a7ef156b4aabfa2a913831e773157eBob Halley case $host in
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley *-dec-osf*)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley CC="$CC -std"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley CCOPT="$CCOPT -std"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley MKDEPCC="$CC"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley ;;
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley *-hp-hpux*)
c64aeaf419a7ef156b4aabfa2a913831e773157eBob Halley CC="$CC -Ae -z"
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley # The version of the C compiler that constantly warns about
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley # 'const' as well as alignment issues is unfortunately not
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson # able to be discerned via the version of the operating
ce8c568e0d6106bb87069453505e09bc66754b40Andreas Gustafsson # system, nor does cc have a version flag.
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson case "`$CC +W 123 2>&1`" in
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson *Unknown?option*)
ce8c568e0d6106bb87069453505e09bc66754b40Andreas Gustafsson STD_CWARNINGS="+w1"
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson ;;
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson *)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley # Turn off the pointlessly noisy warnings.
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley STD_CWARNINGS="+w1 +W 474,530"
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson ;;
c64aeaf419a7ef156b4aabfa2a913831e773157eBob Halley esac
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley CCOPT="$CCOPT -Ae -z"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews LIBS="-Wl,+vnocompatwarnings $LIBS"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews ;;
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews *-sgi-irix*)
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews STD_CWARNINGS="-fullwarn -woff 1209"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews #
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews # Silence more than 250 instances of
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews # "prototyped function redeclared without prototype"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews # and 11 instances of
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews # "variable ... was set but never used"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews # from lib/dns/sec/openssl.
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews #
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews ;;
9ed37e8b9ccd53bc37b546fffe487b9547dda3a0Mark Andrews *-solaris*)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence MKDEPCFLAGS="-xM"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ;;
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence # UnixWare
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence CC="$CC -w"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ;;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence esac
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrencefi
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrenceAC_SUBST(MKDEPCC)
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrenceAC_SUBST(MKDEPCFLAGS)
4108eed5092156cf0407a97a9bd8ab7775164694Brian WellingtonAC_SUBST(MKDEPPROG)
4108eed5092156cf0407a97a9bd8ab7775164694Brian WellingtonAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington#
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington# NLS
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington#
4108eed5092156cf0407a97a9bd8ab7775164694Brian WellingtonAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# -lxnet buys us one big porting headache... standards, gotta love 'em.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# AC_CHECK_LIB(xnet, socket, ,
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington# AC_CHECK_LIB(socket, socket)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington# AC_CHECK_LIB(nsl, inet_ntoa)
c0ef1acf49b383d8b6d3742cb963f7d08f5762e3Andreas Gustafsson# )
c0ef1acf49b383d8b6d3742cb963f7d08f5762e3Andreas Gustafsson#
c0ef1acf49b383d8b6d3742cb963f7d08f5762e3Andreas Gustafsson# Use this for now, instead:
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington#
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellingtoncase "$host" in
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington mips-sgi-irix*)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington ;;
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington *)
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence AC_CHECK_LIB(socket, socket)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_CHECK_LIB(nsl, inet_ntoa)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrenceesac
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence#
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# Purify support
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence#
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_MSG_CHECKING(whether to use purify)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_ARG_WITH(purify,
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence [ --with-purify[=PATH] use Rational purify],
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence use_purify="$withval", use_purify="no")
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencecase "$use_purify" in
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence no)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence yes)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_PATH_PROG(purify_path, purify, purify)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence *)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence purify_path="$use_purify"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrenceesac
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencecase "$use_purify" in
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence no)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_MSG_RESULT(no)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence PURIFY=""
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence *)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence if test -f $purify_path || test $purify_path = purify; then
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_MSG_RESULT($purify_path)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence PURIFYFLAGS="`echo $PURIFYOPTIONS`"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence PURIFY="$purify_path $PURIFYFLAGS"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence else
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_MSG_ERROR([$purify_path not found.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrencePlease choose the proper path with the following command:
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence configure --with-purify=PATH
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence])
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence fi
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ;;
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrenceesac
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(PURIFY)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence#
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# GNU libtool support
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence#
dc97fe4ed08488d314ab5bc8e99ed839542cf411David LawrenceAC_ARG_WITH(libtool,
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence [ --with-libtool use GNU libtool (following indented options supported)],
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence use_libtool="$withval", use_libtool="no")
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencecase $use_libtool in
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence yes)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AM_PROG_LIBTOOL
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence O=lo
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence A=la
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LIBTOOL_MODE_COMPILE='--mode=compile'
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LIBTOOL_MODE_INSTALL='--mode=install'
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LIBTOOL_MODE_LINK='--mode=link'
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence ;;
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence *)
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence O=o
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence A=a
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson LIBTOOL=
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews AC_SUBST(LIBTOOL)
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBTOOL_MKDEP_SED=
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBTOOL_MODE_COMPILE=
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBTOOL_MODE_INSTALL=
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LIBTOOL_MODE_LINK=
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews ;;
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrenceesac
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence#
e544b507b8019a62c5d2716281f6832519a8791dDavid Lawrence# File name extension for static archive files, for those few places
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence# where they are treated differently from dynamic ones.
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence#
dc97fe4ed08488d314ab5bc8e99ed839542cf411David LawrenceSA=a
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(O)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(A)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(SA)
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrenceAC_SUBST(LIBTOOL_MKDEP_SED)
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrenceAC_SUBST(LIBTOOL_MODE_COMPILE)
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob HalleyAC_SUBST(LIBTOOL_MODE_INSTALL)
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob HalleyAC_SUBST(LIBTOOL_MODE_LINK)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews#
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews# build libbind?
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews#
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark AndrewsAC_ARG_ENABLE(libbind,
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews [ --enable-libbind build libbind [default=no]])
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrewscase "$enable_libbind" in
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews yes)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews LIBBIND=lib/bind
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews AC_SUBST(LIBBIND)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews ;;
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews no|'')
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews ;;
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrewsesac
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews#
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews# Here begins a very long section to determine the system's networking
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews# capabilities. The order of the tests is signficant.
435532822dc571a904207d8176e063cc8731eef5Bob Halley#
9ac79ef3f89b23d80f9649abf71fdc65bb7a8b62David Lawrence
435532822dc571a904207d8176e063cc8731eef5Bob Halley#
435532822dc571a904207d8176e063cc8731eef5Bob Halley# IPv6
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence#
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark AndrewsAC_ARG_ENABLE(ipv6,
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews [ --enable-ipv6 use IPv6 [default=autodetect]])
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrewscase "$enable_ipv6" in
7c014c5bf41dc38802e8889c0a9110204eb1a552Andreas Gustafsson yes|''|autodetect)
435532822dc571a904207d8176e063cc8731eef5Bob Halley AC_DEFINE(WANT_IPV6)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ;;
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence no)
435532822dc571a904207d8176e063cc8731eef5Bob Halley ;;
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrenceesac
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff#
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson# We do the IPv6 compilation checking after libtool so that we can put
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson# the right suffix on the files.
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson#
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas GustafssonAC_MSG_CHECKING(for IPv6 structures)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas GustafssonAC_TRY_COMPILE([
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson#include <sys/types.h>
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson#include <sys/socket.h>
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson#include <netinet/in.h>],
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson[struct sockaddr_in6 sin6; return (0);],
7c014c5bf41dc38802e8889c0a9110204eb1a552Andreas Gustafsson [AC_MSG_RESULT(yes)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson found_ipv6=yes],
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson [AC_MSG_RESULT(no)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson found_ipv6=no])
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson#
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson# See whether IPv6 support is provided via a Kame add-on.
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson# This is done before other IPv6 linking tests to LIBS is properly set.
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff#
8313838954d67250d0ed7edf67fba5da0790d1a7Michael GraffAC_MSG_CHECKING(for Kame IPv6 support)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael GraffAC_ARG_WITH(kame,
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff use_kame="$withval", use_kame="no")
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graffcase "$use_kame" in
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff no)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff ;;
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff yes)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff kame_path=/usr/local/v6
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff ;;
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff *)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff kame_path="$use_kame"
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff ;;
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graffesac
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graffcase "$use_kame" in
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff no)
163bf7444f140c9201cc093c31431a56d4665af7Michael Graff AC_MSG_RESULT(no)
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence ;;
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence *)
163bf7444f140c9201cc093c31431a56d4665af7Michael Graff if test -f $kame_path/lib/libinet6.a; then
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff AC_MSG_RESULT($kame_path/lib/libinet6.a)
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff LIBS="-L$kame_path/lib -linet6 $LIBS"
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff else
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrencePlease choose the proper path with the following command:
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence configure --with-kame=PATH
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob Halley])
9ac79ef3f89b23d80f9649abf71fdc65bb7a8b62David Lawrence fi
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ;;
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graffesac
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence#
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# Including it on Kame-using platforms is very bad, though, because
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# Kame uses #error against direct inclusion. So include it on only
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# This is done before the in6_pktinfo check because that's what
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence# netinet6/in6.h is needed for.
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley#
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob Halleychangequote({, })
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrencecase "$host" in
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence*-bsdi4.[01]*)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews isc_netinet6in6_hack="#include <netinet6/in6.h>"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews ;;
435532822dc571a904207d8176e063cc8731eef5Bob Halley*)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
2f330bed30b752451b8a5258c7551b22ba602337Andreas Gustafsson LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
2f330bed30b752451b8a5258c7551b22ba602337Andreas Gustafsson isc_netinet6in6_hack=""
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff ;;
e544b507b8019a62c5d2716281f6832519a8791dDavid Lawrenceesac
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob Halleychangequote([, ])
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob Halley
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob Halley#
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob Halley# This is similar to the netinet6/in6.h issue.
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencecase "$host" in
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews # UnixWare
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews isc_netinetin6_hack="#include <netinet/in6.h>"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ;;
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews*)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews isc_netinetin6_hack=""
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ;;
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrewsesac
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews#
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews# Now delve deeper into the suitability of the IPv6 support.
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews#
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrewscase "$found_ipv6" in
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews yes)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence AC_MSG_CHECKING(for in6_addr)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence AC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#include <netinet/in.h>
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson$isc_netinetin6_hack
495c00c1c995c96587b38d2d5fa41f127869d5b8David Lawrence$isc_netinet6in6_hack
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence[struct in6_addr in6; return (0);],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [AC_MSG_RESULT(yes)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
a2495a1323842d2f2c6269eea66a2ba7e0baffccDavid Lawrence LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence isc_in_addr6_hack=""],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [AC_MSG_RESULT(no)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence isc_in_addr6_hack="#define in6_addr in_addr6"])
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence AC_MSG_CHECKING(for in6addr_any)
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson AC_TRY_LINK([
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson#include <sys/types.h>
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson#include <sys/socket.h>
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews#include <netinet/in.h>
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews$isc_netinetin6_hack
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson$isc_netinet6in6_hack
495c00c1c995c96587b38d2d5fa41f127869d5b8David Lawrence$isc_in_addr6_hack
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson [AC_MSG_RESULT(yes)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews [AC_MSG_RESULT(no)
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence AC_MSG_CHECKING(for in6addr_loopback)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence AC_TRY_LINK([
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#include <sys/types.h>
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson#include <sys/socket.h>
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson#include <netinet/in.h>
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson$isc_netinetin6_hack
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson$isc_netinet6in6_hack
495c00c1c995c96587b38d2d5fa41f127869d5b8David Lawrence$isc_in_addr6_hack
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [AC_MSG_RESULT(yes)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
a2495a1323842d2f2c6269eea66a2ba7e0baffccDavid Lawrence LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence [AC_MSG_RESULT(no)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence AC_TRY_COMPILE([
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#include <sys/types.h>
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#include <sys/socket.h>
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#include <netinet/in.h>
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence$isc_netinetin6_hack
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence$isc_netinet6in6_hack
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_HAVE_SIN6_SCOPE_ID="$result"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_MSG_CHECKING(for in6_pktinfo)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <netinet/in.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence$isc_netinetin6_hack
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence$isc_netinet6in6_hack
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [struct in6_pktinfo xyzzy; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ;;
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_IPV6_H="ipv6.h"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_IPV6_O="ipv6.$O"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_ISCIPV6_O="unix/ipv6.$O"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_IPV6_C="ipv6.c"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ;;
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrenceesac
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVEIPV6)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_IPV6_H)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_IPV6_O)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_ISCIPV6_O)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_IPV6_C)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING([for struct if_laddrreq])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_LINK([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <net/if6.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence],[ struct if_laddrreq a; ],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews [AC_MSG_RESULT(no)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_MSG_CHECKING([for struct if_laddrconf])
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_TRY_LINK([
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews#include <sys/types.h>
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews#include <net/if6.h>
c4157085cd215999883eb3de41bf16ce798379ceAndreas Gustafsson],[ struct if_laddrconf a; ],
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews [AC_MSG_RESULT(yes)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews [AC_MSG_RESULT(no)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Check for network functions that are often missing. We do this
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# after the libtool checking, so we can put the right suffix on
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# the files. It also needs to come after checking for a Kame add-on,
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# which provides some (all?) of the desired functions.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING([for inet_ntop with IPv6 support])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_RUN([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <netinet/in.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <arpa/inet.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencemain() {
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencechar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# addresses with less than four octets, like "1.2.3". Also leading
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# zeros should also be rejected.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING([for working inet_pton with IPv6 support])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_RUN([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <netinet/in.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <arpa/inet.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencemain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(assuming target platform has working inet_pton)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING([for inet_aton])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_LINK([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
3aa5ecb8f7081d831bb267d45437e46c61a41f25Brian Wellington#include <netinet/in.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <arpa/inet.h>],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [struct in_addr in; inet_aton(0, &in); return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDNTOP)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDPTON)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDATON)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for a 4.4BSD-style sa_len member in struct sockaddr.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencecase "$host" in
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence *-dec-osf*)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence # Turn on 4.4BSD style sa_len support.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_DEFINE(_SOCKADDR_LEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ;;
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrenceesac
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for sa_len in struct sockaddr)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[struct sockaddr sa; sa.sa_len = 0; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
703e1c0bb66f3cd3d300358ca0c1fdf3cb5fb1c5Brian Wellington ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVESALEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_HAVESALEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for a 4.4BSD or 4.3BSD struct msghdr
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for struct msghdr flavor)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/types.h>
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#include <sys/socket.h>],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[struct msghdr msg; msg.msg_flags = 0; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(4.4BSD)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(4.3BSD)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for in_port_t.
1bb509f58b57f1d9ef413762fb9e3dd2bcaf7ed4Mark Andrews#
1bb509f58b57f1d9ef413762fb9e3dd2bcaf7ed4Mark AndrewsAC_MSG_CHECKING(for type in_port_t)
358628c8f4804a2db52be0f6d03a66137fab4884David LawrenceAC_TRY_COMPILE([
affd6c025b39ec89a91056efb084fff7239ad6e3Mark Andrews#include <sys/types.h>
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley#include <netinet/in.h>],
f7bf83d0cc099e754327f8da8c4d6d320da1de01Mark Andrews[in_port_t port = 25; return (0);],
f7bf83d0cc099e754327f8da8c4d6d320da1de01Mark Andrews [AC_MSG_RESULT(yes)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
51a659eb711eb6a17891675d3de6b8085a766ab2Mark Andrews [AC_MSG_RESULT(no)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
c654449ccf403ccd2b81be2038b1013d6fbb06ccMark AndrewsAC_SUBST(ISC_PLATFORM_NEEDPORTT)
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob Halley#
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob Halley# Check for addrinfo
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence#
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_MSG_CHECKING(for struct addrinfo)
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_TRY_COMPILE([
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson#include <netdb.h>],
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson[struct addrinfo a; return (0);],
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson [AC_MSG_RESULT(yes)
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson AC_DEFINE(HAVE_ADDRINFO)],
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson [AC_MSG_RESULT(no)
8a1930d026517e4733d680ac51abeb01353332c4Mark Andrews ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_SUBST(ISC_LWRES_NEEDADDRINFO)
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson#
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson# Check for rrsetinfo
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson#
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_MSG_CHECKING(for struct rrsetinfo)
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_TRY_COMPILE([
5c00d1c90030a311d2700970fa7cffc8f828a48cBob Halley#include <netdb.h>],
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence[struct rrsetinfo r; return (0);],
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence [AC_MSG_RESULT(yes)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
5c00d1c90030a311d2700970fa7cffc8f828a48cBob Halley [AC_MSG_RESULT(no)
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
e980502db40155234b4e8d320b748b34dbaba3a2Brian WellingtonAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington
e980502db40155234b4e8d320b748b34dbaba3a2Brian WellingtonAC_MSG_CHECKING(for int sethostent)
e980502db40155234b4e8d320b748b34dbaba3a2Brian WellingtonAC_TRY_COMPILE([
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington#include <netdb.h>],
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington[int i = sethostent(0); return(0);],
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington [AC_MSG_RESULT(yes)
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellington ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
f8727bd90366af835f551da1b5e1fdfcd2d3d01fBrian Wellington [AC_MSG_RESULT(no)
5c00d1c90030a311d2700970fa7cffc8f828a48cBob Halley ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid LawrenceAC_SUBST(ISC_LWRES_SETHOSTENTINT)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David LawrenceAC_MSG_CHECKING(for int endhostent)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David LawrenceAC_TRY_COMPILE([
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence#include <netdb.h>],
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence[int i = endhostent(); return(0);],
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence [AC_MSG_RESULT(yes)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence [AC_MSG_RESULT(no)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas GustafssonAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas GustafssonAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas GustafssonAC_TRY_COMPILE([
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews#include <netdb.h>
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrewsstruct netent *getnetbyaddr(in_addr_t, int);],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews [AC_MSG_RESULT(yes)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews [AC_MSG_RESULT(no)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_MSG_CHECKING(for int setnetent)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_TRY_COMPILE([
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews#include <netdb.h>],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[int i = setnetent(0); return(0);],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews [AC_MSG_RESULT(yes)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews [AC_MSG_RESULT(no)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_SUBST(ISC_LWRES_SETNETENTINT)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_MSG_CHECKING(for int endnetent)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_TRY_COMPILE([
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews#include <netdb.h>],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[int i = endnetent(); return(0);],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews [AC_MSG_RESULT(yes)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson [AC_MSG_RESULT(no)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas GustafssonAC_SUBST(ISC_LWRES_ENDNETENTINT)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews
52d6c41cfcf21ddd240ddba15f3cdccea2e1ef47Andreas GustafssonAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
37aa91031830d2fc428331378f089169eb3e6dc2David LawrenceAC_TRY_COMPILE([
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence#include <netdb.h>
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrencestruct hostent *gethostbyaddr(const void *, size_t, int);],
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence[return(0);],
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence [AC_MSG_RESULT(yes)
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
073719ac7155ba72a353590190da58837bd590eaMark Andrews [AC_MSG_RESULT(no)
073719ac7155ba72a353590190da58837bd590eaMark Andrews ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
37aa91031830d2fc428331378f089169eb3e6dc2David LawrenceAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David LawrenceAC_MSG_CHECKING(for h_errno in netdb.h)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_TRY_COMPILE([
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence#include <netdb.h>],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence[h_errno = 1; return(0);],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [AC_MSG_RESULT(yes)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence [AC_MSG_RESULT(no)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(ISC_LWRES_NEEDHERRNO)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_CHECK_FUNC(getipnodebyname,
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_CHECK_FUNC(getnameinfo,
9c9cf3a8d063b0255dbc8679dab588708e9b6f1cAndreas Gustafsson [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_CHECK_FUNC(getaddrinfo,
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_DEFINE(HAVE_GETADDRINFO)],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_ARG_ENABLE(getifaddrs,
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence[ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no|glibc]].
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence want_getifaddrs="$enableval", want_getifaddrs="yes")
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecase $want_getifaddrs in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrenceyes|glibc)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence#
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence# Do we have getifaddrs() ?
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence#
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencecase $host in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence*-linux*)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # Some recent versions of glibc support getifaddrs() which does not
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # provide AF_INET6 addresses while the function provided by the USAGI
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # project handles the AF_INET6 case correctly. We need to avoid
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # using the former but prefer the latter unless overridden by
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # --enable-getifaddrs=glibc.
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence if $use_getifaddrs = glibc
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence then
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence else
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence save_LIBS="$LIBS"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LIBS="-L/usr/local/v6/lib $LIBS"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_CHECK_LIB(inet6, getifaddrs,
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LIBS="$LIBS -linet6"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_DEFINE(HAVE_GETIFADDRS),
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LIBS=${save_LIBS})
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence fi
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ;;
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence*)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence ;;
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrenceesac
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson;;
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafssonno)
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson;;
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafssonesac
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson
26bc09bc89c2a96f36147be4e664c552efe78fa2Andreas Gustafsson#
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson# Look for a sysctl call to get the list of network interfaces.
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson#
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafssoncase $ac_cv_header_sys_sysctl_h in
26bc09bc89c2a96f36147be4e664c552efe78fa2Andreas Gustafssonyes)
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas GustafssonAC_MSG_CHECKING(for interface list sysctl)
26bc09bc89c2a96f36147be4e664c552efe78fa2Andreas GustafssonAC_EGREP_CPP(found_rt_iflist, [
26bc09bc89c2a96f36147be4e664c552efe78fa2Andreas Gustafsson#include <sys/param.h>
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas Gustafsson#include <sys/sysctl.h>
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas Gustafsson#include <sys/socket.h>
26bc09bc89c2a96f36147be4e664c552efe78fa2Andreas Gustafsson#ifdef NET_RT_IFLIST
2bd433da8785d3da8e8dd140248762c5d3220b0fEric Lucefound_rt_iflist
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson#endif
2bd433da8785d3da8e8dd140248762c5d3220b0fEric Luce],
2bd433da8785d3da8e8dd140248762c5d3220b0fEric Luce [AC_MSG_RESULT(yes)
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson AC_DEFINE(HAVE_IFLIST_SYSCTL)],
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson [AC_MSG_RESULT(no)])
2bd433da8785d3da8e8dd140248762c5d3220b0fEric Luce;;
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafssonesac
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson
2bd433da8785d3da8e8dd140248762c5d3220b0fEric Luce#
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# Check for some other useful functions that are not ever-present.
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson#
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# reportedly defines strsep() without declaring it in <string.h> when
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# AC_CHECK_FUNC() incorrectly succeeds because it declares
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# the function itself.
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_MSG_CHECKING(for correctly declared strsep())
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_CHECK_FUNC(memmove,
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_CHECK_FUNC(strtoul,
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_CHECK_FUNC(strlcpy,
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_CHECK_FUNC(strlcat,
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas GustafssonISC_PRINT_OBJS=
b796a9c6f99410b08f4ecdfca5d9ddf7bd6d1ad5Andreas GustafssonISC_PRINT_SRCS=
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas GustafssonAC_MSG_CHECKING(sprintf)
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas GustafssonAC_TRY_COMPILE([
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas Gustafsson#include <stdio.h>
a737f45fbacf209ec75595c85447b2bfd264138bAndreas Gustafsson],
a737f45fbacf209ec75595c85447b2bfd264138bAndreas Gustafsson[ char buf[2]; return(*sprintf(buf,"x"));],
a737f45fbacf209ec75595c85447b2bfd264138bAndreas Gustafsson[
a737f45fbacf209ec75595c85447b2bfd264138bAndreas GustafssonISC_PRINT_OBJS="print.$O"
b796a9c6f99410b08f4ecdfca5d9ddf7bd6d1ad5Andreas GustafssonISC_PRINT_SRCS="print.c"
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas GustafssonISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson],
b796a9c6f99410b08f4ecdfca5d9ddf7bd6d1ad5Andreas Gustafsson[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"]
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson)
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas GustafssonAC_CHECK_FUNC(vsnprintf,
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"],
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson [ISC_PRINT_OBJS="print.$O"
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson ISC_PRINT_SRCS="print.c"
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas Gustafsson ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"])
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
dc8f5b39e23f723c0a99657ce9768950042d7c1eAndreas GustafssonISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
f9f9c47053364ba915d3ef0dbb4f55bd202487daAndreas GustafssonISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas Gustafsson
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas GustafssonAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
60084a1a5a9e570842b8147ff4c34b68ce4de7f8Andreas Gustafsson
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas GustafssonAC_SUBST(ISC_EXTRA_OBJS)
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas GustafssonAC_SUBST(ISC_EXTRA_SRCS)
b796a9c6f99410b08f4ecdfca5d9ddf7bd6d1ad5Andreas Gustafsson
23dd0aa5d54bd459dbb5e73f1213fb103114945cAndreas Gustafsson#
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson# Determine the printf format characters to use when printing
23dd0aa5d54bd459dbb5e73f1213fb103114945cAndreas Gustafsson# values of type isc_int64_t. We make the assumption that platforms
23dd0aa5d54bd459dbb5e73f1213fb103114945cAndreas Gustafsson# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
45fca822d565a2c600b04330a1dd25a9db7e2974Andreas Gustafsson# want "%ld" and everyone else can use "%lld". Win32 uses "%I64d",
23dd0aa5d54bd459dbb5e73f1213fb103114945cAndreas Gustafsson# but that's defined elsewhere since we don't use configure on Win32.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence#
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid LawrenceAC_MSG_CHECKING(printf format modifier for 64-bit integers)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid LawrenceAC_TRY_RUN([main() { exit(!(sizeof(long long int) == sizeof(long int))); }],
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob Halley [AC_MSG_RESULT(l)
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob Halley ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob Halley [AC_MSG_RESULT(ll)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'],
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington [AC_MSG_RESULT(assuming target platform uses ll)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'])
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob HalleyAC_SUBST(ISC_PLATFORM_QUADFORMAT)
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews#
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley# Security Stuff
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley#
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian WellingtonAC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas GustafssonAC_ARG_ENABLE(linux-caps,
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley [ --disable-linux-caps disable linux capabilities])
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graffcase "$enable_linux_caps" in
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews yes|'')
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley AC_CHECK_HEADERS(linux/capability.h)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley ;;
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington no)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson ;;
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halleyesac
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael GraffAC_CHECK_HEADERS(sys/prctl.h)
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley#
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley# Time Zone Stuff
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews#
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob Halley# BSD/OS, and perhaps some others, don't define rlim_t.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
2180f41c907e013715cbc54c64545b26fc3c0dbaMichael GraffAC_MSG_CHECKING(for type rlim_t)
2180f41c907e013715cbc54c64545b26fc3c0dbaMichael GraffAC_TRY_COMPILE([
2180f41c907e013715cbc54c64545b26fc3c0dbaMichael Graff#include <sys/types.h>
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#include <sys/time.h>
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley#include <sys/resource.h>],
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley[rlim_t rl = 19671212; return (0);],
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley[AC_MSG_RESULT(yes)
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
b1e8b7fd92f6b23954c8077d6f5de93fab23fc12Andreas Gustafsson[AC_MSG_RESULT(no)
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas GustafssonAC_MSG_CHECKING(type of rlim_cur)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas GustafssonAC_TRY_RUN([
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson#include <sys/types.h>
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley#include <sys/time.h>
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley#include <sys/resource.h>
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halleymain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews[AC_MSG_RESULT(int)
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews[
b2f85baf7905bad89781f8ef73003d4cfa955257Michael GraffAC_TRY_RUN([
b2f85baf7905bad89781f8ef73003d4cfa955257Michael Graff#include <sys/types.h>
b2f85baf7905bad89781f8ef73003d4cfa955257Michael Graff#include <sys/time.h>
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#include <sys/resource.h>
9fbc1afb8b08432e3a1adda1f41d5575620e9785Bob Halleymain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley[AC_MSG_RESULT(long int)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
9fbc1afb8b08432e3a1adda1f41d5575620e9785Bob Halley[
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob HalleyAC_TRY_RUN([
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#include <sys/types.h>
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#include <sys/time.h>
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#include <sys/resource.h>
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleymain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley[AC_MSG_RESULT(long long int)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley],[AC_MSG_ERROR(this cannot happen)])
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob Halley],[AC_MSG_ERROR(this cannot happen)])
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington],[AC_MSG_ERROR(cannot determine type of rlim_cur when cross compiling - define rlim_t)])
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian Wellington])
fafb62400d2f1b1da4f3908447e1f3935fc5155bBrian WellingtonAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington# Compaq TruCluster requires more code for handling cluster IP aliases
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson#
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafssoncase "$host" in
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson *-dec-osf*)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley AC_CHECK_FUNC(clua_getaliasaddress,
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley AC_DEFINE(HAVE_TRUCLUSTER, 1,
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington [Define if running under Compaq TruCluster]))
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington ;;
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington *)
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington ;;
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrewsesac
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews#
c68fa795a1c87fd5d0386e0503dc5666490ac77fMichael Graff# Microsoft has their own way of handling shared libraries that requires
c68fa795a1c87fd5d0386e0503dc5666490ac77fMichael Graff# additional qualifiers on extern variables. Unix systems don't need it.
c68fa795a1c87fd5d0386e0503dc5666490ac77fMichael Graff#
c7620c99f1139b77f14678e21a44f7c8c4236a7bMark AndrewsAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob HalleyISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
bf6d4f9cad79d182eea7487e2ee2fb2bc4b0824eBrian WellingtonAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
34729dbcb3526974cf98ee03ec20a107d9458417Andreas GustafssonLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson#
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson# Random remaining OS-specific issues involving compiler warnings.
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson# XXXDCL print messages to indicate some compensation is being done?
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson#
44aae046c38e796e581110b7ecdf4478167d684dBob HalleyAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
44aae046c38e796e581110b7ecdf4478167d684dBob HalleyISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
44aae046c38e796e581110b7ecdf4478167d684dBob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleycase "$host" in
fa67ca21f6d5033221d9893b3c38a7bf8fecdb18Mark Andrews *-bsdi3.1*)
690a68b8112039e633e26f9216c0d463751e011aMichael Graff hack_shutup_sputaux=yes
1cafbcfa6f7560597e577f78795143b4964464d9Bob Halley ;;
12ccbb032ec1b5f6b93aac923f2645a19fc90c75David Lawrence *-bsdi4.0*)
326bcfa0e2a6b924cb829a0bcc3bf9590ce21ad6Mark Andrews hack_shutup_sigwait=yes
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer hack_shutup_sputaux=yes
d11097cf86e789c8dbb7df86753491b30add2f5aMichael Sawyer ;;
44aae046c38e796e581110b7ecdf4478167d684dBob Halley [*-bsdi4.[12]*])
44aae046c38e796e581110b7ecdf4478167d684dBob Halley hack_shutup_stdargcast=yes
44aae046c38e796e581110b7ecdf4478167d684dBob Halley ;;
44aae046c38e796e581110b7ecdf4478167d684dBob Halley [*-solaris2.[89]])
297a9ce042b977f2e4eb3b3e4bf9e7b72f96d640William King hack_shutup_pthreadonceinit=yes
297a9ce042b977f2e4eb3b3e4bf9e7b72f96d640William King ;;
297a9ce042b977f2e4eb3b3e4bf9e7b72f96d640William Kingesac
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington
a9f861e65b6544e16c23a44b239d80436b3e0414William Kingcase "$hack_shutup_pthreadonceinit" in
0111b7c5e12837bca4b97d2dd0e3989348a6a85dMichael Graff yes)
683da0cd900532fc45fa4dfb687b5041156ec8abAndreas Gustafsson #
244b9e154bde055d9b7798111dbaadab5dee73eaMichael Sawyer # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson #
39469093ea30f42ee3fcc6c457688cf8577432c6Brian Wellington ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
0b1f1952f4a1c8ddb90dc2dfcab30669903c6e8eBrian Wellington ;;
e855fd594d04413c29504bdc6b8792be9fa79bd2Andreas Gustafssonesac
95be83b467e2384d414693982318a5c06cccf1d7Andreas Gustafsson
4bd173d7ae482d5cc297295aca6db1d609ab7b91Andreas Gustafssoncase "$hack_shutup_sigwait" in
59563a18b7d83c3de5bb4b57f41fb4c0f9162cd0Andreas Gustafsson yes)
b796a9c6f99410b08f4ecdfca5d9ddf7bd6d1ad5Andreas Gustafsson #
339bf07cd663634eb57a22d36c6f6a706ab6b7ffAndreas Gustafsson # Shut up a -Wmissing-prototypes warning for sigwait().
42cf4e4eadee9fda7dafc6cd4acbc629181bacebAndreas Gustafsson #
22f0b13f28a7df3b348b18848d0ccd745ea88c3cAndreas Gustafsson AC_DEFINE(SHUTUP_SIGWAIT)
6c68e68fc550c947100581eb7b5340b81c062c94Andreas Gustafsson ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonesac
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtoncase "$hack_shutup_sputaux" in
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence yes)
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence #
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence # Shut up a -Wmissing-prototypes warning from <stdio.h>.
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence #
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence AC_DEFINE(SHUTUP_SPUTAUX)
;;
esac
case "$hack_shutup_stdargcast" in
yes)
#
# Shut up a -Wcast-qual warning from va_start().
#
AC_DEFINE(SHUTUP_STDARG_CAST)
;;
esac
#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
ac_cv_have_if_nametoindex=no)
case $ac_cv_have_if_nametoindex in
no)
case "$host" in
*-hp-hpux*)
AC_CHECK_LIB(ipv6, if_nametoindex,
ac_cv_have_if_nametoindex=yes
LIBS="-lipv6 $LIBS",)
;;
esac
esac
case $ac_cv_have_if_nametoindex in
yes)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
;;
*)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
#
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
# a developer editing the documentation source.
#
# Directory trees where SGML files are commonly found.
sgmltrees="/usr/pkg/share/sgml /usr/local/share/sgml /usr/share/sgml"
#
# Look for openjade. Plain jade is no longer supported.
#
AC_PATH_PROGS(OPENJADE, openjade, openjade)
AC_SUBST(OPENJADE)
#
# Look for TeX.
#
AC_PATH_PROGS(JADETEX, jadetex, jadetex)
AC_SUBST(JADETEX)
AC_PATH_PROGS(PDFJADETEX, pdfjadetex, pdfjadetex)
AC_SUBST(PDFJADETEX)
#
# Subroutine for searching for an ordinary file (e.g., a stylesheet)
# in a number of directories:
#
# NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
#
# If the file FILENAME is found in one of the DIRECTORIES, the shell
# variable VARIABLE is defined to its absolute pathname. Otherwise,
# it is set to FILENAME, with no directory prefix (that's not terribly
# useful, but looks less confusing in substitutions than leaving it
# empty). The variable VARIABLE will be substituted into output files.
#
AC_DEFUN(NOM_PATH_FILE, [
$1=""
AC_MSG_CHECKING(for $2)
for d in $3
do
f=$d/$2
if test -f $f
then
$1=$f
AC_MSG_RESULT($f)
break
fi
done
if test "X[$]$1" = "X"
then
AC_MSG_RESULT("not found");
$1=$2
fi
AC_SUBST($1)
])
#
# Look for the SGML catalog.
# Its location varies, so far we have seen:
#
# NetBSD /usr/pkg/share/sgml/docbook/catalog
# FreeBSD /usr/local/share/sgml/docbook/catalog
# Linux /usr/local/share/dsssl/docbook/catalog
# /usr/share/sgml/docbook/dsssl-stylesheets/catalog
#
catalogpath=""
for d in $sgmltrees
do
catalogpath="$catalogpath $d"
for s in docbook/dsssl-stylesheets
do
catalogpath="$catalogpath $d/$s"
done
done
NOM_PATH_FILE(SGMLCATALOG, catalog, $catalogpath)
#
# Look for the HTML stylesheet html/docbook.dsl, used for
# formatting man pages in HTML. Its location varies,
# so far we have seen:
#
# NetBSD /usr/pkg/share/sgml/docbook/dsssl/modular/
# FreeBSD /usr/local/share/sgml/docbook/dsssl/modular/
# Linux /usr/local/share/dsssl/docbook/
# /usr/share/sgml/docbook/dsssl-stylesheets/
#
# Ditto for the print stylesheet print/docbook.dsl.
#
stylepath=""
for d in $sgmltrees
do
for s in docbook/dsssl/modular dsssl/docbook docbook/dsssl-stylesheets
do
stylepath="$stylepath $d/$s"
done
done
NOM_PATH_FILE(HTMLSTYLE, html/docbook.dsl, $stylepath)
NOM_PATH_FILE(PRINTSTYLE, print/docbook.dsl, $stylepath)
#
# Look for XML declarations.
# Its location varies, so far we have seen:
#
# NetBSD /usr/pkg/share/sgml/docbook/dsssl/modular/dtds/decls/
# FreeBSD /usr/local/share/sgml/docbook/dsssl/modular/dtds/decls/
# Linux /usr/local/share/dsssl/docbook/dtds/decls/
# /usr/share/sgml/docbook/dsssl-stylesheets/dtds/decls/
#
xmlpath=""
for d in $sgmltrees
do
for s in docbook/dsssl/modular dsssl/docbook docbook/dsssl-stylesheets
do
xmlpath="$xmlpath $d/$s"
done
done
NOM_PATH_FILE(XMLDCL, dtds/decls/xml.dcl, $xmlpath)
#
# Look for docbook2man-spec.pl
#
NOM_PATH_FILE(DOCBOOK2MANSPEC, docbook2X/docbook2man-spec.pl, $sgmltrees)
#
# Substitutions
#
AC_SUBST(BIND9_TOP_BUILDDIR)
BIND9_TOP_BUILDDIR=`pwd`
AC_SUBST(BIND9_ISC_BUILDINCLUDE)
AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
AC_SUBST(BIND9_DNS_BUILDINCLUDE)
AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
if test "X$srcdir" != "X"; then
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
else
BIND9_ISC_BUILDINCLUDE=""
BIND9_ISCCC_BUILDINCLUDE=""
BIND9_ISCCFG_BUILDINCLUDE=""
BIND9_DNS_BUILDINCLUDE=""
BIND9_LWRES_BUILDINCLUDE=""
BIND9_BIND9_BUILDINCLUDE=""
fi
AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
AC_SUBST_FILE(BIND9_MAKE_RULES)
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
. $srcdir/version
BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
AC_SUBST(BIND9_VERSION)
AC_SUBST_FILE(LIBISC_API)
LIBISC_API=$srcdir/lib/isc/api
AC_SUBST_FILE(LIBISCCC_API)
LIBISCCC_API=$srcdir/lib/isccc/api
AC_SUBST_FILE(LIBISCCFG_API)
LIBISCCFG_API=$srcdir/lib/isccfg/api
AC_SUBST_FILE(LIBDNS_API)
LIBDNS_API=$srcdir/lib/dns/api
AC_SUBST_FILE(LIBBIND9_API)
LIBBIND9_API=$srcdir/lib/bind9/api
AC_SUBST_FILE(LIBLWRES_API)
LIBLWRES_API=$srcdir/lib/lwres/api
AC_OUTPUT(
make/rules
make/includes
Makefile
make/Makefile
make/mkdep
lib/Makefile
lib/isc/Makefile
lib/isc/include/Makefile
lib/isc/include/isc/Makefile
lib/isc/include/isc/platform.h
lib/isc/unix/Makefile
lib/isc/unix/include/Makefile
lib/isc/unix/include/isc/Makefile
lib/isc/nls/Makefile
lib/isc/$thread_dir/Makefile
lib/isc/$thread_dir/include/Makefile
lib/isc/$thread_dir/include/isc/Makefile
lib/isccc/Makefile
lib/isccc/include/Makefile
lib/isccc/include/isccc/Makefile
lib/isccfg/Makefile
lib/isccfg/include/Makefile
lib/isccfg/include/isccfg/Makefile
lib/dns/Makefile
lib/dns/include/Makefile
lib/dns/include/dns/Makefile
lib/dns/sec/Makefile
lib/dns/sec/dst/Makefile
lib/dns/sec/dst/include/Makefile
lib/dns/sec/dst/include/dst/Makefile
lib/bind9/Makefile
lib/bind9/include/Makefile
lib/bind9/include/bind9/Makefile
lib/lwres/Makefile
lib/lwres/include/Makefile
lib/lwres/include/lwres/Makefile
lib/lwres/include/lwres/netdb.h
lib/lwres/include/lwres/platform.h
lib/lwres/man/Makefile
lib/lwres/unix/Makefile
lib/lwres/unix/include/Makefile
lib/lwres/unix/include/lwres/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
bin/Makefile
bin/check/Makefile
bin/named/Makefile
bin/named/unix/Makefile
bin/rndc/Makefile
bin/rndc/unix/Makefile
bin/dig/Makefile
bin/nsupdate/Makefile
bin/tests/Makefile
bin/tests/names/Makefile
bin/tests/master/Makefile
bin/tests/rbt/Makefile
bin/tests/db/Makefile
bin/tests/tasks/Makefile
bin/tests/timers/Makefile
bin/tests/dst/Makefile
bin/tests/mem/Makefile
bin/tests/net/Makefile
bin/tests/sockaddr/Makefile
bin/tests/system/Makefile
bin/tests/system/conf.sh
bin/tests/system/lwresd/Makefile
bin/tests/system/tkey/Makefile
bin/tests/headerdep_test.sh
bin/dnssec/Makefile
doc/Makefile
doc/arm/Makefile
doc/arm/nominum-docbook-html.dsl
doc/arm/nominum-docbook-print.dsl
doc/arm/validate.sh
doc/misc/Makefile
docutil/docbook2man-wrapper.sh
isc-config.sh
)
chmod a+x isc-config.sh
# Tell Emacs to edit this file in shell mode.
# Local Variables:
# mode: sh
# End: