configure.in revision 294ef74e5ad68d898207c4fb36d8b18d526a11f6
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# Copyright (C) 1998-2016 Internet Systems Consortium, Inc. ("ISC")
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# License, v. 2.0. If a copy of the MPL was not distributed with this
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# file, You can obtain one at http://mozilla.org/MPL/2.0/.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David LawrenceAC_DIVERT_PUSH(1)dnl
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrewsesyscmd([sed -e 's/^/# /' -e '/Portions of this code/,$d' COPYRIGHT])dnl
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsAC_DIVERT_POP()dnl
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsAC_INIT(BIND, [9.11], [bind9-bugs@isc.org], [], [https://www.isc.org/downloads/BIND/])
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsAC_PREREQ(2.59)
dafcb997e390efa4423883dafd100c975c4095d6Mark AndrewsAC_CONFIG_HEADER(config.h)
66bd3b3c6b171271c705b897823dcdcf29464698Michael GraffAC_CONFIG_MACRO_DIR([libtool.m4])
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan HuntAC_CANONICAL_HOST
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_PROG_MAKE_SET
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff# GNU libtool support
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halleycase $build_os in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff # Just set the maximum command line length for sunos as it otherwise
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff # takes a exceptionally long time to work it out. Required for libtool.
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff lt_cv_sys_max_cmd_len=4096;
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas GustafssonAC_PROG_LIBTOOL
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael GraffAC_PROG_INSTALL
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrenceAC_SUBST(STD_CINCLUDES)
440be4c866f6935ac069db79a414304507a664c2Michael GraffAC_SUBST(STD_CDEFINES)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_SUBST(STD_CWARNINGS)
e45d323a2a0f4ca08d4b139546e60a5fa7bd3f0cMichael GraffAC_SUBST(CCOPT)
29f28fe573d4b3b318b3b026d567c1eb86738015Michael GraffAC_SUBST(CCNOOPT)
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael GraffAC_SUBST(BACKTRACECFLAGS)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff# Warn if the user specified libbind, which is now deprecated
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael GraffAC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrewscase "$enable_libbind" in
09f22ac5b09e70bc526015f37168ba33e21ea91fDavid Lawrence AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark AndrewsIt is available from http://www.isc.org as a separate download.])
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_ARG_ENABLE(warn_shadow, [ --enable-warn-shadow turn on -Wshadow when compiling])
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_ARG_ENABLE(warn_error, [ --enable-warn-error turn on -Werror when compiling])
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_ARG_ENABLE(developer, [ --enable-developer enable developer build settings])
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graffcase "$enable_developer" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff STD_CDEFINES="$STD_CDEFINES -DISC_LIST_CHECKINIT=1"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff test "${enable_querytrace+set}" = set || enable_querytrace=yes
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff test "${with_atf+set}" = set || with_atf=yes
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff test "${enable_symtable+set}" = set || enable_symtable=all
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark Andrews test "${enable_warn_error+set}" = set || enable_warn_error=yes
d947011dc393d9f9988d1349d585b246d19cc3c7Michael Graff test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
3115cd89bc1e1fd3ecc4705d253e3484a3f5c555Michael Graff test "${with_zlib+set}" = set || with_zlib=yes
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff# American Fuzzy Lop
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_ARG_ENABLE(afl, [ --enable-afl enable American Fuzzy Lop test harness [[default=no]]],
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff [AC_DEFINE([ENABLE_AFL], [1], [Define to enable American Fuzzy Lop test harness])])
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graffcase "$enable_afl" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff LIBS="$LIBS -lpthread"
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff#libseccomp sandboxing
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_ARG_ENABLE(seccomp,
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff AS_HELP_STRING([--enable-seccomp],[enable support for libseccomp system call filtering [default=no]]))
213973a334f92d4aef4ef62b4538fc2e4d0e8082Michael Graffcase "$enable_seccomp" in
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff case $host_os in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff AC_MSG_WARN([seccomp is not supported on non-linux platforms; disabling it])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff enable_seccomp=no
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff AC_SEARCH_LIBS(seccomp_init, [seccomp])
fe14eafefa91fada7cea0a55b09196c01477406cBob Halley if test "X$ac_cv_search_seccomp_init" = "X-lseccomp" ; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater int main(void)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if (ret < 0) {
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews switch (errno) {
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if (ret < 0) {
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater switch (errno) {
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews , AC_DEFINE([HAVE_LIBSECCOMP], 1,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [Define to use libseccomp system call filtering.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Make very sure that these are the first files processed by
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# config.status, since we use the processed output as the input for
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# AC_SUBST_FILE() substitutions in other files.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_PATH_PROG(AR, ar)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsARFLAGS="cruv"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ARFLAGS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# The POSIX ln(1) program. Non-POSIX systems may substitute
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# "copy" or something.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase "$AR" in
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_MSG_ERROR([
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffar program not found. Please fix your PATH to include the directory in
8cdfd17426179ae6f629a9b7475d46a22f535047Bob Halleywhich ar resides, or set AR in the environment with the full path to ar.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_PATH_PROGS(ETAGS, etags emacs-etags)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# GNU emacs etags, and it requires the -L flag.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X$ETAGS" != "X"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for Exuberant Ctags etags)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ETAGS="$ETAGS -L"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ETAGS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Perl is optional; it is used only by some of the system test scripts.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# Note: the backtrace feature (see below) uses perl to build the symbol table,
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff# but it still compiles without perl, in which case an empty table will be used.
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_PATH_PROGS(PERL, perl5 perl)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff# Python is also optional; it is used by the tools in bin/python.
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graff# If python is unavailable, we simply don't build those.
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael GraffAC_ARG_WITH(python,
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff[ --with-python=PATH specify path to python interpreter],
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff use_python="$withval", use_python="unspec")
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffpython="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatertestargparse='try: import argparse
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterexcept: exit(1)'
66bd3b3c6b171271c705b897823dcdcf29464698Michael Grafftestply='try: from ply import *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austeinexcept: exit(1)'
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Grafftestminvers='import sys
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graffif (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_python" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([for python support])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(disabled)
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff unspec|yes|*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$use_python" in
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff unspec|yes|'')
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff for p in $python
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff AC_PATH_PROGS(PYTHON, $p)
57ecc983c0b37ce7dbccf28f44c6bffdfd6491f7Andreas Gustafsson if test "X$PYTHON" = "X"; then
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if ${PYTHON:-false} -c "$testminvers"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater unset ac_cv_path_PYTHON
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([python module 'argparse'])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if ${PYTHON:-false} -c "$testargparse"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT([found])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT([not found])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews unset ac_cv_path_PYTHON
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews unset PYTHON
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([python module 'ply'])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if ${PYTHON:-false} -c "$testply"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater unset ac_cv_path_PYTHON
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$PYTHON" = "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([for python support])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$use_python" in
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_MSG_RESULT(disabled)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_ERROR([missing python])
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrews case "$use_python" in
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrews PYTHON="$use_python"
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff AC_PATH_PROGS(PYTHON, $use_python)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff if ${PYTHON:-false} -c "$testminvers"; then
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff AC_MSG_RESULT([found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([not found])
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_CHECKING([python module 'argparse'])
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 if ${PYTHON:-false} -c "$testargparse"; then
dd95acdbce0e2a2775391709cdfca0a9eda7e8f7Mark Andrews AC_MSG_RESULT([found, using $PYTHON])
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafsson AC_MSG_ERROR([not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([python module 'ply'])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if ${PYTHON:-false} -c "$testply"; then
c803787146cadcb2d7e10cbf4491f3be513dfa1aMichael Graff AC_MSG_RESULT([found, using $PYTHON])
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff AC_MSG_ERROR([not found])
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffPYTHON_TOOLS=''
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X$PYTHON" != "X"; then
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff PYTHON_TOOLS=python
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 CHECKDS=checkds
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 COVERAGE=coverage
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley KEYMGR=keymgr
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(CHECKDS)
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark AndrewsAC_SUBST(COVERAGE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(KEYMGR)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(PYTHON_TOOLS)
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff# Special processing of paths depending on whether --prefix,
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff# --sysconfdir or --localstatedir arguments were given. What's
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff# desired is some compatibility with the way previous versions
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# of BIND built; they defaulted to /usr/local for most parts of
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff# the installation, but named.boot/named.conf was in /etc
dd95acdbce0e2a2775391709cdfca0a9eda7e8f7Mark Andrews# So ... if none of --prefix, --sysconfdir or --localstatedir are
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff# specified, set things up that way. If --prefix is given, use
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff# it for sysconfdir and localstatedir the way configure normally
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff# would. To change the prefix for everything but leave named.conf
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael Graff# in /etc or named.pid in /var/run, then do this the usual configure way:
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# ./configure --prefix=/somewhere --sysconfdir=/etc
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# ./configure --prefix=/somewhere --localstatedir=/var
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# To put named.conf and named.pid in /usr/local with everything else,
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# set the prefix explicitly to /usr/local even though that's the default:
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# ./configure --prefix=/usr/local
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graffcase "$prefix" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff case "$sysconfdir" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff '${prefix}/etc')
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff sysconfdir=/etc
14b98cb34eda66c87ce41a207704a2c232280eafMichael Graff case "$localstatedir" in
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 '${prefix}/var')
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 localstatedir=/var
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffexpanded_sysconfdir=`eval echo $sysconfdir`
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael GraffAC_SUBST(expanded_sysconfdir)
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# Make sure INSTALL uses an absolute path, else it will be wrong in all
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# configure based on the location of the file where it is substituted.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff# subdirectory of install-sh, This relative path will be wrong for all
49a940dc68b30d9e4f9e1bd3c0503d8b90bb1726Mark Andrews# directories more than one level down from install-sh.
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffcase "$INSTALL" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff # Not all systems have dirname.
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff changequote({, })
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff changequote([, ])
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff test "X$ac_dir" = "X$ac_prog" && ac_dir=.
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff INSTALL="$ac_dir/$ac_prog"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# On these hosts, we really want to use cc, not gcc, even if it is
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# found. The gcc that these systems have will not correctly handle
4a3ad0da975d7115d401700f955814a0dff1adb0Bob Halley# However, if the user sets $CC to be something, let that override
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graffif test "X$CC" = "X" ; then
65f6d2e1c1fce0989c13c2efb44b8dd26cd977f3Michael Graff case "$host" in
3d12fa7e76c02d06e1adeaa7846b60378a3cd204Michael Graff # Use Sun's cc if it is available, but watch
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff # out for /usr/ucb/cc; it will never be the right
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff # compiler to use.
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff # If setting CC here fails, the AC_PROG_CC done
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff # below might still find gcc.
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff for ac_dir in $PATH; do
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff test -z "$ac_dir" && ac_dir=.
53cf67186506f9557aaf2149898dd76715803db2Mark Andrews case "$ac_dir" in
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff if test -f "$ac_dir/cc"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater IFS="$ac_save_ifs"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater mips-sgi-irix*)
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# gcc's optimiser is broken at -02 for ultrasparc
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graffif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff case "$host" in
306a93530536f05edfb477cac1c2667d90129a8fMichael Graff CCFLAGS="-g -O1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# OS dependent CC flags
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
9e992ecf375cd1eaa5351d06eca8cf7f543d5938Andreas Gustafsson # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
9e992ecf375cd1eaa5351d06eca8cf7f543d5938Andreas Gustafsson # -D_XOPEN_SOURCE_EXTENDED.
306a93530536f05edfb477cac1c2667d90129a8fMichael Graff STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
306a93530536f05edfb477cac1c2667d90129a8fMichael Graff CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="-lxnet $LIBS"
306a93530536f05edfb477cac1c2667d90129a8fMichael Graff # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
76c8294c81fb48b1da6e1fc5b83322a4cedb8e58Andreas Gustafsson STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
76c8294c81fb48b1da6e1fc5b83322a4cedb8e58Andreas Gustafsson CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence # parts of the IPv6 Advanced Socket API as a result. This is stupid
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # as it breaks how the two halves (Basic and Advanced) of the IPv6
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff # Socket API were designed to be used but we have to live with it.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-linux* | *-kfreebsd*-gnu*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
21e7034ec046105c00a0dab86c83732e2e77ad99Michael Graff # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews # Setting this is sufficient to select the correct behavior for BIND 9.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
d9059b0c38bd630c367d81424d72b1308cd74b04Tatuya JINMEI 神明達哉 CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Huntif test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt CCNOOPT="-O0"
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan HuntAC_HEADER_STDC
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan HuntAC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/mman.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h sys/socket.h net/route.h linux/netlink.h linux/rtnetlink.h,,,
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt[$ac_includes_default
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt#ifdef HAVE_SYS_PARAM_H
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt#ifdef HAVE_SYS_SOCKET_H
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan HuntAC_C_VOLATILE
a14eb88840e06b8d458c1556e5452b6d2a50012eMichael GraffAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
a14eb88840e06b8d458c1556e5452b6d2a50012eMichael GraffAC_C_FLEXIBLE_ARRAY_MEMBER
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for the existence of mmap to enable the fast format zones
a14eb88840e06b8d458c1556e5452b6d2a50012eMichael GraffAC_CHECK_FUNCS(mmap)
a14eb88840e06b8d458c1556e5452b6d2a50012eMichael Graff# Older versions of HP/UX don't define seteuid() and setegid()
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNCS(seteuid setresuid)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNCS(setegid setresgid)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# BSDI doesn't have ftello fseeko
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNCS(ftello fseeko)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# UnixWare 7.1.1 with the feature supplement to the UDK compiler
8868ef9c6411a51697749be54328ed78d2d8be96Automatic Updater# is reported to not support "static inline" (RT #1212).
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(for static inline breakage)
8868ef9c6411a51697749be54328ed78d2d8be96Automatic UpdaterAC_TRY_COMPILE([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews static inline int foo1() {
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews static inline int foo2() {
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews return foo1();
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ], [foo1();],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TYPE_SIZE_T
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_TYPE(ssize_t, int)
8868ef9c6411a51697749be54328ed78d2d8be96Automatic UpdaterAC_CHECK_TYPE(uintptr_t,unsigned long)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_TYPE(socklen_t,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TRY_COMPILE(
3426bd337df23a83c1e9b45184600edfd056c667Mark Andrewsint getsockname(int, struct sockaddr *, size_t *);
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_SOCKADDR_LEN_T)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_HEADER_TIME
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(for long long)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TRY_COMPILE([],[long long i = 0; return (0);],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check for uname library routine
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(for uname)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TRY_COMPILE([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsstruct utsname uts;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsprintf("running on %s %s %s for %s\n",
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews uts.sysname, uts.release, uts.version, uts.machine);
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_UNAME)],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_WARN([uname is not correctly supported])])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check for GCC noreturn attribute
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(for GCC noreturn attribute)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_NORETURN_PRE)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_NORETURN_POST)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check if we have lifconf
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(for struct lifconf)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_TRY_COMPILE([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsstruct lifconf lifconf;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check if we have kqueue
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_ARG_ENABLE(kqueue,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews want_kqueue="$enableval", want_kqueue="yes")
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase $want_kqueue in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case $ac_cv_have_kqueue in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# so we need to try running the code, not just test its existence.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_ARG_ENABLE(epoll,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[ --enable-epoll use Linux epoll when available [[default=auto]]],
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt want_epoll="$enableval", want_epoll="auto")
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Huntcase $want_epoll in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING(epoll support)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_TRY_RUN([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if (epoll_create(1) < 0)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEEPOLL)
8868ef9c6411a51697749be54328ed78d2d8be96Automatic Updater# check if we support /dev/poll
8868ef9c6411a51697749be54328ed78d2d8be96Automatic UpdaterAC_ARG_ENABLE(devpoll,
8868ef9c6411a51697749be54328ed78d2d8be96Automatic Updater [ --enable-devpoll use /dev/poll when available [[default=yes]]],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews want_devpoll="$enableval", want_devpoll="yes")
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase $want_devpoll in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# check if we need to #include sys/select.h explicitly
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase $ac_cv_header_unistd_h in
3426bd337df23a83c1e9b45184600edfd056c667Mark AndrewsAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
3426bd337df23a83c1e9b45184600edfd056c667Mark AndrewsAC_TRY_COMPILE([
3426bd337df23a83c1e9b45184600edfd056c667Mark Andrews#include <sys/types.h> /* Ultrix */
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[fd_set read_set; return (0);],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case $ac_cv_header_sys_select_h in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_ERROR([need either working unistd.h or sys/select.h])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case $ac_cv_header_sys_select_h in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_ERROR([need either unistd.h or sys/select.h])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# Find the machine's endian flavor.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_C_BIGENDIAN
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# GeoIP support?
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsGEOIPLINKSRCS=
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsGEOIPLINKOBJS=
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_ARG_WITH(geoip,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[ --with-geoip=PATH Build with GeoIP support (yes|no|path)],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews use_geoip="$withval", use_geoip="no")
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsif test "yes" = "$use_geoip"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews use_geoip=$d
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase "$use_geoip" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING([for GeoIP support])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT([disabled])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test -d "$use_geoip" -o -L "$use_geoip"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$CFLAGS -I$use_geoip/include"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CPPFLAGS="$CPPFLAGS -I$use_geoip/include"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LIBS="$LIBS -L$use_geoip/lib"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case "$host_os" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews netbsd*|openbsd*|solaris*)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LIBS="$LIBS -Wl,-rpath=$use_geoip/lib"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews elif test "yes" = "$use_geoip"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_ERROR([GeoIP path not found])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_ERROR([GeoIP path $use_geoip does not exist])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_CHECK_HEADER(GeoIP.h, [],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_ERROR([GeoIP header file not found])]
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_SEARCH_LIBS(GeoIP_id_by_addr_gl, GeoIP, [],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_ERROR([suitable GeoIP library not found])]
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_SEARCH_LIBS(fabsf, m, [],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_ERROR([Math library not found])]
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_GEOIP, 1, Build with GeoIP support)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews GEOIPLINKSRCS='${GEOIPLINKSRCS}'
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews GEOIPLINKOBJS='${GEOIPLINKOBJS}'
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING([for GeoIP support])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT([yes])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING([for GeoIP Country IPv6 support])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_COMPILE_IFELSE(
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_LANG_PROGRAM([
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt struct in6_addr in6;
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt GeoIP_country_name_by_ipnum_v6(NULL, in6);
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT([yes])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_GEOIP_V6, 1, Build with GeoIP Country IPv6 support)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT([no])]
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING([for GeoIP City IPv6 support])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_COMPILE_IFELSE(
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_LANG_PROGRAM([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews struct in6_addr in6;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews int i = GEOIP_CITY_EDITION_REV0_V6;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews GeoIP_record_by_ipnum_v6(NULL, in6);
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT([yes])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_GEOIP_CITY_V6, 1, Build with GeoIP City IPv6 support)
8868ef9c6411a51697749be54328ed78d2d8be96Automatic Updater [AC_MSG_RESULT([no])]
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(GEOIPLINKSRCS)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(GEOIPLINKOBJS)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_MSG_CHECKING(for GSSAPI library)
2bcb48cfcae36398454c98e40c563e2cde748e07Michael GraffAC_ARG_WITH(gssapi,
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff[ --with-gssapi=[[PATH|[/path/]krb5-config]] Specify path for system-supplied GSSAPI [[default=yes]]],
d1fb73ada84ee15ea078c80b1cd0ca8ddc6aa856Michael Graff use_gssapi="$withval", use_gssapi="yes")
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff# first try using krb5-config, if that does not work then fall back to "yes" method.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_gssapi" in
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff*/krb5-config|krb5-config)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(trying $use_gssapi)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test krb5-config = "$use_gssapi"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater KRB5_CONFIG="$use_gssapi"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater gssapi_cflags=`$KRB5_CONFIG --cflags gssapi`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater gssapi_libs=`$KRB5_CONFIG --libs gssapi`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cppflags="$CPPFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$gssapi_cflags $CPPFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
a95a9de45ca739dab17ec1263186dbaaaba50d97Tatuya JINMEI 神明達哉 if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([krb5-config: gssapi.h not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$saved_cppflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([krb5-config: krb5.h not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$saved_cppflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="$saved_cppflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_libs="$LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS=$gssapi_libs
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([krb5-config linking as $LIBS])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater gssapi_linked=yes, gssapi_linked=no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case $gssapi_linked in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater yes) AC_MSG_RESULT([krb5-config: linked]);;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater no) AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS=$saved_libs
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$use_gssapi"; then
e851ea826066ac5a5b01c2c23218faa0273a12e8Evan Hunt AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$use_gssapi"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi=framework
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉# gssapi is just the framework, we really require kerberos v5, so
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# look for those headers (the gssapi headers must be there, too)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# The problem with this implementation is that it doesn't allow
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# for the specification of gssapi and krb5 headers in different locations,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# which probably ought to be fixed although fixing might raise the issue of
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# trying to build with incompatible versions of gssapi and krb5.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "yes" = "$use_gssapi"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # first, deal with the obvious
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test \( -f /usr/include/kerberosv5/krb5.h -o \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi=/usr
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
a95a9de45ca739dab17ec1263186dbaaaba50d97Tatuya JINMEI 神明達哉 for d in $krb5dirs
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f $d/include/gssapi/gssapi_krb5.h -o \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f $d/include/gssapi/gssapi.h -o \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_gssapi="no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_gssapi" in
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_MSG_RESULT(disabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([--with-gssapi must specify a path])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater */krb5-config|krb5-config)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater USE_GSSAPI='-DGSSAPI'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_GSSAPI_INC="$gssapi_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DNS_GSSAPI_LIBS="$gssapi_libs"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater USE_GSSAPI='-DGSSAPI'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <Kerberos/Kerberos.h>"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <Kerberos/Kerberos.h>"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DNS_GSSAPI_LIBS="-framework Kerberos"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(framework)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(looking in $use_gssapi/lib)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater USE_GSSAPI='-DGSSAPI'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cppflags="$CPPFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews gssapi_hack="#include <$ac_header>"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([gssapi.h not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater gssapi_krb5_hack="#include <$ac_header>"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
2bcb48cfcae36398454c98e40c563e2cde748e07Michael Graff krb5_hack="#include <$ac_header>"])
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_ERROR([krb5.h not found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # XXXDCL This probably doesn't work right on all systems.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # It will need to be worked on as problems become evident.
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 # Essentially the problems here relate to two different
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # areas. The first area is building with either KTH
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # or MIT Kerberos, particularly when both are present on
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # the machine. The other is static versus dynamic linking.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # On the KTH vs MIT issue, Both have libkrb5 that can mess
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # up the works if one implementation ends up trying to
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # use the other's krb. This is unfortunately a situation
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # that very easily arises.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Dynamic linking when the dependency information is built
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # all such problems go away, but when that setup is not
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # present, because either the dynamic libraries lack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # dependencies or static linking is being done, then the
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # problems start to show up.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_libs="$LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater for TRY_LIBS in \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi_krb5" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi -lkrb5 -lgssapi_krb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgssapi -lkrb5 -lhx509 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "-lgss -lkrb5"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Note that this does not include $saved_libs, because
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 # on FreeBSD machines this configure script has added
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 # -L/usr/local/lib to LIBS, which can make the
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # -lgssapi_krb5 test succeed with shared libraries even
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # when you are trying to build with KTH in /usr/lib.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "/usr" = "$use_gssapi"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$TRY_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="-L$use_gssapi/lib $TRY_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(linking as $TRY_LIBS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$gssapi_krb5_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉#if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉gsskrb5_register_acceptor_identity(NULL);
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 gssapi_linked=yes, gssapi_linked=no)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 case $gssapi_linked in
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 yes) AC_MSG_RESULT(yes); break ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater no) AC_MSG_RESULT(no) ;;
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff CPPFLAGS="$saved_cppflags"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff case $gssapi_linked in
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # but MIT in /usr/local/lib and trying to build with KTH.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # /usr/local/lib can end up earlier on the link lines.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Like most kludges, this one is not only inelegant it
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # is also likely to be the wrong thing to do at least as
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # many times as it is the right thing. Something better
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # needs to be done.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "/usr" = "$use_gssapi" -a \
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater FIX_KTH_VS_MIT=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$FIX_KTH_VS_MIT" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$enable_static_linking" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater yes) gssapi_lib_suffix=".a" ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *) gssapi_lib_suffix=".so" ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater for lib in $LIBS; do
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 new_lib=`echo $lib |
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater -e s%$%$gssapi_lib_suffix%`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater NEW_LIBS="$NEW_LIBS $new_lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$NEW_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_GSSAPI_INC="-I$use_gssapi/include"
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff DNS_GSSAPI_LIBS="$LIBS"
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff LIBS="$saved_libs"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_KRB5HEADER)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(USE_GSSAPI)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(DST_GSSAPI_INC)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(DNS_GSSAPI_LIBS)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffDNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence# Applications linking with libdns also need to link with these libraries.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael GraffAC_SUBST(DNS_CRYPTO_LIBS)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff# was --with-randomdev specified?
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉AC_MSG_CHECKING(for random device)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉AC_ARG_WITH(randomdev,
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉[ --with-randomdev=PATH Specify path for random device],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_randomdev="$withval", use_randomdev="unspec")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_randomdev" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$cross_compiling" in
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_MSG_RESULT(unspecified)
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley case "$host" in
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_RESULT($devrandom)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_CHECK_FILE($devrandom,
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 "$devrandom"),)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_ERROR([--with-randomdev must specify a path])
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_RESULT(disabled)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_RESULT(using "$use_randomdev")
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# Only check dsa signature generation on these platforms when performing
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley# system tests.
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyif grep "#define PATH_RANDOMDEV " confdefs.h > /dev/null
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *darwin*|*freebsd*)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyAC_SUBST(CHECK_DSA)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉# Do we have arc4random(), etc ?
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉# Will use stir and if not exist addrandom
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNCS(arc4random)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNCS(arc4random_stir)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNCS(arc4random_addrandom)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halleyif $use_threads
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence if test "X$GCC" = "Xyes"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -pthread"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff CC="$CC -pthread"
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff CCOPT="$CCOPT -pthread"
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff CCNOOPT="$CCNOOPT -pthread"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LIBS="$LIBS -lthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -mt"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -mt"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-sco-sysv*uw*|*-*-sysv*UnixWare*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -Kthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -Kthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -Kthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-*-sysv*OpenUNIX*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -Kpthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -Kpthread"
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 CCNOOPT="$CCNOOPT -Kpthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ALWAYS_DEFINES="-D_REENTRANT"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater THREADOPTOBJS='${THREADOPTOBJS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater THREADOPTSRCS='${THREADOPTSRCS}'
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff thread_dir=pthreads
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # We'd like to use sigwait() too
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_FUNC(sigwait,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_DEFINE(HAVE_SIGWAIT),
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff AC_CHECK_LIB(c, sigwait,
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence AC_DEFINE(HAVE_SIGWAIT),
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_CHECK_LIB(pthread, sigwait,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_SIGWAIT),
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_LIB(pthread, _Psigwait,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_SIGWAIT),))))
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_CHECK_FUNC(pthread_attr_getstacksize,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNC(pthread_attr_setstacksize,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_ARG_WITH(locktype,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --with-locktype=ARG Specify mutex lock type (adaptive or standard)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater locktype="$withval", locktype="adaptive")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$locktype" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater #define _GNU_SOURCE
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater return (PTHREAD_MUTEX_ADAPTIVE_NP);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ AC_MSG_RESULT(using adaptive lock type)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ AC_MSG_RESULT(using standard lock type) ])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(using standard lock type)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_CHECK_HEADERS(sched.h)
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff case "$host" in
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff AC_CHECK_LIB(rt, sched_yield)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNCS(sched_yield pthread_yield pthread_yield_np)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Additional OS-specific issues related to pthreads and sigwait.
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff case "$host" in
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff # One more place to look for sigwait.
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # BSDI 3.0 through 4.0.1 needs pthread_init() to be
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # called before certain pthreads calls. This is deprecated
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-bsdi3.*|*-bsdi4.0*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(NEED_PTHREAD_INIT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # LinuxThreads requires some changes to the way we
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # deal with signals.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_LINUXTHREADS)
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 # Ensure the right sigwait() semantics on Solaris and make
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 # sure we call pthread_setconcurrency.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNC(pthread_setconcurrency,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # UnixWare does things its own way.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff # Look for sysconf to allow detection of the number of processors.
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater thread_dir=nothreads
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater THREADOPTOBJS=""
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley THREADOPTSRCS=""
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley ALWAYS_DEFINES=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ALWAYS_DEFINES)
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob HalleyAC_SUBST(ISC_PLATFORM_USETHREADS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(THREADOPTOBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(THREADOPTSRCS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_THREAD_DIR=$thread_dir
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_THREAD_DIR)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for libtool)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(libtool,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --with-libtool use GNU libtool],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_libtool="$withval", use_libtool="no")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $use_libtool in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AM_PROG_LIBTOOL
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_COMPILE='--mode=compile --tag=CC'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_INSTALL='--mode=install --tag=CC'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_LINK='--mode=link --tag=CC'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_UNINSTALL='--mode=uninstall --tag=CC'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater INSTALL_LIBRARY='${INSTALL_PROGRAM}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *) LIBTOOL_ALLOW_UNDEFINED= ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *) LIBTOOL_IN_MAIN= ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_SUBST(LIBTOOL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MKDEP_SED=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_COMPILE=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_INSTALL=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_LINK=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_MODE_UNINSTALL=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_ALLOW_UNDEFINED=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBTOOL_IN_MAIN=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater INSTALL_LIBRARY='${INSTALL_DATA}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(INSTALL_LIBRARY)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# was --enable-native-pkcs11 specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# (note it implies both --without-openssl and --with-pkcs11)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(native-pkcs11,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --enable-native-pkcs11 use native PKCS11 for all crypto [[default=no]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater want_native_pkcs11="$enableval", want_native_pkcs11="no")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# was --with-openssl specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(openssl,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater (Crypto is required for DNSSEC)],
16508d9185e5eb96af2ebe900a08c46a6e5eb7edBob Halley use_openssl="$withval", use_openssl="auto")
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff# was --with-pkcs11 specified?
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael GraffAC_ARG_WITH(pkcs11,
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence[ --with-pkcs11[=PATH] Build with PKCS11 support [yes|no|path]
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater (PATH is for the PKCS11 provider)],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff use_pkcs11="$withval", use_pkcs11="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# were --with-ecdsa, --with-gost, --with-aes specified
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(ecdsa, [ --with-ecdsa Crypto ECDSA],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_ecdsa="$withval", with_ecdsa="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(gost, [ --with-gost Crypto GOST [yes|no|raw|asn1].],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_gost="$withval", with_gost="auto")
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael GraffAC_ARG_WITH(aes, [ --with-aes Crypto AES],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff with_aes="$withval", with_aes="checkcc")
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff# was --enable-openssl-hash specified?
4281fe4a80af7402613f0d5c3eeff8829a4ede1fMichael GraffAC_ARG_ENABLE(openssl-hash,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --enable-openssl-hash use OpenSSL for hash functions [[default=no]]],
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff want_openssl_hash="$enableval", want_openssl_hash="checkcc")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Client Cookie algorithm choice
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(cc-alg,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --with-cc-alg=ALG choose the algorithm for Client Cookie [[aes|sha1|sha256]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="$withval", with_cc_alg="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $with_cc_alg in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="sha1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="sha256"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "$with_aes" != "no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_aes="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "$with_aes" != "no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_aes="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "with_aes" = "checkcc"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for OpenSSL library)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterOPENSSL_WARNING=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updateropenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "yes" = "$want_native_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_openssl="native_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(use of native PKCS11 instead)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "auto" = "$use_openssl"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater for d in $openssldirs
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_openssl=$d
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterOPENSSL_ECDSA=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterOPENSSL_GOST=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$with_gost" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_gost="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(PREFER_GOSTASN1, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if GOST private keys are encoded in ASN.1.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater gosttype="asn1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_gost="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR(unknown GOST private key encoding)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_openssl" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater native_pkcs11)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_MSG_RESULT(disabled because of native PKCS11)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff DST_OPENSSL_INC=""
a253e35c2451818fb39f9b808c7641adb5275fb3Michael Graff CRYPTO="-DPKCS11CRYPTO"
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence OPENSSLGOSTLINKOBJS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLGOSTLINKSRS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKOBJS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKSRCS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_INC=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLGOSTLINKOBJS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLGOSTLINKSRS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKOBJS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKSRCS=""
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff DST_OPENSSL_INC=""
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff OPENSSLGOSTLINKOBJS=""
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff OPENSSLGOSTLINKSRS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKOBJS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLLINKSRCS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterIf you don't want OpenSSL, use --without-openssl])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$want_native_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT()
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([OpenSSL and native PKCS11 cannot be used together.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$use_openssl"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # User did not specify a path - guess it
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater for d in $openssldirs
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff use_openssl=$d
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$use_openssl"
a385f150bb21b8b81f70ed7df545357a83f1da82Michael Graff AC_MSG_RESULT(not found)
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_MSG_ERROR(
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater elif ! test -f "$use_openssl"/include/openssl/opensslv.h
30251e07d1705d1a85b0e1d5a969496e1aed612eMichael Graff AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff CRYPTO='-DOPENSSL'
78bf1ca89505820ed7b03be4bf0c0b53b557f3cdAndreas Gustafsson if test "/usr" = "$use_openssl"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_INC=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_LIBS="-lcrypto"
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff DST_OPENSSL_INC="-I$use_openssl/include"
439c0011e642fb1d26011116144af698125262dbMichael Graff case $host in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
439c0011e642fb1d26011116144af698125262dbMichael Graff DST_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-apple-darwin*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Apple's ld seaches for serially for dynamic
439c0011e642fb1d26011116144af698125262dbMichael Graff # then static libraries. This means you can't
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # use -L to override dynamic system libraries
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # with static ones when linking. Instead
439c0011e642fb1d26011116144af698125262dbMichael Graff # we specify a absolute path.
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cc="$CC"
439c0011e642fb1d26011116144af698125262dbMichael Graff saved_cflags="$CFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_libs="$LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$DST_OPENSSL_INC $CFLAGS"
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 LIBS="$DST_OPENSSL_LIBS $LIBS"
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_CHECKING(whether linking with OpenSSL works)
439c0011e642fb1d26011116144af698125262dbMichael Graff ERR_clear_error();
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_ERROR(Could not run test program using OpenSSL from
439c0011e642fb1d26011116144af698125262dbMichael GraffPlease check the argument to --with-openssl and your
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatershared library configuration (e.g., LD_LIBRARY_PATH).)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(assuming it does work on target platform)])
5f1f24822fabe7b78af5f81553bfc11a170326c3Mark Andrews AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
439c0011e642fb1d26011116144af698125262dbMichael Graff#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterOPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterDSO_METHOD_dlfcn();
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [LIBS="$LIBS -ldl"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterOPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterDSO_METHOD_dlfcn();
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_OPENSSL_LIBS="$DST_OPENSSL_LIBS -ldl"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(unknown)
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews [AC_MSG_RESULT(assuming it does work on target platform)])
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews [AC_MSG_RESULT(assuming it does work on target platform)]
c965b1869024ab38518fade703cc1dae2d71a59eMark AndrewsAC_ARG_ENABLE(openssl-version-check,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[AC_HELP_STRING([--enable-openssl-version-check],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [check OpenSSL version @<:@default=yes@:>@])])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase "$enable_openssl_version_check" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(OpenSSL library version)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff OPENSSL_VERSION_NUMBER < 0x00908000L) ||
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater (OPENSSL_VERSION_NUMBER >= 0x0090804fL &&
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSL_VERSION_NUMBER < 0x10002000L) ||
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSL_VERSION_NUMBER >= 0x1000205fL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater printf("\n\nFound OPENSSL_VERSION_NUMBER %#010lx\n",
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSL_VERSION_NUMBER);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "Require OPENSSL_VERSION_NUMBER 0x1000000f or greater (1.0.0)\n"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "Require OPENSSL_VERSION_NUMBER 0x1000100f or greater (1.0.1)\n"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater "Require OPENSSL_VERSION_NUMBER 0x1000205f or greater (1.0.2e)\n\n");
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [AC_MSG_RESULT(ok)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(not compatible)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews OPENSSL_WARNING=yes
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt [AC_MSG_RESULT(assuming target platform has compatible version)])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_MSG_RESULT(Skipped OpenSSL version check)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_CHECKING(for OpenSSL DSA support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f $use_openssl/include/openssl/dsa.h
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_OPENSSL_DSA)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNCS(EVP_sha256 EVP_sha384 EVP_sha512)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_CHECKING(for OpenSSL ECDSA support)
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff have_ecdsa=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater EC_KEY *ec256, *ec384;
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff#if !defined(HAVE_EVP_SHA256) || !defined(HAVE_EVP_SHA384)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ec256 = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if (ec256 == NULL || ec384 == NULL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff have_ecdsa="yes"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_ecdsa="no"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(using --with-ecdsa)])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff case "$with_ecdsa" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$have_ecdsa" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater no) AC_MSG_ERROR([ecdsa not supported]) ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *) have_ecdsa=yes ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_ecdsa=no ;;
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff case "$have_ecdsa" in
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff *) AC_MSG_ERROR([need --with-ecdsa=[[yes or no]]]) ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case $have_ecdsa in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSL_ECDSA="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_OPENSSL_ECDSA, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your OpenSSL version supports ECDSA.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for OpenSSL GOST support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$use_pkcs11" in
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence if $use_threads; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10000000L)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews OPENSSL_config(NULL);
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews e = ENGINE_by_id("gost");
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if (e == NULL)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if (ENGINE_init(e) <= 0)
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt [AC_MSG_RESULT(yes)
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews have_gost="yes"],
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews [AC_MSG_RESULT(no)
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews have_gost="no"],
8868ef9c6411a51697749be54328ed78d2d8be96Automatic Updater [AC_MSG_RESULT(using --with-gost)])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case "$with_gost" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case "$have_gost" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews no) AC_MSG_ERROR([gost not supported]) ;;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews *) have_gost=yes ;;
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff have_gost=no ;;
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence case "$have_gost" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *) AC_MSG_ERROR([need --with-gost=[[yes, no, raw or asn1]]]) ;;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case $have_gost in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSL_GOST="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLGOSTLINKOBJS='${OPENSSLGOSTLINKOBJS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater OPENSSLGOSTLINKSRCS='${OPENSSLGOSTLINKSRCS}'
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_DEFINE(HAVE_OPENSSL_GOST, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your OpenSSL version supports GOST.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for OpenSSL AES support)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews const EVP_CIPHER *aes128, *aes192, *aes256;
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews aes128 = EVP_aes_128_ecb();
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff aes192 = EVP_aes_192_ecb();
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff aes256 = EVP_aes_256_ecb();
2992344aacdb08e4af936c176d49ef789f5673ddMichael Graff if (aes128 == NULL || aes192 == NULL || aes256 == NULL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_aes="evp"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_CHECK_FUNC(AES_encrypt,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_aes="yes"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)])],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(using --with-aes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Expect cross-compiling with a modern OpenSSL
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_aes="evp"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_INC=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_LIBS=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$with_aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$have_aes" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_OPENSSL_EVP_AES, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your OpenSSL version supports EVP AES])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_INC="$DST_OPENSSL_INC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_OPENSSL_AES, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your OpenSSL version supports AES])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_INC="$DST_OPENSSL_INC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$saved_cc"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$saved_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$saved_libs"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# This would include the system openssl path (and linker options to use
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# it as needed) if it is found.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DST_OPENSSL_INC)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(OPENSSLGOSTLINKOBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(OPENSSLGOSTLINKSRCS)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(OPENSSLLINKOBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(OPENSSLLINKSRCS)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffAC_SUBST(OPENSSL_ECDSA)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(OPENSSL_GOST)
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael GraffDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DST_OPENSSL_LIBS"
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrenceISC_PLATFORM_WANTAES="#undef ISC_PLATFORM_WANTAES"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "yes" = "$with_aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$CRYPTO" = "X"
bb143613cf26e0f27dfd9caf1a7336065d064b26Michael Graffif test "yes" = "$with_aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_WANTAES="#define ISC_PLATFORM_WANTAES 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_WANTAES)
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff# Choose Client Cookie algorithm
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_MSG_CHECKING(for the Algorithm for Client Cookie)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "auto" = "$with_cc_alg"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$with_aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="aes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater with_cc_alg="sha256"
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graffcase $with_cc_alg in
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_RESULT(sha1)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$CRYPTO" = "X-DOPENSSL"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "checkcc" = "$want_openssl_hash"
439c0011e642fb1d26011116144af698125262dbMichael Graff want_openssl_hash="yes"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_DEFINE(HMAC_SHA1_CC, 1,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [Use HMAC-SHA1 for Client Cookie generation])
d98c74e2ec5b96bd22aa4ed6d893e8993787493bMichael Graff AC_MSG_RESULT(sha256)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$CRYPTO" = "X-DOPENSSL"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "checkcc" = "$want_openssl_hash"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater want_openssl_hash="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HMAC_SHA256_CC, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Use HMAC-SHA256 for Client Cookie generation])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(aes)
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt if test "$with_aes" != "yes"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff AC_MSG_ERROR("Client Cookie wants to use unavailable AES");
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_DEFINE(AES_CC, 1,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [Use AES for Client Cookie generation])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "checkcc" = "$want_openssl_hash"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater want_openssl_hash="no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Use OpenSSL for hash functions
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for using OpenSSL for hash functions)
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael GraffISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $want_openssl_hash in
6d14fe95e9ea5bbc5e863e5aab4618f7b3dbcc0fMichael Graff if test "$CRYPTO" != "-DOPENSSL"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_MSG_ERROR([No OpenSSL for hash functions])
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_MSG_RESULT(yes)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_OPENSSL_INC="$DST_OPENSSL_INC"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_OPENSSLHASH)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_OPENSSL_INC)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_OPENSSL_LIBS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# PKCS11 (aka crypto hardware) support (--with moved just after openssl)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for PKCS11 support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "auto" = "$use_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$want_native_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_pkcs11="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_pkcs11="no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_pkcs11" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_TEST=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_TOOLS=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PK11_C=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PK11_O=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PK11_API_C=""
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff ISC_PK11_API_O=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_PK11_RESULT_C=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_PK11_RESULT_O=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_ISCPK11_API_C=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff ISC_ISCPK11_API_O=""
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_MSG_RESULT(yes)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff if ! $use_threads; then
e51511aa3281f8dc384eb1283115c7f8d5c402aeMichael Graff AC_MSG_ERROR([PKCS11 requires thread support])
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 if test "X$CRYPTO" = "X-DOPENSSL"
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_MSG_CHECKING(for OpenSSL with PKCS11 support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cc="$CC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cflags="$CFLAGS"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews saved_libs="$LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CC="$CC -pthread"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS $DST_OPENSSL_INC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$LIBS $DST_OPENSSL_LIBS"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff OPENSSL_config(NULL);
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 e = ENGINE_by_id("pkcs11");
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 if (e == NULL)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 if (ENGINE_init(e) <= 0)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 [AC_MSG_RESULT(yes)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 PKCS11_TEST=pkcs11ssl
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 PKCS11_ENGINE='-DPKCS11_ENGINE="\"pkcs11\""'],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 PKCS11_TEST=''
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [AC_MSG_RESULT(cross compile, defaulting to no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_TEST=''
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'])
11fcc67616fac1bc6a28b3d4fed24641137888e7Michael Graff CC="$saved_cc"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff CFLAGS="$saved_cflags"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff LIBS="$saved_libs"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff PKCS11_TEST=''
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrews PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater USE_PKCS11='-DUSE_PKCS11'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_TOOLS=pkcs11
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNC(getpassphrase, AC_DEFINE(HAVE_GETPASSPHRASE),)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PK11_O="pk11.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PK11_API_C="pk11_api.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PK11_API_O="pk11_api.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PK11_RESULT_C="pk11_result.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PK11_RESULT_O="pk11_result.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_ISCPK11_API_C="unix/pk11_api.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_ISCPK11_API_O="unix/pk11_api.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(USE_PKCS11)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11_TOOLS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11_ENGINE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PK11_C)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PK11_O)
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffAC_SUBST(ISC_PK11_API_C)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PK11_API_O)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PK11_RESULT_C)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PK11_RESULT_O)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_ISCPK11_API_C)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_ISCPK11_API_O)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for PKCS11 tools)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_pkcs11" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_PROVIDER="undefined"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(disabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_PROVIDER="undefined"
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael Graff AC_MSG_RESULT(enabled)
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrews PKCS11_PROVIDER="$use_pkcs11"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT([enabled, PKCS11 provider is $PKCS11_PROVIDER])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11_PROVIDER)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterPKCS11_ECDSA=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterset_pk11_flavor="no"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for native PKCS11)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$want_native_pkcs11" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(using native PKCS11 crypto)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11LINKOBJS='${PKCS11LINKOBJS}'
47c5b8af920a93763c97d9a93ea1fd766961a5b3Evan Hunt PKCS11LINKSRCS='${PKCS11LINKSRCS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_TEST=pkcs11
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for PKCS11 ECDSA)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$with_ecdsa" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(disabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(enabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_ECDSA="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_PKCS11_ECDSA, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your PKCS11 provider supports ECDSA.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for PKCS11 GOST)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$with_gost" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(enabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PKCS11_GOST="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_PKCS11_GOST, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if your PKCS11 provider supports GOST.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(disabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for PKCS11 flavor)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$PKCS11_PROVIDER" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(Thales nCipher)
47c5b8af920a93763c97d9a93ea1fd766961a5b3Evan Hunt pk11_flavor="PK11_THALES_FLAVOR"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater set_pk11_flavor="yes"
698a4dcc8ae5c2a62a254ab2aff7b16d52598cc0Mark Andrews *libsofthsm2*)
698a4dcc8ae5c2a62a254ab2aff7b16d52598cc0Mark Andrews AC_MSG_RESULT(SoftHSMv2)
698a4dcc8ae5c2a62a254ab2aff7b16d52598cc0Mark Andrews pk11_flavor="PK11_SOFTHSMV2_FLAVOR"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater set_pk11_flavor="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(SoftHSM)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater pk11_flavor="PK11_SOFTHSMV1_FLAVOR"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater set_pk11_flavor="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(Cryptech)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater pk11_flavor="PK11_CRYPTECH_FLAVOR"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater set_pk11_flavor="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(AEP Keyper: not yet supported)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(undefined provider?)
439c0011e642fb1d26011116144af698125262dbMichael Graff AC_MSG_RESULT(unknown provider: tweaks are in lib/isc/include/pk11/site.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$set_pk11_flavor" ; then
439c0011e642fb1d26011116144af698125262dbMichael Graff CFLAGS="$CFLAGS -DPK11_FLAVOR=$pk11_flavor"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(disabled)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11LINKOBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11LINKSRCS)
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael GraffAC_SUBST(CRYPTO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PKCS11_ECDSA)
0dba2713dec4cf3f97f21b957e403a36ee989b3cMark AndrewsAC_SUBST(PKCS11_GOST)
0dba2713dec4cf3f97f21b957e403a36ee989b3cMark AndrewsAC_SUBST(PKCS11_TEST)
816496b22114ee7c2c15321c2c6cc4be77fdf822Mark Andrews# for PKCS11 benchmarks
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterhave_clock_gt=no
08d131595373326ec4a3af793b536df8c33115ecMichael GraffAC_CHECK_FUNC(clock_gettime,have_clock_gt=yes,)
08d131595373326ec4a3af793b536df8c33115ecMichael Graffif test "no" = "$have_clock_gt"; then
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,)
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graffif test "$have_clock_gt" != "no"; then
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "rt" = "$have_clock_gt"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="-lrt $LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# was --with-lmdb specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for lmdb library)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(lmdb,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ --with-lmdb[=PATH] build with LMDB library [yes|no|path]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_lmdb="$withval", use_lmdb="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_lmdb" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f "${d}/include/lmdb.h"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test ${d} != /usr
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater lmdb_cflags="-I ${d}/include"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$LIBS -L${d}/lib"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff have_lmdb="yes"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff if test -f "${use_lmdb}/include/lmdb.h"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff lmdb_cflags="-I${use_lmdb}/include"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff LIBS="$LIBS -L${use_lmdb}/lib"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff have_lmdb="yes"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉if test "X${have_lmdb}" != "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_SEARCH_LIBS([mdb_env_create], [lmdb], [],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_ERROR([found lmdb include but not library.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_lmdb=""])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterelif test "X$use_lmdb" = Xyes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([include/lmdb.h not found.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X${have_lmdb}" != "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS $lmdb_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_LMDB, 1, [Define if lmdb was found])
0874abad14e3e9ecfc3dc1a1a2b9969f2f027724Mark Andrews NZD_TOOLS="nzd"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater NZDSRCS='${NZDSRCS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater NZDTARGETS='${NZDTARGETS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(NZD_TOOLS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(NZDSRCS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(NZDTARGETS)
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉# was --with-libxml2 specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for libxml2 library)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(libxml2,
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff[ --with-libxml2[=PATH] build with libxml2 library [yes|no|path]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_libxml2="$withval", use_libxml2="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_libxml2" in
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff DST_LIBXML2_INC=""
ff303bcf27507c2bab1fab7f05e203fdccae7e19Andreas Gustafsson case X`(xml2-config --version) 2>/dev/null` in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley X2.[[6789]].*)
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff libxml2_libs=`xml2-config --libs`
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley libxml2_cflags=`xml2-config --cflags`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$use_libxml2" ; then
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR(required libxml2 version not available)
5f1f24822fabe7b78af5f81553bfc11a170326c3Mark Andrews libxml2_libs=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater libxml2_cflags=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f "$use_libxml2/bin/xml2-config" ; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X$libxml2_libs" != "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS $libxml2_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$LIBS $libxml2_libs"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # Sanity check xml2-config output.
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff AC_TRY_LINK([#include <libxml/xmlwriter.h>],
84c46a7acb961cac19c0d857bfdd00f3383a9bc6Michael Graff [return(xmlTextWriterStartElement(NULL, NULL));],
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff AC_MSG_RESULT(yes),
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence AC_MSG_ERROR(xml2-config returns badness))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(XMLSTATS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# was --with-libjson specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for json library)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(libjson,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ --with-libjson[=PATH] build with libjson0 library [yes|no|path]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_libjson="$withval", use_libjson="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterhave_libjson=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterhave_libjson_c=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_libjson" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater libjson_libs=""
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley if test ${d} != /usr
e34efaccfaab4dbbe45edd0a58e2b6e930e5784bMichael Graff libjson_cflags="-I ${d}/include"
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence LIBS="$LIBS -L${d}/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_libjson="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater elif test -f "${d}/include/json-c/json.h"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test ${d} != /usr
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater libjson_cflags="-I ${d}/include"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$LIBS -L${d}/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_libjson="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_libjson_c="yes"
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley if test -f "${use_libjson}/include/json/json.h"
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff libjson_cflags="-I${use_libjson}/include"
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence LIBS="$LIBS -L${use_libjson}/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_libjson="yes"
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff elif test -f "${use_libjson}/include/json-c/json.h"
8013077aa7ed5d6e1daddc973ddb3c7cc7d28df1Mark Andrews libjson_cflags="-I${use_libjson}/include"
8013077aa7ed5d6e1daddc973ddb3c7cc7d28df1Mark Andrews LIBS="$LIBS -L${use_libjson}/lib"
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff have_libjson="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_libjson_c="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([$use_libjson/include/json{,-c}/json.h not found.])
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graffif test "X${have_libjson}" != "X"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_SEARCH_LIBS([json_object_new_int64], [json json-c], [],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_ERROR([found libjson include but not library.])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews have_libjson=""])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewselif test "X$use_libjson" = Xyes
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_ERROR([include/json{,-c}/json.h not found.])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsif test "X${have_libjson}" != "X"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$CFLAGS $libjson_cflags"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_JSON, 1, [Define if libjson was found])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test "X${have_libjson_c}" = Xyes
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_DEFINE(HAVE_JSON_C, 1, [Define if json-c was found])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(JSONSTATS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# was --with-zlib specified?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for zlib library)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_ARG_WITH(zlib,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[ --with-zlib[=PATH] build with zlib for HTTP compression [[default=yes]] ],
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graff with_zlib="$withval", with_zlib="auto")
3024dbecbac365171bc6de0f3fa04951d6558be3Michael Graffcase "$with_zlib" in
fbcf7bc351f2d42d338cb1fa29e59babd9bee94eMichael Graff if test -f "${d}/include/zlib.h"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff if test ${d} != /usr
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater zlib_cflags="-I ${d}/include"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews LIBS="$LIBS -L${d}/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_zlib="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f "${with_zlib}/zlib.h"
5c024f787777143031c2c49f9811c39c84bfa259Tatuya JINMEI 神明達哉 zlib_cflags="-I${with_zlib}/include"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$LIBS -L${with_zlib}/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_zlib="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([$with_zlib/include/zlib.h not found.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X${have_zlib}" != "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_SEARCH_LIBS([deflate], [z], [],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_ERROR([found zlib include but not library.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_zlib=""])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterelif test "X$with_zlib" = Xyes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([include/zlib.h not found.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X${have_zlib}" != "X"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS $zlib_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib was found])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# In solaris 10, SMF can manage named service
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_LIB(scf, smf_enable_instance)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# flockfile is usually provided by pthreads, but we may want to use it
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# even if compiled with --disable-threads. getc_unlocked might also not
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# be defined.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# Indicate what the final decision was regarding threads.
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(whether to build with threads)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewsif $use_threads; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(no)
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews# End of pthreads stuff.
c965b1869024ab38518fade703cc1dae2d71a59eMark AndrewsAC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrews want_largefile="yes", want_largefile="no")
c965b1869024ab38518fade703cc1dae2d71a59eMark Andrewscase $want_largefile in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Additional compiler settings.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterMKDEPCFLAGS="-M"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterIRIX_DNSSEC_WARNINGS_HACK=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "X$GCC" = "Xyes"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater SAVE_CFLAGS="$CFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS -Werror -fno-strict-aliasing"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$SAVE_CFLAGS"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test "yes" = "$FNOSTRICTALIASING"; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews # turn off delete null pointer checks
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_CHECKING(if "$CC" supports -fno-delete-null-pointer-checks)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews SAVE_CFLAGS="$CFLAGS"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$CFLAGS -Werror -fno-delete-null-pointer-checks"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_TRY_COMPILE(,, [FNODELETENULLPOINTERCHECKS=yes],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [FNODELETENULLPOINTERCHECKS=no])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$SAVE_CFLAGS"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test "yes" = "$FNODELETENULLPOINTERCHECKS"; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case "$host" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test "X$enable_warn_shadow" = Xyes; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -Wshadow"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test "X$enable_warn_error" = Xyes; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -Werror"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews case $host in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CC="$CC -std"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CCOPT="$CCOPT -std"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -std"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CC="$CC -Ae -z"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # The version of the C compiler that constantly warns about
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # 'const' as well as alignment issues is unfortunately not
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews # able to be discerned via the version of the operating
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # system, nor does cc have a version flag.
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 case "`$CC +W 123 2>&1`" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *Unknown?option*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CWARNINGS="+w1"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews # Turn off the pointlessly noisy warnings.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CWARNINGS="+w1 +W 474,530,2193,2236"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCOPT="$CCOPT -Ae -z"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CCNOOPT="$CCNOOPT -Ae -z"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater STD_CWARNINGS="-fullwarn -woff 1209"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Silence more than 250 instances of
64574939c4a591a457bdd352f86375d6bb1d5435David Lawrence # "prototyped function redeclared without prototype"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # and 11 instances of
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # "variable ... was set but never used"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff MKDEPCFLAGS="-xM"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(MKDEPCC)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(MKDEPCFLAGS)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael GraffAC_SUBST(MKDEPPROG)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff# -lxnet buys us one big porting headache... standards, gotta love 'em.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt# AC_CHECK_LIB(xnet, socket, ,
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt# AC_CHECK_LIB(socket, socket)
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt# Use this for now, instead:
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater mips-sgi-irix*)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_CHECK_LIB(socket, socket)
3ac63b472022ff92691d1fe69ac715a729671965Michael Graff AC_CHECK_LIB(nsl, inet_addr)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# Work around Solaris's select() limitations.
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graffcase "$host" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews *-solaris2.[[89]]|*-solaris2.1?)
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff AC_DEFINE(FD_SETSIZE, 65536,
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [Solaris hack to get select_large_fdset.])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# Purify support
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(whether to use purify)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_ARG_WITH(purify,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [ --with-purify[=PATH] use Rational purify],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews use_purify="$withval", use_purify="no")
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase "$use_purify" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_PATH_PROG(purify_path, purify, purify)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews purify_path="$use_purify"
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrewscase "$use_purify" in
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT(no)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews if test -f $purify_path || test $purify_path = purify; then
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews AC_MSG_RESULT($purify_path)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PURIFYFLAGS="`echo $PURIFYOPTIONS`"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater PURIFY="$purify_path $PURIFYFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([$purify_path not found.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterPlease choose the proper path with the following command:
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater configure --with-purify=PATH
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(PURIFY)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews# Google/Great Performance Tools CPU Profiler
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_MSG_CHECKING(whether to use gperftools profiler)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(gperftools-profiler,
9a7d202077fae00fbdca610d8a8d90689e30f331Mark Andrews [ --with-gperftools-profiler use gperftools CPU profiler],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_profiler="$withval", use_profiler="no")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $use_profiler in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(yes)
f181f94ec8da8b1dbcc6353e8be965ea4a5ea282Michael Graff AC_DEFINE([HAVE_GPERFTOOLS_PROFILER], 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define to use gperftools CPU profiler.])
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff LIBS="$LIBS -lprofiler"
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# enable/disable dumping stack backtrace. Also check if the system supports
9b8057fce9ee7cdc39ad35f6e16d4ff5e623a941Mark Andrews# glibc-compatible backtrace() function.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(backtrace,
9b8057fce9ee7cdc39ad35f6e16d4ff5e623a941Mark Andrews[ --enable-backtrace log stack backtrace on abort [[default=yes]]],
9b8057fce9ee7cdc39ad35f6e16d4ff5e623a941Mark Andrews want_backtrace="$enableval", want_backtrace="yes")
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graffcase $want_backtrace in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_LINK([#include <execinfo.h>],
ad3a5c4b7e21af04d1b872f933c2e19e5c0a135bMichael Graff [return (backtrace((void **)0, 0));],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
ca50fa02308a99f5f30b4fac892a75f8ea2fd38bAndreas GustafssonAC_SUBST(ISC_PLATFORM_USEBACKTRACE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(symtable,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ --enable-symtable use internal symbol table for backtrace
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [[all|minimal(default)|none]]],
ca50fa02308a99f5f30b4fac892a75f8ea2fd38bAndreas Gustafsson want_symtable="$enableval", want_symtable="minimal")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $want_symtable in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updateryes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "" = "$PERL"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterInstall perl or explicitly disable the feature by --disable-symtable.])
59c049874bbef182857c57bd9cca292898921c69Bob Halley if test "yes" = "$use_libtool"; then
59c049874bbef182857c57bd9cca292898921c69Bob Halley AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # we generate the internal symbol table only for those systems
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # known to work to avoid unexpected build failure. Also, warn
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # about unsupported systems when the feature is enabled
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case $host_os in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater MKSYMTBL_PROGRAM="$PERL"
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence if test $want_symtable = all; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ALWAYS_MAKE_SYMTABLE="yes"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test $want_symtable = yes -o $want_symtable = all
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(MKSYMTBL_PROGRAM)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ALWAYS_MAKE_SYMTABLE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# File name extension for static archive files, for those few places
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# where they are treated differently from dynamic ones.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LIBTOOL_MKDEP_SED)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(LIBTOOL_MODE_COMPILE)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(LIBTOOL_MODE_INSTALL)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(LIBTOOL_MODE_LINK)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(LIBTOOL_MODE_UNINSTALL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
59c049874bbef182857c57bd9cca292898921c69Bob HalleyAC_SUBST(LIBTOOL_IN_MAIN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterBIND9_CO_RULE=".c.$O:"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(BIND9_CO_RULE)
59c049874bbef182857c57bd9cca292898921c69Bob Halley# Here begins a very long section to determine the system's networking
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# capabilities. The order of the tests is significant.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(ipv6,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --enable-ipv6 use IPv6 [default=autodetect]])
59c049874bbef182857c57bd9cca292898921c69Bob Halleycase "$enable_ipv6" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater yes|''|autodetect)
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff AC_DEFINE(WANT_IPV6)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# We do the IPv6 compilation checking after libtool so that we can put
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff# the right suffix on the files.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for IPv6 structures)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct sockaddr_in6 sin6; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews found_ipv6=yes],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater found_ipv6=no])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# See whether IPv6 support is provided via a Kame add-on.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# This is done before other IPv6 linking tests to LIBS is properly set.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for Kame IPv6 support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(kame,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_kame="$withval", use_kame="no")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_kame" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater kame_path="$use_kame"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_kame" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f $kame_path/lib/libinet6.a; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="-L$kame_path/lib -linet6 $LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterPlease choose the proper path with the following command:
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater configure --with-kame=PATH
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Including it on Kame-using platforms is very bad, though, because
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Kame uses #error against direct inclusion. So include it on only
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# This is done before the in6_pktinfo check because that's what
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterchangequote({, })
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater isc_netinet6in6_hack="#include <netinet6/in6.h>"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews isc_netinet6in6_hack=""
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewschangequote([, ])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# This is similar to the netinet6/in6.h issue.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater isc_netinetin6_hack="#include <netinet/in6.h>"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater isc_netinetin6_hack=""
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Now delve deeper into the suitability of the IPv6 support.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$found_ipv6" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for in6_addr)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct in6_addr in6; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater isc_in_addr6_hack=""],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater isc_in_addr6_hack="#define in6_addr in_addr6"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for in6addr_any)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_in_addr6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for in6addr_loopback)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_in_addr6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_COMPILE([
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_HAVE_SIN6_SCOPE_ID="$result"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING(for in6_pktinfo)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [struct in6_pktinfo xyzzy; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
ea6228c9ce45dafa26e4cd79d71629c8ba5cd7c7Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
ff9bb3fc5453bbf310b67c560fbf04a5c0fb60daMichael Graff [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_IPV6_O="ipv6.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_ISCIPV6_O="unix/ipv6.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for struct sockaddr_storage)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinetin6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater$isc_netinet6in6_hack
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct sockaddr_storage storage; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEIPV6)
294802790e8030f1c19b6c2c5d5204b6f464c729Michael GraffAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
4a3ad0da975d7115d401700f955814a0dff1adb0Bob HalleyAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_IPV6_H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_IPV6_O)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_ISCIPV6_O)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_IPV6_C)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING([for struct if_laddrreq])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews],[ struct if_laddrreq a; ],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING([for struct if_laddrconf])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews],[ struct if_laddrconf a; ],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for network functions that are often missing. We do this
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# after the libtool checking, so we can put the right suffix on
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# the files. It also needs to come after checking for a Kame add-on,
dec90b6caef758fe2890ee50db148cff6acffb90Michael Graff# which provides some (all?) of the desired functions.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING([for inet_ntop with IPv6 support])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterchar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(assuming inet_ntop not needed)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# addresses with less than four octets, like "1.2.3". Also leading
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# zeros should also be rejected.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING([for working inet_pton with IPv6 support])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatermain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
439c0011e642fb1d26011116144af698125262dbMichael Graff [AC_MSG_RESULT(assuming inet_pton needed)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDNTOP)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDPTON)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for a 4.4BSD-style sa_len member in struct sockaddr.
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graffcase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Turn on 4.4BSD style sa_len support.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(_SOCKADDR_LEN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for sa_len in struct sockaddr)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct sockaddr sa; sa.sa_len = 0; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESALEN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_HAVESALEN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for a 4.4BSD or 4.3BSD struct msghdr
439c0011e642fb1d26011116144af698125262dbMichael GraffAC_MSG_CHECKING(for struct msghdr flavor)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
66bd3b3c6b171271c705b897823dcdcf29464698Michael Graff[struct msghdr msg; msg.msg_flags = 0; return (0);],
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence [AC_MSG_RESULT(4.4BSD)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(4.3BSD)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for in_port_t.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for type in_port_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[in_port_t port = 25; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDPORTT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for TCP_FASTOPEN
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for TCP_FASTOPEN socket option)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_EGREP_CPP(has_tfo, [
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater#ifdef TCP_FASTOPEN
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterint has_tfo() { return (0); }
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVETFO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for addrinfo
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for struct addrinfo)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct addrinfo a; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_ADDRINFO)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_NEEDADDRINFO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_IRS_NEEDADDRINFO)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff# Check for rrsetinfo
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrenceAC_MSG_CHECKING(for struct rrsetinfo)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[struct rrsetinfo r; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for int sethostent)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[int i = sethostent(0); return(0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_SETHOSTENTINT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for int endhostent)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[int i = endhostent(); return(0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterstruct netent *getnetbyaddr(in_addr_t, int);],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff [AC_MSG_RESULT(yes)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for int setnetent)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[int i = setnetent(0); return(0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_SETNETENTINT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for int endnetent)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[int i = endnetent(); return(0);],
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff [AC_MSG_RESULT(yes)
897c9ddb4d745b2bfecf98b17e5487bb6656299aMichael Graff ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff [AC_MSG_RESULT(no)
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_LWRES_ENDNETENTINT)
dd95acdbce0e2a2775391709cdfca0a9eda7e8f7Mark AndrewsAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graffstruct hostent *gethostbyaddr(const void *, size_t, int);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for h_errno in netdb.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[h_errno = 1; return(0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
dd95acdbce0e2a2775391709cdfca0a9eda7e8f7Mark Andrews ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_NEEDHERRNO)
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff# Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff# known variations here:
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for getnameinfo prototype definitions)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafssonint getnameinfo(const struct sockaddr *, socklen_t, char *,
dd95acdbce0e2a2775391709cdfca0a9eda7e8f7Mark Andrews socklen_t, char *, socklen_t, unsigned int);],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews[ return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define to the sockaddr length type used by getnameinfo(3).])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
7c19754baccc946eb655f49b6981fe6c0d478dfaMark Andrews [Define to the buffer length type used by getnameinfo(3).])
7c19754baccc946eb655f49b6981fe6c0d478dfaMark Andrews AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
7c19754baccc946eb655f49b6981fe6c0d478dfaMark Andrews [Define to the flags type used by getnameinfo(3).])],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterint getnameinfo(const struct sockaddr *, socklen_t, char *,
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews size_t, char *, size_t, int);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ return (0);],
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews [AC_MSG_RESULT(size_t for buflen; int for flags)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterint getnameinfo(const struct sockaddr *, size_t, char *,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater size_t, char *, size_t, int);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(size_t for buflen; int for flags)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, size_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(not match any subspecies; assume standard definition)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# ...and same for gai_strerror().
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for gai_strerror prototype definitions)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterchar *gai_strerror(int ecode);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ return (0); ],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(returning char *)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [return type of gai_strerror])],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(not match any subspecies; assume standard definition)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(getipnodebyname,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(getnameinfo,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(getaddrinfo,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_GETADDRINFO)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(getifaddrs,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ --enable-getifaddrs enable the use of getifaddrs() [[yes|no]].],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater want_getifaddrs="$enableval", want_getifaddrs="yes")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# This interface iteration code for getifaddrs() will fall back to using
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $want_getifaddrs in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark AndrewsAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
64828244e04e86dfa40f0a4f0c05f27923da499dMichael GraffAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for a sysctl call to get the list of network interfaces.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $ac_cv_header_sys_sysctl_h in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for interface list sysctl)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_EGREP_CPP(found_rt_iflist, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews#ifdef NET_RT_IFLIST
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewsfound_rt_iflist
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_DEFINE(HAVE_IFLIST_SYSCTL)],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for some other useful functions that are not ever-present.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# reportedly defines strsep() without declaring it in <string.h> when
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafsson# AC_CHECK_FUNC() incorrectly succeeds because it declares
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafsson# the function itself.
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael GraffAC_MSG_CHECKING(for correctly declared strsep())
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrenceAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(memmove,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(strtoul,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater GENRANDOMLIB=""],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater GENRANDOMLIB='${ISCLIBS}'])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(GENRANDOMLIB)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(strlcpy,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDSTRLCPY="#undef LWRES_PLATFORM_NEEDSTRLCPY"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDSTRLCPY="#define LWRES_PLATFORM_NEEDSTRLCPY 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDSTRLCPY)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(strlcat,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(strcasestr,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRCASESTR="#undef ISC_PLATFORM_NEEDSTRCASESTR"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PLATFORM_NEEDSTRCASESTR="#define ISC_PLATFORM_NEEDSTRCASESTR 1"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSTRCASESTR)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(READLINE_LIB)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(readline,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --with-readline[=LIBSPEC] specify readline library [default auto]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_readline="$withval", use_readline="auto")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$use_readline" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_LIBS="$LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$use_readline" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael Graff *) try_readline="$use_readline"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff for readline in "$try_readline" $or_readline
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$readline"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff AC_MSG_NOTICE(checking for readline with $readline)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNCS(readline)
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff if test "yes" = "$ac_cv_func_readline"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater READLINE_LIB="$readline"
64828244e04e86dfa40f0a4f0c05f27923da499dMichael Graff for lib in -lterminfo -ltermcap -lncurses -lcurses
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_NOTICE(checking for readline with $readline $lib)
5fca48054b5e791a2fa0c5015bc3b6fef4fcdce1Andreas Gustafsson unset ac_cv_func_readline
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LIBS="$readline $lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNCS(readline)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$ac_cv_func_readline"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater READLINE_LIB="$readline $lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "yes" = "$ac_cv_func_readline"
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence if test "$use_readline" != "auto" &&
5d0984f4fd3133c869b0736adb5291e6fca34a0cTatuya JINMEI 神明達哉 test "X$READLINE_LIB" = "X"
517274e709a3c730cd42f37dc1260dde95d1ea38Michael Graff AC_MSG_ERROR([The readline library was not found.])
59e22acc4f79ff481f7bfa46ef0558957ae53cfcMichael Graff LIBS="$saved_LIBS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test yes = "$ac_cv_func_readline"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$READLINE_LIB" in
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff AC_CHECK_HEADERS(editline/readline.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(readline/readline.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(readline/history.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PRINT_OBJS=
86944a4c8002e80ae9b6eb5a5e29b797879be45fMichael GraffISC_PRINT_SRCS=
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffISC_PLATFORM_NEEDPRINTF='#undef ISC_PLATFORM_NEEDPRINTF'
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffISC_PLATFORM_NEEDFPRINTF='#undef ISC_PLATFORM_NEEDFPRINTF'
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrenceISC_PLATFORM_NEEDSPRINTF='#undef ISC_PLATFORM_NEEDSPRINTF'
d8590892d10fc9528b0dde7e2781935e7b8d7a87Michael GraffISC_PLATFORM_NEEDVSNPRINTF='#undef ISC_PLATFORM_NEEDVSNPRINTF'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterLWRES_PLATFORM_NEEDVSNPRINTF='#undef LWRES_PLATFORM_NEEDVSNPRINTF'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(sprintf return type)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[ char buf[2]; return(*sprintf(buf,"x"));],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(char *)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PRINT_OBJS="print.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PRINT_SRCS="print.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater],[AC_MSG_RESULT(int)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(vsnprintf, [],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ISC_PRINT_OBJS="print.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PRINT_SRCS="print.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉AC_MSG_CHECKING(printf for %z support)
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 char buf[100];
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 sprintf(buf, "%zu", j);
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 exit(strcmp(buf, "0") != 0);
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 [AC_MSG_RESULT(yes)],
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 [AC_MSG_RESULT(no)
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 ISC_PRINT_OBJS="print.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PRINT_SRCS="print.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDPRINTF='#define ISC_PLATFORM_NEEDPRINTF 1'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDFPRINTF='#define ISC_PLATFORM_NEEDFPRINTF 1'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDFSRINTF='#define ISC_PLATFORM_NEEDSPRINTF 1'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(assuming target platform supports %z)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDFPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_EXTRA_OBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_EXTRA_SRCS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Use our own SPNEGO implementation?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(isc-spnego,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --disable-isc-spnego use SPNEGO from GSSAPI library])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test -n "$USE_GSSAPI"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$enable_isc_spnego" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(using SPNEGO from lib/dns)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_RESULT(using SPNEGO from GSSAPI library)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(USE_ISC_SPNEGO)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DST_EXTRA_OBJS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DST_EXTRA_SRCS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Determine the printf format characters to use when printing
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# values of type isc_int64_t. This will normally be "ll", but where
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# the compiler treats "long long" as a alias for "long" and printf
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# doesn't know about "long long" use "l". Hopefully the sprintf
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# will produce a inconsistent result in the later case. If the compiler
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# fails due to seeing "%lld" we fall back to "l".
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# %ld even for (long long)/
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Win32 uses "%I64d", but that's defined elsewhere since we don't use
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# configure on Win32.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(printf format modifier for 64-bit integers)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater long long int j = 0;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater char buf[100];
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater sprintf(buf, "%lld", j);
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater exit((sizeof(long long int) != sizeof(long int))? 0 :
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater (strcmp(buf, "0") != 0));
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(ll)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(l)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(assuming target platform uses ll)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_QUADFORMAT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Security Stuff
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Note it is very recommended to *not* disable chroot(),
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# this is only because chroot() was made obsolete by Posix.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(chroot,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --disable-chroot disable chroot])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_chroot" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNCS(chroot)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(linux-caps,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --disable-linux-caps disable linux capabilities])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_linux_caps" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(linux/types.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS([sys/capability.h])
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff AC_CHECK_HEADERS([linux/capability.h], [], [],
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff [#ifdef HAVE_LINUX_TYPES_H
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_LIB(cap, cap_set_proc)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_HEADERS(sys/prctl.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_HEADERS(sys/un.h,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESYSUNH)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if connect does not honour the permission on the UNIX domain socket.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if connect does not honour the permission on the UNIX domain socket.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Time Zone Stuff
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for optarg declaration)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
f2d09cd90d63ea6842a7d4a2bfacb0d89be47d1cMark Andrews[optarg = 0;],
f2d09cd90d63ea6842a7d4a2bfacb0d89be47d1cMark Andrews[AC_MSG_RESULT(yes)],
f2d09cd90d63ea6842a7d4a2bfacb0d89be47d1cMark Andrews[AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterGEN_NEED_OPTARG="-DNEED_OPTARG=1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for nanoseconds in file stats
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([#include <sys/fcntl.h>],[struct stat s; return(s.st_mtim.tv_nsec);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESTATNSEC)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# BSD/OS, and perhaps some others, don't define rlim_t.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(for type rlim_t)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_TRY_COMPILE([
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉[rlim_t rl = 19671212; return (0);],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_CHECKING(type of rlim_cur)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatermain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(int)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatermain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(long int)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatermain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_RESULT(long long int)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews],[AC_MSG_ERROR(this cannot happen)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater],[AC_MSG_ERROR(this cannot happen)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_WITH(rlimtype, , rlimtype="$withval", rlimtype="long long int")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE $rlimtype"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming $rlimtype)])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Older HP-UX doesn't have gettune
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_HEADERS(sys/dyntune.h)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Compaq TruCluster requires more code for handling cluster IP aliases
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_FUNC(clua_getaliasaddress,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_TRUCLUSTER, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if running under Compaq TruCluster]))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Some hosts need msg_namelen to match the size of the socket structure.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Some hosts don't set msg_namelen appropriately on return from recvmsg().
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*os2*|*hp-mpeix*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(BROKEN_RECVMSG, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define if recvmsg() does not meet all of the BSD socket API specifications.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Microsoft has their own way of handling shared libraries that requires
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# additional qualifiers on extern variables. Unix systems don't need it.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark AndrewsISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(IRS_PLATFORM_USEDECLSPEC)
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark AndrewsIRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Random remaining OS-specific issues involving compiler warnings.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# XXXDCL print messages to indicate some compensation is being done?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halleycase "$host" in
4abed3e3563c7ad346178433130e6d150d3ffeafBob Halley *-aix5.[[123]].*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater hack_shutup_pthreadonceinit=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater hack_shutup_sputaux=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater hack_shutup_sigwait=yes
528829aa8ad69238e674cd81078bc14d4199691bMichael Graff hack_shutup_sputaux=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [*-bsdi4.[12]*])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater hack_shutup_stdargcast=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [*-solaris2.[89]])
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff hack_shutup_pthreadonceinit=yes
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff *-solaris2.1[[0-9]])
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$hack_shutup_pthreadonceinit" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$hack_shutup_sigwait" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Shut up a -Wmissing-prototypes warning for sigwait().
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(SHUTUP_SIGWAIT)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$hack_shutup_sputaux" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Shut up a -Wmissing-prototypes warning from <stdio.h>.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(SHUTUP_SPUTAUX)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$hack_shutup_stdargcast" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # Shut up a -Wcast-qual warning from va_start().
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(SHUTUP_STDARG_CAST)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_HEADERS(strings.h,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Check for if_nametoindex() for IPv6 scoped addresses support
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ac_cv_have_if_nametoindex=no)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $ac_cv_have_if_nametoindex in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_CHECK_LIB(ipv6, if_nametoindex,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ac_cv_have_if_nametoindex=yes
ddad35552931651426ad70912d29d9ab7d2a8d80Automatic Updater LIBS="-lipv6 $LIBS",)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase $ac_cv_have_if_nametoindex in
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
1c3bc66ada38236cc81c41b7174a9f0a872c9ab6Michael Graff [Define to 1 if you have the if_nametoindex function.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
e883738546c7c73b761bce8a15e08661863d3ae1Michael GraffAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
e883738546c7c73b761bce8a15e08661863d3ae1Michael GraffAC_CHECK_FUNCS(nanosleep usleep)
f58cfa95f77ae2c26847b41c731dc17366e273b2Andreas Gustafsson# Machine architecture dependent features
14b98cb34eda66c87ce41a207704a2c232280eafMichael GraffAC_ARG_ENABLE(atomic,
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff [ --enable-atomic enable machine specific atomic operations
bcf369e513a1cc2209e2a987f5772afa79813540Mark Andrews [[default=autodetect]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_atomic="$enableval",
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff enable_atomic="autodetect")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_atomic" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater yes|''|autodetect)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater case "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater powerpc-ibm-aix*)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$GCC" = "Xyes"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([if asm("isc"); works])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_TRY_COMPILE(,[
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater main() { asm("ics"); exit(0); }
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT(yes)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_atomic=yes],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater saved_cflags="$CFLAGS"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS -Wa,-many"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater main() { asm("ics"); exit(0); }
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT([yes, required -Wa,-many])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_atomic=yes],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT([no, use_atomic disabled])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$saved_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_atomic=no],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [AC_MSG_RESULT([cross compile, assume yes])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$saved_cflags"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_atomic=yes])
fd447061627e77db3ccf2536e14134e50647b9beMark Andrews use_atomic=yes
f36a81c88493985ee2d1c53cc6fe88f4b00dbbc8Michael Graff use_atomic=yes
beb2b4f19624af46230a8e3df97e54d6c596573eMichael Graff use_atomic=no
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM"
beb2b4f19624af46230a8e3df97e54d6c596573eMichael GraffISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "yes" = "$use_atomic"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater have_atomic=yes # set default
beb2b4f19624af46230a8e3df97e54d6c596573eMichael Graff case "$host" in
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [i[3456]86-*])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # XXX: some old x86 architectures actually do not support
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # (some of) these operations. Do we need stricter checks?
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_CHECK_SIZEOF([void *])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if test $ac_cv_sizeof_void_p = 8; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_xaddq=yes
166c4c6c5bafd25283b797979f77d780856fef30Evan Hunt x86_64-*|amd64-*)
beb2b4f19624af46230a8e3df97e54d6c596573eMichael Graff AC_CHECK_SIZEOF([void *])
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews if test $ac_cv_sizeof_void_p = 8; then
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews have_xaddq=yes
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater powerpc-*|powerpc64-*)
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews mips-*|mipsel-*|mips64-*|mips64el-*)
4f6dd51441290a9feacbe62991a2cdfdc7554e8bMichael Graff have_atomic=no
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews AC_MSG_CHECKING([architecture type for atomic operations])
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews AC_MSG_RESULT($arch)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "yes" = "$have_atomic"; then
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_MSG_CHECKING([compiler support for inline assembly code])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater compiler=generic
4f6dd51441290a9feacbe62991a2cdfdc7554e8bMichael Graff # Check whether the compiler supports the assembly syntax we provide.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test "X$GCC" = "Xyes"; then
4f6dd51441290a9feacbe62991a2cdfdc7554e8bMichael Graff # GCC's ASM extension always works
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley compiler=gcc
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if test $arch = "x86_64"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # We can share the same code for gcc with x86_32
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if test $arch = "powerpc"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # The MacOS (and maybe others) uses "r0" for register
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # zero. Under linux/ibm it is "0" for register 0.
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # Probe to see if we have a MacOS style assembler.
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_COMPILE(, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews __asm__ volatile ("li r0, 0x0\n"::);
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews compiler="mac"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ], [AC_MSG_RESULT(no)])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews case "$host" in
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews alpha*-dec-osf*)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # Tru64 compiler has its own syntax for inline
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_COMPILE(, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews#ifndef __DECC
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews#error "unexpected compiler"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews return (0);],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [compiler=osf],)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews powerpc-ibm-aix*)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews compiler=aix
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews case "$compiler" in
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # See if the generic __asm function works. If not,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews # we need to disable the atomic operations.
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_LINK(, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews __asm("nop")
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [compiler="standard"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [compiler="not supported (atomic operations disabled)"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_atomic=no
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews arch=noatomic ]);
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT($compiler)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewsif test "yes" = "$have_atomic"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews if test "yes" = "$have_xaddq"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEATOMICSTOREQ="#define ISC_PLATFORM_HAVEATOMICSTOREQ 1"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEATOMICSTOREQ="#undef ISC_PLATFORM_HAVEATOMICSTOREQ"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_HAVEATOMICSTOREQ="#undef ISC_PLATFORM_HAVEATOMICSTOREQ"
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEXADD)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEXADDQ)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEATOMICSTOREQ)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_USEGCCASM)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_USEOSFASM)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_USESTDASM)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_USEMACASM)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsISC_ARCH_DIR=$arch
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_ARCH_DIR)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews# Check for __builtin_expect
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_MSG_CHECKING([compiler support for __builtin_expect])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_TRY_LINK(, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews return (__builtin_expect(1, 1) ? 1 : 0);
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_builtin_expect=yes
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_builtin_expect=no
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(no)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewsif test "yes" = "$have_builtin_expect"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews# Check for __builtin_clz
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_MSG_CHECKING([compiler support for __builtin_clz])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_TRY_LINK(, [
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews return (__builtin_clz(0xff) == 24 ? 1 : 0);
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_builtin_clz=yes
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews have_builtin_clz=no
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_RESULT(no)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewsif test "yes" = "$have_builtin_clz"; then
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews# CPU relax (for spin locks)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewsif $use_threads
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews case "$host" in
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [i[3456]86-*])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([if asm("rep; nop"); works])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_COMPILE(,[asm("rep; nop");],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(no)],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT([cross compile, assume yes])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews x86_64-*|amd64-*)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([if asm("rep; nop"); works])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_COMPILE(,[asm("rep; nop");],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(no)],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT([cross compile, assume yes])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([if asm("hint @pause"); works])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_TRY_COMPILE(,[asm("hint @pause");],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(no)],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT([cross compile, assume yes])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_MSG_CHECKING([if cpu_relax(); or __cpu_relax(); works])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_CHECK_FUNC(cpu_relax,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP cpu_relax()"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_CHECK_FUNC(__cpu_relax,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(yes)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP __cpu_relax()"],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [AC_MSG_RESULT(no)])])
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_SUBST(ISC_PLATFORM_BUSYWAITNOP)
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews# Activate "rrset-order fixed" or not?
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark AndrewsAC_ARG_ENABLE(fixed-rrset,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [ --enable-fixed-rrset enable fixed rrset ordering [[default=no]]],
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews enable_fixed="$enableval",
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews enable_fixed="no")
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrewscase "$enable_fixed" in
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews AC_DEFINE(DNS_RDATASET_FIXED, 1,
8e15d5eb3a000f1341e6bea0ddbc28d6dd2a0591Mark Andrews [Define to enable "rrset-order fixed" syntax.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Enable response policy rewriting using NS IP addresses
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(rpz-nsip,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --disable-rpz-nsip disable rpz-nsip rules [[default=enabled]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_nsip="$enableval",
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_nsip="yes")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_nsip" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(ENABLE_RPZ_NSIP, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define to enable rpz-nsip rules.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Enable response policy rewriting using NS name
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(rpz-nsdname,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --disable-rpz-nsdname disable rpz-nsdname rules [[default=enabled]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_nsdname="$enableval",
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_nsdname="yes")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_nsdname" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Define to enable rpz-nsdname rules.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Activate "filter-aaaa-on-v4/v6" or not?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(filter-aaaa,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [ --enable-filter-aaaa enable filtering of AAAA records [[default=no]]],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_filter="$enableval",
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater enable_filter="no")
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$enable_filter" in
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley AC_DEFINE(ALLOW_FILTER_AAAA, 1,
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley [Define to enable the "filter-aaaa-on-v4" and "filter-aaaa-on-v6" options.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Activate dnstap?
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_PATH_PROG(FSTRM_CAPTURE, fstrm_capture)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_ARG_ENABLE(dnstap,
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 [ --enable-dnstap enable dnstap support (requires fstrm, protobuf-c)],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley use_dnstap=$enableval,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater use_dnstap=no)
a44c12b332b867f29631e235eb11d1263c73d6c0Bob HalleyDNSTAP_PB_C_H=
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updaterif test "x$use_dnstap" != "xno"; then
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 if ! $use_threads; then
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence AC_MSG_ERROR([Dnstap requires threads.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_PATH_PROG([PROTOC_C], [protoc-c])
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley if test -z "$PROTOC_C"; then
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews AC_MSG_ERROR([The protoc-c program was not found.])
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews AC_ARG_WITH([protobuf-c],
ee2f98d5cf12c86e7590efcdf6725ab133a430f3Mark Andrews AC_HELP_STRING([--with-protobuf-c=path],
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley [Path where protobuf-c is installed, for dnstap]), [
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉 # workaround for protobuf-c includes at old dir
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley # before protobuf-c-1.0.0
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f $withval/include/google/protobuf-c/protobuf-c.h
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS -I$withval/include/google"
45dadd25ba4b72ec2d8eecc342edc787d8421e3aBob Halley CFLAGS="$CFLAGS -I$withval/include"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LDFLAGS="$LDFLAGS -L$withval/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # workaround for protobuf-c includes at old dir
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater # before protobuf-c-1.0.0
a44c12b332b867f29631e235eb11d1263c73d6c0Bob Halley if test -f /usr/include/google/protobuf-c/protobuf-c.h
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington CFLAGS="$CFLAGS -I/usr/include/google"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater CFLAGS="$CFLAGS -I/usr/local/include/google"
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington LDFLAGS="$LDFLAGS -L/usr/local/lib"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_ARG_WITH([libfstrm], AC_HELP_STRING([--with-libfstrm=path],
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Path where libfstrm is installed, for dnstap]), [
82f77687abd21349fa7c7f51e71fdc0c7367d2e2Mark Andrews CFLAGS="$CFLAGS -I$withval/include"
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater LDFLAGS="$LDFLAGS -L$withval/lib"
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington DNSTAP=dnstap
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews DNSTAPSRCS='${DNSTAPSRCS}'
1e4bfff1855795853648f507422b96fc8fecbff1Mark Andrews DNSTAPOBJS='${DNSTAPOBJS}'
1e4bfff1855795853648f507422b96fc8fecbff1Mark Andrews DNSTAPTARGETS='${DNSTAPTARGETS}'
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DNSTAP)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DNSTAPSRCS)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_SUBST(DNSTAPOBJS)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_SUBST(DNSTAPTARGETS)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(DNSTAP_PB_C_H)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# The following sets up how non-blocking i/o is established.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Sunos, cygwin and solaris 2.x (x<5) require special handling.
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updatercase "$host" in
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*-solaris2.[[01234]])
c82bb6a709abe89c051485b49403ef5bad1b756cTatuya JINMEI 神明達哉 AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater AC_DEFINE(USE_FIONBIO_IOCTL, 1,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# This prevents the source address being set.
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Huntcase "$host" in
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt*-solaris2.[[012345]]|*-solaris2.5.1)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt [Define if you cannot bind() before connect() for TCP sockets.])
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# The following sections deal with tools used for formatting
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# the documentation. They are all optional, unless you are
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# a developer editing the documentation source.
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan Hunt# Look for TeX.
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_PATH_PROGS(LATEX, latex, latex)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_SUBST(LATEX)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_SUBST(PDFLATEX)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_PATH_PROGS(DBLATEX, dblatex, dblatex)
9fa5a723e188ddb5e6165af4957ba789e17cfdf5Evan HuntAC_SUBST(DBLATEX)
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews# Look for w3m
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉AC_PATH_PROGS(W3M, w3m, w3m)
27fe1966c948ba0c1c9d0d831ea3d8bf32d052acTatuya JINMEI 神明達哉# Look for xsltproc (libxslt)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic UpdaterAC_SUBST(XSLTPROC)
5f1f24822fabe7b78af5f81553bfc11a170326c3Mark Andrews# Look for xmllint (libxml2)
081cff0c33514a5dc63ab794fc199c07377ab756Mark AndrewsAC_PATH_PROG(XMLLINT, xmllint, xmllint)
081cff0c33514a5dc63ab794fc199c07377ab756Mark AndrewsAC_SUBST(XMLLINT)
2a184ff86544cc67c36e2ce6bb3ddb5ac44684b8Evan Hunt# Look for Doxygen
081cff0c33514a5dc63ab794fc199c07377ab756Mark AndrewsAC_PATH_PROG(DOXYGEN, doxygen, doxygen)
f3350b671881f175d03e16fa5d0f685a1691bcabMark AndrewsAC_SUBST(DOXYGEN)
f172f06ff2e7609dd7d91914a44b4e24cff8bb7aAutomatic Updater# Look for curl
f3350b671881f175d03e16fa5d0f685a1691bcabMark AndrewsAC_PATH_PROG(CURL, curl, curl)
081cff0c33514a5dc63ab794fc199c07377ab756Mark Andrews# Subroutine for searching for an ordinary file (e.g., a stylesheet)
docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook-ns /usr/local/share/xsl/docbook /usr/share/xsl/docbook /opt/local/share/xsl/docbook-xsl /usr/share/xml/docbook/stylesheet/docbook-xsl"
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
dblatex_xsl_trees="/usr/local/share/xml/docbook/stylesheet/dblatex /usr/pkg/share/xml/docbook/stylesheet/dblatex /usr/share/xml/docbook/stylesheet/dblatex"
NOM_PATH_FILE(XSLT_DBLATEX_STYLE, xsl/docbook.xsl, $dblatex_xsl_trees)
NOM_PATH_FILE(XSLT_DBLATEX_FASTBOOK, xsl/latex_book_fast.xsl, $dblatex_xsl_trees)
idn_path=/usr/local
STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
atf=`pwd`/unit/atf
mkdir -p unit/atf-src;
cd unit/atf-src;
${SHELL} "${srcdir}${srcdir:+/unit/atf-src/}./configure" --enable-tools --disable-shared MISSING=: --prefix $atfdir;
[atfdir=`pwd`/unit/atf])
AC_MSG_RESULT(building ATF from bind9/unit/atf-src)
STD_CINCLUDES="$STD_CINCLUDES -I$atf/include"
ATFBIN="$atf/bin"
ATFLIBS="-L$atf/lib -latf-c"
AC_CHECK_HEADERS(locale.h)
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include"
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
. "$srcdir/version"
BIND9_VERSION="${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
BIND9_VERSIONSTRING="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}${DESCRIPTION:+ }${DESCRIPTION}"
BIND9_VERSIONSHORT="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
LIBISC_API="$srcdir/lib/isc/api"
LIBISCCC_API="$srcdir/lib/isccc/api"
LIBISCCFG_API="$srcdir/lib/isccfg/api"
LIBDNS_API="$srcdir/lib/dns/api"
LIBDNS_MAPAPI="$srcdir/lib/dns/mapapi"
LIBBIND9_API="$srcdir/lib/bind9/api"
LIBLWRES_API="$srcdir/lib/lwres/api"
LIBIRS_API="$srcdir/lib/irs/api"
# If config.dlz.in selects one or more DLZ drivers, it will set
sinclude(contrib/dlz/config.dlz.in)
DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
DLZ_DRIVER_RULES=/dev/null
# Commands to run at the end of config.status.
# runs config.status directly (which autoconf allows).
echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
test "X$NZD_TOOLS" = "X" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
test "$use_dlz_bdb $use_dlz_ldap $use_dlz_mysql $use_dlz_odbc $use_dlz_postgres $use_dlz_filesystem $use_dlz_stub" = "no no no no no no no" && echo " None"
echo " OpenSSL cryptography/DNSSEC (--with-openssl)"