9eb24f1f84885d5c2e51a7f675264db398c31af7Tinderbox User# Copyright (C) 1998-2018 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark AndrewsAC_DIVERT_PUSH(1)dnl
bff64bf12b58a6f80e740e94f2e42a32df18113aEvan Huntesyscmd([sed -e 's/^/# /' -e '/Portions of this code/,$d' COPYRIGHT])dnl
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid LawrenceAC_DIVERT_POP()dnl
2baa66562a2f119edffded961d3391f87ff98ec0Ondřej SurýAC_INIT(BIND, [9.11], [info@isc.org], [], [https://www.isc.org/downloads/BIND/])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_PREREQ(2.59)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyAC_CONFIG_HEADER(config.h)
63dd46733010bb9622810faa17d88c3e3c28b730Mark AndrewsAC_CONFIG_MACRO_DIR([libtool.m4])
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyAC_CANONICAL_HOST
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_PROG_MAKE_SET
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews# GNU libtool support
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrewscase $build_os in
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews # Just set the maximum command line length for sunos as it otherwise
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews # takes a exceptionally long time to work it out. Required for libtool.
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews lt_cv_sys_max_cmd_len=4096;
914eeb33149a0008e26741d9e7d89dcd6f8b6d0bMark AndrewsAC_PROG_LIBTOOL
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_PROG_INSTALL
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CINCLUDES)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CDEFINES)
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael GraffAC_SUBST(STD_CWARNINGS)
3d776d762914d1b675b4fd49728ce353ccf6f77eBrian WellingtonAC_SUBST(CCOPT)
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan HuntAC_SUBST(CCNOOPT)
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark AndrewsAC_SUBST(BACKTRACECFLAGS)
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews# Warn if the user specified libbind, which is now deprecated
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(libbind, AS_HELP_STRING([--enable-libbind], [deprecated]))
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrewscase "$enable_libbind" in
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark AndrewsIt is available from http://www.isc.org as a separate download.])
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark AndrewsAC_ARG_ENABLE(buffer_useinline, AS_HELP_STRING([--enable-buffer-useinline],
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews [define ISC_BUFFER_USEINLINE when compiling [[default=yes]]]),
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews if test yes = "${enable}"
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews [Define if you want to use inline buffers])
31c7ab4fb3f7710af87dc9c3d64c5daf9a3dea35Mark Andrews AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(warn_shadow,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-warn-shadow],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [turn on -Wshadow when compiling]))
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(warn_error,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-warn-error],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [turn on -Werror when compiling]))
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(developer,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-developer],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable developer build settings]))
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrewscase "$enable_developer" in
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews STD_CDEFINES="$STD_CDEFINES -DISC_LIST_CHECKINIT=1"
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
84f95ddb2572641022619950a211aff49e331c98Mukund Sivaraman test "${enable_querytrace+set}" = set || enable_querytrace=yes
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews test "${with_atf+set}" = set || with_atf=yes
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
71697fd082b1c76562dc80fa91787af3860146bfEvan Hunt test "${enable_symtable+set}" = set || enable_symtable=all
1c1290afabb3c8f4dd498170ac9592e5be450161Mark Andrews test "${enable_warn_error+set}" = set || enable_warn_error=yes
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
a97185d9e01800850222878c2af93ea5cb08a68cMark Andrews test "${with_zlib+set}" = set || with_zlib=yes
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark Andrews XTARGETS='${XTARGETS}'
800cfc8a5ce9ffacfc076003b34b5f787f82c701Mark AndrewsAC_SUBST(XTARGETS)
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki# American Fuzzy Lop
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(afl,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-afl],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable American Fuzzy Lop test harness
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [default=no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AC_DEFINE([ENABLE_AFL], [1],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Define to enable American Fuzzy Lop test harness])])
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecickicase "$enable_afl" in
19d80ce5844e00a021643759adcbe27c11b485a0Witold Krecicki LIBS="$LIBS -lpthread"
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt#libseccomp sandboxing
8bcd80824c51c802c2927236b012cd526f569b04Mark AndrewsAC_CHECK_FUNCS(getrandom)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan HuntAC_ARG_ENABLE(seccomp,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-seccomp],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable support for libseccomp system call
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews filtering [default=no]]))
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Huntcase "$enable_seccomp" in
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt case $host_os in
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt AC_MSG_WARN([seccomp is not supported on non-linux platforms; disabling it])
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt enable_seccomp=no
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt AC_SEARCH_LIBS(seccomp_init, [seccomp])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "X$ac_cv_search_seccomp_init" = "X-lseccomp" ; then
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt AC_TRY_RUN([
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt int main(void)
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt if (ret < 0) {
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt switch (errno) {
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt case ENOSYS:
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt case EINVAL:
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt if (ret < 0) {
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt switch (errno) {
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt case EINVAL:
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt case EFAULT:
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt , AC_DEFINE([HAVE_LIBSECCOMP], 1,
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt [Define to use libseccomp system call filtering.])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Make very sure that these are the first files processed by
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# config.status, since we use the processed output as the input for
323a9f3430abf186f8f84d795549391a8ed7f274Francis Dupont# AC_SUBST_FILE() substitutions in other files.
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceAC_PATH_PROG(AR, ar)
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceARFLAGS="cruv"
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid LawrenceAC_SUBST(ARFLAGS)
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson# The POSIX ln(1) program. Non-POSIX systems may substitute
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson# "copy" or something.
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence AC_MSG_ERROR([
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrencear program not found. Please fix your PATH to include the directory in
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrencewhich ar resides, or set AR in the environment with the full path to ar.
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael GraffAC_PATH_PROGS(ETAGS, etags emacs-etags)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley# GNU emacs etags, and it requires the -L flag.
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halleyif test "X$ETAGS" != "X"; then
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_CHECKING(for Exuberant Ctags etags)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_RESULT(yes)
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley ETAGS="$ETAGS -L"
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley AC_MSG_RESULT(no)
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael GraffAC_SUBST(ETAGS)
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson# Perl is optional; it is used only by some of the system test scripts.
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉# Note: the backtrace feature (see below) uses perl to build the symbol table,
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉# but it still compiles without perl, in which case an empty table will be used.
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas GustafssonAC_PATH_PROGS(PERL, perl5 perl)
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Python is also optional; it is used by the tools in bin/python.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# If python is unavailable, we simply don't build those.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark AndrewsAC_ARG_WITH(python,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-python=PATH],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [specify path to python interpreter]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_python="$withval", use_python="unspec")
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał KępieńAC_ARG_WITH(python-install-dir,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-python-install-dir=PATH],
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień [installation directory for Python modules]),
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień use_python_install_dir="$withval", use_python_install_dir="unspec")
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrewspython="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunttestargparse='try: import argparse
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Huntexcept: exit(1)'
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunttestply='try: from ply import *
523f3d630243211ddfda852f5224f7eff681d3a5Evan Huntexcept: exit(1)'
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrewstestminvers='import sys
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrewsif (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrewscase "$use_python" in
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_CHECKING([for python support])
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews AC_MSG_RESULT(disabled)
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews unspec|yes|*)
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews case "$use_python" in
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews unspec|yes|'')
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt for p in $python
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_PATH_PROGS(PYTHON, $p)
1f27b7873c640771df00a47ee3be188c4079479cFrancis Dupont if test "X$PYTHON" = "X"; then
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews if ${PYTHON:-false} -c "$testminvers"; then
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews AC_MSG_RESULT([found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT([not found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset ac_cv_path_PYTHON
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset PYTHON
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_CHECKING([python module 'argparse'])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt if ${PYTHON:-false} -c "$testargparse"; then
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_RESULT([found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT([not found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset ac_cv_path_PYTHON
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset PYTHON
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_CHECKING([python module 'ply'])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt if ${PYTHON:-false} -c "$testply"; then
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_RESULT([found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT([not found])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset ac_cv_path_PYTHON
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews unset PYTHON
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień if test "X$PYTHON" != "X"
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień case "$use_python_install_dir" in
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień PYTHON_INSTALL_DIR=""
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień PYTHON_INSTALL_LIB=""
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień PYTHON_INSTALL_DIR="$use_python_install_dir"
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał Kępień PYTHON_INSTALL_LIB="--install-lib=$use_python_install_dir"
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_CHECKING([for python support])
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt case "$use_python" in
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_RESULT(disabled)
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_ERROR([missing python])
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews case "$use_python" in
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt PYTHON="$use_python"
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_PATH_PROGS(PYTHON, $use_python)
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews if ${PYTHON:-false} -c "$testminvers"; then
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews AC_MSG_RESULT([found])
21e5f9c5cdb3052f282e3dbdc2dc47f29cfe1187Mark Andrews AC_MSG_ERROR([not found])
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_CHECKING([python module 'argparse'])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt if ${PYTHON:-false} -c "$testargparse"; then
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_RESULT([found, using $PYTHON])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_ERROR([not found])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt AC_MSG_CHECKING([python module 'ply'])
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt if ${PYTHON:-false} -c "$testply"; then
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_RESULT([found, using $PYTHON])
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt AC_MSG_ERROR([not found])
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark AndrewsPYTHON_TOOLS=''
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrewsif test "X$PYTHON" != "X"; then
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews PYTHON_TOOLS=python
66dddd906ada6035d65bbbad2ecbcd74037759a8Mark Andrews CHECKDS=checkds
831f59eb43b56642b00f82e07722836d2f9593abEvan Hunt COVERAGE=coverage
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Hunt KEYMGR=keymgr
66dddd906ada6035d65bbbad2ecbcd74037759a8Mark AndrewsAC_SUBST(CHECKDS)
831f59eb43b56642b00f82e07722836d2f9593abEvan HuntAC_SUBST(COVERAGE)
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan HuntAC_SUBST(KEYMGR)
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark AndrewsAC_SUBST(PYTHON_TOOLS)
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał KępieńAC_SUBST(PYTHON_INSTALL_DIR)
a22c3cf51567651f74aee5c263c597b8d752c2ccMichał KępieńAC_SUBST(PYTHON_INSTALL_LIB)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Special processing of paths depending on whether --prefix,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# --sysconfdir or --localstatedir arguments were given. What's
b587e1d83f007ce68a9ae93097c461d8eb7aa373Mark Andrews# desired is some compatibility with the way previous versions
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# of BIND built; they defaulted to /usr/local for most parts of
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# the installation, but named.boot/named.conf was in /etc
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# So ... if none of --prefix, --sysconfdir or --localstatedir are
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# specified, set things up that way. If --prefix is given, use
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# it for sysconfdir and localstatedir the way configure normally
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# would. To change the prefix for everything but leave named.conf
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# in /etc or named.pid in /var/run, then do this the usual configure way:
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/somewhere --sysconfdir=/etc
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/somewhere --localstatedir=/var
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# To put named.conf and named.pid in /usr/local with everything else,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# set the prefix explicitly to /usr/local even though that's the default:
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# ./configure --prefix=/usr/local
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrencecase "$prefix" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case "$sysconfdir" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews '${prefix}/etc')
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews sysconfdir=/etc
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case "$localstatedir" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews '${prefix}/var')
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews localstatedir=/var
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan Huntexpanded_sysconfdir=`eval echo $sysconfdir`
f6096b958c8b58c4709860d7c4dcdde5deeacb7aEvan HuntAC_SUBST(expanded_sysconfdir)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Make sure INSTALL uses an absolute path, else it will be wrong in all
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# configure based on the location of the file where it is substituted.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# subdirectory of install-sh, This relative path will be wrong for all
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# directories more than one level down from install-sh.
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrencecase "$INSTALL" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # Not all systems have dirname.
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews changequote({, })
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews changequote([, ])
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews test "X$ac_dir" = "X$ac_prog" && ac_dir=.
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews INSTALL="$ac_dir/$ac_prog"
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# On these hosts, we really want to use cc, not gcc, even if it is
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# found. The gcc that these systems have will not correctly handle
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# However, if the user sets $CC to be something, let that override
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graffif test "X$CC" = "X" ; then
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff case "$host" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # Use Sun's cc if it is available, but watch
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # out for /usr/ucb/cc; it will never be the right
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # compiler to use.
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # If setting CC here fails, the AC_PROG_CC done
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # below might still find gcc.
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence for ac_dir in $PATH; do
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence test -z "$ac_dir" && ac_dir=.
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence case "$ac_dir" in
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence if test -f "$ac_dir/cc"; then
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence IFS="$ac_save_ifs"
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff mips-sgi-irix*)
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews# gcc's optimiser is broken at -02 for ultrasparc
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrewsif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews case "$host" in
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews CCFLAGS="-g -O1"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews# OS dependent CC flags
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrewscase "$host" in
323a9f3430abf186f8f84d795549391a8ed7f274Francis Dupont # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews # -D_XOPEN_SOURCE_EXTENDED.
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews LIBS="-lxnet $LIBS"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews # parts of the IPv6 Advanced Socket API as a result. This is stupid
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews # as it breaks how the two halves (Basic and Advanced) of the IPv6
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews # Socket API were designed to be used but we have to live with it.
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
89119e3cafff373426858f6cec7c09539f53e209Mark Andrews *-linux* | *-kfreebsd*-gnu*)
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
ab3aeba682460fd39deb7901aa69f976583c9f47Michael Graff # Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
ab3aeba682460fd39deb7901aa69f976583c9f47Michael Graff # Setting this is sufficient to select the correct behavior for BIND 9.
ab3aeba682460fd39deb7901aa69f976583c9f47Michael Graff STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
ab3aeba682460fd39deb7901aa69f976583c9f47Michael Graff CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Huntif test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt CCNOOPT="-O0"
850b5e80930907e4747347201dc41e4d04e036f8Mark AndrewsAC_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,,,
6342df69b05f2f62d060fd4affdf536e51504084Mark Andrews[$ac_includes_default
6342df69b05f2f62d060fd4affdf536e51504084Mark Andrews#ifdef HAVE_SYS_PARAM_H
62ec9fd1681ffae7d6b0d54618599ecf650e3100Mark Andrews#ifdef HAVE_SYS_SOCKET_H
8486ce1efa5deded85415d21d5696e5a51c63357Mark AndrewsAC_C_VOLATILE
c654449ccf403ccd2b81be2038b1013d6fbb06ccMark AndrewsAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
5b02fc32d693bb811199308a40143df0adf818c1Mark AndrewsAC_C_FLEXIBLE_ARRAY_MEMBER
5506903c9215faf42586307c2288942fd804c579Evan Hunt# Check for the existence of mmap to enable the fast format zones
5506903c9215faf42586307c2288942fd804c579Evan HuntAC_CHECK_FUNCS(mmap)
38cd4d14cc341c2663e574035074788bb6f0fce2Evan Hunt# Older versions of HP/UX don't define seteuid() and setegid()
38cd4d14cc341c2663e574035074788bb6f0fce2Evan HuntAC_CHECK_FUNCS(seteuid setresuid)
38cd4d14cc341c2663e574035074788bb6f0fce2Evan HuntAC_CHECK_FUNCS(setegid setresgid)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews# BSDI doesn't have ftello fseeko
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_CHECK_FUNCS(ftello fseeko)
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson# UnixWare 7.1.1 with the feature supplement to the UDK compiler
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson# is reported to not support "static inline" (RT #1212).
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas GustafssonAC_MSG_CHECKING(for static inline breakage)
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan HuntAC_TRY_COMPILE([
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington static inline int foo1() {
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington static inline int foo2() {
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington return foo1();
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan Hunt ], [foo1();],
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson [AC_MSG_RESULT(no)],
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson [AC_MSG_RESULT(yes)
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews AC_DEFINE(inline, ,[Define to empty if your compiler does not support "static inline".])])
8f3dd8f8e73e4465221a5297819db70e6b383138Mark AndrewsAC_CHECK_TYPE(ssize_t, int)
6e9efadbea9febb0494e713e54dfea6f7ef70383Mark AndrewsAC_CHECK_TYPE(uintptr_t,unsigned long)
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark AndrewsAC_CHECK_TYPE(socklen_t,
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark AndrewsAC_TRY_COMPILE(
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrewsint getsockname(int, struct sockaddr *, size_t *);
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark AndrewsAC_SUBST(ISC_SOCKADDR_LEN_T)
754cca729dd82ae8363917dc00ad44f9d900635bMark AndrewsAC_MSG_CHECKING(for long long)
754cca729dd82ae8363917dc00ad44f9d900635bMark AndrewsAC_TRY_COMPILE([],[long long i = 0; return (0);],
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews [AC_MSG_RESULT(yes)
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews [AC_MSG_RESULT(no)
754cca729dd82ae8363917dc00ad44f9d900635bMark Andrews ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
754cca729dd82ae8363917dc00ad44f9d900635bMark AndrewsAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
f02c22d58ac88777655e0b407b22b07864d39184Evan Hunt# check for uname library routine
f02c22d58ac88777655e0b407b22b07864d39184Evan HuntAC_MSG_CHECKING(for uname)
f02c22d58ac88777655e0b407b22b07864d39184Evan HuntAC_TRY_COMPILE([
f02c22d58ac88777655e0b407b22b07864d39184Evan Huntstruct utsname uts;
f02c22d58ac88777655e0b407b22b07864d39184Evan Huntprintf("running on %s %s %s for %s\n",
f02c22d58ac88777655e0b407b22b07864d39184Evan Hunt uts.sysname, uts.release, uts.version, uts.machine);
f02c22d58ac88777655e0b407b22b07864d39184Evan Hunt [AC_MSG_RESULT(yes)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_DEFINE(HAVE_UNAME)],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AC_MSG_RESULT(no)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_WARN([uname is not correctly supported])])
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont# check for GCC noreturn attribute
debd489a44363870f96f75818e89ec27d3cab736Francis DupontAC_MSG_CHECKING(for GCC noreturn attribute)
debd489a44363870f96f75818e89ec27d3cab736Francis DupontAC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont [AC_MSG_RESULT(yes)
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont [AC_MSG_RESULT(no)
debd489a44363870f96f75818e89ec27d3cab736Francis Dupont ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
339c130823ff00cdfa70d1f0a8922199aa37f33cMark Andrews ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
debd489a44363870f96f75818e89ec27d3cab736Francis DupontAC_SUBST(ISC_PLATFORM_NORETURN_PRE)
debd489a44363870f96f75818e89ec27d3cab736Francis DupontAC_SUBST(ISC_PLATFORM_NORETURN_POST)
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews# check if we have lifconf
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_MSG_CHECKING(for struct lifconf)
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_TRY_COMPILE([
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrewsstruct lifconf lifconf;
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews [AC_MSG_RESULT(yes)
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews [AC_MSG_RESULT(no)
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark AndrewsAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉# check if we have kqueue
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark AndrewsAC_ARG_ENABLE(kqueue,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-kqueue],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use BSD kqueue when available [default=yes]]),
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews want_kqueue="$enableval", want_kqueue="yes")
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrewscase $want_kqueue in
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews case $ac_cv_have_kqueue in
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews# so we need to try running the code, not just test its existence.
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark AndrewsAC_ARG_ENABLE(epoll,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-epoll],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use Linux epoll when available [default=auto]]),
ddb35cf2f301ae1c3fa601792034f6d349efc8c5Mark Andrews want_epoll="$enableval", want_epoll="auto")
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrewscase $want_epoll in
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews AC_MSG_CHECKING(epoll support)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews AC_TRY_RUN([
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews if (epoll_create(1) < 0)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews [AC_MSG_RESULT(yes)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews [AC_MSG_RESULT(no)
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"],
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews [AC_MSG_RESULT(no)
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
ddb35cf2f301ae1c3fa601792034f6d349efc8c5Mark Andrews ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉# check if we support /dev/poll
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark AndrewsAC_ARG_ENABLE(devpoll,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-devpoll],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use /dev/poll when available [default=yes]]),
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews want_devpoll="$enableval", want_devpoll="yes")
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrewscase $want_devpoll in
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
3dfa202e4fea6b985bcf8761e2d11c176baa40d1Mark Andrews ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson# check if we need to #include sys/select.h explicitly
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafssoncase $ac_cv_header_unistd_h in
963c48ba4d06a112c70d50328e827749e95f58dbMark AndrewsAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_TRY_COMPILE([
963c48ba4d06a112c70d50328e827749e95f58dbMark Andrews#include <sys/types.h> /* Ultrix */
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson[fd_set read_set; return (0);],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(yes)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson [AC_MSG_RESULT(no)
a1898260ad19d02e88ab76c1855d33c67add9defMark Andrews case $ac_cv_header_sys_select_h in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson AC_MSG_ERROR([need either working unistd.h or sys/select.h])
a1898260ad19d02e88ab76c1855d33c67add9defMark Andrews case $ac_cv_header_sys_select_h in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson AC_MSG_ERROR([need either unistd.h or sys/select.h])
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas GustafssonAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff# Find the machine's endian flavor.
90407942d3afe50f04ccea361de3b164a5a1702dMichael GraffAC_C_BIGENDIAN
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# GeoIP support?
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntGEOIPLINKSRCS=
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntGEOIPLINKOBJS=
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_WITH(geoip,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-geoip=PATH],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Build with GeoIP support (yes|no|path)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_geoip="$withval", use_geoip="no")
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$use_geoip"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_geoip=$d
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_geoip" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING([for GeoIP support])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT([disabled])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if test -d "$use_geoip" -o -L "$use_geoip"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CFLAGS="$CFLAGS -I$use_geoip/include"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CPPFLAGS="$CPPFLAGS -I$use_geoip/include"
568de8123acb1a94e2d7bfe9cc5eb5d099f6c1f5Mark Andrews LIBS="$LIBS -L$use_geoip/lib"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host_os" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt netbsd*|openbsd*|solaris*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$LIBS -Wl,-rpath=$use_geoip/lib"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews elif test "yes" = "$use_geoip"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([GeoIP path not found])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([GeoIP path $use_geoip does not exist])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_HEADER(GeoIP.h, [],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_ERROR([GeoIP header file not found])]
bb70b45c1f3869ec81678fc857e3dfad60da5de4Evan Hunt AC_SEARCH_LIBS(GeoIP_id_by_addr_gl, GeoIP, [],
bb70b45c1f3869ec81678fc857e3dfad60da5de4Evan Hunt [AC_MSG_ERROR([suitable GeoIP library not found])]
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_SEARCH_LIBS(fabsf, m, [],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_ERROR([Math library not found])]
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_DEFINE(HAVE_GEOIP, 1, Build with GeoIP support)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt GEOIPLINKSRCS='${GEOIPLINKSRCS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt GEOIPLINKOBJS='${GEOIPLINKOBJS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING([for GeoIP support])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT([yes])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING([for GeoIP Country IPv6 support])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_COMPILE_IFELSE(
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_LANG_PROGRAM([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt struct in6_addr in6;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt GeoIP_country_name_by_ipnum_v6(NULL, in6);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT([yes])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_DEFINE(HAVE_GEOIP_V6, 1, Build with GeoIP Country IPv6 support)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT([no])]
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING([for GeoIP City IPv6 support])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_COMPILE_IFELSE(
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_LANG_PROGRAM([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt struct in6_addr in6;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews int i = GEOIP_CITY_EDITION_REV0_V6;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt GeoIP_record_by_ipnum_v6(NULL, in6);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT([yes])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_DEFINE(HAVE_GEOIP_CITY_V6, 1, Build with GeoIP City IPv6 support)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT([no])]
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(GEOIPLINKSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(GEOIPLINKOBJS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_MSG_CHECKING(for GSSAPI library)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_WITH(gssapi,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Specify path for system-supplied GSSAPI
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [default=yes]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_gssapi="$withval", use_gssapi="yes")
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews# first try using krb5-config, if that does not work then fall back to "yes" method.
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrewscase "$use_gssapi" in
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews*/krb5-config|krb5-config)
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_MSG_RESULT(trying $use_gssapi)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test krb5-config = "$use_gssapi"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews KRB5_CONFIG="$use_gssapi"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews gssapi_cflags=`$KRB5_CONFIG --cflags gssapi`
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews gssapi_libs=`$KRB5_CONFIG --libs gssapi`
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews saved_cppflags="$CPPFLAGS"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews CPPFLAGS="$gssapi_cflags $CPPFLAGS"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_MSG_RESULT([krb5-config: gssapi.h not found])
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews CPPFLAGS="$saved_cppflags"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews use_gssapi="yes"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_MSG_RESULT([krb5-config: krb5.h not found])
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews CPPFLAGS="$saved_cppflags"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews use_gssapi="yes"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews CPPFLAGS="$saved_cppflags"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews saved_libs="$LIBS"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews LIBS=$gssapi_libs
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_MSG_CHECKING([krb5-config linking as $LIBS])
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews gssapi_linked=yes, gssapi_linked=no)
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews case $gssapi_linked in
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews yes) AC_MSG_RESULT([krb5-config: linked]);;
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews no) AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage])
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews use_gssapi="yes"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews LIBS=$saved_libs
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_gssapi"; then
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewscase "$host" in
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_gssapi"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews use_gssapi=framework
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# gssapi is just the framework, we really require kerberos v5, so
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# look for those headers (the gssapi headers must be there, too)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# The problem with this implementation is that it doesn't allow
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# for the specification of gssapi and krb5 headers in different locations,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# which probably ought to be fixed although fixing might raise the issue of
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# trying to build with incompatible versions of gssapi and krb5.
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$use_gssapi"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # first, deal with the obvious
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if test \( -f /usr/include/kerberosv5/krb5.h -o \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_gssapi=/usr
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt for d in $krb5dirs
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_gssapi=$d
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_gssapi="no"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_gssapi" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(disabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt USE_GSSAPI=''
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([--with-gssapi must specify a path])
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews */krb5-config|krb5-config)
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews USE_GSSAPI='-DGSSAPI'
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews DST_GSSAPI_INC="$gssapi_cflags"
c2a6e9d347ea5364041d4241e4683d076d4e091bMark Andrews DNS_GSSAPI_LIBS="$gssapi_libs"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews USE_GSSAPI='-DGSSAPI'
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <Kerberos/Kerberos.h>"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <Kerberos/Kerberos.h>"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews DNS_GSSAPI_LIBS="-framework Kerberos"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews AC_MSG_RESULT(framework)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(looking in $use_gssapi/lib)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt USE_GSSAPI='-DGSSAPI'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_cppflags="$CPPFLAGS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt gssapi_hack="#include <$ac_header>"])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([gssapi.h not found])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt gssapi_krb5_hack="#include <$ac_header>"])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt krb5_hack="#include <$ac_header>"])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([krb5.h not found])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # XXXDCL This probably doesn't work right on all systems.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # It will need to be worked on as problems become evident.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Essentially the problems here relate to two different
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # areas. The first area is building with either KTH
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # or MIT Kerberos, particularly when both are present on
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # the machine. The other is static versus dynamic linking.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # On the KTH vs MIT issue, Both have libkrb5 that can mess
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # up the works if one implementation ends up trying to
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # use the other's krb. This is unfortunately a situation
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # that very easily arises.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Dynamic linking when the dependency information is built
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # all such problems go away, but when that setup is not
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # present, because either the dynamic libraries lack
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # dependencies or static linking is being done, then the
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # problems start to show up.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_libs="$LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt for TRY_LIBS in \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi_krb5" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt "-lgssapi -lkrb5 -lgssapi_krb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgssapi -lkrb5 -lhx509 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "-lgss -lkrb5"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Note that this does not include $saved_libs, because
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # on FreeBSD machines this configure script has added
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # -L/usr/local/lib to LIBS, which can make the
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # -lgssapi_krb5 test succeed with shared libraries even
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # when you are trying to build with KTH in /usr/lib.
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "/usr" = "$use_gssapi"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$TRY_LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="-L$use_gssapi/lib $TRY_LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING(linking as $TRY_LIBS)
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt AC_TRY_LINK([
f0e9d6e905235482ff9b4be770ee35018fcd8234Evan Hunt$gssapi_krb5_hack
0277def3cf21a0b52bdb50a9b449c37b2139b321Mark Andrews ] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
0277def3cf21a0b52bdb50a9b449c37b2139b321Mark Andrews#if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
0277def3cf21a0b52bdb50a9b449c37b2139b321Mark Andrewsgsskrb5_register_acceptor_identity(NULL);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt gssapi_linked=yes, gssapi_linked=no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $gssapi_linked in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt yes) AC_MSG_RESULT(yes); break ;;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt no) AC_MSG_RESULT(no) ;;
55fff76a16c8c822bb7bb8bc63ed26ede9fbeb9cMark Andrews CPPFLAGS="$saved_cppflags"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $gssapi_linked in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # but MIT in /usr/local/lib and trying to build with KTH.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # /usr/local/lib can end up earlier on the link lines.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Like most kludges, this one is not only inelegant it
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # is also likely to be the wrong thing to do at least as
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # many times as it is the right thing. Something better
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # needs to be done.
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "/usr" = "$use_gssapi" -a \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt FIX_KTH_VS_MIT=yes
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$FIX_KTH_VS_MIT" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$enable_static_linking" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt yes) gssapi_lib_suffix=".a" ;;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *) gssapi_lib_suffix=".so" ;;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt for lib in $LIBS; do
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $lib in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt new_lib=`echo $lib |
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt sed -e s%^-l%$use_gssapi/lib/lib% \
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt -e s%$%$gssapi_lib_suffix%`
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt NEW_LIBS="$NEW_LIBS $new_lib"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$NEW_LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_GSSAPI_INC="-I$use_gssapi/include"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DNS_GSSAPI_LIBS="$LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$saved_libs"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_KRB5HEADER)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(USE_GSSAPI)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(DST_GSSAPI_INC)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(DNS_GSSAPI_LIBS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntDNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# Applications linking with libdns also need to link with these libraries.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(DNS_CRYPTO_LIBS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# was --with-randomdev specified?
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_MSG_CHECKING(for random device)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_WITH(randomdev,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-randomdev=PATH],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Specify path for random device]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_randomdev="$withval", use_randomdev="unspec")
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_randomdev" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$cross_compiling" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(unspecified)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT($devrandom)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FILE($devrandom,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt "$devrandom"),)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([--with-randomdev must specify a path])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(disabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(using "$use_randomdev")
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# Only check dsa signature generation on these platforms when performing
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# system tests.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntif grep "#define PATH_RANDOMDEV " confdefs.h > /dev/null
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *darwin*|*freebsd*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(CHECK_DSA)
669e108d6753b27a9745cc506193a9e0b32d217cEvan Hunt# Do we have arc4random(), etc ?
669e108d6753b27a9745cc506193a9e0b32d217cEvan Hunt# Will use stir and if not exist addrandom
294ef74e5ad68d898207c4fb36d8b18d526a11f6Curtis BlackburnAC_CHECK_FUNCS(arc4random)
294ef74e5ad68d898207c4fb36d8b18d526a11f6Curtis BlackburnAC_CHECK_FUNCS(arc4random_stir)
294ef74e5ad68d898207c4fb36d8b18d526a11f6Curtis BlackburnAC_CHECK_FUNCS(arc4random_addrandom)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntif $use_threads
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if test "X$GCC" = "Xyes"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$LIBS -lthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $host in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -mt"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -mt"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -mt"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-sco-sysv*uw*|*-*-sysv*UnixWare*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -Kthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -Kthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -Kthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-*-sysv*OpenUNIX*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CC="$CC -Kpthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCOPT="$CCOPT -Kpthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CCNOOPT="$CCNOOPT -Kpthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ALWAYS_DEFINES="-D_REENTRANT"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt THREADOPTOBJS='${THREADOPTOBJS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt THREADOPTSRCS='${THREADOPTSRCS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt thread_dir=pthreads
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # We'd like to use sigwait() too
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(sigwait,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_SIGWAIT),
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_LIB(c, sigwait,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_SIGWAIT),
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_LIB(pthread, sigwait,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_SIGWAIT),
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_LIB(pthread, _Psigwait,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_SIGWAIT),))))
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(pthread_attr_getstacksize,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(pthread_attr_setstacksize,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_ARG_WITH(locktype,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-locktype=ARG],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Specify mutex lock type
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews (adaptive or standard)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews locktype="$withval", locktype="adaptive")
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews case "$locktype" in
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4c432aae90bc9b220725ca7df5a6af40cf4c74b3Mark Andrews #ifndef _GNU_SOURCE
4c432aae90bc9b220725ca7df5a6af40cf4c74b3Mark Andrews #define _GNU_SOURCE
4c432aae90bc9b220725ca7df5a6af40cf4c74b3Mark Andrews return (PTHREAD_MUTEX_ADAPTIVE_NP);
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [ AC_MSG_RESULT(using adaptive lock type)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [ AC_MSG_RESULT(using standard lock type) ])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT(using standard lock type)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_HEADERS(sched.h)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_LIB(rt, sched_yield)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNCS(sched_yield pthread_yield pthread_yield_np)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Additional OS-specific issues related to pthreads and sigwait.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$host" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # One more place to look for sigwait.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $host in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-freebsd6.*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # BSDI 3.0 through 4.0.1 needs pthread_init() to be
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # called before certain pthreads calls. This is deprecated
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-bsdi3.*|*-bsdi4.0*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(NEED_PTHREAD_INIT)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # LinuxThreads requires some changes to the way we
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # deal with signals.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_LINUXTHREADS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Ensure the right sigwait() semantics on Solaris and make
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # sure we call pthread_setconcurrency.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(pthread_setconcurrency,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # UnixWare does things its own way.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
8b9c4592ed718c4187971f1104381faf538bf4f7Evan Hunt # Look for functions relating to thread naming
8b9c4592ed718c4187971f1104381faf538bf4f7Evan Hunt AC_CHECK_FUNCS(pthread_setname_np pthread_set_name_np)
93f0e3d747797d215c6a3dceb8698a5636120a0bCurtis Blackburn AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Look for sysconf to allow detection of the number of processors.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt thread_dir=nothreads
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt THREADOPTOBJS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt THREADOPTSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ALWAYS_DEFINES=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ALWAYS_DEFINES)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_USETHREADS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(THREADOPTOBJS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(THREADOPTSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntISC_THREAD_DIR=$thread_dir
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_THREAD_DIR)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntAC_MSG_CHECKING(for libtool)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_WITH(libtool, AS_HELP_STRING([--with-libtool], [use GNU libtool]),
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt use_libtool="$withval", use_libtool="no")
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Huntcase $use_libtool in
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_RESULT(yes)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt AM_PROG_LIBTOOL
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_COMPILE='--mode=compile --tag=CC'
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_INSTALL='--mode=install --tag=CC'
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_LINK='--mode=link --tag=CC'
8a5809527e6c85e39699901712a455d5480907c1Evan Hunt LIBTOOL_MODE_UNINSTALL='--mode=uninstall --tag=CC'
f687e639f00a31e0884fb2c95a627b10b50c364bEvan Hunt INSTALL_LIBRARY='${INSTALL_PROGRAM}'
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt case "$host" in
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt *) LIBTOOL_ALLOW_UNDEFINED= ;;
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt case "$host" in
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt *-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt *) LIBTOOL_IN_MAIN= ;;
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_RESULT(no)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt AC_SUBST(LIBTOOL)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MKDEP_SED=
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_COMPILE=
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_INSTALL=
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_MODE_LINK=
8a5809527e6c85e39699901712a455d5480907c1Evan Hunt LIBTOOL_MODE_UNINSTALL=
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_ALLOW_UNDEFINED=
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt LIBTOOL_IN_MAIN=
f687e639f00a31e0884fb2c95a627b10b50c364bEvan Hunt INSTALL_LIBRARY='${INSTALL_DATA}'
f687e639f00a31e0884fb2c95a627b10b50c364bEvan HuntAC_SUBST(INSTALL_LIBRARY)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# was --enable-native-pkcs11 specified?
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# (note it implies both --without-openssl and --with-pkcs11)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_ENABLE(native-pkcs11,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-native-pkcs11],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use native PKCS11 for all crypto [default=no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews want_native_pkcs11="$enableval", want_native_pkcs11="no")
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# was --with-openssl specified?
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_WITH(openssl,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-openssl[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Build with OpenSSL [yes|no|path].
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews (Crypto is required for DNSSEC)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_openssl="$withval", use_openssl="auto")
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# was --with-pkcs11 specified?
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_WITH(pkcs11,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-pkcs11[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Build with PKCS11 support [yes|no|path]
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews (PATH is for the PKCS11 provider)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_pkcs11="$withval", use_pkcs11="auto")
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont# were --with-ecdsa, --with-gost, --with-eddsa, --with-aes specified
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_WITH(ecdsa, AS_HELP_STRING([--with-ecdsa], [Crypto ECDSA]),
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt with_ecdsa="$withval", with_ecdsa="auto")
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_WITH(gost,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-gost], [Crypto GOST [yes|no|raw|asn1].]),
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt with_gost="$withval", with_gost="auto")
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_WITH(eddsa, AS_HELP_STRING([--with-eddsa], [Crypto EDDSA [yes|all|no].]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews with_eddsa="$withval", with_eddsa="auto")
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_WITH(aes, AS_HELP_STRING([--with-aes], [Crypto AES]),
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_aes="$withval", with_aes="checkcc")
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt# was --enable-openssl-hash specified?
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntAC_ARG_ENABLE(openssl-hash,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-openssl-hash],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use OpenSSL for hash functions [default=no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews want_openssl_hash="$enableval", want_openssl_hash="checkcc")
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews# Client Cookie algorithm choice
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark AndrewsAC_ARG_WITH(cc-alg,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-cc-alg=ALG],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [choose the algorithm for Client Cookie
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [aes|sha1|sha256]]),
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="$withval", with_cc_alg="auto")
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrewscase $with_cc_alg in
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="sha1"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="sha256"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "no" != "$with_aes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_aes="yes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="aes"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "no" != "$with_aes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_aes="yes"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "checkcc" = "with_aes"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt with_aes="no"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntAC_MSG_CHECKING(for OpenSSL library)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntOPENSSL_WARNING=
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$want_native_pkcs11"
0187198379120ce8ee099984e42e7f11c4c8abebEvan Hunt use_openssl="native_pkcs11"
0187198379120ce8ee099984e42e7f11c4c8abebEvan Hunt AC_MSG_RESULT(use of native PKCS11 instead)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "auto" = "$use_openssl"
0187198379120ce8ee099984e42e7f11c4c8abebEvan Hunt for d in $openssldirs
0187198379120ce8ee099984e42e7f11c4c8abebEvan Hunt use_openssl=$d
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntOPENSSL_ECDSA=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntOPENSSL_GOST=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontOPENSSL_ED25519=""
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Huntgosttype="raw"
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Huntcase "$with_gost" in
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt with_gost="yes"
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt AC_DEFINE(PREFER_GOSTASN1, 1,
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt [Define if GOST private keys are encoded in ASN.1.])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews gosttype="asn1"
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt with_gost="yes"
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt auto|yes|no)
12bf5d4796505b4c20680531da96a31e6c2c1144Evan Hunt AC_MSG_ERROR(unknown GOST private key encoding)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_openssl" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt native_pkcs11)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(disabled because of native PKCS11)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_OPENSSL_INC=""
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt CRYPTO="-DPKCS11CRYPTO"
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKSRCS=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSLEDDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLEDDSALINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLGOSTLINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLGOSTLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKOBJS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_OPENSSL_INC=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKSRCS=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSLEDDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLEDDSALINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLGOSTLINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLGOSTLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKOBJS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_OPENSSL_INC=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKSRCS=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSLEDDSALINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLEDDSALINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLGOSTLINKOBJS=""
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLGOSTLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKOBJS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLLINKSRCS=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR(
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntIf you don't want OpenSSL, use --without-openssl])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$want_native_pkcs11"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT()
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_ERROR([OpenSSL and native PKCS11 cannot be used together.])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_openssl"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # User did not specify a path - guess it
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt for d in $openssldirs
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_openssl=$d
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_openssl"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(not found)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR(
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt elif ! test -f "$use_openssl"/include/openssl/opensslv.h
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CRYPTO='-DOPENSSL'
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "/usr" = "$use_openssl"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_OPENSSL_INC=""
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="-lcrypto"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt DST_OPENSSL_INC="-I$use_openssl/include"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case $host in
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt *-apple-darwin*)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # Apple's ld seaches for serially for dynamic
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # then static libraries. This means you can't
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # use -L to override dynamic system libraries
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # with static ones when linking. Instead
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt # we specify a absolute path.
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_cc="$CC"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_cflags="$CFLAGS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_libs="$LIBS"
76af83c9adb772f7b045c62cf8b411165bfaa5efMark Andrews CFLAGS="$DST_OPENSSL_INC $CFLAGS"
76af83c9adb772f7b045c62cf8b411165bfaa5efMark Andrews LIBS="$DST_OPENSSL_LIBS $LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING(whether linking with OpenSSL works)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_TRY_RUN([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ERR_clear_error();
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(yes)],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR(Could not run test program using OpenSSL from
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntPlease check the argument to --with-openssl and your
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntshared library configuration (e.g., LD_LIBRARY_PATH).)],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(assuming it does work on target platform)])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_TRY_LINK([
48e1d4823cf4f5b2c1769ed18c172aa93bfbf386Mark Andrews#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
48e1d4823cf4f5b2c1769ed18c172aa93bfbf386Mark Andrews#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
76af83c9adb772f7b045c62cf8b411165bfaa5efMark AndrewsOPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
76af83c9adb772f7b045c62cf8b411165bfaa5efMark AndrewsDSO_METHOD_dlfcn();
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(no)],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [LIBS="$LIBS -ldl"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_TRY_LINK([
48e1d4823cf4f5b2c1769ed18c172aa93bfbf386Mark Andrews#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
48e1d4823cf4f5b2c1769ed18c172aa93bfbf386Mark Andrews#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100004L)
76af83c9adb772f7b045c62cf8b411165bfaa5efMark AndrewsOPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
76af83c9adb772f7b045c62cf8b411165bfaa5efMark AndrewsDSO_METHOD_dlfcn();
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(yes)
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews DST_OPENSSL_LIBS="$DST_OPENSSL_LIBS -ldl"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(unknown)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(assuming it does work on target platform)])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(assuming it does work on target platform)]
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_ARG_ENABLE(openssl-version-check,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AS_HELP_STRING([--enable-openssl-version-check],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [check OpenSSL version @<:@default=yes@:>@])])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$enable_openssl_version_check" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING(OpenSSL library version)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_TRY_RUN([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_VERSION_NUMBER < 0x00908000L) ||
a12a21a8432222f951695b7bb44efb1275fc29a8Mark Andrews (OPENSSL_VERSION_NUMBER >= 0x0090804fL &&
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews OPENSSL_VERSION_NUMBER < 0x10002000L) ||
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews OPENSSL_VERSION_NUMBER >= 0x1000205fL)
76af83c9adb772f7b045c62cf8b411165bfaa5efMark Andrews printf("\n\nFound OPENSSL_VERSION_NUMBER %#010lx\n",
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_VERSION_NUMBER);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n"
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews "Require OPENSSL_VERSION_NUMBER 0x1000000f or greater (1.0.0)\n"
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews "Require OPENSSL_VERSION_NUMBER 0x1000100f or greater (1.0.1)\n"
10d7ab44cc72170c527dde8cc9e049e046342769Mark Andrews "Require OPENSSL_VERSION_NUMBER 0x1000205f or greater (1.0.2e)\n\n");
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(ok)],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(not compatible)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_WARNING=yes
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(assuming target platform has compatible version)])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(Skipped OpenSSL version check)
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont AC_MSG_CHECKING(for OpenSSL FIPS mode support)
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont have_fips_mode=""
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont AC_TRY_LINK([#include <openssl/crypto.h>],
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont [FIPS_mode();],
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont have_fips_mode=yes,
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont have_fips_mode=no)
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont if test "x$have_fips_mode" = "xyes"
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont AC_DEFINE([HAVE_FIPS_MODE], [1],
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont [Define if OpenSSL provides FIPS_mode()])
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont AC_MSG_RESULT(yes)
f9c410d93711fbf312a0162f1e2d3f2a5ede69afFrancis Dupont AC_MSG_RESULT(no)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_CHECKING(for OpenSSL DSA support)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_DEFINE(HAVE_OPENSSL_DSA)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_RESULT(yes)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_RESULT(no)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_CHECK_FUNCS(EVP_sha256 EVP_sha384 EVP_sha512)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_CHECKING(for OpenSSL ECDSA support)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_ecdsa=""
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_TRY_RUN([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt EC_KEY *ec256, *ec384;
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt#if !defined(HAVE_EVP_SHA256) || !defined(HAVE_EVP_SHA384)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ec256 = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (ec256 == NULL || ec384 == NULL)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(yes)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_ecdsa="yes"],
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(no)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_ecdsa="no"],
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(using --with-ecdsa)])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$with_ecdsa" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$have_ecdsa" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews no) AC_MSG_ERROR([ecdsa not supported]) ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews *) have_ecdsa=yes ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_ecdsa=no ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$have_ecdsa" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews *) AC_MSG_ERROR([need --with-ecdsa=[[yes or no]]]) ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case $have_ecdsa in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews OPENSSL_ECDSA="yes"
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKOBJS='${OPENSSLECDSALINKOBJS}'
2d82ed9456e72dc4373bea19d63411afe1c48962Mark Andrews OPENSSLECDSALINKSRCS='${OPENSSLECDSALINKSRCS}'
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_DEFINE(HAVE_OPENSSL_ECDSA, 1,
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [Define if your OpenSSL version supports ECDSA.])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_CHECKING(for OpenSSL GOST support)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_gost=""
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$use_pkcs11" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews if $use_threads; then
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews CC="$CC -pthread"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_TRY_RUN([
48e1d4823cf4f5b2c1769ed18c172aa93bfbf386Mark Andrews#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10000000L)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_config(NULL);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt e = ENGINE_by_id("gost");
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (e == NULL)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (ENGINE_init(e) <= 0)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(yes)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_gost="yes"],
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(no)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_gost="no"],
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [AC_MSG_RESULT(using --with-gost)])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$with_gost" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$have_gost" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews no) AC_MSG_ERROR([gost not supported]) ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews *) have_gost=yes ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_gost=no ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case "$have_gost" in
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews *) AC_MSG_ERROR([need --with-gost=[[yes, no, raw or asn1]]]) ;;
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews case $have_gost in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_GOST="yes"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLGOSTLINKOBJS='${OPENSSLGOSTLINKOBJS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSLGOSTLINKSRCS='${OPENSSLGOSTLINKSRCS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_OPENSSL_GOST, 1,
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [Define if your OpenSSL version supports GOST.])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_CHECKING(for OpenSSL Ed25519 support)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed25519=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed448=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont EVP_PKEY_CTX *ctx;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont ctx = EVP_PKEY_CTX_new_id(NID_ED25519, NULL);
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont if (ctx == NULL)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(yes)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed25519="yes"],
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(no)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed25519="no"],
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(using --with-eddsa)])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case "$with_eddsa" in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case "$have_ed25519" in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont no) AC_MSG_ERROR([eddsa not supported]) ;;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont *) have_ed25519=yes ;;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed25519=no ;;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case "$have_ed25519" in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont *) AC_MSG_ERROR([need --with-eddsa=[[yes, all or no]]]) ;;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case $have_ed25519 in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSL_ED25519="yes"
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSLEDDSALINKOBJS='${OPENSSLEDDSALINKOBJS}'
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont OPENSSLEDDSALINKSRCS='${OPENSSLEDDSALINKSRCS}'
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_DEFINE(HAVE_OPENSSL_ED25519, 1,
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [Define if your OpenSSL version supports Ed25519.])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_CHECKING(for OpenSSL Ed448 support)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont EVP_PKEY_CTX *ctx;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont ctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont if (ctx == NULL)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(yes)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed448="yes"],
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(no)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed448="no"],
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [AC_MSG_RESULT(using --with-eddsa)])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case $with_eddsa in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont have_ed448=yes ;;
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case $have_ed448 in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_DEFINE(HAVE_OPENSSL_ED448, 1,
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [Define if your OpenSSL version supports Ed448.])],
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt have_aes="no"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_CHECKING(for OpenSSL AES support)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_TRY_RUN([
76af83c9adb772f7b045c62cf8b411165bfaa5efMark Andrews const EVP_CIPHER *aes128, *aes192, *aes256;
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt aes128 = EVP_aes_128_ecb();
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt aes192 = EVP_aes_192_ecb();
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt aes256 = EVP_aes_256_ecb();
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt if (aes128 == NULL || aes192 == NULL || aes256 == NULL)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [AC_MSG_RESULT(yes)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt have_aes="evp"],
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [AC_CHECK_FUNC(AES_encrypt,
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [AC_MSG_RESULT(yes)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt have_aes="yes"],
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [AC_MSG_RESULT(no)])],
d3f21e063a84eed1752f1228892dd9a42b366ecfEvan Hunt [AC_MSG_RESULT(using --with-aes)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews # Expect cross-compiling with a modern OpenSSL
d3f21e063a84eed1752f1228892dd9a42b366ecfEvan Hunt have_aes="evp"])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_INC=""
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_LIBS=""
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$with_aes"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt case "$have_aes" in
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_DEFINE(HAVE_OPENSSL_EVP_AES, 1,
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [Define if your OpenSSL version supports EVP AES])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_INC="$DST_OPENSSL_INC"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_DEFINE(HAVE_OPENSSL_AES, 1,
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt [Define if your OpenSSL version supports AES])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_INC="$DST_OPENSSL_INC"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews CC="$saved_cc"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews CFLAGS="$saved_cflags"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews LIBS="$saved_libs"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# This would include the system openssl path (and linker options to use
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# it as needed) if it is found.
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(DST_OPENSSL_INC)
2d82ed9456e72dc4373bea19d63411afe1c48962Mark AndrewsAC_SUBST(OPENSSLECDSALINKOBJS)
2d82ed9456e72dc4373bea19d63411afe1c48962Mark AndrewsAC_SUBST(OPENSSLECDSALINKSRCS)
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontAC_SUBST(OPENSSLEDDSALINKOBJS)
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontAC_SUBST(OPENSSLEDDSALINKSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSLGOSTLINKOBJS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSLGOSTLINKSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSLLINKOBJS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSLLINKSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSL_ECDSA)
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontAC_SUBST(OPENSSL_ED25519)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(OPENSSL_GOST)
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark AndrewsDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DST_OPENSSL_LIBS"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntISC_PLATFORM_WANTAES="#undef ISC_PLATFORM_WANTAES"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$with_aes"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt if test "X$CRYPTO" = "X"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt with_aes="no"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$with_aes"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt ISC_PLATFORM_WANTAES="#define ISC_PLATFORM_WANTAES 1"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntAC_SUBST(ISC_PLATFORM_WANTAES)
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews# Choose Client Cookie algorithm
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark AndrewsAC_MSG_CHECKING(for the Algorithm for Client Cookie)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "auto" = "$with_cc_alg"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$with_aes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="aes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews with_cc_alg="sha256"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrewscase $with_cc_alg in
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_RESULT(sha1)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "X$CRYPTO" = "X-DOPENSSL"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "checkcc" = "$want_openssl_hash"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt want_openssl_hash="yes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews AC_DEFINE(HMAC_SHA1_CC, 1,
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews [Use HMAC-SHA1 for Client Cookie generation])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_RESULT(sha256)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "X$CRYPTO" = "X-DOPENSSL"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "checkcc" = "$want_openssl_hash"
969728a667996d7dc06999523048671bfb24fd2dMark Andrews want_openssl_hash="yes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews AC_DEFINE(HMAC_SHA256_CC, 1,
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews [Use HMAC-SHA256 for Client Cookie generation])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_RESULT(aes)
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" != "$with_aes"
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews AC_MSG_ERROR("Client Cookie wants to use unavailable AES");
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews AC_DEFINE(AES_CC, 1,
ce67023ae3ad39a77da5361d0187ab6f3f0219cbMark Andrews [Use AES for Client Cookie generation])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "checkcc" = "$want_openssl_hash"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt want_openssl_hash="no"
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt# Use OpenSSL for hash functions
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntAC_MSG_CHECKING(for using OpenSSL for hash functions)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase $want_openssl_hash in
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt if test "$CRYPTO" != "-DOPENSSL"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([No OpenSSL for hash functions])
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews AC_MSG_RESULT(yes)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt ISC_OPENSSL_INC="$DST_OPENSSL_INC"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews AC_MSG_RESULT(no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_PLATFORM_OPENSSLHASH)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(ISC_OPENSSL_INC)
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark AndrewsAC_SUBST(ISC_OPENSSL_LIBS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# PKCS11 (aka crypto hardware) support (--with moved just after openssl)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_MSG_CHECKING(for PKCS11 support)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "auto" = "$use_pkcs11"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$want_native_pkcs11"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_pkcs11="yes"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt use_pkcs11="no"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_pkcs11" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(no)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt USE_PKCS11=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt PKCS11_TEST=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt PKCS11_TOOLS=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_C=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_O=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_API_C=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_API_O=""
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan Hunt ISC_PK11_RESULT_C=""
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan Hunt ISC_PK11_RESULT_O=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_ISCPK11_API_C=""
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_ISCPK11_API_O=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(yes)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews if ! $use_threads; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_ERROR([PKCS11 requires thread support])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "X$CRYPTO" = "X-DOPENSSL"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_CHECKING(for OpenSSL with PKCS11 support)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews saved_cc="$CC"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_cflags="$CFLAGS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt saved_libs="$LIBS"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews CC="$CC -pthread"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CFLAGS="$CFLAGS $DST_OPENSSL_INC"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews LIBS="$LIBS $DST_OPENSSL_LIBS"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_TRY_RUN([
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt OPENSSL_config(NULL);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt e = ENGINE_by_id("pkcs11");
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (e == NULL)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt if (ENGINE_init(e) <= 0)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(yes)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_TEST=pkcs11ssl
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_ENGINE='-DPKCS11_ENGINE="\"pkcs11\""'],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_TEST=''
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'],
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt [AC_MSG_RESULT(cross compile, defaulting to no)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_TEST=''
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews CC="$saved_cc"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt CFLAGS="$saved_cflags"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt LIBS="$saved_libs"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_TEST=''
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_ENGINE='-DPKCS11_ENGINE=NULL'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt USE_PKCS11='-DUSE_PKCS11'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_TOOLS=pkcs11
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_CHECK_FUNC(getpassphrase, AC_DEFINE(HAVE_GETPASSPHRASE),)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_C="pk11.c"
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_O="pk11.$O"
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_API_C="pk11_api.c"
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_PK11_API_O="pk11_api.$O"
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan Hunt ISC_PK11_RESULT_C="pk11_result.c"
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan Hunt ISC_PK11_RESULT_O="pk11_result.$O"
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_ISCPK11_API_C="unix/pk11_api.c"
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt ISC_ISCPK11_API_O="unix/pk11_api.$O"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(USE_PKCS11)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_TOOLS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_ENGINE)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_PK11_C)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_PK11_O)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_PK11_API_C)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_PK11_API_O)
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan HuntAC_SUBST(ISC_PK11_RESULT_C)
acbb301e648b82fcc38b876a44403cf0fe539cc9Evan HuntAC_SUBST(ISC_PK11_RESULT_O)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_ISCPK11_API_C)
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAC_SUBST(ISC_ISCPK11_API_O)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_MSG_CHECKING(for PKCS11 tools)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$use_pkcs11" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_PROVIDER="undefined"
dee520f1be8c59e10a55b6995844395e811c310fBrian Wellington AC_MSG_RESULT(disabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_PROVIDER="undefined"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(enabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_PROVIDER="$use_pkcs11"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT([enabled, PKCS11 provider is $PKCS11_PROVIDER])
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_PROVIDER)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntPKCS11_ECDSA=""
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntPKCS11_GOST=""
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontPKCS11_ED25519=""
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrewsset_pk11_flavor="no"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_MSG_CHECKING(for native PKCS11)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntcase "$want_native_pkcs11" in
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(using native PKCS11 crypto)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11LINKOBJS='${PKCS11LINKOBJS}'
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11LINKSRCS='${PKCS11LINKSRCS}'
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews PKCS11_TEST=pkcs11
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_CHECKING(for PKCS11 ECDSA)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$with_ecdsa" in
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_RESULT(disabled)
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_RESULT(enabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_ECDSA="yes"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_PKCS11_ECDSA, 1,
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [Define if your PKCS11 provider supports ECDSA.])
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_CHECKING(for PKCS11 GOST)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt case "$with_gost" in
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_RESULT(enabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt PKCS11_GOST="yes"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_PKCS11_GOST, 1,
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews [Define if your PKCS11 provider supports GOST.])
3be40291a093da104557a1748847c7e8bc5e9862Evan Hunt AC_MSG_RESULT(disabled)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_CHECKING(for PKCS11 Ed25519)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case "$with_eddsa" in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_RESULT(enabled)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont PKCS11_ED25519="yes"
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_DEFINE(HAVE_PKCS11_ED25519, 1,
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [Define if your PKCS11 provider supports Ed25519.])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_CHECKING(for PKCS11 Ed448)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont case "$with_eddsa" in
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_RESULT(enabled)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_DEFINE(HAVE_PKCS11_ED448, 1,
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont [Define if your PKCS11 provider supports Ed448.])
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_RESULT(disabled)
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont AC_MSG_RESULT(disabled)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_CHECKING(for PKCS11 flavor)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews case "$PKCS11_PROVIDER" in
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(Thales nCipher)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews pk11_flavor="PK11_THALES_FLAVOR"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews set_pk11_flavor="yes"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews *libsofthsm2*)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(SoftHSMv2)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews pk11_flavor="PK11_SOFTHSMV2_FLAVOR"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews set_pk11_flavor="yes"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews *libsofthsm*)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(SoftHSM)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews pk11_flavor="PK11_SOFTHSMV1_FLAVOR"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews set_pk11_flavor="yes"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(Cryptech)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews pk11_flavor="PK11_CRYPTECH_FLAVOR"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews set_pk11_flavor="yes"
f5c17a057fc5974bb51d7bc8c5827a7fd6dc9aeeEvan Hunt AC_MSG_RESULT(AEP Keyper)
f5c17a057fc5974bb51d7bc8c5827a7fd6dc9aeeEvan Hunt pk11_flavor="PK11_AEP_FLAVOR"
f5c17a057fc5974bb51d7bc8c5827a7fd6dc9aeeEvan Hunt set_pk11_flavor="yes"
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(undefined provider?)
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews AC_MSG_RESULT(unknown provider: tweaks are in lib/isc/include/pk11/site.h)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$set_pk11_flavor" ; then
c40906dfad6dd6e3a3e3c94b8c8847bc9bc064e5Mark Andrews CFLAGS="$CFLAGS -DPK11_FLAVOR=$pk11_flavor"
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_MSG_RESULT(disabled)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11LINKOBJS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11LINKSRCS)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(CRYPTO)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_ECDSA)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_GOST)
78608b0a454246d0e1e0169f1d671b8427e48199Francis DupontAC_SUBST(PKCS11_ED25519)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_SUBST(PKCS11_TEST)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# for PKCS11 benchmarks
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunthave_clock_gt=no
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntAC_CHECK_FUNC(clock_gettime,have_clock_gt=yes,)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "no" = "$have_clock_gt"; then
be42c2e7dc19f4602671420dd171307ec4a68896Francis Dupont AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,)
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "no" != "$have_clock_gt"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "rt" = "$have_clock_gt"; then
be42c2e7dc19f4602671420dd171307ec4a68896Francis Dupont LIBS="-lrt $LIBS"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt# was --with-lmdb specified?
801707fe19600313a0b1f7845a518100f69e58b6Evan HuntAC_MSG_CHECKING(for lmdb library)
801707fe19600313a0b1f7845a518100f69e58b6Evan HuntAC_ARG_WITH(lmdb,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-lmdb[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [build with LMDB library [yes|no|path]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_lmdb="$withval", use_lmdb="auto")
801707fe19600313a0b1f7845a518100f69e58b6Evan Huntcase "$use_lmdb" in
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt lmdb_libs=""
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt if test -f "${d}/include/lmdb.h"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt if test ${d} != /usr
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt lmdb_cflags="-I ${d}/include"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt LIBS="$LIBS -L${d}/lib"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt have_lmdb="yes"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt if test -f "${use_lmdb}/include/lmdb.h"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt lmdb_cflags="-I${use_lmdb}/include"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt LIBS="$LIBS -L${use_lmdb}/lib"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt have_lmdb="yes"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
801707fe19600313a0b1f7845a518100f69e58b6Evan Huntif test "X${have_lmdb}" != "X"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_MSG_RESULT(yes)
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_SEARCH_LIBS([mdb_env_create], [lmdb], [],
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt [AC_MSG_ERROR([found lmdb include but not library.])
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt have_lmdb=""])
801707fe19600313a0b1f7845a518100f69e58b6Evan Huntelif test "X$use_lmdb" = Xyes
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_MSG_ERROR([include/lmdb.h not found.])
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_MSG_RESULT(no)
801707fe19600313a0b1f7845a518100f69e58b6Evan Huntif test "X${have_lmdb}" != "X"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt CFLAGS="$CFLAGS $lmdb_cflags"
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt AC_DEFINE(HAVE_LMDB, 1, [Define if lmdb was found])
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt NZD_TOOLS="nzd"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews NZDSRCS='${NZDSRCS}'
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews NZDTARGETS='${NZDTARGETS}'
801707fe19600313a0b1f7845a518100f69e58b6Evan HuntAC_SUBST(NZD_TOOLS)
801707fe19600313a0b1f7845a518100f69e58b6Evan HuntAC_SUBST(NZDSRCS)
801707fe19600313a0b1f7845a518100f69e58b6Evan HuntAC_SUBST(NZDTARGETS)
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews# was --with-libxml2 specified?
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark AndrewsAC_MSG_CHECKING(for libxml2 library)
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark AndrewsAC_ARG_WITH(libxml2,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-libxml2[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [build with libxml2 library [yes|no|path]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_libxml2="$withval", use_libxml2="auto")
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrewscase "$use_libxml2" in
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews DST_LIBXML2_INC=""
b7945d73bc42499d50d5c4af6a525fe56e4dfacaMark Andrews case X`(xml2-config --version) 2>/dev/null` in
0277a7d6c19ab116b6832076ab9d850e1bf112d3Mark Andrews X2.[[6789]].*)
b7945d73bc42499d50d5c4af6a525fe56e4dfacaMark Andrews libxml2_libs=`xml2-config --libs`
b7945d73bc42499d50d5c4af6a525fe56e4dfacaMark Andrews libxml2_cflags=`xml2-config --cflags`
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_libxml2" ; then
bcf76c1fb8ada1e9c900a00ca5253f677b9ddaf1Evan Hunt AC_MSG_RESULT(no)
bcf76c1fb8ada1e9c900a00ca5253f677b9ddaf1Evan Hunt AC_MSG_ERROR(required libxml2 version not available)
bcf76c1fb8ada1e9c900a00ca5253f677b9ddaf1Evan Hunt libxml2_libs=
bcf76c1fb8ada1e9c900a00ca5253f677b9ddaf1Evan Hunt libxml2_cflags=
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews if test -f "$use_libxml2/bin/xml2-config" ; then
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrewsif test "X$libxml2_libs" != "X"
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews CFLAGS="$CFLAGS $libxml2_cflags"
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews LIBS="$LIBS $libxml2_libs"
53f91cbd80dc353ecb7e8914dae84a6cd85c67c6Mark Andrews # Sanity check xml2-config output.
53f91cbd80dc353ecb7e8914dae84a6cd85c67c6Mark Andrews AC_TRY_LINK([#include <libxml/xmlwriter.h>],
53f91cbd80dc353ecb7e8914dae84a6cd85c67c6Mark Andrews [return(xmlTextWriterStartElement(NULL, NULL));],
53f91cbd80dc353ecb7e8914dae84a6cd85c67c6Mark Andrews AC_MSG_RESULT(yes),
53f91cbd80dc353ecb7e8914dae84a6cd85c67c6Mark Andrews AC_MSG_ERROR(xml2-config returns badness))
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
186e7f37c9fc985a7a7264cc8170e48a25bed434Mark Andrews AC_MSG_RESULT(no)
aa9b64060fb6e946a920e957805f564d149e88e0Evan HuntAC_SUBST(XMLSTATS)
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Hunt# was --with-libjson specified?
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan HuntAC_MSG_CHECKING(for json library)
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan HuntAC_ARG_WITH(libjson,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-libjson[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [build with libjson0 library [yes|no|path]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_libjson="$withval", use_libjson="auto")
d94e22448b1bac4387386febb09aebb5554577b6Evan Hunthave_libjson=""
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrewshave_libjson_c=""
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Huntcase "$use_libjson" in
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Hunt libjson_libs=""
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews if test -f "${d}/include/json/json.h"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews if test ${d} != /usr
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews libjson_cflags="-I ${d}/include"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews LIBS="$LIBS -L${d}/lib"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews have_libjson="yes"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews elif test -f "${d}/include/json-c/json.h"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews if test ${d} != /usr
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews libjson_cflags="-I ${d}/include"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews LIBS="$LIBS -L${d}/lib"
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews have_libjson="yes"
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews have_libjson_c="yes"
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Hunt if test -f "${use_libjson}/include/json/json.h"
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews libjson_cflags="-I${use_libjson}/include"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt LIBS="$LIBS -L${use_libjson}/lib"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt have_libjson="yes"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt elif test -f "${use_libjson}/include/json-c/json.h"
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews libjson_cflags="-I${use_libjson}/include"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt LIBS="$LIBS -L${use_libjson}/lib"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt have_libjson="yes"
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews have_libjson_c="yes"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt AC_MSG_ERROR([$use_libjson/include/json{,-c}/json.h not found.])
673a2bb07b9e54a32699a9d7ca916dc5114d8d45Mark Andrewsif test "X${have_libjson}" != "X"
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Hunt AC_MSG_RESULT(yes)
673a2bb07b9e54a32699a9d7ca916dc5114d8d45Mark Andrews AC_SEARCH_LIBS([json_object_new_int64], [json json-c], [],
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews [AC_MSG_ERROR([found libjson include but not library.])
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews have_libjson=""])
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrewselif test "X$use_libjson" = Xyes
a0f91e910bd9af006a65e555ec4082864ca1eb8dMark Andrews AC_MSG_ERROR([include/json{,-c}/json.h not found.])
feb067b25a8e33db62e2a7bf2e83bbb7f6eee845Evan Hunt AC_MSG_RESULT(no)
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Huntif test "X${have_libjson}" != "X"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt CFLAGS="$CFLAGS $libjson_cflags"
4b13ea47db7d72596d3fa10c30b20c16b4936747Evan Hunt AC_DEFINE(HAVE_JSON, 1, [Define if libjson was found])
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews if test "X${have_libjson_c}" = Xyes
8a9bac8dec81997fec38fb880dc81b41eb026c27Mark Andrews AC_DEFINE(HAVE_JSON_C, 1, [Define if json-c was found])
aa9b64060fb6e946a920e957805f564d149e88e0Evan HuntAC_SUBST(JSONSTATS)
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki# was --with-zlib specified?
a239044323418956d7d48c14d61d19f721cc5ba5Witold KrecickiAC_MSG_CHECKING(for zlib library)
a239044323418956d7d48c14d61d19f721cc5ba5Witold KrecickiAC_ARG_WITH(zlib,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-zlib[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [build with zlib for HTTP compression
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [default=yes]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews with_zlib="$withval", with_zlib="auto")
e09b40bec46ae8486a0ebea9aa888962c77d6556Mark Andrewscase "$with_zlib" in
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki if test -f "${d}/include/zlib.h"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki if test ${d} != /usr
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki zlib_cflags="-I ${d}/include"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki LIBS="$LIBS -L${d}/lib"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki have_zlib="yes"
9789e54e55b61b669fb31a8b70e9655e8357dda2Mark Andrews if test -f "${with_zlib}/include/zlib.h"
e09b40bec46ae8486a0ebea9aa888962c77d6556Mark Andrews zlib_cflags="-I${with_zlib}/include"
e09b40bec46ae8486a0ebea9aa888962c77d6556Mark Andrews LIBS="$LIBS -L${with_zlib}/lib"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki have_zlib="yes"
e09b40bec46ae8486a0ebea9aa888962c77d6556Mark Andrews AC_MSG_ERROR([$with_zlib/include/zlib.h not found.])
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecickiif test "X${have_zlib}" != "X"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki AC_MSG_RESULT(yes)
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki AC_SEARCH_LIBS([deflate], [z], [],
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki [AC_MSG_ERROR([found zlib include but not library.])
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki have_zlib=""])
e09b40bec46ae8486a0ebea9aa888962c77d6556Mark Andrewselif test "X$with_zlib" = Xyes
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki AC_MSG_ERROR([include/zlib.h not found.])
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki AC_MSG_RESULT(no)
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecickiif test "X${have_zlib}" != "X"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki CFLAGS="$CFLAGS $zlib_cflags"
a239044323418956d7d48c14d61d19f721cc5ba5Witold Krecicki AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib was found])
aa9b64060fb6e946a920e957805f564d149e88e0Evan HuntAC_SUBST(ZLIB)
23ac30603a7639bea1d331537634b079b046b122Mark Andrews# In solaris 10, SMF can manage named service
23ac30603a7639bea1d331537634b079b046b122Mark AndrewsAC_CHECK_LIB(scf, smf_enable_instance)
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington# flockfile is usually provided by pthreads, but we may want to use it
64b92523f9333ba053f4b2860335583be455b0b3Brian Wellington# even if compiled with --disable-threads. getc_unlocked might also not
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian WellingtonAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
64b92523f9333ba053f4b2860335583be455b0b3Brian WellingtonAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence# Indicate what the final decision was regarding threads.
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_MSG_CHECKING(whether to build with threads)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrenceif $use_threads; then
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_MSG_RESULT(yes)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence AC_MSG_RESULT(no)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence# End of pthreads stuff.
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(largefile,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-largefile], [64-bit file support]),
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley want_largefile="yes", want_largefile="no")
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halleycase $want_largefile in
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence# Additional compiler settings.
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceMKDEPCFLAGS="-M"
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceIRIX_DNSSEC_WARNINGS_HACK=""
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrenceif test "X$GCC" = "Xyes"; then
603a78708343f063b44affb882ef93bb19a5142aMark Andrews STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
728156dfbdced7bc18b1f88227cced9d426a70e7Mark Andrews AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
603a78708343f063b44affb882ef93bb19a5142aMark Andrews SAVE_CFLAGS="$CFLAGS"
e840f92bfba0881039f1cdfb3349ecb03382b7beMark Andrews CFLAGS="$CFLAGS -Werror -fno-strict-aliasing"
728156dfbdced7bc18b1f88227cced9d426a70e7Mark Andrews AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
603a78708343f063b44affb882ef93bb19a5142aMark Andrews CFLAGS="$SAVE_CFLAGS"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$FNOSTRICTALIASING"; then
728156dfbdced7bc18b1f88227cced9d426a70e7Mark Andrews AC_MSG_RESULT(yes)
603a78708343f063b44affb882ef93bb19a5142aMark Andrews STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"
603a78708343f063b44affb882ef93bb19a5142aMark Andrews AC_MSG_RESULT(no)
603a78708343f063b44affb882ef93bb19a5142aMark Andrews # turn off delete null pointer checks
603a78708343f063b44affb882ef93bb19a5142aMark Andrews AC_MSG_CHECKING(if "$CC" supports -fno-delete-null-pointer-checks)
603a78708343f063b44affb882ef93bb19a5142aMark Andrews SAVE_CFLAGS="$CFLAGS"
e840f92bfba0881039f1cdfb3349ecb03382b7beMark Andrews CFLAGS="$CFLAGS -Werror -fno-delete-null-pointer-checks"
603a78708343f063b44affb882ef93bb19a5142aMark Andrews AC_TRY_COMPILE(,, [FNODELETENULLPOINTERCHECKS=yes],
603a78708343f063b44affb882ef93bb19a5142aMark Andrews [FNODELETENULLPOINTERCHECKS=no])
603a78708343f063b44affb882ef93bb19a5142aMark Andrews CFLAGS="$SAVE_CFLAGS"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$FNODELETENULLPOINTERCHECKS"; then
603a78708343f063b44affb882ef93bb19a5142aMark Andrews AC_MSG_RESULT(yes)
603a78708343f063b44affb882ef93bb19a5142aMark Andrews STD_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"
728156dfbdced7bc18b1f88227cced9d426a70e7Mark Andrews AC_MSG_RESULT(no)
3ea6d4dc33482a752553c59ed94bcecd23d254b0Mark Andrews case "$host" in
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt if test "X$enable_warn_shadow" = Xyes; then
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt STD_CWARNINGS="$STD_CWARNINGS -Wshadow"
1c1290afabb3c8f4dd498170ac9592e5be450161Mark Andrews if test "X$enable_warn_error" = Xyes; then
1c1290afabb3c8f4dd498170ac9592e5be450161Mark Andrews STD_CWARNINGS="$STD_CWARNINGS -Werror"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence case $host in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CC="$CC -std"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CCOPT="$CCOPT -std"
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt CCNOOPT="$CCNOOPT -std"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence MKDEPCC="$CC"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CC="$CC -Ae -z"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # The version of the C compiler that constantly warns about
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # 'const' as well as alignment issues is unfortunately not
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # able to be discerned via the version of the operating
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews # system, nor does cc have a version flag.
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence case "`$CC +W 123 2>&1`" in
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence *Unknown?option*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence STD_CWARNINGS="+w1"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # Turn off the pointlessly noisy warnings.
16ee4fe11bad616a76c79e9f626a7e04a88ef4abMark Andrews STD_CWARNINGS="+w1 +W 474,530,2193,2236"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence CCOPT="$CCOPT -Ae -z"
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt CCNOOPT="$CCNOOPT -Ae -z"
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews CFLAGS="$CFLAGS -Wl,+vnocompatwarnings"
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews BACKTRACECFLAGS="$BACKTRACECFLAGS -Wl,+vnocompatwarnings"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence STD_CWARNINGS="-fullwarn -woff 1209"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # Silence more than 250 instances of
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # "prototyped function redeclared without prototype"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # and 11 instances of
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence # "variable ... was set but never used"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence MKDEPCFLAGS="-xM"
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_SUBST(MKDEPCC)
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_SUBST(MKDEPCFLAGS)
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_SUBST(MKDEPPROG)
9a2574531e3d2ced31072200b416467fdee0c29cDavid LawrenceAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob HalleyAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# -lxnet buys us one big porting headache... standards, gotta love 'em.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# AC_CHECK_LIB(xnet, socket, ,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# AC_CHECK_LIB(socket, socket)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Use this for now, instead:
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graffcase "$host" in
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff mips-sgi-irix*)
882350d11c90de9de6fc1cead25690c8114b0b95Michael Graff AC_CHECK_LIB(socket, socket)
d5518bf5bc1830f89f411288f39c5c9e6eb7511cMark Andrews AC_CHECK_LIB(nsl, inet_addr)
4e9775118dbf128dd296f01638733ba221f76c34Mark Andrews# Work around Solaris's select() limitations.
4e9775118dbf128dd296f01638733ba221f76c34Mark Andrewscase "$host" in
4e9775118dbf128dd296f01638733ba221f76c34Mark Andrews *-solaris2.[[89]]|*-solaris2.1?)
4e9775118dbf128dd296f01638733ba221f76c34Mark Andrews AC_DEFINE(FD_SETSIZE, 65536,
4e9775118dbf128dd296f01638733ba221f76c34Mark Andrews [Solaris hack to get select_large_fdset.])
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob# Purify support
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_MSG_CHECKING(whether to use purify)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_ARG_WITH(purify,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-purify[=PATH]], [use Rational purify]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_purify="$withval", use_purify="no")
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobcase "$use_purify" in
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_PATH_PROG(purify_path, purify, purify)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob purify_path="$use_purify"
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacobcase "$use_purify" in
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_MSG_RESULT(no)
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test -f "$purify_path" || test purify = "$purify_path"; then
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_MSG_RESULT($purify_path)
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob PURIFYFLAGS="`echo $PURIFYOPTIONS`"
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob PURIFY="$purify_path $PURIFYFLAGS"
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob AC_MSG_ERROR([$purify_path not found.
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobPlease choose the proper path with the following command:
d901b2252d664a5b96bae117416f8ee822dc6691Stephen Jacob configure --with-purify=PATH
d901b2252d664a5b96bae117416f8ee822dc6691Stephen JacobAC_SUBST(PURIFY)
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont# Google/Great Performance Tools CPU Profiler
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis DupontAC_MSG_CHECKING(whether to use gperftools profiler)
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis DupontAC_ARG_WITH(gperftools-profiler,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-gperftools-profiler],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use gperftools CPU profiler]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_profiler="$withval", use_profiler="no")
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupontcase $use_profiler in
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont AC_MSG_RESULT(yes)
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont AC_DEFINE([HAVE_GPERFTOOLS_PROFILER], 1,
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont [Define to use gperftools CPU profiler.])
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont LIBS="$LIBS -lprofiler"
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont AC_MSG_RESULT(no)
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉# enable/disable dumping stack backtrace. Also check if the system supports
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉# glibc-compatible backtrace() function.
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉AC_ARG_ENABLE(backtrace,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-backtrace],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [log stack backtrace on abort [default=yes]]),
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 want_backtrace="$enableval", want_backtrace="yes")
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉case $want_backtrace in
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 AC_TRY_LINK([#include <execinfo.h>],
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 [return (backtrace((void **)0, 0));],
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 [AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉AC_ARG_ENABLE(symtable,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-symtable],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use internal symbol table for backtrace
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [all|minimal(default)|none]]),
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 want_symtable="$enableval", want_symtable="minimal")
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉case $want_symtable in
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "" = "$PERL"
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉Install perl or explicitly disable the feature by --disable-symtable.])
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_libtool"; then
866a531c59f4005b6857b633a0db6ef00e7741efTatuya JINMEI 神明達哉 AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 # we generate the internal symbol table only for those systems
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 # known to work to avoid unexpected build failure. Also, warn
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 # about unsupported systems when the feature is enabled
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 case $host_os in
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 MKSYMTBL_PROGRAM="$PERL"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "all" = "$want_symtable"; then
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 ALWAYS_MAKE_SYMTABLE="yes"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
2c016c64f533171e1342c1914754b017026c8ad5Tatuya JINMEI 神明達哉 AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉AC_SUBST(MKSYMTBL_PROGRAM)
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉AC_SUBST(ALWAYS_MAKE_SYMTABLE)
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson# File name extension for static archive files, for those few places
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson# where they are treated differently from dynamic ones.
c64aeaf419a7ef156b4aabfa2a913831e773157eBob HalleyAC_SUBST(LIBTOOL_MKDEP_SED)
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark AndrewsAC_SUBST(LIBTOOL_MODE_COMPILE)
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark AndrewsAC_SUBST(LIBTOOL_MODE_INSTALL)
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark AndrewsAC_SUBST(LIBTOOL_MODE_LINK)
8a5809527e6c85e39699901712a455d5480907c1Evan HuntAC_SUBST(LIBTOOL_MODE_UNINSTALL)
aceae69c7f3e76e8842de178851928619c65b61cMark AndrewsAC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
6e1141e6e83b3907b8b187d97932f30fa82470efMark AndrewsAC_SUBST(LIBTOOL_IN_MAIN)
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan HuntBIND9_CO_RULE=".c.$O:"
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_SUBST(BIND9_CO_RULE)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Here begins a very long section to determine the system's networking
323a9f3430abf186f8f84d795549391a8ed7f274Francis Dupont# capabilities. The order of the tests is significant.
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid LawrenceAC_ARG_ENABLE(ipv6,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-ipv6], [use IPv6 [default=autodetect]]))
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellingtoncase "$enable_ipv6" in
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington yes|''|autodetect)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington AC_DEFINE(WANT_IPV6)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# We do the IPv6 compilation checking after libtool so that we can put
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# the right suffix on the files.
4108eed5092156cf0407a97a9bd8ab7775164694Brian WellingtonAC_MSG_CHECKING(for IPv6 structures)
4108eed5092156cf0407a97a9bd8ab7775164694Brian WellingtonAC_TRY_COMPILE([
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington[struct sockaddr_in6 sin6; return (0);],
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington [AC_MSG_RESULT(yes)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington found_ipv6=yes],
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington [AC_MSG_RESULT(no)
4108eed5092156cf0407a97a9bd8ab7775164694Brian Wellington found_ipv6=no])
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# See whether IPv6 support is provided via a Kame add-on.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# This is done before other IPv6 linking tests to LIBS is properly set.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_MSG_CHECKING(for Kame IPv6 support)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_ARG_WITH(kame,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-kame[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use Kame IPv6 [default path /usr/local/v6]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_kame="$withval", use_kame="no")
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencecase "$use_kame" in
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence kame_path="$use_kame"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencecase "$use_kame" in
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_MSG_RESULT(no)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LIBS="-L$kame_path/lib -linet6 $LIBS"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrencePlease choose the proper path with the following command:
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence configure --with-kame=PATH
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# Including it on Kame-using platforms is very bad, though, because
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# Kame uses #error against direct inclusion. So include it on only
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# This is done before the in6_pktinfo check because that's what
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# netinet6/in6.h is needed for.
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencechangequote({, })
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrencecase "$host" in
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence*-bsdi4.[01]*)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence isc_netinet6in6_hack="#include <netinet6/in6.h>"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence isc_netinet6in6_hack=""
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrencechangequote([, ])
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence# This is similar to the netinet6/in6.h issue.
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrencecase "$host" in
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
aa30ee42c4b6da9bab4fb84d6cbbda6036a4d426Mark Andrews isc_netinetin6_hack="#include <netinet/in6.h>"
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence isc_netinetin6_hack=""
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence# Now delve deeper into the suitability of the IPv6 support.
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrencecase "$found_ipv6" in
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob Halley ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob Halley LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews AC_MSG_CHECKING(for in6_addr)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews AC_TRY_COMPILE([
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews$isc_netinetin6_hack
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews$isc_netinet6in6_hack
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews[struct in6_addr in6; return (0);],
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews [AC_MSG_RESULT(yes)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews isc_in_addr6_hack=""],
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews [AC_MSG_RESULT(no)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews isc_in_addr6_hack="#define in6_addr in_addr6"])
435532822dc571a904207d8176e063cc8731eef5Bob Halley AC_MSG_CHECKING(for in6addr_any)
9ac79ef3f89b23d80f9649abf71fdc65bb7a8b62David Lawrence AC_TRY_LINK([
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews$isc_netinetin6_hack
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews$isc_netinet6in6_hack
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark Andrews$isc_in_addr6_hack
7c014c5bf41dc38802e8889c0a9110204eb1a552Andreas Gustafsson [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
435532822dc571a904207d8176e063cc8731eef5Bob Halley [AC_MSG_RESULT(yes)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
435532822dc571a904207d8176e063cc8731eef5Bob Halley [AC_MSG_RESULT(no)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson AC_MSG_CHECKING(for in6addr_loopback)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson$isc_netinetin6_hack
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson$isc_netinet6in6_hack
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson$isc_in_addr6_hack
7c014c5bf41dc38802e8889c0a9110204eb1a552Andreas Gustafsson [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson [AC_MSG_RESULT(yes)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson [AC_MSG_RESULT(no)
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
9f6c66e1b3902b61256267d124f1b9cd61402e76Andreas Gustafsson LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff AC_TRY_COMPILE([
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff$isc_netinetin6_hack
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff$isc_netinet6in6_hack
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff [AC_MSG_RESULT(yes)
6526fd032fc418411da3af4201214e95c113d3e2Mark Andrews ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff [AC_MSG_RESULT(no)
6526fd032fc418411da3af4201214e95c113d3e2Mark Andrews ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff LWRES_HAVE_SIN6_SCOPE_ID="$result"
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff AC_MSG_CHECKING(for in6_pktinfo)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid Lawrence AC_TRY_COMPILE([
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence$isc_netinetin6_hack
dc97fe4ed08488d314ab5bc8e99ed839542cf411David Lawrence$isc_netinet6in6_hack
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff [struct in6_pktinfo xyzzy; return (0);],
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff [AC_MSG_RESULT(yes)
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob Halley LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
9ac79ef3f89b23d80f9649abf71fdc65bb7a8b62David Lawrence ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
8313838954d67250d0ed7edf67fba5da0790d1a7Michael Graff LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
6526fd032fc418411da3af4201214e95c113d3e2Mark Andrews ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence ISC_IPV6_O="ipv6.$O"
7bb707a34778fc4bd9624d6c5de95675424ea59fDavid Lawrence ISC_ISCIPV6_O="unix/ipv6.$O"
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_MSG_CHECKING(for struct sockaddr_storage)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_TRY_COMPILE([
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews$isc_netinetin6_hack
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews$isc_netinet6in6_hack
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews[struct sockaddr_storage storage; return (0);],
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews[AC_MSG_RESULT(yes)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsISC_PLATFORM_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"],
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews[AC_MSG_RESULT(no)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"])
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob HalleyAC_SUBST(ISC_PLATFORM_HAVEIPV6)
35c842e05dc6382ce1d9161a658d3ff4b2c3d4c9Bob HalleyAC_SUBST(LWRES_PLATFORM_HAVEIPV6)
dc97fe4ed08488d314ab5bc8e99ed839542cf411David LawrenceAC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
dc97fe4ed08488d314ab5bc8e99ed839542cf411David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
0adde9f4f9369b23c67b9a29e824dda09b19022fDavid LawrenceAC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark AndrewsAC_SUBST(ISC_PLATFORM_HAVEINADDR6)
19cfe6a53b6b932a375299ff8d82dbd66e54b5fdMark AndrewsAC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
435532822dc571a904207d8176e063cc8731eef5Bob HalleyAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
2f330bed30b752451b8a5258c7551b22ba602337Andreas GustafssonAC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
2f330bed30b752451b8a5258c7551b22ba602337Andreas GustafssonAC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael GraffAC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
e544b507b8019a62c5d2716281f6832519a8791dDavid LawrenceAC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE)
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob HalleyAC_SUBST(ISC_IPV6_H)
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob HalleyAC_SUBST(ISC_IPV6_O)
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob HalleyAC_SUBST(ISC_ISCIPV6_O)
0fde58a7673f28fcc08eb8f597581247a4c2db20Bob HalleyAC_SUBST(ISC_IPV6_C)
8313838954d67250d0ed7edf67fba5da0790d1a7Michael GraffAC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
6526fd032fc418411da3af4201214e95c113d3e2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVESCOPEID)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_MSG_CHECKING([for struct if_laddrreq])
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_TRY_LINK([
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews],[ struct if_laddrreq a; ],
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews [AC_MSG_RESULT(yes)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews [AC_MSG_RESULT(no)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_MSG_CHECKING([for struct if_laddrconf])
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_TRY_LINK([
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews],[ struct if_laddrconf a; ],
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews [AC_MSG_RESULT(yes)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews [AC_MSG_RESULT(no)
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark Andrews ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
31d3464c0c0a35236c7924f698c5a8a66a9ed534Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Check for network functions that are often missing. We do this
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# after the libtool checking, so we can put the right suffix on
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# the files. It also needs to come after checking for a Kame add-on,
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# which provides some (all?) of the desired functions.
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark AndrewsAC_MSG_CHECKING([for inet_ntop with IPv6 support])
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark Andrewschar a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(yes)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(no)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt [AC_MSG_RESULT(assuming inet_ntop not needed)
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
41149b919e439a0551be66eabe76398ab493e436Andreas Gustafsson# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews# addresses with less than four octets, like "1.2.3". Also leading
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews# zeros should also be rejected.
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark AndrewsAC_MSG_CHECKING([for working inet_pton with IPv6 support])
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark Andrewsmain() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark Andrews inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
5f4098e478ae913cdc1bb8851599b8f2431050d3Mark Andrews (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(yes)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(no)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(assuming inet_pton needed)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
a59b51eb1d9a80d682efc669414e16dc8da47e95David LawrenceAC_SUBST(ISC_PLATFORM_NEEDNTOP)
a59b51eb1d9a80d682efc669414e16dc8da47e95David LawrenceAC_SUBST(ISC_PLATFORM_NEEDPTON)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for a 4.4BSD-style sa_len member in struct sockaddr.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencecase "$host" in
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence # Turn on 4.4BSD style sa_len support.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_DEFINE(_SOCKADDR_LEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for sa_len in struct sockaddr)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[struct sockaddr sa; sa.sa_len = 0; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_HAVESALEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(LWRES_PLATFORM_HAVESALEN)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for a 4.4BSD or 4.3BSD struct msghdr
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for struct msghdr flavor)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[struct msghdr msg; msg.msg_flags = 0; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(4.4BSD)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(4.3BSD)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for in_port_t.
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for type in_port_t)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[in_port_t port = 25; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_PLATFORM_NEEDPORTT)
b351a5864727a390e06d787e522b141ca760590fMichał Kępień# Allow forcibly disabling TCP Fast Open support as autodetection might yield
b351a5864727a390e06d787e522b141ca760590fMichał Kępień# confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
b351a5864727a390e06d787e522b141ca760590fMichał KępieńAC_ARG_ENABLE(tcp_fastopen,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--disable-tcp-fastopen],
d4e99895acc296bd2cab16bc3babbf39f34c9d22Mark Andrews [disable TCP Fast Open support [default=autodetect]]))
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsAC_MSG_CHECKING(for TCP_FASTOPEN socket option)
b351a5864727a390e06d787e522b141ca760590fMichał Kępieńcase "$enable_tcp_fastopen" in
b351a5864727a390e06d787e522b141ca760590fMichał Kępieńyes|''|autodetect)
b351a5864727a390e06d787e522b141ca760590fMichał Kępień AC_EGREP_CPP(has_tfo, [
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews#ifdef TCP_FASTOPEN
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewsint has_tfo() { return (0); }
b351a5864727a390e06d787e522b141ca760590fMichał Kępień [AC_MSG_RESULT(yes)
b351a5864727a390e06d787e522b141ca760590fMichał Kępień ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"],
b351a5864727a390e06d787e522b141ca760590fMichał Kępień [AC_MSG_RESULT(no)
b351a5864727a390e06d787e522b141ca760590fMichał Kępień ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"])
b351a5864727a390e06d787e522b141ca760590fMichał Kępień AC_MSG_RESULT(disabled)
b351a5864727a390e06d787e522b141ca760590fMichał Kępień ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVETFO)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Check for addrinfo
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for struct addrinfo)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[struct addrinfo a; return (0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 ISC_IRS_NEEDADDRINFO="#undef ISC_IRS_NEEDADDRINFO"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_DEFINE(HAVE_ADDRINFO)],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 ISC_IRS_NEEDADDRINFO="#define ISC_IRS_NEEDADDRINFO 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_NEEDADDRINFO)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_SUBST(ISC_IRS_NEEDADDRINFO)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews# Check for rrsetinfo
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_MSG_CHECKING(for struct rrsetinfo)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_TRY_COMPILE([
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews[struct rrsetinfo r; return (0);],
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews [AC_MSG_RESULT(yes)
c4157085cd215999883eb3de41bf16ce798379ceAndreas Gustafsson ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews [AC_MSG_RESULT(no)
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark Andrews ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
2449f41e75d3b3f1c0ec3f05b1603fd8f80d8ae0Mark AndrewsAC_SUBST(ISC_LWRES_NEEDRRSETINFO)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for int sethostent)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[int i = sethostent(0); return(0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_SETHOSTENTINT)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for int endhostent)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[int i = endhostent(); return(0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_ENDHOSTENTINT)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencestruct netent *getnetbyaddr(in_addr_t, int);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for int setnetent)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[int i = setnetent(0); return(0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_SETNETENTINT)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for int endnetent)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[int i = endnetent(); return(0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_ENDNETENTINT)
3aa5ecb8f7081d831bb267d45437e46c61a41f25Brian WellingtonAC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencestruct hostent *gethostbyaddr(const void *, size_t, int);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for h_errno in netdb.h)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_TRY_COMPILE([
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence[h_errno = 1; return(0);],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_NEEDHERRNO)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉# Sadly, the definitions of system-supplied getnameinfo(3) vary. Try to catch
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉# known variations here:
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_MSG_CHECKING(for getnameinfo prototype definitions)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_TRY_COMPILE([
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉int getnameinfo(const struct sockaddr *, socklen_t, char *,
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews socklen_t, char *, socklen_t, unsigned int);],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉[ return (0);],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t,
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews [Define to the sockaddr length type used by getnameinfo(3).])
e09cdbac087b88524ac40e943d040e2a032c48f2Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
e09cdbac087b88524ac40e943d040e2a032c48f2Mark Andrews [Define to the buffer length type used by getnameinfo(3).])
e09cdbac087b88524ac40e943d040e2a032c48f2Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
e09cdbac087b88524ac40e943d040e2a032c48f2Mark Andrews [Define to the flags type used by getnameinfo(3).])],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉[AC_TRY_COMPILE([
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉int getnameinfo(const struct sockaddr *, socklen_t, char *,
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews size_t, char *, size_t, int);],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉[ return (0);],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 [AC_MSG_RESULT(size_t for buflen; int for flags)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews[AC_TRY_COMPILE([
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrewsint getnameinfo(const struct sockaddr *, size_t, char *,
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews size_t, char *, size_t, int);],
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews[ return (0);],
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews [AC_MSG_RESULT(size_t for buflen; int for flags)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, size_t)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉 AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉[AC_MSG_RESULT(not match any subspecies; assume standard definition)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark AndrewsAC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])])
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉# ...and same for gai_strerror().
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉AC_MSG_CHECKING(for gai_strerror prototype definitions)
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉AC_TRY_COMPILE([
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉char *gai_strerror(int ecode);],
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉[ return (0); ],
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉 [AC_MSG_RESULT(returning char *)
588f79e557cd66ef77c90378a997b0d377af9db7Tatuya JINMEI 神明達哉 AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [char *],
4ffd660d41080dc4c5641c9ce4f80b04af611849Tatuya JINMEI 神明達哉 [return type of gai_strerror])],
4ffd660d41080dc4c5641c9ce4f80b04af611849Tatuya JINMEI 神明達哉[AC_MSG_RESULT(not match any subspecies; assume standard definition)
4ffd660d41080dc4c5641c9ce4f80b04af611849Tatuya JINMEI 神明達哉AC_DEFINE([IRS_GAISTRERROR_RETURN_T], [const char *])])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_CHECK_FUNC(getipnodebyname,
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_CHECK_FUNC(getnameinfo,
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_CHECK_FUNC(getaddrinfo,
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_DEFINE(HAVE_GETADDRINFO)],
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
703e1c0bb66f3cd3d300358ca0c1fdf3cb5fb1c5Brian WellingtonAC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_GETIPNODEPROTO)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_SUBST(ISC_IRS_GETNAMEINFOSOCKLEN)
8ca42f6318be756354b70260050132545aa680d3Mark AndrewsAC_ARG_ENABLE(getifaddrs,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-getifaddrs],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable the use of getifaddrs() [yes|no].]),
8ca42f6318be756354b70260050132545aa680d3Mark Andrews want_getifaddrs="$enableval", want_getifaddrs="yes")
ea8564f68adbacd904e55e47668fe1bbf65ddd1dMark Andrews# This interface iteration code for getifaddrs() will fall back to using
ea8564f68adbacd904e55e47668fe1bbf65ddd1dMark Andrews# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
8ca42f6318be756354b70260050132545aa680d3Mark Andrewscase $want_getifaddrs in
ea8564f68adbacd904e55e47668fe1bbf65ddd1dMark AndrewsAC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
ea8564f68adbacd904e55e47668fe1bbf65ddd1dMark AndrewsAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
ea8564f68adbacd904e55e47668fe1bbf65ddd1dMark AndrewsAC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence# Look for a sysctl call to get the list of network interfaces.
be0e075ac2c10ade3e80edef7fa14ac0fda92690Mark Andrewscase $ac_cv_header_sys_sysctl_h in
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_MSG_CHECKING(for interface list sysctl)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David LawrenceAC_EGREP_CPP(found_rt_iflist, [
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence#ifdef NET_RT_IFLIST
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrencefound_rt_iflist
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(yes)
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence AC_DEFINE(HAVE_IFLIST_SYSCTL)],
905e0c15332d3209dd73ff8b2334f6b80f7fe3a6David Lawrence [AC_MSG_RESULT(no)])
a59b51eb1d9a80d682efc669414e16dc8da47e95David Lawrence# Check for some other useful functions that are not ever-present.
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# reportedly defines strsep() without declaring it in <string.h> when
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# AC_CHECK_FUNC() incorrectly succeeds because it declares
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson# the function itself.
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas GustafssonAC_MSG_CHECKING(for correctly declared strsep())
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas GustafssonAC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson [AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
ba1549060f6bc5750adc20ed9d695f8b2cc556d7Andreas Gustafsson [AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
21f1794606dce19928cf455029e173321f166380Mark AndrewsAC_CHECK_FUNC(memmove,
21f1794606dce19928cf455029e173321f166380Mark Andrews [ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
21f1794606dce19928cf455029e173321f166380Mark Andrews [ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
21f1794606dce19928cf455029e173321f166380Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
21f1794606dce19928cf455029e173321f166380Mark AndrewsAC_CHECK_FUNC(strtoul,
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews [ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
ac124a78a097a0840992c5726cbbdaf1448b6ab3Mark Andrews LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews GENRANDOMLIB=""],
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews [ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
ac124a78a097a0840992c5726cbbdaf1448b6ab3Mark Andrews LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
a34d19803a206febe10866394393ec1c09b28984Mark Andrews GENRANDOMLIB='${ISCLIBS}'])
21f1794606dce19928cf455029e173321f166380Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark AndrewsAC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark AndrewsAC_SUBST(GENRANDOMLIB)
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark AndrewsAC_CHECK_FUNC(strlcpy,
70be3889746884692aa49939833d624ddd432bf0Mark Andrews [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews LWRES_PLATFORM_NEEDSTRLCPY="#undef LWRES_PLATFORM_NEEDSTRLCPY"],
70be3889746884692aa49939833d624ddd432bf0Mark Andrews [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews LWRES_PLATFORM_NEEDSTRLCPY="#define LWRES_PLATFORM_NEEDSTRLCPY 1"])
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
70be3889746884692aa49939833d624ddd432bf0Mark AndrewsAC_SUBST(LWRES_PLATFORM_NEEDSTRLCPY)
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark AndrewsAC_CHECK_FUNC(strlcat,
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark Andrews [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark Andrews [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
935000aa6e2b9d08f363b2e698a258a458a5a7cfMark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
60fb67079ebd868e1053181e73792704c3db17efEvan HuntAC_CHECK_FUNC(strcasestr,
60fb67079ebd868e1053181e73792704c3db17efEvan Hunt [ISC_PLATFORM_NEEDSTRCASESTR="#undef ISC_PLATFORM_NEEDSTRCASESTR"],
60fb67079ebd868e1053181e73792704c3db17efEvan Hunt [ISC_PLATFORM_NEEDSTRCASESTR="#define ISC_PLATFORM_NEEDSTRCASESTR 1"])
60fb67079ebd868e1053181e73792704c3db17efEvan HuntAC_SUBST(ISC_PLATFORM_NEEDSTRCASESTR)
dab4aac006fadcaf3c5a9ccd983188b37ead08eeMark AndrewsAC_SUBST(READLINE_LIB)
1d32b1df372d6be6bac6450739b9e5ea23819995Evan HuntAC_ARG_WITH(readline,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-readline[=LIBSPEC]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [specify readline library [default auto]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_readline="$withval", use_readline="auto")
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrewscase "$use_readline" in
017cbd4429a16d1b8eb77333c86f022dcc31045dEvan Hunt saved_LIBS="$LIBS"
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews case "$use_readline" in
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews *) try_readline="$use_readline"
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews for readline in "$try_readline" $or_readline
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews LIBS="$readline"
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews AC_MSG_NOTICE(checking for readline with $readline)
017cbd4429a16d1b8eb77333c86f022dcc31045dEvan Hunt AC_CHECK_FUNCS(readline)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$ac_cv_func_readline"
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews READLINE_LIB="$readline"
017cbd4429a16d1b8eb77333c86f022dcc31045dEvan Hunt for lib in -lterminfo -ltermcap -lncurses -lcurses
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews AC_MSG_NOTICE(checking for readline with $readline $lib)
017cbd4429a16d1b8eb77333c86f022dcc31045dEvan Hunt unset ac_cv_func_readline
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews LIBS="$readline $lib"
017cbd4429a16d1b8eb77333c86f022dcc31045dEvan Hunt AC_CHECK_FUNCS(readline)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$ac_cv_func_readline"
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews READLINE_LIB="$readline $lib"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$ac_cv_func_readline"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "auto" != "$use_readline" &&
01387de5a773ccbfd576218a5a89e8bd78ca267fMark Andrews test "X$READLINE_LIB" = "X"
0b612b420df38f1b2f1ba19df727f77a492f08a7Mark Andrews AC_MSG_ERROR([The readline library was not found.])
dab4aac006fadcaf3c5a9ccd983188b37ead08eeMark Andrews LIBS="$saved_LIBS"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "yes" = "$ac_cv_func_readline"
2a1860ad83294da4abe34a72bdb6f5a28b87f2efMark Andrews case "$READLINE_LIB" in
2a1860ad83294da4abe34a72bdb6f5a28b87f2efMark Andrews AC_CHECK_HEADERS(editline/readline.h)
2a1860ad83294da4abe34a72bdb6f5a28b87f2efMark Andrews AC_CHECK_HEADERS(readline/readline.h)
2a1860ad83294da4abe34a72bdb6f5a28b87f2efMark Andrews AC_CHECK_HEADERS(readline/history.h)
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_PRINT_OBJS=
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_PRINT_SRCS=
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsISC_PLATFORM_NEEDPRINTF='#undef ISC_PLATFORM_NEEDPRINTF'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsISC_PLATFORM_NEEDFPRINTF='#undef ISC_PLATFORM_NEEDFPRINTF'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsISC_PLATFORM_NEEDSPRINTF='#undef ISC_PLATFORM_NEEDSPRINTF'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsISC_PLATFORM_NEEDVSNPRINTF='#undef ISC_PLATFORM_NEEDVSNPRINTF'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsLWRES_PLATFORM_NEEDVSNPRINTF='#undef LWRES_PLATFORM_NEEDVSNPRINTF'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_MSG_CHECKING(sprintf return type)
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsAC_TRY_COMPILE([
f95231835fdcd8d5f58486c9f9993602f27fe157Mark Andrews[ char buf[2]; return(*sprintf(buf,"x"));],
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews[AC_MSG_RESULT(char *)
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_PRINT_OBJS="print.$O"
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_PRINT_SRCS="print.c"
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
16a68807e13caea3183a41a5292f1b3f48b81a26Mark AndrewsLWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews],[AC_MSG_RESULT(int)])
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_CHECK_FUNC(vsnprintf, [],
734b3777705434fedc7eb4b4c5f51e9a606d86b7Mark Andrews [ISC_PRINT_OBJS="print.$O"
734b3777705434fedc7eb4b4c5f51e9a606d86b7Mark Andrews ISC_PRINT_SRCS="print.c"
16a68807e13caea3183a41a5292f1b3f48b81a26Mark Andrews ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
16a68807e13caea3183a41a5292f1b3f48b81a26Mark Andrews LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_MSG_CHECKING(printf for %z support)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews size_t j = 0;
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews char buf[100];
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews sprintf(buf, "%zu", j);
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews exit(strcmp(buf, "0") != 0);
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AC_MSG_RESULT(yes)],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AC_MSG_RESULT(no)
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews ISC_PRINT_OBJS="print.$O"
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews ISC_PRINT_SRCS="print.c"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ISC_PLATFORM_NEEDPRINTF='#define ISC_PLATFORM_NEEDPRINTF 1'
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ISC_PLATFORM_NEEDFPRINTF='#define ISC_PLATFORM_NEEDFPRINTF 1'
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ISC_PLATFORM_NEEDFSRINTF='#define ISC_PLATFORM_NEEDSPRINTF 1'
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark Andrews LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [AC_MSG_RESULT(assuming target platform supports %z)])
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDPRINTF)
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDFPRINTF)
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob HalleyAC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
16a68807e13caea3183a41a5292f1b3f48b81a26Mark AndrewsAC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
f95231835fdcd8d5f58486c9f9993602f27fe157Mark AndrewsISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob HalleyAC_SUBST(ISC_EXTRA_OBJS)
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob HalleyAC_SUBST(ISC_EXTRA_SRCS)
7507c1826f7a7d6820d1323f6091e4d1aef29320Mark AndrewsAC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews# Use our own SPNEGO implementation?
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsAC_ARG_ENABLE(isc-spnego,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--disable-isc-spnego],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [use SPNEGO from GSSAPI library]))
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrewsif test -n "$USE_GSSAPI"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case "$enable_isc_spnego" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews AC_MSG_RESULT(using SPNEGO from lib/dns)
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews AC_MSG_RESULT(using SPNEGO from GSSAPI library)
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsAC_SUBST(USE_ISC_SPNEGO)
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsAC_SUBST(DST_EXTRA_OBJS)
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsAC_SUBST(DST_EXTRA_SRCS)
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson# Determine the printf format characters to use when printing
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# values of type isc_int64_t. This will normally be "ll", but where
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# the compiler treats "long long" as a alias for "long" and printf
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# doesn't know about "long long" use "l". Hopefully the sprintf
323a9f3430abf186f8f84d795549391a8ed7f274Francis Dupont# will produce a inconsistent result in the later case. If the compiler
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# fails due to seeing "%lld" we fall back to "l".
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews# %ld even for (long long)/
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# Win32 uses "%I64d", but that's defined elsewhere since we don't use
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews# configure on Win32.
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_MSG_CHECKING(printf format modifier for 64-bit integers)
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews long long int j = 0;
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews char buf[100];
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews sprintf(buf, "%lld", j);
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews exit((sizeof(long long int) != sizeof(long int))? 0 :
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews (strcmp(buf, "0") != 0));
28a3d529046ec5536e1ea619454624b683509675Andreas Gustafsson [AC_MSG_RESULT(ll)
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
9105a6a730bfb8472c48230629c5a0aebb88c422Mark Andrews [AC_MSG_RESULT(l)
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson [AC_MSG_RESULT(assuming target platform uses ll)
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
b4028939fdffc92cf659764deb9c6e3c805cc948Mark Andrews LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
28a3d529046ec5536e1ea619454624b683509675Andreas GustafssonAC_SUBST(ISC_PLATFORM_QUADFORMAT)
b4028939fdffc92cf659764deb9c6e3c805cc948Mark AndrewsAC_SUBST(LWRES_PLATFORM_QUADFORMAT)
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Security Stuff
9935447b51456f598b45246d0114b8006049244dMark Andrews# Note it is very recommended to *not* disable chroot(),
9935447b51456f598b45246d0114b8006049244dMark Andrews# this is only because chroot() was made obsolete by Posix.
67247b4a8304bac790648a351a95b8b0f4c512a6Mark AndrewsAC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot]))
9935447b51456f598b45246d0114b8006049244dMark Andrewscase "$enable_chroot" in
9935447b51456f598b45246d0114b8006049244dMark Andrews AC_CHECK_FUNCS(chroot)
e980502db40155234b4e8d320b748b34dbaba3a2Brian WellingtonAC_ARG_ENABLE(linux-caps,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--disable-linux-caps],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [disable linux capabilities]))
e980502db40155234b4e8d320b748b34dbaba3a2Brian Wellingtoncase "$enable_linux_caps" in
c174d5c13c03dd59283243e3fd5461d41140a798Evan Hunt AC_CHECK_HEADERS(linux/types.h)
7433a204d32673e9f6747172f202272cc5bfe27cMark Andrews AC_CHECK_HEADERS([sys/capability.h])
7433a204d32673e9f6747172f202272cc5bfe27cMark Andrews AC_CHECK_HEADERS([linux/capability.h], [], [],
c174d5c13c03dd59283243e3fd5461d41140a798Evan Hunt [#ifdef HAVE_LINUX_TYPES_H
0415ca35ada2cac6a86127eaca64f3a997aea121Evan Hunt AC_CHECK_LIB(cap, cap_set_proc)
f8727bd90366af835f551da1b5e1fdfcd2d3d01fBrian WellingtonAC_CHECK_HEADERS(sys/prctl.h)
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark AndrewsAC_CHECK_HEADERS(sys/un.h,
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark AndrewsISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark AndrewsISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVESYSUNH)
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrewscase "$host" in
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews [Define if connect does not honour the permission on the UNIX domain socket.])
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews [Define if connect does not honour the permission on the UNIX domain socket.])
6286983c506433d642b23e64845c50be30f2a7f6Mark Andrews# Time Zone Stuff
6286983c506433d642b23e64845c50be30f2a7f6Mark AndrewsAC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
323a9f3430abf186f8f84d795549391a8ed7f274Francis DupontAC_MSG_CHECKING(for optarg declaration)
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark AndrewsAC_TRY_COMPILE([
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews[optarg = 0;],
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews[AC_MSG_RESULT(yes)],
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark Andrews[AC_MSG_RESULT(no)
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsGEN_NEED_OPTARG="-DNEED_OPTARG=1"
e7fb847ed570dd8c1bcdacabb3d69bd81feb79aeMark AndrewsAC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
28053af04c5121ec234c320e4c76273305816e7aEvan Hunt# Check for nanoseconds in file stats
28053af04c5121ec234c320e4c76273305816e7aEvan HuntAC_MSG_CHECKING(st_mtim.tv_nsec)
28053af04c5121ec234c320e4c76273305816e7aEvan HuntAC_TRY_COMPILE([#include <sys/fcntl.h>],[struct stat s; return(s.st_mtim.tv_nsec);],
28053af04c5121ec234c320e4c76273305816e7aEvan Hunt [AC_MSG_RESULT(yes)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"],
28053af04c5121ec234c320e4c76273305816e7aEvan Hunt [AC_MSG_RESULT(no)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"])
28053af04c5121ec234c320e4c76273305816e7aEvan HuntAC_SUBST(ISC_PLATFORM_HAVESTATNSEC)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence# BSD/OS, and perhaps some others, don't define rlim_t.
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David LawrenceAC_MSG_CHECKING(for type rlim_t)
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David LawrenceAC_TRY_COMPILE([
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence[rlim_t rl = 19671212; return (0);],
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson[AC_MSG_RESULT(yes)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson[AC_MSG_RESULT(no)
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas GustafssonAC_MSG_CHECKING(type of rlim_cur)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrewsmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[AC_MSG_RESULT(int)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrewsmain() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[AC_MSG_RESULT(long int)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrewsmain() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[AC_MSG_RESULT(long long int)
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark Andrews[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson],[AC_MSG_ERROR(this cannot happen)])
caa736a754e90f44bbc249e22f96bcbf4e04b849Andreas Gustafsson],[AC_MSG_ERROR(this cannot happen)])
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan HuntAC_ARG_WITH(rlimtype, , rlimtype="$withval", rlimtype="long long int")
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan HuntISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE $rlimtype"
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan HuntAC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming $rlimtype)])
6ab3d08c1257efa6287d8ad7bb41d8fb99d5d6dfMark AndrewsAC_SUBST(ISC_PLATFORM_RLIMITTYPE)
101a7960b7989a18d873f3302b3b2415aeafb108Mark Andrews# Older HP-UX doesn't have gettune
101a7960b7989a18d873f3302b3b2415aeafb108Mark Andrewscase "$host" in
101a7960b7989a18d873f3302b3b2415aeafb108Mark Andrews AC_CHECK_HEADERS(sys/dyntune.h)
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrews# Compaq TruCluster requires more code for handling cluster IP aliases
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrewscase "$host" in
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrews AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrews AC_CHECK_FUNC(clua_getaliasaddress,
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrews AC_DEFINE(HAVE_TRUCLUSTER, 1,
e2cf63c5df79eb7c8b86b6278289883fa760cda5Mark Andrews [Define if running under Compaq TruCluster]))
95b484c9580d06eb2f9735a22e9841389c2859baMark Andrews# Some hosts need msg_namelen to match the size of the socket structure.
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews# Some hosts don't set msg_namelen appropriately on return from recvmsg().
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrewscase $host in
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews*os2*|*hp-mpeix*)
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews AC_DEFINE(BROKEN_RECVMSG, 1,
43501e6570e9081d459fb5c1a81b73c2c53c5df0Mark Andrews [Define if recvmsg() does not meet all of the BSD socket API specifications.])
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence# Microsoft has their own way of handling shared libraries that requires
37aa91031830d2fc428331378f089169eb3e6dc2David Lawrence# additional qualifiers on extern variables. Unix systems don't need it.
37aa91031830d2fc428331378f089169eb3e6dc2David LawrenceAC_SUBST(ISC_PLATFORM_USEDECLSPEC)
37aa91031830d2fc428331378f089169eb3e6dc2David LawrenceISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
073719ac7155ba72a353590190da58837bd590eaMark AndrewsAC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
073719ac7155ba72a353590190da58837bd590eaMark AndrewsLWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_SUBST(IRS_PLATFORM_USEDECLSPEC)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC"
17012a879742ceb6561dcc4ae3bcd4ff80dc9887David Lawrence# Random remaining OS-specific issues involving compiler warnings.
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence# XXXDCL print messages to indicate some compensation is being done?
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceAC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David LawrenceISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrencecase "$host" in
1ad94515ee37580a2298b1484ddf44b52dc03a6aMark Andrews *-aix5.[[123]].*)
09ba9eacebdffc689da9851ce3bd932aedd1deddMark Andrews hack_shutup_pthreadonceinit=yes
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence hack_shutup_sputaux=yes
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence hack_shutup_sigwait=yes
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence hack_shutup_sputaux=yes
9c9cf3a8d063b0255dbc8679dab588708e9b6f1cAndreas Gustafsson [*-bsdi4.[12]*])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence hack_shutup_stdargcast=yes
b1070fe55c8864ef24a479a6c40d1776f35c2593Mark Andrews [*-solaris2.[89]])
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence hack_shutup_pthreadonceinit=yes
101a7960b7989a18d873f3302b3b2415aeafb108Mark Andrews *-solaris2.1[[0-9]])
9908cbc06f89c8d44f092708a43ae3a6e7a4416cMark Andrews AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecase "$hack_shutup_pthreadonceinit" in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecase "$hack_shutup_sigwait" in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # Shut up a -Wmissing-prototypes warning for sigwait().
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_DEFINE(SHUTUP_SIGWAIT)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecase "$hack_shutup_sputaux" in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # Shut up a -Wmissing-prototypes warning from <stdio.h>.
8b11f3debd9a9494d5aec60ea228ab393fbdc26eDavid Lawrence AC_DEFINE(SHUTUP_SPUTAUX)
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrencecase "$hack_shutup_stdargcast" in
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence # Shut up a -Wcast-qual warning from va_start().
ed71ea51c6ecb5d7d659b6e6a20f6b3f5c2678c6David Lawrence AC_DEFINE(SHUTUP_STDARG_CAST)
d468b1b7b2ccfdf132df15f600be48dccf447eb1Evan HuntAC_CHECK_HEADERS(strings.h,
d468b1b7b2ccfdf132df15f600be48dccf447eb1Evan Hunt ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1"
d468b1b7b2ccfdf132df15f600be48dccf447eb1Evan Hunt ISC_PLATFORM_HAVESTRINGSH="#undef ISC_PLATFORM_HAVESTRINGSH"
d468b1b7b2ccfdf132df15f600be48dccf447eb1Evan HuntAC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews# Check for if_nametoindex() for IPv6 scoped addresses support
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark AndrewsAC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews ac_cv_have_if_nametoindex=no)
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrewscase $ac_cv_have_if_nametoindex in
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews case "$host" in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews AC_CHECK_LIB(ipv6, if_nametoindex,
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews ac_cv_have_if_nametoindex=yes
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews LIBS="-lipv6 $LIBS",)
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrewscase $ac_cv_have_if_nametoindex in
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
1831311ac6179951c8fcca75aa29dc2f5c0218b9Francis Dupont [Define to 1 if you have the if_nametoindex function.])
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark Andrews ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
41f5cf4ac1728a1584b71085868962d977b6c4e5Mark AndrewsAC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
b5252fcde512405a68dd4becfe683d9763bd0feaMukund SivaramanAC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉# Machine architecture dependent features
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunthave_stdatomic=no
fd82c70695888c134287b8018296028c252d100eMukund SivaramanAC_MSG_CHECKING(for usable stdatomic.h)
fd82c70695888c134287b8018296028c252d100eMukund SivaramanAC_TRY_COMPILE([
fd82c70695888c134287b8018296028c252d100eMukund Sivaramanatomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman [AC_MSG_RESULT(yes)
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman have_stdatomic=yes
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman ISC_PLATFORM_HAVESTDATOMIC="#define ISC_PLATFORM_HAVESTDATOMIC 1"],
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman [AC_MSG_RESULT(no)
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman have_stdatomic=no
fd82c70695888c134287b8018296028c252d100eMukund Sivaraman ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"])
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_ARG_ENABLE(atomic,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-atomic],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable machine specific atomic operations [default=autodetect]]),
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 enable_atomic="$enableval",
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 enable_atomic="autodetect")
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉case "$enable_atomic" in
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 yes|''|autodetect)
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews case "$host" in
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews powerpc-ibm-aix*)
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews if test "X$GCC" = "Xyes"; then
5eceaccb005c98e738e877d9cc60eb064a642418Mukund Sivaraman AC_MSG_CHECKING([if asm("ics"); works])
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews AC_TRY_COMPILE(,[
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews main() { asm("ics"); exit(0); }
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews [AC_MSG_RESULT(yes)
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews use_atomic=yes],
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews saved_cflags="$CFLAGS"
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews CFLAGS="$CFLAGS -Wa,-many"
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews AC_TRY_RUN([
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews main() { asm("ics"); exit(0); }
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews [AC_MSG_RESULT([yes, required -Wa,-many])
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews use_atomic=yes],
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews [AC_MSG_RESULT([no, use_atomic disabled])
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews CFLAGS="$saved_cflags"
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews use_atomic=no],
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews [AC_MSG_RESULT([cross compile, assume yes])
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews CFLAGS="$saved_cflags"
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews use_atomic=yes])
8e22c73f3ea64337926151b53245f61342fa52faMark Andrews use_atomic=yes
616560e3db487f548b383c7eecc6e855e8afe7d6Mark Andrews use_atomic=yes
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews have_stdatomic=no
99056063905a9273ec59cf477ae747e0490182b7Mukund Sivaraman ISC_PLATFORM_HAVESTDATOMIC="#undef ISC_PLATFORM_HAVESTDATOMIC"
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Huntif test "X$have_stdatomic" = "Xyes"; then
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt AC_MSG_CHECKING(if -latomic is needed to use 64-bit stdatomic.h primitives)
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt AC_LINK_IFELSE(
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt [AC_LANG_PROGRAM([#include <stdatomic.h>],
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt [atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);])],
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt [AC_MSG_RESULT(no)
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt ISC_ATOMIC_LIBS=""],
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt [AC_MSG_RESULT(yes)
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt ISC_ATOMIC_LIBS="-latomic"]
8de17f83cafa91a5720dd0b8c1aee5f47f6d7f09Evan Hunt LIBS="$LIBS $ISC_ATOMIC_LIBS"
99056063905a9273ec59cf477ae747e0490182b7Mukund SivaramanAC_SUBST(ISC_PLATFORM_HAVESTDATOMIC)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
77b179cbbe7b820b5d838a675200a7b87eb12dacMark AndrewsISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM"
77b179cbbe7b820b5d838a675200a7b87eb12dacMark AndrewsISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM"
77b179cbbe7b820b5d838a675200a7b87eb12dacMark AndrewsISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$use_atomic"; then
01b8bc018d83e757b0578723977b0a71e1e626f8Mark Andrews have_atomic=yes # set default
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 case "$host" in
01b8bc018d83e757b0578723977b0a71e1e626f8Mark Andrews [i[3456]86-*])
161835380928f2ff8abff8930078152a71340b65Tatuya JINMEI 神明達哉 # XXX: some old x86 architectures actually do not support
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 # (some of) these operations. Do we need stricter checks?
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_CHECK_SIZEOF([void *])
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt if test $ac_cv_sizeof_void_p = 8; then
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt have_xaddq=yes
2e61d171bc1fa47ea4d551b87546ebcf78f61e4aMark Andrews x86_64-*|amd64-*)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_CHECK_SIZEOF([void *])
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt if test $ac_cv_sizeof_void_p = 8; then
85a79fa7eb17767d9ae9030e0289ed3e95aab7c8Evan Hunt have_xaddq=yes
ad9107efaaae2407cf11bf0c55407d8daed2e2d4Mark Andrews powerpc-*|powerpc64-*)
6672b3524c2305d8c66d8189c774f549be352ac0Mark Andrews arch=powerpc
5cc6a0f7dae472e5c2022b2cbb5343ec9f7f4942Mark Andrews mips-*|mipsel-*|mips64-*|mips64el-*)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 have_atomic=no
9da98335c185c39591150ccb4e307adc4cea44bcMukund Sivaraman AC_MSG_CHECKING([architecture type for atomic operations])
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 AC_MSG_RESULT($arch)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$have_atomic"; then
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 AC_MSG_CHECKING([compiler support for inline assembly code])
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 compiler=generic
6672b3524c2305d8c66d8189c774f549be352ac0Mark Andrews # Check whether the compiler supports the assembly syntax we provide.
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 if test "X$GCC" = "Xyes"; then
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 # GCC's ASM extension always works
01b8bc018d83e757b0578723977b0a71e1e626f8Mark Andrews if test $arch = "x86_64"; then
01b8bc018d83e757b0578723977b0a71e1e626f8Mark Andrews # We can share the same code for gcc with x86_32
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews if test $arch = "powerpc"; then
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews # The MacOS (and maybe others) uses "r0" for register
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews # zero. Under linux/ibm it is "0" for register 0.
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews # Probe to see if we have a MacOS style assembler.
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews AC_TRY_COMPILE(, [
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews __asm__ volatile ("li r0, 0x0\n"::);
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews AC_MSG_RESULT(yes)
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews compiler="mac"
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark Andrews ], [AC_MSG_RESULT(no)])
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 case "$host" in
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 alpha*-dec-osf*)
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 # Tru64 compiler has its own syntax for inline
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 AC_TRY_COMPILE(, [
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉#error "unexpected compiler"
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 [compiler=osf],)
6672b3524c2305d8c66d8189c774f549be352ac0Mark Andrews powerpc-ibm-aix*)
6672b3524c2305d8c66d8189c774f549be352ac0Mark Andrews compiler=aix
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 case "$compiler" in
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 # See if the generic __asm function works. If not,
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 # we need to disable the atomic operations.
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 AC_TRY_LINK(, [
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 [compiler="standard"
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 [compiler="not supported (atomic operations disabled)"
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 have_atomic=no
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 arch=noatomic ]);
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉 AC_MSG_RESULT($compiler)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$have_atomic"; then
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$have_xaddq"; then
77b179cbbe7b820b5d838a675200a7b87eb12dacMark Andrews ISC_PLATFORM_HAVEXADDQ="#define ISC_PLATFORM_HAVEXADDQ 1"
821ff5e8fa1df2e09fea157ee3e298eef6cf4ec9Evan Hunt ISC_PLATFORM_HAVEATOMICSTOREQ="#define ISC_PLATFORM_HAVEATOMICSTOREQ 1"
77b179cbbe7b820b5d838a675200a7b87eb12dacMark Andrews ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
821ff5e8fa1df2e09fea157ee3e298eef6cf4ec9Evan Hunt ISC_PLATFORM_HAVEATOMICSTOREQ="#undef ISC_PLATFORM_HAVEATOMICSTOREQ"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
90c1e763d577da656b5eeb02462b5236dca5f266Mark Andrews ISC_PLATFORM_HAVEXADDQ="#undef ISC_PLATFORM_HAVEXADDQ"
821ff5e8fa1df2e09fea157ee3e298eef6cf4ec9Evan Hunt ISC_PLATFORM_HAVEATOMICSTOREQ="#undef ISC_PLATFORM_HAVEATOMICSTOREQ"
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEXADD)
1c3ed2a83d176d9023b51b60dfc96c133f678362Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEXADDQ)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
821ff5e8fa1df2e09fea157ee3e298eef6cf4ec9Evan HuntAC_SUBST(ISC_PLATFORM_HAVEATOMICSTOREQ)
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_USEGCCASM)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_USEOSFASM)
c528bd698637d84a0081d26a58813607c7f52bb7Tatuya JINMEI 神明達哉AC_SUBST(ISC_PLATFORM_USESTDASM)
f31446e6b5925395fce4f62adf71f7ad70cea6ceMark AndrewsAC_SUBST(ISC_PLATFORM_USEMACASM)
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉ISC_ARCH_DIR=$arch
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉AC_SUBST(ISC_ARCH_DIR)
d1dbf6b20fdcfa95acd75cdb96fcd57067a31144Mukund Sivaraman# Check for __builtin_expect
d1dbf6b20fdcfa95acd75cdb96fcd57067a31144Mukund SivaramanAC_MSG_CHECKING([compiler support for __builtin_expect])
d1dbf6b20fdcfa95acd75cdb96fcd57067a31144Mukund SivaramanAC_TRY_LINK(, [
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews return (__builtin_expect(1, 1) ? 1 : 0);
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews have_builtin_expect=yes
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT(yes)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews have_builtin_expect=no
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT(no)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$have_builtin_expect"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
a16f42441a0bdfc911aafe841a975af55181f2f0Mukund Sivaraman# Check for __builtin_clz
a16f42441a0bdfc911aafe841a975af55181f2f0Mukund SivaramanAC_MSG_CHECKING([compiler support for __builtin_clz])
a16f42441a0bdfc911aafe841a975af55181f2f0Mukund SivaramanAC_TRY_LINK(, [
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews return (__builtin_clz(0xff) == 24 ? 1 : 0);
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews have_builtin_clz=yes
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT(yes)
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews have_builtin_clz=no
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_MSG_RESULT(no)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$have_builtin_clz"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt# CPU relax (for spin locks)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Huntif $use_threads
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt case "$host" in
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [i[3456]86-*])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_MSG_CHECKING([if asm("rep; nop"); works])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_TRY_COMPILE(,[asm("rep; nop");],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(yes)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(no)],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT([cross compile, assume yes])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt x86_64-*|amd64-*)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_MSG_CHECKING([if asm("rep; nop"); works])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_TRY_COMPILE(,[asm("rep; nop");],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(yes)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(no)],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT([cross compile, assume yes])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"rep; nop\")"])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_MSG_CHECKING([if asm("hint @pause"); works])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_TRY_COMPILE(,[asm("hint @pause");],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(yes)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(no)],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT([cross compile, assume yes])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP asm(\"hint @pause\")"])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_MSG_CHECKING([if cpu_relax(); or __cpu_relax(); works])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt AC_CHECK_FUNC(cpu_relax,
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(yes)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP cpu_relax()"],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_CHECK_FUNC(__cpu_relax,
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(yes)
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt ISC_PLATFORM_BUSYWAITNOP="#define ISC_PLATFORM_BUSYWAITNOP __cpu_relax()"],
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan Hunt [AC_MSG_RESULT(no)])])
cf24cbd837617c5cb89f04ba97b262be21a925bfEvan HuntAC_SUBST(ISC_PLATFORM_BUSYWAITNOP)
2284b84d74cdfd62ecb962feb850de981bbc2196Evan Hunt# Activate "rrset-order fixed" or not?
2284b84d74cdfd62ecb962feb850de981bbc2196Evan HuntAC_ARG_ENABLE(fixed-rrset,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-fixed-rrset],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable fixed rrset ordering [default=no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews enable_fixed="$enableval", enable_fixed="no")
2284b84d74cdfd62ecb962feb850de981bbc2196Evan Huntcase "$enable_fixed" in
2284b84d74cdfd62ecb962feb850de981bbc2196Evan Hunt AC_DEFINE(DNS_RDATASET_FIXED, 1,
90c1e763d577da656b5eeb02462b5236dca5f266Mark Andrews [Define to enable "rrset-order fixed" syntax.])
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Enable response policy rewriting using NS IP addresses
87708bde16713bc02ff2598f4a82f98c699a2f2dMark AndrewsAC_ARG_ENABLE(rpz-nsip,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--disable-rpz-nsip],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [disable rpz nsip rules [default=enabled]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews enable_nsip="$enableval", enable_nsip="yes")
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewscase "$enable_nsip" in
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews AC_DEFINE(ENABLE_RPZ_NSIP, 1,
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews [Define to enable rpz-nsip rules.])
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Enable response policy rewriting using NS name
87708bde16713bc02ff2598f4a82f98c699a2f2dMark AndrewsAC_ARG_ENABLE(rpz-nsdname,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--disable-rpz-nsdname],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [disable rpz nsdname rules [default=enabled]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews enable_nsdname="$enableval", enable_nsdname="yes")
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewscase "$enable_nsdname" in
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews [Define to enable rpz-nsdname rules.])
d878b8d87c3f46a25ccae9f5cfe6e39af67562e0Evan Hunt# Activate "filter-aaaa-on-v4/v6" or not?
c8aa7ce70d75d5d8f28f941e3a522c71e948b166Evan HuntAC_ARG_ENABLE(filter-aaaa,
b5f6271f4daf1e54501af2cb7dd278d7e8003d65Mark Andrews [ --enable-filter-aaaa enable filtering of AAAA records [[default=no]]],
c8aa7ce70d75d5d8f28f941e3a522c71e948b166Evan Hunt enable_filter="$enableval",
c8aa7ce70d75d5d8f28f941e3a522c71e948b166Evan Hunt enable_filter="no")
c8aa7ce70d75d5d8f28f941e3a522c71e948b166Evan Huntcase "$enable_filter" in
d878b8d87c3f46a25ccae9f5cfe6e39af67562e0Evan Hunt AC_DEFINE(ALLOW_FILTER_AAAA, 1,
d878b8d87c3f46a25ccae9f5cfe6e39af67562e0Evan Hunt [Define to enable the "filter-aaaa-on-v4" and "filter-aaaa-on-v6" options.])
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# Activate dnstap?
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntAC_ARG_ENABLE(dnstap,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-dnstap],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable dnstap support
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews (requires fstrm, protobuf-c)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_dnstap=$enableval, use_dnstap=no)
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntDNSTAPTARGETS=
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark AndrewsDNSTAP_PB_C_H=
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntif test "x$use_dnstap" != "xno"; then
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews if ! $use_threads; then
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_MSG_ERROR([Dnstap requires threads.])
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_ARG_WITH([protobuf-c],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-protobuf-c=path],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Path where protobuf-c is installed,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews for dnstap]), [
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews # workaround for protobuf-c includes at old dir
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews # before protobuf-c-1.0.0
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews if test -f $withval/include/google/protobuf-c/protobuf-c.h
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews CFLAGS="$CFLAGS -I$withval/include/google"
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews CFLAGS="$CFLAGS -I$withval/include"
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews LDFLAGS="$LDFLAGS -L$withval/lib"
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews AC_PATH_PROG([PROTOC_C], [protoc-c], [],
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews [$PATH$PATH_SEPARATOR$withval/bin])
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews # workaround for protobuf-c includes at old dir
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews # before protobuf-c-1.0.0
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews if test -f /usr/include/google/protobuf-c/protobuf-c.h
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews CFLAGS="$CFLAGS -I/usr/include/google"
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews CFLAGS="$CFLAGS -I/usr/local/include/google"
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews LDFLAGS="$LDFLAGS -L/usr/local/lib"
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews AC_PATH_PROG([PROTOC_C],[protoc-c])
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews if test -z "$PROTOC_C"; then
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews AC_MSG_ERROR([The protoc-c program was not found.])
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AC_ARG_WITH([libfstrm], AS_HELP_STRING([--with-libfstrm=path],
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews [Path where libfstrm is installed, for dnstap]), [
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews CFLAGS="$CFLAGS -I$withval/include"
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews LDFLAGS="$LDFLAGS -L$withval/lib"
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture], [], [$PATH$PATH_SEPARATOR$withval/bin])
ace5680c122ef239e64eec1120f13f5a7f087d79Mark Andrews AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews DNSTAP=dnstap
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews DNSTAPSRCS='${DNSTAPSRCS}'
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews DNSTAPOBJS='${DNSTAPOBJS}'
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews DNSTAPTARGETS='${DNSTAPTARGETS}'
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark Andrews DNSTAP_PB_C_H="dnstap.pb-c.h"
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntAC_SUBST(DNSTAP)
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntAC_SUBST(DNSTAPSRCS)
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntAC_SUBST(DNSTAPOBJS)
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntAC_SUBST(DNSTAPTARGETS)
7d262a3647a517a86d6d83058aedd18b7a6b06dfMark AndrewsAC_SUBST(DNSTAP_PB_C_H)
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews# The following sets up how non-blocking i/o is established.
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews# Sunos, cygwin and solaris 2.x (x<5) require special handling.
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrewscase "$host" in
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2e3203a08c2b8f305bac3519ea7cd9873b7fcd5aMark Andrews*-solaris2.[[01234]])
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews AC_DEFINE(USE_FIONBIO_IOCTL, 1,
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
b2f160f266005ceaed77a3f575109f74cd13d548Mark Andrews [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews# This prevents the source address being set.
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrewscase "$host" in
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews*-solaris2.[[012345]]|*-solaris2.5.1)
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
2b66a51a7d72e9cc07917fb583ad528b0539d2a3Mark Andrews [Define if you cannot bind() before connect() for TCP sockets.])
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson# The following sections deal with tools used for formatting
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson# the documentation. They are all optional, unless you are
f252f91e2725f2b505d12da6c049896e1de74112Andreas Gustafsson# a developer editing the documentation source.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Look for TeX.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_PATH_PROGS(LATEX, latex, latex)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_SUBST(LATEX)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_SUBST(PDFLATEX)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntAC_PATH_PROGS(DBLATEX, dblatex, dblatex)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntAC_SUBST(DBLATEX)
94a8c22d559fe1f977ed41d6fe0b2513ecee7ff9Rob Austein# Look for w3m
94a8c22d559fe1f977ed41d6fe0b2513ecee7ff9Rob AusteinAC_PATH_PROGS(W3M, w3m, w3m)
94a8c22d559fe1f977ed41d6fe0b2513ecee7ff9Rob AusteinAC_SUBST(W3M)
0d7548ee341c83c540624a423e2c701b6e9ddc4eEvan Hunt# Look for pandoc
0d7548ee341c83c540624a423e2c701b6e9ddc4eEvan HuntAC_PATH_PROG(PANDOC, pandoc, pandoc)
0d7548ee341c83c540624a423e2c701b6e9ddc4eEvan HuntAC_SUBST(PANDOC)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Look for xsltproc (libxslt)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_SUBST(XSLTPROC)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Look for xmllint (libxml2)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_PATH_PROG(XMLLINT, xmllint, xmllint)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_SUBST(XMLLINT)
29747dfe5e073a299b3681e01f5c55540f8bfed7Mark Andrews# Look for Doxygen
29747dfe5e073a299b3681e01f5c55540f8bfed7Mark AndrewsAC_PATH_PROG(DOXYGEN, doxygen, doxygen)
29747dfe5e073a299b3681e01f5c55540f8bfed7Mark AndrewsAC_SUBST(DOXYGEN)
08f01297320b7ad55d0abff0aca9a577196079e2Mukund Sivaraman# Look for curl
08f01297320b7ad55d0abff0aca9a577196079e2Mukund SivaramanAC_PATH_PROG(CURL, curl, curl)
08f01297320b7ad55d0abff0aca9a577196079e2Mukund SivaramanAC_SUBST(CURL)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# Subroutine for searching for an ordinary file (e.g., a stylesheet)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# in a number of directories:
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# If the file FILENAME is found in one of the DIRECTORIES, the shell
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# variable VARIABLE is defined to its absolute pathname. Otherwise,
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# it is set to FILENAME, with no directory prefix (that's not terribly
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# useful, but looks less confusing in substitutions than leaving it
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson# empty). The variable VARIABLE will be substituted into output files.
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_DEFUN(NOM_PATH_FILE, [
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas GustafssonAC_MSG_CHECKING(for $2)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson AC_MSG_RESULT($f)
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafssonif test "X[$]$1" = "X"
68f72235f8f41fa949823551d8e6476057ec5bd6Andreas Gustafsson AC_MSG_RESULT("not found");
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews# Look for Docbook-XSL stylesheets. Location probably varies by system.
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews# If it's not explicitly specified, guess where it might be found, based on
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews# where SGML stuff lives on some systems (FreeBSD is the only one we're sure
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews# of at the moment).
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsAC_MSG_CHECKING(for Docbook-XSL path)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsAC_ARG_WITH(docbook-xsl,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-docbook-xsl[=PATH]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [specify path for Docbook-XSL stylesheets]),
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews docbook_path="$withval", docbook_path="auto")
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrewscase "$docbook_path" in
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews AC_MSG_RESULT(auto)
ec11d3e03e63b78822556a2d0d82b6ed144dca4fMark Andrews 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"
c0fb34e8156aea6b7fde8488e7440524c703f22eMark Andrews docbook_xsl_trees="$withval"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_MSG_RESULT($docbook_xsl_trees)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Look for stylesheets we need.
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
c0fb34e8156aea6b7fde8488e7440524c703f22eMark AndrewsNOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Same dance for dblatex
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdblatex_xsl_trees="/usr/local/share/xml/docbook/stylesheet/dblatex /usr/pkg/share/xml/docbook/stylesheet/dblatex /usr/share/xml/docbook/stylesheet/dblatex"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntNOM_PATH_FILE(XSLT_DBLATEX_STYLE, xsl/docbook.xsl, $dblatex_xsl_trees)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntNOM_PATH_FILE(XSLT_DBLATEX_FASTBOOK, xsl/latex_book_fast.xsl, $dblatex_xsl_trees)
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews# IDN support
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_ARG_WITH(idn,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-idn[=MPREFIX]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable IDN support using idnkit [default PREFIX]]),
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews use_idn="$withval", use_idn="no")
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrewscase "$use_idn" in
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews if test X$prefix = XNONE ; then
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews idn_path=$prefix
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews idn_path="$use_idn"
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_ARG_WITH(libiconv,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-libiconv[=IPREFIX]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [GNU libiconv are in IPREFIX [default PREFIX]]),
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews use_libiconv="$withval", use_libiconv="no")
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrewscase "$use_libiconv" in
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews if test X$prefix = XNONE ; then
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_ARG_WITH(iconv,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-iconv[=LIBSPEC]],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [specify iconv library [default -liconv]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews iconvlib="$withval")
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrewscase "$iconvlib" in
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews iconvlib=-liconv
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_ARG_WITH(idnlib,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-idnlib=ARG], [specify libidnkit]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews idnlib="$withval", idnlib="no")
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$idnlib"; then
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "no" != "$use_idn"; then
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "no" != "$idnlib"; then
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews IDNLIBS="$idnlib $iconvlib"
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrews IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_SUBST(IDNLIBS)
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Check whether to build Automated Test Framework unit tests
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntAC_ARG_WITH(atf,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-atf],[support Automated Test Framework]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews atf="$withval", atf="no")
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "yes" = "$atf"; then
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt ATFBUILD=atf-src
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt AC_SUBST(ATFBUILD)
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt AC_CONFIG_COMMANDS([atf-config],
c3b9fad5e3be639c9b36ff0ac921c30133da395cMar Andrews case "$srcdir" in
c3b9fad5e3be639c9b36ff0ac921c30133da395cMar Andrews *) srcdir="../../$srcdir";;
a747113422afaa29ce72d2c5ba7f0b7ea9ec2054Evan Hunt ${SHELL} "${srcdir}${srcdir:+/unit/atf-src/}./configure" --enable-tools --disable-shared MISSING=: --prefix $atfdir;
a38f07c73790170842e4523b4a474d01ca0dede1Michał Kępień ) || AC_MSG_ERROR([Failed to configure ATF.]) ],
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt [atfdir=`pwd`/unit/atf])
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt AC_MSG_RESULT(building ATF from bind9/unit/atf-src)
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "no" != "$atf"; then
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt AC_DEFINE(ATF_TEST, 1, [define if ATF unit tests are to be built.])
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt STD_CINCLUDES="$STD_CINCLUDES -I$atf/include"
a5ee263bea49d05a827a459ed2f891463512e90aMark Andrews ATFLIBS="-L$atf/lib -latf-c"
84dc4b3e7eea3e9c8fafa5f4fd632a51ee8b356fMukund Sivaraman AC_CHECK_LIB(m, exp, libm=yes, libm=no)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$libm"; then
84dc4b3e7eea3e9c8fafa5f4fd632a51ee8b356fMukund Sivaraman ATFLIBS="$ATFLIBS -lm"
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt UNITTESTS=tests
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntAC_SUBST(ATFBIN)
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntAC_SUBST(ATFLIBS)
ef421f66f47224a42073deaf087378c5d0c9952eEvan HuntAC_SUBST(UNITTESTS)
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_CHECK_HEADERS(locale.h)
6cf369f528c4acd8182eada41ad83b8d97623db8Mark AndrewsAC_CHECK_FUNCS(setlocale)
6a3fa181d1253db5191139e20231512eebaddeebEvan Hunt# was --with-tuning specified?
6a3fa181d1253db5191139e20231512eebaddeebEvan HuntAC_ARG_WITH(tuning,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-tuning=ARG],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [Specify server tuning (large or default)]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews use_tuning="$withval", use_tuning="no")
6a3fa181d1253db5191139e20231512eebaddeebEvan Huntcase "$use_tuning" in
6a3fa181d1253db5191139e20231512eebaddeebEvan Hunt if ! $use_threads; then
6a3fa181d1253db5191139e20231512eebaddeebEvan Hunt AC_MSG_ERROR([Large-system tuning requires threads.])
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_DEFINE(TUNE_LARGE, 1, [Define to use large-system tuning.])
6a3fa181d1253db5191139e20231512eebaddeebEvan Hunt AC_MSG_RESULT(using large-system tuning)
6a3fa181d1253db5191139e20231512eebaddeebEvan Hunt AC_MSG_RESULT(using default tuning)
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt AC_MSG_ERROR([You must specify "large" or "default" for --with-tuning.])
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaraman# was --enable-querytrace specified?
1783676a64b8e390b756d775ae152509f1d76719Mukund SivaramanAC_ARG_ENABLE(querytrace,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-querytrace],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [enable very verbose query trace logging
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [default=no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews want_querytrace="$enableval", want_querytrace="no")
9da98335c185c39591150ccb4e307adc4cea44bcMukund SivaramanAC_MSG_CHECKING([whether to enable query trace logging])
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaramancase "$want_querytrace" in
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaraman AC_MSG_RESULT(yes)
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaraman AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaraman AC_MSG_RESULT(no)
1783676a64b8e390b756d775ae152509f1d76719Mukund Sivaraman AC_MSG_ERROR("--enable-querytrace requires yes or no")
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence# Substitutions
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob HalleyAC_SUBST(BIND9_TOP_BUILDDIR)
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob HalleyBIND9_TOP_BUILDDIR=`pwd`
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob HalleyAC_SUBST(BIND9_ISC_BUILDINCLUDE)
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian WellingtonAC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas GustafssonAC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob HalleyAC_SUBST(BIND9_DNS_BUILDINCLUDE)
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael GraffAC_SUBST(BIND9_LWRES_BUILDINCLUDE)
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsAC_SUBST(BIND9_BIND9_BUILDINCLUDE)
1d761cb453c76353deb8423c78e98d00c5f86ffaEvan HuntAC_SUBST(BIND9_IRS_BUILDINCLUDE)
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halleyif test "X$srcdir" != "X"; then
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
1d761cb453c76353deb8423c78e98d00c5f86ffaEvan Hunt BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include"
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley BIND9_ISC_BUILDINCLUDE=""
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington BIND9_ISCCC_BUILDINCLUDE=""
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas Gustafsson BIND9_ISCCFG_BUILDINCLUDE=""
51917258dbb23cfe6069ae1cf2b7fc5aefc1e0c2Bob Halley BIND9_DNS_BUILDINCLUDE=""
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff BIND9_LWRES_BUILDINCLUDE=""
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews BIND9_BIND9_BUILDINCLUDE=""
1d761cb453c76353deb8423c78e98d00c5f86ffaEvan Hunt BIND9_IRS_BUILDINCLUDE=""
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsAC_SUBST_FILE(BIND9_MAKE_INCLUDES)
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsBIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyAC_SUBST_FILE(BIND9_MAKE_RULES)
f107fe7fc97f8e6fb950fb87f52a5617a1b6e946Evan HuntBIND9_PRODUCT="PRODUCT=\"${PRODUCT}\""
53a4e18582ae0c50f3742d2f6b684231a50be038Curtis BlackburnAC_SUBST(BIND9_PRODUCT)
af9f195c9e128fc9cc5912498b8f7f26f07887c3Evan HuntBIND9_DESCRIPTION="DESCRIPTION=\"${DESCRIPTION}\""
af9f195c9e128fc9cc5912498b8f7f26f07887c3Evan HuntAC_SUBST(BIND9_DESCRIPTION)
e13d04fda918c0c14c2247475bb99e0760d9a6a4Evan HuntBIND9_VERSION="${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
2180f41c907e013715cbc54c64545b26fc3c0dbaMichael GraffAC_SUBST(BIND9_VERSION)
7829fad4093f2c1985b1efb7cea00287ff015d2bckbBIND9_MAJOR="MAJOR=${MAJORVER}.${MINORVER}"
7829fad4093f2c1985b1efb7cea00287ff015d2bckbAC_SUBST(BIND9_MAJOR)
dd66b77417aff9a7805f52b1e37ac48e647e0102Evan HuntBIND9_VERSIONSTRING="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}${DESCRIPTION:+ }${DESCRIPTION}"
dd66b77417aff9a7805f52b1e37ac48e647e0102Evan HuntAC_SUBST(BIND9_VERSIONSTRING)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntBIND9_VERSIONSHORT="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntAC_SUBST(BIND9_VERSIONSHORT)
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold KrecickiBIND9_SRCID="SRCID=unset_id"
0e1dfb8ff5ac2cf1215691ffc32d7a0b76709721Mark Andrewsif test -f "${srcdir}/srcid"; then
0e1dfb8ff5ac2cf1215691ffc32d7a0b76709721Mark Andrews . "${srcdir}/srcid"
bcf966e6146943ebcac1603a52468f5292612b18Evan Hunt BIND9_SRCID="SRCID=$SRCID"
0e1dfb8ff5ac2cf1215691ffc32d7a0b76709721Mark Andrewselif test -d "${srcdir}/.git"; then
a4e76a630ea69c04f89c6c1bf0b7d15e655c97c2Evan Hunt BIND9_SRCID="SRCID="`(cd "${srcdir}";git rev-parse --short HEAD)`
bcf966e6146943ebcac1603a52468f5292612b18Evan HuntAC_SUBST(BIND9_SRCID)
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉if test -z "$ac_configure_args"; then
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉 BIND9_CONFIGARGS="defaults"
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉 for a in $ac_configure_args
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉 BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
eeaa2277ead6df7253a8958ee2d786f73e05b8beTatuya JINMEI 神明達哉AC_SUBST(BIND9_CONFIGARGS)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyAC_SUBST_FILE(LIBISC_API)
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian WellingtonAC_SUBST_FILE(LIBISCCC_API)
be7f27304337afbf078e8bd8db0f951a33abe33bAndreas GustafssonAC_SUBST_FILE(LIBISCCFG_API)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob HalleyAC_SUBST_FILE(LIBDNS_API)
c9611b45736af157e2993c6ef852e55e8e24ca83Evan HuntAC_SUBST_FILE(LIBDNS_MAPAPI)
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark AndrewsAC_SUBST_FILE(LIBBIND9_API)
b2f85baf7905bad89781f8ef73003d4cfa955257Michael GraffAC_SUBST_FILE(LIBLWRES_API)
307d2084502eddc7ce921e5ce439aec3531d90e0Tatuya JINMEI 神明達哉AC_SUBST_FILE(LIBIRS_API)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Configure any DLZ drivers.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# If config.dlz.in selects one or more DLZ drivers, it will set
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# CONTRIB_DLZ to a non-empty value, which will be our clue to
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# build DLZ drivers in contrib.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# This section has to come after the libtool stuff because it needs to
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# know how to name the driver object files.
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntCONTRIB_DLZ=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsDLZ_DRIVER_INCLUDES=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsDLZ_DRIVER_LIBS=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsDLZ_DRIVER_SRCS=""
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsDLZ_DRIVER_OBJS=""
8bc194b266a17f89e6c54469d4dfbb408070f39eMark AndrewsDLZ_SYSTEM_TEST=""
0612274565d80e0ad87a19920e561cce5bddb05bEvan HuntDLZ_DRIVER_MYSQL_INCLUDES=""
0612274565d80e0ad87a19920e561cce5bddb05bEvan HuntDLZ_DRIVER_MYSQL_LIBS=""
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# Configure support for building a shared library object
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# Even when libtool is available it can't always be relied upon
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# to build an object that can be dlopen()'ed, but this is necessary
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# for building the dlzexternal system test, so we'll try it the
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt# old-fashioned way.
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark AndrewsSO_LDFLAGS=""
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntSO_TARGETS=""
fe6557e5901162308e716791077ace6811728242Mark AndrewsSO_STRIP="cat"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_ARG_WITH(dlopen,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-dlopen=ARG],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [support dynamically loadable DLZ drivers]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews dlopen="$withval", dlopen="yes")
6f6b1abb106d970f1b0c5e959cddfabc9cc3b4aeEvan Huntcase $host in
6f6b1abb106d970f1b0c5e959cddfabc9cc3b4aeEvan Hunt *-sunos*) dlopen="no"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$dlopen"; then
7a2173839c5ca103090431f36709fde99b599097Evan Hunt AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$have_dl"; then
7a2173839c5ca103090431f36709fde99b599097Evan Hunt LIBS="-ldl $LIBS"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews AC_CHECK_FUNCS(dlopen dlclose dlsym,,dlopen=no)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$dlopen"; then
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt case $host in
89119e3cafff373426858f6cec7c09539f53e209Mark Andrews *-linux*|*-gnu*)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="-fPIC"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS=""
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$have_dl"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_libtool"; then
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-Xcompiler -shared"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LD="${CC}"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-shared"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LD="${CC}"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-shared"
87e7d08a8bae58ab8edacaa990a4234063c23793Mar Andrews *-freebsd*|*-openbsd*)
0be436fc397396ed490182f022d02b46c7a50271Mark Andrews LDFLAGS="${LDFLAGS} -Wl,-E"
87e7d08a8bae58ab8edacaa990a4234063c23793Mar Andrews SO_CFLAGS="-fpic"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_libtool"; then
1a0e5b0504576a17a99817d9eef10c4937ef0d63Mark Andrews SO_LDFLAGS="-Xcompiler -shared"
1a0e5b0504576a17a99817d9eef10c4937ef0d63Mark Andrews SO_LD="${CC}"
1a0e5b0504576a17a99817d9eef10c4937ef0d63Mark Andrews SO_LDFLAGS="-shared"
1a0e5b0504576a17a99817d9eef10c4937ef0d63Mark Andrews SO_LD="${CC}"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="-fpic"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-Bshareable -x"
fe6557e5901162308e716791077ace6811728242Mark Andrews SO_STRIP="sed -e s/-Wl,//g"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="-KPIC"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-G -z text"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="+z"
ac49f1c511debb13794488e2bc5429fa68629d28Mark Andrews SO_LDFLAGS="-b +vnocompatwarnings"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="-fPIC"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt if test "X$GCC" = "Xyes"; then
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_CFLAGS="-fPIC"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews if test -z "$SO_LD"
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrews if test "yes" = "$use_libtool"; then
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-Xcompiler -shared"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LD="${CC}"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LDFLAGS="-shared"
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark Andrews SO_LD="${CC}"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt # If we still don't know how to make shared objects, don't make any.
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt if test -n "$SO_LD"; then
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt SO_TARGETS="\${SO_TARGETS}"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt AC_DEFINE(ISC_DLZ_DLOPEN, 1,
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt [Define to allow building of objects for dlopen().])
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan HuntCFLAGS="$CFLAGS $SO_CFLAGS"
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_SUBST(SO_CFLAGS)
d7729155dff87d3c7a2b9103bf6e5164ea4d7dd7Mark AndrewsAC_SUBST(SO_LDFLAGS)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_SUBST(SO_LD)
fe6557e5901162308e716791077ace6811728242Mark AndrewsAC_SUBST(SO_STRIP)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_SUBST(SO_TARGETS)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_MSG_CHECKING(contributed DLZ drivers)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Huntif test -n "$CONTRIB_DLZ"
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_RESULT(yes)
0612274565d80e0ad87a19920e561cce5bddb05bEvan Hunt AC_CONFIG_FILES([$DLZ_DRIVER_RULES
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews AC_MSG_RESULT(no)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews DLZ_DRIVER_RULES=/dev/null
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntAC_SUBST(CONTRIB_DLZ)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(DLZ_DRIVER_INCLUDES)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(DLZ_DRIVER_LIBS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(DLZ_DRIVER_SRCS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST(DLZ_DRIVER_OBJS)
8bc194b266a17f89e6c54469d4dfbb408070f39eMark AndrewsAC_SUBST(DLZ_SYSTEM_TEST)
0612274565d80e0ad87a19920e561cce5bddb05bEvan HuntAC_SUBST(DLZ_DRIVER_MYSQL_INCLUDES)
0612274565d80e0ad87a19920e561cce5bddb05bEvan HuntAC_SUBST(DLZ_DRIVER_MYSQL_LIBS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_SUBST_FILE(DLZ_DRIVER_RULES)
2a80bc01530013293016172b1dcc1d12471ccf33Mark Andrewsif test "yes" = "$cross_compiling"; then
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews if test -z "$BUILD_CC"; then
870cd6c03741332ebffb808aba1ab14be1624ad5Mark Andrews AC_MSG_ERROR([BUILD_CC not set])
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_CFLAGS="$BUILD_CFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_LDFLAGS="$BUILD_LDFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_LIBS="$BUILD_LIBS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_CC="$CC"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_CFLAGS="$CFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_LDFLAGS="$LDFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark Andrews BUILD_LIBS="$LIBS"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrewsfor e in $BUILD_LDFLAGS ; do
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case $host_os in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
203e146e5e3bba340d24fee62e2a1c5114fff0cbEvan Hunt ee=`echo $e | sed -e 's%^-L%-R%'`
19e4588ed76d6832be4de0813b6108a292ef413aMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
7794a776e0c12bb5be0b813dfd7fa797358ff451Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsBUILD_LDFLAGS="$NEWFLAGS"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrewsfor e in $DNS_GSSAPI_LIBS ; do
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case $host_os in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
203e146e5e3bba340d24fee62e2a1c5114fff0cbEvan Hunt ee=`echo $e | sed -e 's%^-L%-R%'`
19e4588ed76d6832be4de0813b6108a292ef413aMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
7794a776e0c12bb5be0b813dfd7fa797358ff451Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsDNS_GSSAPI_LIBS="$NEWFLAGS"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrewsfor e in $ISC_OPENSSL_LIBS ; do
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews case $host_os in
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews ee=`echo $e | sed -e 's%^-L%-R%'`
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews NEWFLAGS="$NEWFLAGS $e"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark Andrews NEWFLAGS="$NEWFLAGS $e"
2729aea3c1a720269aaae92ce3a84af1ba0a75ebMark AndrewsISC_OPENSSL_LIBS="$NEWFLAGS"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrewsfor e in $DNS_CRYPTO_LIBS ; do
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews case $host_os in
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
203e146e5e3bba340d24fee62e2a1c5114fff0cbEvan Hunt ee=`echo $e | sed -e 's%^-L%-R%'`
19e4588ed76d6832be4de0813b6108a292ef413aMark Andrews NEWFLAGS="$NEWFLAGS $e $ee"
7794a776e0c12bb5be0b813dfd7fa797358ff451Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews NEWFLAGS="$NEWFLAGS $e"
289ae548d52bc8f982d9823af64cafda7bd92232Mark AndrewsDNS_CRYPTO_LIBS="$NEWFLAGS"
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsAC_SUBST(BUILD_CC)
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsAC_SUBST(BUILD_CFLAGS)
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsAC_SUBST(BUILD_CPPFLAGS)
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsAC_SUBST(BUILD_LDFLAGS)
118394ef2ec7cef253c55359a3d70d202ddc2fa0Mark AndrewsAC_SUBST(BUILD_LIBS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Commands to run at the end of config.status.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Don't just put these into configure, it won't work right if somebody
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# runs config.status directly (which autoconf allows).
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAC_CONFIG_COMMANDS(
29747dfe5e073a299b3681e01f5c55540f8bfed7Mark Andrews [chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# Files to configure. These are listed here because we used to
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# specify them as arguments to AC_OUTPUT. It's (now) ok to move these
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# elsewhere if there's a good reason for doing so.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark AndrewsAC_CONFIG_FILES([
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark Andrews# Now that the Makefiles exist we can ensure that everything is rebuilt.
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark AndrewsAC_ARG_WITH(make-clean,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--with-make-clean],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [run "make clean" at end of configure [yes|no]]),
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews make_clean="$withval", make_clean="yes")
003fd2f720f79404b62d49f6dfe7aa1257f03b08Mark Andrewscase "$make_clean" in
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" != "$no_create"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" = "$silent"
71697fd082b1c76562dc80fa91787af3860146bfEvan HuntAC_ARG_ENABLE(full-report,
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews AS_HELP_STRING([--enable-full-report],
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews [report values of all configure options]))
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "==============================================================================="
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "Configuration summary:"
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "-------------------------------------------------------------------------------"
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "Optional features enabled:"
3195754154292f0651c195433607696a259a98e2Evan Hunt if $use_threads; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Multiprocessing support (--enable-threads)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews if test "yes" = "$enable_full_report" -o "standard" = "$locktype"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Mutex lock type: $locktype"
42c1acfa478aacfbda2d298cf74a137de2df4b87Michał Kępień test "large" = "$use_tuning" && echo " Large-system tuning (--with-tuning)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dnstap" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Allow 'dnstap' packet logging (--enable-dnstap)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_geoip" || echo " GeoIP access control (--with-geoip)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_gssapi" || echo " GSS-API (--with-gssapi)"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" = "$enable_full_report" -o "aes" != "$with_cc_alg"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Algorithm: $with_cc_alg"
3195754154292f0651c195433607696a259a98e2Evan Hunt # these lines are only printed if run with --enable-full-report
3195754154292f0651c195433607696a259a98e2Evan Hunt if test "yes" = "$enable_full_report"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "no" = "$enable_ipv6" -o "no" = "$found_ipv6" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " IPv6 support (--enable-ipv6)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$CRYPTO" = "X" -o "yes" = "$want_native_pkcs11" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$PYTHON" = "X" || echo " Python tools (--with-python)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$ZLIB" = "X" || echo " HTTP zlib compression (--with-zlib)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews test "X$NZD_TOOLS" = "X" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "no" != "$use_pkcs11"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews if test "yes" = "$want_native_pkcs11"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Native PKCS#11/Cryptoki support (--enable-native-pkcs11)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " PKCS#11/Cryptoki support using OpenSSL (--with-pkcs11)"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Provider library: $PKCS11_PROVIDER"
3195754154292f0651c195433607696a259a98e2Evan Hunt if test "yes" = "$OPENSSL_GOST" -o "yes" = "$PKCS11_GOST"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " GOST algorithm support (encoding: $gosttype) (--with-gost)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$OPENSSL_ECDSA" -o "$PKCS11_ECDSA" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " ECDSA algorithm support (--with-ecdsa)"
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont test "yes" = "$OPENSSL_ED25519" -o "$PKCS11_ED25519" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " EDDSA algorithm support (--with-eddsa)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$enable_fixed" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$enable_filter" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " AAAA filtering (--enable-filter-aaaa)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$enable_seccomp" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Use libseccomp system call filtering (--enable-seccomp)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_backtrace" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Print backtrace on crash (--enable-backtrace)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "minimal" = "$want_symtable" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Use symbol table for backtrace, named only (--enable-symtable)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_querytrace" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Very verbose query trace logging (--enable-querytrace)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$atf" || echo " Automated Testing Framework (--with-atf)"
3195754154292f0651c195433607696a259a98e2Evan Hunt echo " Dynamically loadable zone (DLZ) drivers:"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_bdb" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Berkeley DB (--with-dlz-bdb)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_ldap" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " LDAP (--with-dlz-ldap)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_mysql" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " MySQL (--with-dlz-mysql)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_odbc" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " ODBC (--with-dlz-odbc)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_postgres" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Postgres (--with-dlz-postgres)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_filesystem" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Filesystem (--with-dlz-filesystem)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dlz_stub" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Stub (--with-dlz-stub)"
3195754154292f0651c195433607696a259a98e2Evan Hunt 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"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo "-------------------------------------------------------------------------------"
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "Features disabled or unavailable on this platform:"
3195754154292f0651c195433607696a259a98e2Evan Hunt $use_threads || echo " Multiprocessing support (--enable-threads)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$enable_ipv6" -o "no" = "$found_ipv6" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " IPv6 support (--enable-ipv6)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "large" = "$use_tuning" || echo " Large-system tuning (--with-tuning)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_dnstap" && \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Allow 'dnstap' packet logging (--enable-dnstap)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_geoip" && echo " GeoIP access control (--with-geoip)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$use_gssapi" && echo " GSS-API (--with-gssapi)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$enable_fixed" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
3195754154292f0651c195433607696a259a98e2Evan Hunt if test "X$CRYPTO" = "X" -o "yes" = "$want_native_pkcs11"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
3195754154292f0651c195433607696a259a98e2Evan Hunt elif test "no" = "$use_pkcs11"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " PKCS#11/Cryptoki support (--with-pkcs11)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_native_pkcs11" ||
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Native PKCS#11/Cryptoki support (--enable-native-pkcs11)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$CRYPTO" = "X" -o "yes" = "$OPENSSL_GOST" -o "yes" = "$PKCS11_GOST" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " GOST algorithm support (--with-gost)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$CRYPTO" = "X" -o "yes" = "$OPENSSL_ECDSA" -o "yes" = "$PKCS11_ECDSA" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " ECDSA algorithm support (--with-ecdsa)"
78608b0a454246d0e1e0169f1d671b8427e48199Francis Dupont test "X$CRYPTO" = "X" -o "yes" = "$OPENSSL_ED25519" -o "yes" = "$PKCS11_ED25519" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " EDDSA algorithm support (--with-eddsa)"
4d41be5f9e86c11a6f00e2b005cfc5abae2c1ab3Mark Andrews test "yes" = "$enable_seccomp" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Use libseccomp system call filtering (--enable-seccomp)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_backtrace" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Print backtrace on crash (--enable-backtrace)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$want_querytrace" || \
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " Very verbose query trace logging (--enable-querytrace)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "yes" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "no" = "$atf" && echo " Automated Testing Framework (--with-atf)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$XMLSTATS" = "X" && echo " XML statistics (--with-libxml2)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$JSONSTATS" = "X" && echo " JSON statistics (--with-libjson)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$ZLIB" = "X" && echo " HTTP zlib compression (--with-zlib)"
3195754154292f0651c195433607696a259a98e2Evan Hunt test "X$NZD_TOOLS" = "X" && echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo "-------------------------------------------------------------------------------"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo "Configured paths:"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo " prefix: $prefix"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo " sysconfdir: $sysconfdir"
9519bb92d7f3f35015aecb84954dd21607cc2c80Evan Hunt echo " localstatedir: $localstatedir"
3195754154292f0651c195433607696a259a98e2Evan Hunt if test "X$ac_unrecognized_opts" != "X"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo "Unrecognized options:"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo " $ac_unrecognized_opts"
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrews if test "yes" != "$enable_full_report"; then
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo "-------------------------------------------------------------------------------"
67247b4a8304bac790648a351a95b8b0f4c512a6Mark Andrews echo "For more detail, use --enable-full-report."
3195754154292f0651c195433607696a259a98e2Evan Hunt echo "==============================================================================="
8e8ccd0139ce0df306bec7554f0fa8f519fd3eefMark Andrewsif test "yes" != "$silent"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntif test "X$CRYPTO" = "X"; then
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan HuntBIND 9 is being built without cryptography support. This means it will
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntnot have DNSSEC support. Use --with-openssl, or --with-pkcs11 and
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt--enable-native-pkcs11 to enable cryptography.
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark Andrewsif test "X$OPENSSL_WARNING" != "X"; then
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING Your OpenSSL crypto library may be vulnerable to WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING one or more of the the following known security WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING flaws: WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
10d7ab44cc72170c527dde8cc9e049e046342769Mark AndrewsWARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937, WARNING
10d7ab44cc72170c527dde8cc9e049e046342769Mark AndrewsWARNING CVE-2006-2940 and CVE-2015-3193. WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING It is recommended that you upgrade to OpenSSL WARNING
10d7ab44cc72170c527dde8cc9e049e046342769Mark AndrewsWARNING version 1.0.2e/1.0.1/1.0.0/0.9.9/0.9.8d/0.9.7l WARNING
10d7ab44cc72170c527dde8cc9e049e046342769Mark AndrewsWARNING (or greater). WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING You can disable this warning by specifying: WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING --disable-openssl-version-check WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
3ca0e71a863fe3fbb4f439e5d0bebfd7bd38fb16Mark AndrewsWARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence# Tell Emacs to edit this file in shell mode.
afbf0f0d778da7958bbd8d7d71614f32cdc9a9b0David Lawrence# Local Variables: