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