2018-02-23 09:53:12 +01:00
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
2014-03-10 23:46:12 +00:00
#
2016-06-27 14:56:38 +10:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
2018-02-23 09:53:12 +01:00
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
2014-03-10 12:14:35 -07:00
2018-03-08 09:00:45 -04:00
AC_INIT(BIND, [9.13], [info@isc.org], [], [https://www.isc.org/downloads/BIND/])
2018-08-28 21:27:48 +02:00
AC_PREREQ([2.60])
1998-12-11 20:10:26 +00:00
AC_CONFIG_HEADER(config.h)
2018-06-12 11:26:04 +02:00
AC_CONFIG_MACRO_DIR([m4])
1998-12-11 20:10:26 +00:00
AC_CANONICAL_HOST
2018-08-28 21:27:48 +02:00
AC_USE_SYSTEM_EXTENSIONS
# Enable RFC 3542 APIs on macOS
AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
1998-12-11 20:10:26 +00:00
1999-04-29 05:19:29 +00:00
AC_PROG_MAKE_SET
2009-06-10 02:23:42 +00:00
2009-01-19 01:39:50 +00:00
AC_PROG_LIBTOOL
1999-04-29 05:19:29 +00:00
AC_PROG_INSTALL
2005-06-20 01:05:33 +00:00
AC_PROG_LN_S
2018-11-06 17:09:08 +07:00
AX_POSIX_SHELL
1999-04-29 05:19:29 +00:00
AC_SUBST(STD_CINCLUDES)
AC_SUBST(STD_CDEFINES)
AC_SUBST(STD_CWARNINGS)
2000-06-23 22:38:26 +00:00
AC_SUBST(CCOPT)
2013-07-09 11:47:16 -07:00
AC_SUBST(CCNOOPT)
2014-02-12 09:07:54 +11:00
AC_SUBST(BACKTRACECFLAGS)
1999-04-29 05:19:29 +00:00
2018-06-04 08:54:58 +02:00
#
# Use pkg-config
#
PKG_PROG_PKG_CONFIG
2008-09-24 02:13:12 +00:00
# Warn if the user specified libbind, which is now deprecated
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(libbind, AS_HELP_STRING([--enable-libbind], [deprecated]))
2008-09-24 02:13:12 +00:00
case "$enable_libbind" in
yes)
AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
It is available from http://www.isc.org as a separate download.])
;;
no|'')
;;
esac
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(buffer_useinline,
AS_HELP_STRING([--enable-buffer-useinline],
[define ISC_BUFFER_USEINLINE when compiling
[default=yes]]),
2017-11-08 23:28:10 +11:00
if test yes = "${enable}"
then
AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
[Define if you want to use inline buffers])
fi,
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(warn_shadow,
AS_HELP_STRING([--enable-warn-shadow],
[turn on -Wshadow when compiling]))
2015-01-20 13:29:18 -08:00
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(warn_error,
AS_HELP_STRING([--enable-warn-error],
[turn on -Werror when compiling]))
2014-07-08 15:51:40 +10:00
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(developer,
AS_HELP_STRING([--enable-developer],
[enable developer build settings]))
2017-01-12 14:02:51 +11:00
XTARGETS=
2011-12-20 00:39:06 +00:00
case "$enable_developer" in
yes)
2017-10-11 15:02:50 -07:00
STD_CDEFINES="$STD_CDEFINES -DISC_MEM_DEFAULTFILL=1 -DISC_LIST_CHECKINIT=1 -DNS_HOOKS_ENABLE=1"
2011-12-20 00:39:06 +00:00
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
2015-03-02 12:57:50 +05:30
test "${enable_querytrace+set}" = set || enable_querytrace=yes
2018-06-04 08:54:58 +02:00
test "${with_cmocka+set}" = set || with_cmocka=yes
2011-12-20 00:39:06 +00:00
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
2013-07-10 20:54:08 -07:00
test "${enable_symtable+set}" = set || enable_symtable=all
2014-07-08 15:51:40 +10:00
test "${enable_warn_error+set}" = set || enable_warn_error=yes
2015-01-20 13:29:18 -08:00
test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
2016-03-02 12:33:36 +11:00
test "${with_zlib+set}" = set || with_zlib=yes
2017-01-12 14:02:51 +11:00
XTARGETS='${XTARGETS}'
2011-12-20 00:39:06 +00:00
;;
esac
2017-01-12 14:02:51 +11:00
AC_SUBST(XTARGETS)
2014-05-15 20:29:30 -07:00
2018-07-03 15:45:11 +02:00
AC_ARG_ENABLE([fuzzing],
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer>],
[Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
[],
[enable_fuzzing=no])
AC_MSG_CHECKING([whether to enable fuzzing mode])
AS_CASE([$enable_fuzzing],
[no],[AC_MSG_RESULT([no])],
[afl],[
AC_MSG_RESULT([using AFL])
AC_DEFINE([ENABLE_AFL], [1],
[Define to enable American Fuzzy Lop test harness])
CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
LIBS="$LIBS -lpthread"],
[libfuzzer],[
AC_MSG_RESULT([using libFuzzer])
CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer,address,undefined"
LDFLAGS="$LDFLAGS -fsanitize=fuzzer,address,undefined"],
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
AS_IF([test "$enable_fuzzing" = "afl"],
[AC_MSG_CHECKING("for AFL enabled compiler")
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[#ifndef __AFL_COMPILER
#error AFL compiler required
#endif
])],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([set CC=afl-<gcc|clang> when --enable-fuzzing=afl is used])])
])
2016-05-05 11:46:11 +02:00
2005-09-05 00:12:29 +00:00
#
# Make very sure that these are the first files processed by
# config.status, since we use the processed output as the input for
2009-01-17 09:35:58 +00:00
# AC_SUBST_FILE() substitutions in other files.
2005-09-05 00:12:29 +00:00
#
AC_CONFIG_FILES([make/rules make/includes])
1999-09-30 20:09:33 +00:00
AC_PATH_PROG(AR, ar)
ARFLAGS="cruv"
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
2000-06-19 19:04:48 +00:00
# The POSIX ln(1) program. Non-POSIX systems may substitute
# "copy" or something.
LN=ln
AC_SUBST(LN)
2000-05-09 17:07:30 +00:00
case "$AR" in
"")
AC_MSG_ERROR([
ar program not found. Please fix your PATH to include the directory in
which ar resides, or set AR in the environment with the full path to ar.
])
;;
esac
2001-01-17 19:54:21 +00:00
#
# Etags.
#
2000-03-16 23:04:37 +00:00
AC_PATH_PROGS(ETAGS, etags emacs-etags)
2001-02-02 02:07:57 +00:00
2001-01-17 19:54:21 +00:00
#
# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
# GNU emacs etags, and it requires the -L flag.
#
if test "X$ETAGS" != "X"; then
AC_MSG_CHECKING(for Exuberant Ctags etags)
if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
AC_MSG_RESULT(yes)
ETAGS="$ETAGS -L"
else
AC_MSG_RESULT(no)
fi
fi
2000-03-16 23:04:37 +00:00
AC_SUBST(ETAGS)
2000-06-13 17:34:28 +00:00
#
# Perl is optional; it is used only by some of the system test scripts.
2009-09-01 18:40:25 +00:00
# Note: the backtrace feature (see below) uses perl to build the symbol table,
# but it still compiles without perl, in which case an empty table will be used.
2000-06-13 17:34:28 +00:00
#
AC_PATH_PROGS(PERL, perl5 perl)
AC_SUBST(PERL)
2012-06-28 17:06:00 +10:00
#
# Python is also optional; it is used by the tools in bin/python.
# If python is unavailable, we simply don't build those.
#
AC_ARG_WITH(python,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-python=PATH],
[specify path to python interpreter]),
2018-11-06 15:35:02 +11:00
use_python="$withval", use_python="yes")
2017-08-23 11:50:01 +02:00
AC_ARG_WITH(python-install-dir,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-python-install-dir=PATH],
2017-08-23 11:50:01 +02:00
[installation directory for Python modules]),
use_python_install_dir="$withval", use_python_install_dir="unspec")
2012-06-28 17:06:00 +10:00
2016-11-10 09:49:12 +11:00
python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
2016-04-28 00:12:33 -07:00
testargparse='try: import argparse
except: exit(1)'
testply='try: from ply import *
2014-09-05 10:20:26 -07:00
except: exit(1)'
2016-04-28 00:12:33 -07:00
2018-05-25 14:24:21 +02:00
testdnspython='try: import dns.message
except: exit(1)'
2016-11-10 09:49:12 +11:00
testminvers='import sys
if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
exit(1)'
2012-06-28 17:06:00 +10:00
case "$use_python" in
no)
2014-09-05 10:20:26 -07:00
AC_MSG_CHECKING([for python support])
2018-11-06 15:35:02 +11:00
AC_MSG_RESULT([disabled])
2012-06-28 17:06:00 +10:00
;;
2018-11-06 15:35:02 +11:00
yes|*)
2012-06-28 17:06:00 +10:00
case "$use_python" in
2018-11-06 15:35:02 +11:00
yes|'')
2014-09-05 10:20:26 -07:00
for p in $python
do
AC_PATH_PROGS(PYTHON, $p)
2015-04-17 05:02:28 +02:00
if test "X$PYTHON" = "X"; then
2014-09-05 10:20:26 -07:00
continue;
fi
2016-11-10 09:49:12 +11:00
AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
if ${PYTHON:-false} -c "$testminvers"; then
AC_MSG_RESULT([found])
2017-11-13 11:36:45 +11:00
else
AC_MSG_RESULT([not found])
unset ac_cv_path_PYTHON
unset PYTHON
continue
2016-11-10 09:49:12 +11:00
fi
2014-09-05 10:20:26 -07:00
AC_MSG_CHECKING([python module 'argparse'])
2016-04-28 00:12:33 -07:00
if ${PYTHON:-false} -c "$testargparse"; then
AC_MSG_RESULT([found])
2017-11-13 11:36:45 +11:00
else
AC_MSG_RESULT([not found])
unset ac_cv_path_PYTHON
unset PYTHON
continue
2016-04-28 00:12:33 -07:00
fi
AC_MSG_CHECKING([python module 'ply'])
if ${PYTHON:-false} -c "$testply"; then
AC_MSG_RESULT([found])
2018-05-25 14:24:21 +02:00
else
AC_MSG_RESULT([not found])
unset ac_cv_path_PYTHON
unset PYTHON
continue
fi
AC_MSG_CHECKING([python module 'dnspython'])
if ${PYTHON:-false} -c "$testdnspython"; then
AC_MSG_RESULT([found])
2014-09-05 10:20:26 -07:00
break
2017-11-13 11:36:45 +11:00
else
AC_MSG_RESULT([not found])
unset ac_cv_path_PYTHON
unset PYTHON
2014-09-05 10:20:26 -07:00
fi
done
2018-11-06 15:35:02 +11:00
AC_MSG_CHECKING([for python support])
2017-08-23 11:50:01 +02:00
if test "X$PYTHON" != "X"
2014-09-05 10:20:26 -07:00
then
2018-11-06 15:35:02 +11:00
PYTHON_INSTALL_DIR="$use_python_install_dir"
PYTHON_INSTALL_LIB="--install-lib=$use_python_install_dir"
AC_MSG_RESULT([yes])
2017-08-23 11:50:01 +02:00
else
2018-11-06 15:35:02 +11:00
AC_MSG_ERROR([no; python required for dnssec-keymgr])
2014-09-05 10:20:26 -07:00
fi
2012-06-28 17:06:00 +10:00
;;
*)
case "$use_python" in
2014-09-05 10:20:26 -07:00
/*)
PYTHON="$use_python"
2012-06-28 17:06:00 +10:00
;;
2014-09-05 10:20:26 -07:00
*)
AC_PATH_PROGS(PYTHON, $use_python)
2012-06-28 17:06:00 +10:00
;;
esac
2016-11-10 09:49:12 +11:00
AC_MSG_CHECKING([python2 version >= 2.7 or python3 version >= 3.2])
if ${PYTHON:-false} -c "$testminvers"; then
AC_MSG_RESULT([found])
else
AC_MSG_ERROR([not found])
fi
2014-09-05 10:20:26 -07:00
AC_MSG_CHECKING([python module 'argparse'])
2016-04-28 00:12:33 -07:00
if ${PYTHON:-false} -c "$testargparse"; then
AC_MSG_RESULT([found, using $PYTHON])
else
AC_MSG_ERROR([not found])
fi
AC_MSG_CHECKING([python module 'ply'])
if ${PYTHON:-false} -c "$testply"; then
2014-09-05 10:20:26 -07:00
AC_MSG_RESULT([found, using $PYTHON])
else
AC_MSG_ERROR([not found])
fi
;;
esac
2012-06-28 17:06:00 +10:00
;;
esac
PYTHON_TOOLS=''
2012-06-28 23:08:07 +10:00
CHECKDS=''
2013-03-20 14:31:10 -07:00
COVERAGE=''
2016-04-28 00:12:33 -07:00
KEYMGR=''
2012-06-28 17:06:00 +10:00
if test "X$PYTHON" != "X"; then
2014-02-10 15:01:06 +11:00
PYTHON_TOOLS=python
2012-06-28 23:08:07 +10:00
CHECKDS=checkds
2013-03-20 14:31:10 -07:00
COVERAGE=coverage
2016-04-28 00:12:33 -07:00
KEYMGR=keymgr
2012-06-28 17:06:00 +10:00
fi
2012-06-28 23:08:07 +10:00
AC_SUBST(CHECKDS)
2013-03-20 14:31:10 -07:00
AC_SUBST(COVERAGE)
2016-04-28 00:12:33 -07:00
AC_SUBST(KEYMGR)
2012-06-28 17:06:00 +10:00
AC_SUBST(PYTHON_TOOLS)
2017-08-23 11:50:01 +02:00
AC_SUBST(PYTHON_INSTALL_DIR)
AC_SUBST(PYTHON_INSTALL_LIB)
2012-06-28 17:06:00 +10:00
2000-02-11 18:35:11 +00:00
#
# Special processing of paths depending on whether --prefix,
# --sysconfdir or --localstatedir arguments were given. What's
2003-02-07 01:13:13 +00:00
# desired is some compatibility with the way previous versions
2000-02-11 18:35:11 +00:00
# of BIND built; they defaulted to /usr/local for most parts of
# the installation, but named.boot/named.conf was in /etc
# and named.pid was in /var/run.
#
# So ... if none of --prefix, --sysconfdir or --localstatedir are
# specified, set things up that way. If --prefix is given, use
# it for sysconfdir and localstatedir the way configure normally
# would. To change the prefix for everything but leave named.conf
# in /etc or named.pid in /var/run, then do this the usual configure way:
# ./configure --prefix=/somewhere --sysconfdir=/etc
# ./configure --prefix=/somewhere --localstatedir=/var
#
# To put named.conf and named.pid in /usr/local with everything else,
# set the prefix explicitly to /usr/local even though that's the default:
# ./configure --prefix=/usr/local
#
2000-02-10 01:14:06 +00:00
case "$prefix" in
2006-12-04 01:54:53 +00:00
NONE)
case "$sysconfdir" in
'${prefix}/etc')
sysconfdir=/etc
;;
esac
case "$localstatedir" in
'${prefix}/var')
localstatedir=/var
;;
esac
;;
2000-02-10 01:14:06 +00:00
esac
2016-04-28 00:12:33 -07:00
expanded_sysconfdir=`eval echo $sysconfdir`
AC_SUBST(expanded_sysconfdir)
2000-02-10 01:14:06 +00:00
2000-02-11 18:35:11 +00:00
#
# Make sure INSTALL uses an absolute path, else it will be wrong in all
# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
# configure based on the location of the file where it is substituted.
# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
# subdirectory of install-sh, This relative path will be wrong for all
# directories more than one level down from install-sh.
#
2000-02-10 13:52:25 +00:00
case "$INSTALL" in
/*)
2006-12-04 01:54:53 +00:00
;;
*)
#
# Not all systems have dirname.
#
changequote({, })
ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
changequote([, ])
ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
2016-10-20 10:26:05 +11:00
test "X$ac_dir" = "X$ac_prog" && ac_dir=.
2006-12-04 01:54:53 +00:00
test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
INSTALL="$ac_dir/$ac_prog"
;;
2000-02-10 13:52:25 +00:00
esac
2001-01-31 19:22:46 +00:00
AC_PROG_CC
2018-07-24 14:42:20 +02:00
AC_PROG_CC_C99
2003-01-21 04:11:26 +00:00
2013-07-09 11:47:16 -07:00
#
# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
#
if test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
CCNOOPT="-O0"
fi
2001-01-31 19:22:46 +00:00
AC_HEADER_STDC
2014-02-10 09:46:54 +11:00
AC_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,,,
2003-11-05 02:49:04 +00:00
[$ac_includes_default
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
2014-02-07 17:16:37 +11:00
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
2003-11-05 02:49:04 +00:00
])
2001-01-31 19:22:46 +00:00
2018-05-29 14:10:32 +02:00
#
# Check for thread local storage
#
AC_CHECK_HEADERS([threads.h],
[
AC_MSG_CHECKING([for C11 Thread-Local Storage using thread_local])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
#include <threads.h>
],[
static thread_local int tls = 0;
return (tls);
])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_THREAD_LOCAL],[1],[Define if thread_local keyword is available])
AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
],[
AC_MSG_RESULT([no])
])
],[
AC_MSG_CHECKING([for Thread-Local Storage using __thread])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
],[
static __thread int tls = 0;
return (tls);
])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE___THREAD],[1],[Define if __thread keyword is available])
AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
],[
AC_MSG_RESULT([no])
])
])
2001-01-31 19:22:46 +00:00
AC_C_CONST
AC_C_INLINE
2008-01-04 03:28:39 +00:00
AC_C_VOLATILE
2010-05-19 07:13:15 +00:00
AC_C_FLEXIBLE_ARRAY_MEMBER
2001-05-03 19:54:44 +00:00
2018-10-23 09:27:02 +02:00
#
# Check for yield support on ARM processors
#
AS_CASE([$host],
[arm*],[
AC_MSG_CHECKING([for yield instruction support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[__asm__ __volatile__ ("yield")]]
)],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([no, try adding -march=native or -march=armv7-a to CFLAGS (see PLATFORM.md for more information)])])])
2018-09-05 13:33:59 +02:00
AC_CHECK_FUNCS([sysctlbyname])
2012-06-21 12:58:46 -07:00
#
# Check for the existence of mmap to enable the fast format zones
#
AC_CHECK_FUNCS(mmap)
2009-07-14 22:39:30 +00:00
#
# Older versions of HP/UX don't define seteuid() and setegid()
#
AC_CHECK_FUNCS(seteuid setresuid)
AC_CHECK_FUNCS(setegid setresgid)
2001-01-31 19:22:46 +00:00
AC_TYPE_SIZE_T
2018-07-24 14:42:20 +02:00
AC_TYPE_SSIZE_T
AC_TYPE_UINTPTR_T
2001-01-31 19:22:46 +00:00
AC_HEADER_TIME
2016-01-30 11:03:10 -08:00
#
# check for uname library routine
#
2018-09-05 12:58:02 +02:00
AC_MSG_CHECKING([for uname])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/utsname.h>
#include <stdio.h>
]],
[[
struct utsname uts;
uname(&uts);
printf("running on %s %s %s for %s\n",
uts.sysname, uts.release, uts.version, uts.machine);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_UNAME], [1], [define if uname is available])
],
[AC_MSG_RESULT(no)
AC_MSG_WARN([uname is not correctly supported])
])
2016-01-30 11:03:10 -08:00
2009-09-29 15:06:07 +00:00
#
# check for GCC noreturn attribute
#
AC_MSG_CHECKING(for GCC noreturn attribute)
AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
2009-10-02 06:28:27 +00:00
ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
2009-09-29 15:06:07 +00:00
AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
AC_SUBST(ISC_PLATFORM_NORETURN_POST)
2008-06-23 19:41:20 +00:00
#
# check if we have kqueue
#
2018-09-05 12:05:32 +02:00
AC_ARG_ENABLE([kqueue],
[AS_HELP_STRING([--enable-kqueue],
[use BSD kqueue when available [default=yes]])],
[], enable_kqueue="yes")
AS_IF([test "$enable_kqueue" = "yes"],
[AC_CHECK_FUNCS([kqueue])])
2008-06-23 19:41:20 +00:00
#
2008-08-22 13:17:56 +00:00
# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
# so we need to try running the code, not just test its existence.
2008-06-23 19:41:20 +00:00
#
2018-09-05 12:14:27 +02:00
AC_ARG_ENABLE([epoll],
[AS_HELP_STRING([--enable-epoll],
[use Linux epoll when available [default=auto]])],
[], [enable_epoll="yes"])
AS_IF([test "$enable_epoll" = "yes"],
[AC_CHECK_FUNCS([epoll_create1])])
2008-06-23 19:41:20 +00:00
#
# check if we support /dev/poll
#
2018-09-05 12:26:40 +02:00
AC_ARG_ENABLE([devpoll],
[AS_HELP_STRING([--enable-devpoll],
[use /dev/poll when available [default=yes]])],
[], [enable_devpoll="yes"])
AS_IF([test "$enable_devpoll" = "yes"],
[AC_CHECK_HEADERS([sys/devpoll.h devpoll.h])])
2001-10-03 05:08:32 +00:00
2000-06-07 19:41:49 +00:00
#
# Find the machine's endian flavor.
#
AC_C_BIGENDIAN
2000-08-02 19:35:35 +00:00
#
2014-01-14 15:40:56 -08:00
# GeoIP support?
2000-08-02 19:35:35 +00:00
#
2014-01-14 15:40:56 -08:00
GEOIPLINKSRCS=
GEOIPLINKOBJS=
AC_ARG_WITH(geoip,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-geoip=PATH],
[Build with GeoIP support (yes|no|path)]),
2014-01-14 15:40:56 -08:00
use_geoip="$withval", use_geoip="no")
2000-08-02 19:35:35 +00:00
2016-10-20 10:26:05 +11:00
if test "yes" = "$use_geoip"
2004-11-11 00:37:14 +00:00
then
2014-01-30 17:03:32 -08:00
for d in /usr /usr/local /opt/local
2004-11-11 00:37:14 +00:00
do
2014-01-14 15:40:56 -08:00
if test -f $d/include/GeoIP.h
2004-11-11 00:37:14 +00:00
then
2014-01-14 15:40:56 -08:00
use_geoip=$d
2004-11-11 00:37:14 +00:00
break
fi
done
fi
2014-01-14 15:40:56 -08:00
case "$use_geoip" in
no|'')
AC_MSG_CHECKING([for GeoIP support])
AC_MSG_RESULT([disabled])
2004-11-11 00:37:14 +00:00
;;
2000-08-08 19:11:05 +00:00
*)
2014-01-14 15:40:56 -08:00
if test -d "$use_geoip" -o -L "$use_geoip"
2004-07-23 04:35:08 +00:00
then
2014-01-14 15:40:56 -08:00
CFLAGS="$CFLAGS -I$use_geoip/include"
CPPFLAGS="$CPPFLAGS -I$use_geoip/include"
2014-04-01 09:51:14 +11:00
LIBS="$LIBS -L$use_geoip/lib"
2014-01-14 15:40:56 -08:00
case "$host_os" in
netbsd*|openbsd*|solaris*)
LIBS="$LIBS -Wl,-rpath=$use_geoip/lib"
;;
2004-07-23 04:35:08 +00:00
esac
2016-10-20 10:26:05 +11:00
elif test "yes" = "$use_geoip"
2014-02-10 15:01:06 +11:00
then
2014-01-14 15:40:56 -08:00
AC_MSG_ERROR([GeoIP path not found])
else
AC_MSG_ERROR([GeoIP path $use_geoip does not exist])
2004-07-23 04:35:08 +00:00
fi
2014-01-14 15:40:56 -08:00
AC_CHECK_HEADER(GeoIP.h, [],
[AC_MSG_ERROR([GeoIP header file not found])]
)
2014-09-03 21:37:30 -07:00
AC_SEARCH_LIBS(GeoIP_id_by_addr_gl, GeoIP, [],
[AC_MSG_ERROR([suitable GeoIP library not found])]
2014-01-14 15:40:56 -08:00
)
AC_SEARCH_LIBS(fabsf, m, [],
[AC_MSG_ERROR([Math library not found])]
)
2014-02-10 15:01:06 +11:00
AC_DEFINE(HAVE_GEOIP, 1, Build with GeoIP support)
2014-01-14 15:40:56 -08:00
GEOIPLINKSRCS='${GEOIPLINKSRCS}'
GEOIPLINKOBJS='${GEOIPLINKOBJS}'
AC_MSG_CHECKING([for GeoIP support])
AC_MSG_RESULT([yes])
2001-07-11 23:16:44 +00:00
2014-01-14 15:40:56 -08:00
AC_MSG_CHECKING([for GeoIP Country IPv6 support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <GeoIP.h>
#include <netinet/in.h>
], [
struct in6_addr in6;
GeoIP_country_name_by_ipnum_v6(NULL, in6);
])],
[
AC_MSG_RESULT([yes])
2014-02-10 15:01:06 +11:00
AC_DEFINE(HAVE_GEOIP_V6, 1, Build with GeoIP Country IPv6 support)
2014-01-14 15:40:56 -08:00
],
[AC_MSG_RESULT([no])]
)
2002-05-29 04:25:51 +00:00
2014-01-14 15:40:56 -08:00
AC_MSG_CHECKING([for GeoIP City IPv6 support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <GeoIP.h>
#include <GeoIPCity.h>
#include <netinet/in.h>
], [
struct in6_addr in6;
2014-02-10 15:01:06 +11:00
int i = GEOIP_CITY_EDITION_REV0_V6;
2014-01-14 15:40:56 -08:00
GeoIP_record_by_ipnum_v6(NULL, in6);
])],
[
AC_MSG_RESULT([yes])
2014-02-10 15:01:06 +11:00
AC_DEFINE(HAVE_GEOIP_CITY_V6, 1, Build with GeoIP City IPv6 support)
2014-01-14 15:40:56 -08:00
],
[AC_MSG_RESULT([no])]
2002-05-29 04:25:51 +00:00
)
2014-01-14 15:40:56 -08:00
;;
2006-10-02 01:44:27 +00:00
esac
2014-01-14 15:40:56 -08:00
AC_SUBST(GEOIPLINKSRCS)
AC_SUBST(GEOIPLINKOBJS)
2006-10-02 01:44:27 +00:00
2008-03-31 14:42:51 +00:00
#
2016-11-01 14:00:16 -07:00
# Do we have arc4random(), etc ?
2008-03-31 14:42:51 +00:00
#
2018-04-22 14:56:28 +02:00
AC_CHECK_FUNCS(arc4random arc4random_buf arc4random_uniform getrandom)
2008-03-31 14:42:51 +00:00
2018-08-15 11:12:03 +02:00
AX_PTHREAD
2008-03-31 14:42:51 +00:00
2018-08-15 11:12:03 +02:00
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
2013-02-27 17:19:39 -08:00
2018-06-06 11:39:50 +02:00
#
# We'd like to use sigwait() too
#
2018-08-15 11:12:03 +02:00
AC_CHECK_FUNCS([sigwait pthread_attr_getstacksize pthread_attr_setstacksize])
2018-06-06 11:39:50 +02:00
2018-08-15 11:12:03 +02:00
AC_ARG_WITH([locktype],
2018-06-06 11:39:50 +02:00
AS_HELP_STRING([--with-locktype=ARG],
[Specify mutex lock type
2018-08-15 11:12:03 +02:00
(adaptive or standard)]),
[], [with_locktype="adaptive"])
AS_CASE([$with_locktype],
[adaptive],[
AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <pthread.h>
]],
[[
return (PTHREAD_MUTEX_ADAPTIVE_NP);
]]
)],
[AC_MSG_RESULT([using adaptive lock type])
AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
[Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
[AC_MSG_RESULT([using standard lock type])]
)],
[standard],[AC_MSG_RESULT([using standard lock type])],
[AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])]
)
AC_CHECK_HEADERS([sched.h])
AC_SEARCH_LIBS([sched_yield],[rt])
AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np])
2018-06-06 11:39:50 +02:00
2018-10-03 23:20:22 +02:00
AC_CHECK_HEADERS([sys/cpuset.h])
AC_CHECK_HEADERS([sys/procset.h])
AC_CHECK_FUNCS([pthread_setaffinity_np cpuset_setaffinity processor_bind sched_setaffinity])
2018-06-06 11:39:50 +02:00
# Look for functions relating to thread naming
2018-08-15 11:12:03 +02:00
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
2018-06-06 11:39:50 +02:00
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
#
# Look for sysconf to allow detection of the number of processors.
#
2018-09-05 13:29:28 +02:00
AC_CHECK_FUNCS([sysconf])
2006-12-04 01:54:53 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(ALWAYS_DEFINES)
2018-05-03 13:59:04 +02:00
2018-06-12 11:26:04 +02:00
AC_MSG_CHECKING(for libtool)
AC_ARG_WITH(libtool, AS_HELP_STRING([--with-libtool], [use GNU libtool]),
use_libtool="$withval", use_libtool="no")
2010-12-18 01:56:23 +00:00
2018-06-12 11:26:04 +02:00
case $use_libtool in
2014-02-10 15:01:06 +11:00
yes)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(yes)
AM_PROG_LIBTOOL
O=lo
A=la
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
2018-08-27 09:42:11 +02:00
LIBTOOL_MODE_COMPILE='--mode=compile'
LIBTOOL_MODE_INSTALL='--mode=install'
LIBTOOL_MODE_LINK='--mode=link'
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
2018-06-12 11:26:04 +02:00
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
2014-02-10 15:01:06 +11:00
;;
*)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(no)
O=o
A=a
LIBTOOL=
AC_SUBST(LIBTOOL)
LIBTOOL_MKDEP_SED=
LIBTOOL_MODE_COMPILE=
LIBTOOL_MODE_INSTALL=
LIBTOOL_MODE_LINK=
LIBTOOL_MODE_UNINSTALL=
INSTALL_LIBRARY='${INSTALL_DATA}'
2014-02-10 15:01:06 +11:00
;;
2018-06-12 11:26:04 +02:00
esac
AC_SUBST(INSTALL_LIBRARY)
2017-07-31 15:26:00 +02:00
2018-08-24 14:17:34 -07:00
#
# If PIC is disabled, shared libraries must also be
#
2018-08-29 16:17:56 -07:00
AS_IF([test "$pic_mode" = "no"],
2018-08-24 14:17:34 -07:00
[enable_shared="no"])
2018-06-12 11:26:04 +02:00
CRYPTO=OpenSSL
2017-07-31 15:26:00 +02:00
2018-06-12 11:26:04 +02:00
#
# was --with-openssl specified?
#
AX_CHECK_OPENSSL([:],[AC_MSG_FAILURE([OpenSSL/LibreSSL not found])])
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $OPENSSL_INCLUDES"
LIBS="$LIBS $OPENSSL_LIBS"
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
AC_MSG_CHECKING([for OpenSSL >= 1.0.0 or LibreSSL])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],
[[#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
#error OpenSSL >= 1.0.0 or LibreSSL required
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found])])
2018-10-26 05:29:56 +02:00
#
# Check for functions added in OpenSSL or LibreSSL
#
AC_CHECK_FUNCS([CRYPTO_zalloc])
AC_CHECK_FUNCS([EVP_CIPHER_CTX_new EVP_CIPHER_CTX_free])
AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free EVP_MD_CTX_reset])
AC_CHECK_FUNCS([HMAC_CTX_new HMAC_CTX_free HMAC_CTX_reset HMAC_CTX_get_md])
2018-06-12 11:26:04 +02:00
#
# Check for algorithm support in OpenSSL
#
AC_CHECK_FUNCS([ECDSA_sign ECDSA_verify], [:],
[AC_MSG_FAILURE([ECDSA support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for ECDSA P-256 support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
[[EVP_PKEY_CTX *ctx = NID_X9_62_prime256v1;]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found. ECDSA P-256 support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for ECDSA P-384 support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
[[EVP_PKEY_CTX *ctx = NID_secp384r1;]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found. ECDSA P-384 support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for Ed25519 support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
[[EVP_PKEY_CTX *ctx = NID_ED25519;]])],
[AC_DEFINE([HAVE_OPENSSL_ED25519], [1], [define if OpenSSL supports Ed25519])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
2017-07-31 15:26:00 +02:00
2018-06-12 11:26:04 +02:00
AC_MSG_CHECKING([for Ed448 support])
AC_MSG_RESULT([broken])
#AC_COMPILE_IFELSE(
# [AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
# [[EVP_PKEY_CTX *ctx = NID_ED448;]])],
# [AC_DEFINE([HAVE_OPENSSL_ED448], [1], [define if OpenSSL supports Ed448])
# AC_MSG_RESULT([yes])],
# [AC_MSG_RESULT([no])])
2014-02-26 19:00:05 -08:00
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL SHA-1 support
#
AC_CHECK_FUNCS([EVP_sha1], [:],
[AC_MSG_FAILURE([SHA-1 support in OpenSSL is mandatory.])])
2014-02-26 19:00:05 -08:00
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL SHA-2 support
#
AC_CHECK_FUNCS([EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512], [:],
[AC_MSG_FAILURE([SHA-2 support in OpenSSL is mandatory.])])
2014-02-10 15:01:06 +11:00
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL AES support
#
AC_CHECK_FUNCS([EVP_aes_128_ecb EVP_aes_192_ecb EVP_aes_256_ecb], [:],
[AC_MSG_FAILURE([AES support in OpenSSL is mandatory.])])
2006-12-04 01:54:53 +00:00
2014-01-14 15:40:56 -08:00
#
2018-06-12 11:26:04 +02:00
# Check for OpenSSL 1.1.x/LibreSSL functions
2014-01-14 15:40:56 -08:00
#
2018-10-25 11:42:51 +02:00
AC_CHECK_FUNCS([DH_get0_key ECDSA_SIG_get0 RSA_set0_key])
2006-12-04 01:54:53 +00:00
2018-10-14 14:32:02 +02:00
#
# Check whether FIPS mode is available and whether we should enable it
#
AC_ARG_ENABLE([fips-mode],
[AS_HELP_STRING([--enable-fips-mode],
[enable FIPS mode in OpenSSL library [default=no]])],
[], [enable_fips_mode="no"])
AC_MSG_CHECKING([whether to enable FIPS mode in OpenSSL library])
AS_CASE([$enable_fips_mode],
[yes], [AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([FIPS_mode],
[], [AC_MSG_FAILURE([OpenSSL FIPS mode requested but not available.])])],
[no], [AC_MSG_RESULT([no])])
2018-06-12 11:26:04 +02:00
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
2006-12-04 01:54:53 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST([OPENSSL_INCLUDES])
AC_SUBST([OPENSSL_LIBS])
AC_SUBST([OPENSSL_LDFLAGS])
2014-02-19 12:53:42 +11:00
#
2018-06-12 11:26:04 +02:00
# Client Cookie algorithm choice
2014-02-19 12:53:42 +11:00
#
2018-06-12 11:26:04 +02:00
AC_ARG_WITH([cc-alg],
[AS_HELP_STRING([--with-cc-alg=ALG],
[choose the algorithm for Client Cookie
[aes|sha1|sha256] (default is aes)])],
[:], [with_cc_alg="aes"])
AC_MSG_CHECKING([for the algorithm for Client Cookie])
AS_CASE([$with_cc_alg],
[sha1|SHA1],[AC_MSG_RESULT([sha1])
AC_DEFINE([HMAC_SHA1_CC], [1], [Use HMAC-SHA1 for Client Cookie generation])],
[sha256|SHA256],[AC_MSG_RESULT([sha256])
AC_DEFINE([HMAC_SHA256_CC], [1], [Use HMAC-SHA256 for Client Cookie generation])],
[aes|AES|auto],[AC_MSG_RESULT([aes])
AC_DEFINE([AES_CC], [1], [Use AES for Client Cookie generation])],
[AC_MSG_ERROR([Invalid $with_cc_alg algorithm for Client Cookie])])
2014-02-19 12:53:42 +11:00
2014-02-26 19:00:05 -08:00
2018-06-12 11:26:04 +02:00
PKCS11_TOOLS=
2018-07-19 13:46:01 -04:00
PKCS11_TEST=
2014-02-26 19:00:05 -08:00
#
2018-06-12 11:26:04 +02:00
# was --enable-native-pkcs11 specified?
2014-02-26 19:00:05 -08:00
#
2018-06-12 11:26:04 +02:00
AC_ARG_ENABLE(native-pkcs11,
AS_HELP_STRING([--enable-native-pkcs11],
[use native PKCS11 for public-key crypto [default=no]]),
[:], [enable_native_pkcs11="no"])
AC_MSG_CHECKING([for PKCS11 for Public-Key Cryptography])
AS_CASE([$enable_native_pkcs11],
[no],[AC_MSG_RESULT([no])],
[yes],[PKCS11_TOOLS=pkcs11
2018-07-19 13:46:01 -04:00
PKCS11_TEST=pkcs11
2018-06-12 11:26:04 +02:00
CRYPTO=pkcs11
AS_IF([$use_threads],
[:],
[AC_MSG_ERROR([PKCS11 requires threading support])])
AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([getpassphrase])
2018-07-19 13:46:01 -04:00
])
AC_SUBST([PKCS11_TEST])
2018-06-12 11:26:04 +02:00
AC_SUBST([PKCS11_TOOLS])
AS_CASE([$CRYPTO],
[pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])],
[AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])])
# preparation for automake
# AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"])
2014-02-19 12:53:42 +11:00
2017-09-20 02:22:22 +05:30
#
2018-06-12 11:26:04 +02:00
# was --with-pkcs11 specified?
2017-09-20 02:22:22 +05:30
#
2018-06-12 11:26:04 +02:00
AC_ARG_WITH([pkcs11],
[AS_HELP_STRING([--with-pkcs11[=PATH]],
[Build with PKCS11 support [no|path] (PATH is for the PKCS11 provider)])],
[:], [with_pkcs11="undefined"])
2017-09-20 02:22:22 +05:30
2018-06-12 11:26:04 +02:00
AS_CASE([$with_pkcs11],
[yes|auto],[AC_MSG_ERROR([--with-pkcs11 needs explicit path to the PKCS11 library])],
[no|undefined],[with_pkcs11="undefined"])
AC_DEFINE_UNQUOTED([PK11_LIB_LOCATION], ["$with_pkcs11"], [define the default PKCS11 library path])
# for PKCS11 benchmarks
have_clock_gt=no
AC_CHECK_FUNC(clock_gettime,have_clock_gt=yes,)
if test "no" = "$have_clock_gt"; then
AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,)
fi
if test "no" != "$have_clock_gt"; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.])
fi
if test "rt" = "$have_clock_gt"; then
LIBS="-lrt $LIBS"
fi
AC_MSG_CHECKING(for GSSAPI library)
AC_ARG_WITH(gssapi,
AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
[Specify path for system-supplied GSSAPI
[default=yes]]),
use_gssapi="$withval", use_gssapi="yes")
# first try using krb5-config, if that does not work then fall back to "yes" method.
case "$use_gssapi" in
*/krb5-config|krb5-config)
AC_MSG_RESULT(trying $use_gssapi)
if test krb5-config = "$use_gssapi"
then
AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
else
KRB5_CONFIG="$use_gssapi"
fi
gssapi_cflags=`$KRB5_CONFIG --cflags gssapi`
gssapi_libs=`$KRB5_CONFIG --libs gssapi`
saved_cppflags="$CPPFLAGS"
CPPFLAGS="$gssapi_cflags $CPPFLAGS"
AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
[ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
AC_MSG_RESULT([krb5-config: gssapi.h not found])
CPPFLAGS="$saved_cppflags"
use_gssapi="yes"
else
AC_CHECK_HEADERS(krb5/krb5.h krb5.h,
[ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
AC_MSG_RESULT([krb5-config: krb5.h not found])
CPPFLAGS="$saved_cppflags"
use_gssapi="yes"
2017-09-06 11:28:02 +02:00
else
2018-06-12 11:26:04 +02:00
CPPFLAGS="$saved_cppflags"
saved_libs="$LIBS"
LIBS=$gssapi_libs
AC_MSG_CHECKING([krb5-config linking as $LIBS])
AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
gssapi_linked=yes, gssapi_linked=no)
case $gssapi_linked in
yes) AC_MSG_RESULT([krb5-config: linked]);;
no) AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage])
use_gssapi="yes"
;;
esac
LIBS=$saved_libs
2017-09-06 11:28:02 +02:00
fi
2018-06-12 11:26:04 +02:00
fi
if test "yes" = "$use_gssapi"; then
AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])
fi
;;
esac
case "$host" in
*darwin*)
if test "yes" = "$use_gssapi"
then
use_gssapi=framework
fi
;;
2014-02-19 12:53:42 +11:00
esac
2017-09-08 16:15:37 +10:00
2018-06-12 11:26:04 +02:00
# gssapi is just the framework, we really require kerberos v5, so
# look for those headers (the gssapi headers must be there, too)
# The problem with this implementation is that it doesn't allow
# for the specification of gssapi and krb5 headers in different locations,
# which probably ought to be fixed although fixing might raise the issue of
# trying to build with incompatible versions of gssapi and krb5.
if test "yes" = "$use_gssapi"
2014-01-14 15:40:56 -08:00
then
2018-06-12 11:26:04 +02:00
# first, deal with the obvious
if test \( -f /usr/include/kerberosv5/krb5.h -o \
-f /usr/include/krb5/krb5.h -o \
-f /usr/include/krb5.h \) -a \
\( -f /usr/include/gssapi.h -o \
-f /usr/include/gssapi/gssapi.h \)
2014-01-14 15:40:56 -08:00
then
2018-06-12 11:26:04 +02:00
use_gssapi=/usr
2014-01-14 15:40:56 -08:00
else
2018-06-12 11:26:04 +02:00
krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
for d in $krb5dirs
do
if test -f $d/include/gssapi/gssapi_krb5.h -o \
-f $d/include/krb5.h
then
if test -f $d/include/gssapi/gssapi.h -o \
-f $d/include/gssapi.h
then
use_gssapi=$d
break
fi
fi
use_gssapi="no"
done
2014-01-14 15:40:56 -08:00
fi
fi
2000-08-17 18:56:49 +00:00
2018-06-12 11:26:04 +02:00
case "$use_gssapi" in
2014-01-14 15:40:56 -08:00
no)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(disabled)
USE_GSSAPI=''
2000-08-17 18:56:49 +00:00
;;
2018-06-12 11:26:04 +02:00
yes)
AC_MSG_ERROR([--with-gssapi must specify a path])
2000-08-17 18:56:49 +00:00
;;
2018-06-12 11:26:04 +02:00
*/krb5-config|krb5-config)
USE_GSSAPI='-DGSSAPI'
DST_GSSAPI_INC="$gssapi_cflags"
DNS_GSSAPI_LIBS="$gssapi_libs"
2001-06-03 19:36:01 +00:00
;;
2018-06-12 11:26:04 +02:00
framework)
USE_GSSAPI='-DGSSAPI'
ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <Kerberos/Kerberos.h>"
ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <Kerberos/Kerberos.h>"
DNS_GSSAPI_LIBS="-framework Kerberos"
AC_MSG_RESULT(framework)
2014-01-14 15:40:56 -08:00
;;
2018-08-21 14:35:57 +02:00
2000-08-17 18:56:49 +00:00
*)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(looking in $use_gssapi/lib)
USE_GSSAPI='-DGSSAPI'
saved_cppflags="$CPPFLAGS"
CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
[ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
gssapi_hack="#include <$ac_header>"])
2000-08-17 18:56:49 +00:00
2018-06-12 11:26:04 +02:00
if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
AC_MSG_ERROR([gssapi.h not found])
fi
2002-12-04 01:19:28 +00:00
2018-06-12 11:26:04 +02:00
AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
[ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
gssapi_krb5_hack="#include <$ac_header>"])
2000-08-29 00:41:18 +00:00
2018-06-12 11:26:04 +02:00
AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
[ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
krb5_hack="#include <$ac_header>"])
if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
AC_MSG_ERROR([krb5.h not found])
fi
#
# XXXDCL This probably doesn't work right on all systems.
# It will need to be worked on as problems become evident.
#
# Essentially the problems here relate to two different
# areas. The first area is building with either KTH
# or MIT Kerberos, particularly when both are present on
# the machine. The other is static versus dynamic linking.
#
# On the KTH vs MIT issue, Both have libkrb5 that can mess
# up the works if one implementation ends up trying to
# use the other's krb. This is unfortunately a situation
# that very easily arises.
#
# Dynamic linking when the dependency information is built
# into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
# all such problems go away, but when that setup is not
# present, because either the dynamic libraries lack
# dependencies or static linking is being done, then the
# problems start to show up.
saved_libs="$LIBS"
for TRY_LIBS in \
"-lgssapi_krb5" \
"-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
"-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
"-lgssapi" \
"-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lgssapi_krb5 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lhx509 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgss -lkrb5"
do
# Note that this does not include $saved_libs, because
# on FreeBSD machines this configure script has added
# -L/usr/local/lib to LIBS, which can make the
# -lgssapi_krb5 test succeed with shared libraries even
# when you are trying to build with KTH in /usr/lib.
if test "/usr" = "$use_gssapi"
then
LIBS="$TRY_LIBS $ISC_OPENSSL_LIBS"
else
LIBS="-L$use_gssapi/lib $TRY_LIBS $ISC_OPENSSL_LIBS"
fi
AC_MSG_CHECKING(linking as $TRY_LIBS)
AC_TRY_LINK([
#include <sys/types.h>
$gssapi_hack
$gssapi_krb5_hack
$krb5_hack
] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
#if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
gsskrb5_register_acceptor_identity(NULL);
#endif],
gssapi_linked=yes, gssapi_linked=no)
case $gssapi_linked in
yes) AC_MSG_RESULT(yes); break ;;
no) AC_MSG_RESULT(no) ;;
esac
done
CPPFLAGS="$saved_cppflags"
case $gssapi_linked in
no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
2006-07-20 05:42:09 +00:00
esac
2018-06-12 11:26:04 +02:00
#
# XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
# but MIT in /usr/local/lib and trying to build with KTH.
# /usr/local/lib can end up earlier on the link lines.
# Like most kludges, this one is not only inelegant it
# is also likely to be the wrong thing to do at least as
# many times as it is the right thing. Something better
# needs to be done.
#
if test "/usr" = "$use_gssapi" -a \
-f /usr/local/lib/libkrb5.a; then
FIX_KTH_VS_MIT=yes
fi
case "$FIX_KTH_VS_MIT" in
yes)
case "$enable_static_linking" in
yes) gssapi_lib_suffix=".a" ;;
*) gssapi_lib_suffix=".so" ;;
esac
for lib in $LIBS; do
case $lib in
-L*)
;;
-l*)
new_lib=`echo $lib |
sed -e s%^-l%$use_gssapi/lib/lib% \
-e s%$%$gssapi_lib_suffix%`
NEW_LIBS="$NEW_LIBS $new_lib"
;;
2017-07-31 15:26:00 +02:00
*)
2018-06-12 11:26:04 +02:00
AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
;;
2017-07-31 15:26:00 +02:00
esac
2018-06-12 11:26:04 +02:00
done
LIBS="$NEW_LIBS"
;;
2016-08-19 08:02:51 +10:00
esac
2018-06-12 11:26:04 +02:00
DST_GSSAPI_INC="-I$use_gssapi/include"
DNS_GSSAPI_LIBS="$LIBS"
AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
LIBS="$saved_libs"
2014-01-14 15:40:56 -08:00
;;
esac
2013-10-08 11:43:08 +11:00
2018-06-12 11:26:04 +02:00
AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
AC_SUBST(ISC_PLATFORM_KRB5HEADER)
2000-08-29 00:41:18 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(USE_GSSAPI)
AC_SUBST(DST_GSSAPI_INC)
AC_SUBST(DNS_GSSAPI_LIBS)
DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS"
2000-12-23 18:27:43 +00:00
2018-06-12 11:26:04 +02:00
#
# Applications linking with libdns also need to link with these libraries.
#
2000-08-29 18:24:01 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(DNS_CRYPTO_LIBS)
2014-04-03 09:24:53 +02:00
2016-07-21 11:13:03 -07:00
#
# was --with-lmdb specified?
#
AC_MSG_CHECKING(for lmdb library)
AC_ARG_WITH(lmdb,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-lmdb[=PATH]],
[build with LMDB library [yes|no|path]]),
2016-07-21 11:13:03 -07:00
use_lmdb="$withval", use_lmdb="auto")
have_lmdb=""
case "$use_lmdb" in
no)
lmdb_libs=""
;;
auto|yes)
for d in /usr /usr/local /opt/local
do
if test -f "${d}/include/lmdb.h"
then
if test ${d} != /usr
then
lmdb_cflags="-I ${d}/include"
LIBS="$LIBS -L${d}/lib"
fi
have_lmdb="yes"
fi
done
;;
*)
if test -f "${use_lmdb}/include/lmdb.h"
then
lmdb_cflags="-I${use_lmdb}/include"
LIBS="$LIBS -L${use_lmdb}/lib"
have_lmdb="yes"
else
AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
fi
;;
esac
if test "X${have_lmdb}" != "X"
then
AC_MSG_RESULT(yes)
AC_SEARCH_LIBS([mdb_env_create], [lmdb], [],
[AC_MSG_ERROR([found lmdb include but not library.])
have_lmdb=""])
elif test "X$use_lmdb" = Xyes
then
AC_MSG_ERROR([include/lmdb.h not found.])
else
AC_MSG_RESULT(no)
fi
NZD_TOOLS=""
NZDSRCS=
NZDTARGETS=
if test "X${have_lmdb}" != "X"
then
CFLAGS="$CFLAGS $lmdb_cflags"
AC_DEFINE(HAVE_LMDB, 1, [Define if lmdb was found])
NZD_TOOLS="nzd"
2017-11-13 11:36:45 +11:00
NZDSRCS='${NZDSRCS}'
NZDTARGETS='${NZDTARGETS}'
2016-07-21 11:13:03 -07:00
fi
AC_SUBST(NZD_TOOLS)
AC_SUBST(NZDSRCS)
AC_SUBST(NZDTARGETS)
2006-12-21 06:03:37 +00:00
#
# was --with-libxml2 specified?
#
AC_MSG_CHECKING(for libxml2 library)
AC_ARG_WITH(libxml2,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-libxml2[=PATH]],
[build with libxml2 library [yes|no|path]]),
2006-12-21 06:03:37 +00:00
use_libxml2="$withval", use_libxml2="auto")
case "$use_libxml2" in
no)
DST_LIBXML2_INC=""
;;
auto|yes)
2006-12-21 12:04:16 +00:00
case X`(xml2-config --version) 2>/dev/null` in
2013-01-01 23:10:51 +00:00
X2.[[6789]].*)
2006-12-21 12:04:16 +00:00
libxml2_libs=`xml2-config --libs`
libxml2_cflags=`xml2-config --cflags`
;;
*)
2016-10-20 10:26:05 +11:00
if test "yes" = "$use_libxml2" ; then
2015-08-12 21:58:04 -07:00
AC_MSG_RESULT(no)
AC_MSG_ERROR(required libxml2 version not available)
else
libxml2_libs=
libxml2_cflags=
fi
2006-12-21 12:04:16 +00:00
;;
esac
2006-12-21 06:03:37 +00:00
;;
*)
if test -f "$use_libxml2/bin/xml2-config" ; then
libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
fi
;;
esac
if test "X$libxml2_libs" != "X"
then
CFLAGS="$CFLAGS $libxml2_cflags"
LIBS="$LIBS $libxml2_libs"
2014-08-22 16:10:43 +10:00
#
# Sanity check xml2-config output.
#
AC_TRY_LINK([#include <libxml/xmlwriter.h>],
[return(xmlTextWriterStartElement(NULL, NULL));],
AC_MSG_RESULT(yes),
AC_MSG_ERROR(xml2-config returns badness))
2006-12-21 06:03:37 +00:00
AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
2015-10-28 20:19:31 -07:00
XMLSTATS=1
2006-12-21 06:03:37 +00:00
else
AC_MSG_RESULT(no)
fi
2015-10-28 20:19:31 -07:00
AC_SUBST(XMLSTATS)
2006-12-21 06:03:37 +00:00
2013-03-13 14:24:50 -07:00
#
# was --with-libjson specified?
#
AC_MSG_CHECKING(for json library)
AC_ARG_WITH(libjson,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-libjson[=PATH]],
[build with libjson0 library [yes|no|path]]),
use_libjson="$withval", use_libjson="auto")
2013-03-13 14:24:50 -07:00
2013-07-13 15:12:51 -07:00
have_libjson=""
2015-06-05 10:16:24 +10:00
have_libjson_c=""
2013-03-13 14:24:50 -07:00
case "$use_libjson" in
no)
libjson_libs=""
;;
auto|yes)
2014-05-21 12:06:00 +10:00
for d in /usr /usr/local /opt/local
do
if test -f "${d}/include/json/json.h"
then
if test ${d} != /usr
then
2015-06-05 10:16:24 +10:00
libjson_cflags="-I ${d}/include"
2014-05-21 12:06:00 +10:00
LIBS="$LIBS -L${d}/lib"
fi
have_libjson="yes"
elif test -f "${d}/include/json-c/json.h"
then
if test ${d} != /usr
then
2015-06-05 10:16:24 +10:00
libjson_cflags="-I ${d}/include"
2014-05-21 12:06:00 +10:00
LIBS="$LIBS -L${d}/lib"
fi
have_libjson="yes"
2015-06-05 10:16:24 +10:00
have_libjson_c="yes"
2014-05-21 12:06:00 +10:00
fi
done
2013-03-13 14:24:50 -07:00
;;
*)
if test -f "${use_libjson}/include/json/json.h"
2014-02-10 15:01:06 +11:00
then
2015-06-05 10:16:24 +10:00
libjson_cflags="-I${use_libjson}/include"
2013-07-09 16:43:59 -07:00
LIBS="$LIBS -L${use_libjson}/lib"
have_libjson="yes"
elif test -f "${use_libjson}/include/json-c/json.h"
then
2015-06-05 10:16:24 +10:00
libjson_cflags="-I${use_libjson}/include"
2013-07-09 16:43:59 -07:00
LIBS="$LIBS -L${use_libjson}/lib"
have_libjson="yes"
2015-06-05 10:16:24 +10:00
have_libjson_c="yes"
2013-07-09 16:43:59 -07:00
else
AC_MSG_ERROR([$use_libjson/include/json{,-c}/json.h not found.])
2013-03-13 14:24:50 -07:00
fi
;;
esac
2013-08-05 15:14:31 +10:00
if test "X${have_libjson}" != "X"
2013-03-13 14:24:50 -07:00
then
AC_MSG_RESULT(yes)
2013-08-05 15:14:31 +10:00
AC_SEARCH_LIBS([json_object_new_int64], [json json-c], [],
2014-05-21 12:06:00 +10:00
[AC_MSG_ERROR([found libjson include but not library.])
2014-02-10 15:01:06 +11:00
have_libjson=""])
2014-05-21 12:06:00 +10:00
elif test "X$use_libjson" = Xyes
then
AC_MSG_ERROR([include/json{,-c}/json.h not found.])
2013-03-13 14:24:50 -07:00
else
AC_MSG_RESULT(no)
fi
2013-07-09 16:43:59 -07:00
if test "X${have_libjson}" != "X"
then
CFLAGS="$CFLAGS $libjson_cflags"
AC_DEFINE(HAVE_JSON, 1, [Define if libjson was found])
2015-06-05 10:16:24 +10:00
if test "X${have_libjson_c}" = Xyes
then
AC_DEFINE(HAVE_JSON_C, 1, [Define if json-c was found])
fi
2015-10-28 20:19:31 -07:00
JSONSTATS=1
2013-07-09 16:43:59 -07:00
fi
2015-10-28 20:19:31 -07:00
AC_SUBST(JSONSTATS)
2013-07-09 16:43:59 -07:00
2015-10-02 10:45:10 +02:00
#
# was --with-zlib specified?
#
AC_MSG_CHECKING(for zlib library)
AC_ARG_WITH(zlib,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-zlib[=PATH]],
[build with zlib for HTTP compression
[default=yes]]),
with_zlib="$withval", with_zlib="auto")
2015-10-02 10:45:10 +02:00
have_zlib=""
2016-03-02 12:37:41 +11:00
case "$with_zlib" in
2015-10-02 10:45:10 +02:00
no)
zlib_libs=""
;;
auto|yes)
for d in /usr /usr/local /opt/local
do
if test -f "${d}/include/zlib.h"
then
if test ${d} != /usr
then
zlib_cflags="-I ${d}/include"
LIBS="$LIBS -L${d}/lib"
fi
have_zlib="yes"
fi
done
;;
*)
2017-11-07 10:11:55 +11:00
if test -f "${with_zlib}/include/zlib.h"
2015-10-02 10:45:10 +02:00
then
2016-03-02 12:37:41 +11:00
zlib_cflags="-I${with_zlib}/include"
LIBS="$LIBS -L${with_zlib}/lib"
2015-10-02 10:45:10 +02:00
have_zlib="yes"
else
2016-03-02 12:37:41 +11:00
AC_MSG_ERROR([$with_zlib/include/zlib.h not found.])
2015-10-02 10:45:10 +02:00
fi
;;
esac
if test "X${have_zlib}" != "X"
then
AC_MSG_RESULT(yes)
AC_SEARCH_LIBS([deflate], [z], [],
[AC_MSG_ERROR([found zlib include but not library.])
have_zlib=""])
2016-03-02 12:37:41 +11:00
elif test "X$with_zlib" = Xyes
2015-10-02 10:45:10 +02:00
then
AC_MSG_ERROR([include/zlib.h not found.])
else
AC_MSG_RESULT(no)
fi
2015-10-28 20:19:31 -07:00
ZLIB=
2015-10-02 10:45:10 +02:00
if test "X${have_zlib}" != "X"
then
CFLAGS="$CFLAGS $zlib_cflags"
AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib was found])
2015-10-28 20:19:31 -07:00
ZLIB=1
2015-10-02 10:45:10 +02:00
fi
2015-10-28 20:19:31 -07:00
AC_SUBST(ZLIB)
2015-10-02 10:45:10 +02:00
2004-09-01 07:25:51 +00:00
#
# In solaris 10, SMF can manage named service
#
AC_CHECK_LIB(scf, smf_enable_instance)
2002-03-08 00:24:00 +00:00
#
# Large File
#
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(largefile,
AS_HELP_STRING([--enable-largefile], [64-bit file support]),
2002-03-08 00:24:00 +00:00
want_largefile="yes", want_largefile="no")
case $want_largefile in
yes)
ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
;;
*)
;;
esac
2000-12-23 18:27:43 +00:00
#
# Additional compiler settings.
#
MKDEPCC="$CC"
MKDEPCFLAGS="-M"
if test "X$GCC" = "Xyes"; then
2014-05-23 11:25:59 +10:00
STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
2006-08-10 01:57:41 +00:00
AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
2014-05-23 11:25:59 +10:00
SAVE_CFLAGS="$CFLAGS"
2015-04-15 12:39:55 +10:00
CFLAGS="$CFLAGS -Werror -fno-strict-aliasing"
2006-08-10 01:57:41 +00:00
AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
2014-05-23 11:25:59 +10:00
CFLAGS="$SAVE_CFLAGS"
2016-10-20 10:26:05 +11:00
if test "yes" = "$FNOSTRICTALIASING"; then
2006-08-10 01:57:41 +00:00
AC_MSG_RESULT(yes)
2014-05-23 11:25:59 +10:00
STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"
else
AC_MSG_RESULT(no)
fi
#
# turn off delete null pointer checks
#
AC_MSG_CHECKING(if "$CC" supports -fno-delete-null-pointer-checks)
SAVE_CFLAGS="$CFLAGS"
2015-04-15 12:39:55 +10:00
CFLAGS="$CFLAGS -Werror -fno-delete-null-pointer-checks"
2014-05-23 11:25:59 +10:00
AC_TRY_COMPILE(,, [FNODELETENULLPOINTERCHECKS=yes],
[FNODELETENULLPOINTERCHECKS=no])
CFLAGS="$SAVE_CFLAGS"
2016-10-20 10:26:05 +11:00
if test "yes" = "$FNODELETENULLPOINTERCHECKS"; then
2014-05-23 11:25:59 +10:00
AC_MSG_RESULT(yes)
STD_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"
2006-08-10 01:57:41 +00:00
else
AC_MSG_RESULT(no)
fi
2015-01-20 13:29:18 -08:00
if test "X$enable_warn_shadow" = Xyes; then
STD_CWARNINGS="$STD_CWARNINGS -Wshadow"
fi
2014-07-08 15:51:40 +10:00
if test "X$enable_warn_error" = Xyes; then
STD_CWARNINGS="$STD_CWARNINGS -Werror"
fi
2000-12-23 18:27:43 +00:00
else
case $host in
*-solaris*)
MKDEPCFLAGS="-xM"
;;
esac
fi
AC_SUBST(MKDEPCC)
AC_SUBST(MKDEPCFLAGS)
AC_SUBST(MKDEPPROG)
2000-02-11 18:35:11 +00:00
#
# NLS
#
2018-09-05 13:34:44 +02:00
AC_CHECK_FUNCS([catgets])
1999-06-23 02:51:39 +00:00
2000-02-11 18:35:11 +00:00
#
# -lxnet buys us one big porting headache... standards, gotta love 'em.
#
# AC_CHECK_LIB(xnet, socket, ,
# AC_CHECK_LIB(socket, socket)
# )
#
# Use this for now, instead:
#
1999-02-11 06:38:12 +00:00
case "$host" in
2008-12-01 07:50:17 +00:00
*-linux*)
;;
1999-02-11 06:38:12 +00:00
*)
AC_CHECK_LIB(socket, socket)
2008-12-01 07:50:17 +00:00
AC_CHECK_LIB(nsl, inet_addr)
1999-02-11 06:38:12 +00:00
;;
esac
1999-01-22 04:35:11 +00:00
2008-10-21 02:43:08 +00:00
#
# Work around Solaris's select() limitations.
#
case "$host" in
*-solaris2.[[89]]|*-solaris2.1?)
AC_DEFINE(FD_SETSIZE, 65536,
[Solaris hack to get select_large_fdset.])
;;
esac
2001-02-01 23:16:10 +00:00
#
# Purify support
#
AC_MSG_CHECKING(whether to use purify)
AC_ARG_WITH(purify,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-purify[=PATH]],[use Rational purify]),
use_purify="$withval", use_purify="no")
2001-02-01 23:16:10 +00:00
case "$use_purify" in
no)
;;
yes)
AC_PATH_PROG(purify_path, purify, purify)
;;
*)
purify_path="$use_purify"
;;
esac
case "$use_purify" in
no)
AC_MSG_RESULT(no)
PURIFY=""
;;
*)
2017-07-19 15:53:01 +10:00
if test -f "$purify_path" || test purify = "$purify_path"; then
2001-02-01 23:16:10 +00:00
AC_MSG_RESULT($purify_path)
PURIFYFLAGS="`echo $PURIFYOPTIONS`"
PURIFY="$purify_path $PURIFYFLAGS"
else
AC_MSG_ERROR([$purify_path not found.
Please choose the proper path with the following command:
configure --with-purify=PATH
])
fi
;;
esac
AC_SUBST(PURIFY)
2014-10-08 15:14:02 +02:00
#
# Google/Great Performance Tools CPU Profiler
#
AC_MSG_CHECKING(whether to use gperftools profiler)
AC_ARG_WITH(gperftools-profiler,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-gperftools-profiler],
[use gperftools CPU profiler]),
use_profiler="$withval", use_profiler="no")
2014-10-08 15:14:02 +02:00
case $use_profiler in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GPERFTOOLS_PROFILER], 1,
[Define to use gperftools CPU profiler.])
LIBS="$LIBS -lprofiler"
;;
*)
AC_MSG_RESULT(no)
;;
esac
2008-04-28 23:43:24 +00:00
2009-09-01 18:40:25 +00:00
#
# enable/disable dumping stack backtrace. Also check if the system supports
# glibc-compatible backtrace() function.
#
2018-09-04 10:09:24 +02:00
AC_ARG_ENABLE([backtrace],
[AS_HELP_STRING([--enable-backtrace],
[log stack backtrace on abort [default=yes]])],
[], [enable_backtrace="yes"])
AS_IF([test "$enable_backtrace" = "yes"],
[AC_DEFINE([USE_BACKTRACE], [1], [define if we can use backtrace])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <execinfo.h>]],
[[return (backtrace((void **)0, 0));]]
)],
[AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])]
)])
2009-09-01 18:40:25 +00:00
AC_ARG_ENABLE(symtable,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-symtable],
[use internal symbol table for backtrace
[all|minimal(default)|none]]),
2009-09-01 18:40:25 +00:00
want_symtable="$enableval", want_symtable="minimal")
case $want_symtable in
2009-11-11 08:46:47 +00:00
yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
2016-10-20 10:26:05 +11:00
if test "" = "$PERL"
2009-09-01 18:40:25 +00:00
then
AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
Install perl or explicitly disable the feature by --disable-symtable.])
fi
2016-10-20 10:26:05 +11:00
if test "yes" = "$use_libtool"; then
2009-09-15 23:17:22 +00:00
AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
2009-09-01 18:40:25 +00:00
else
2009-11-11 08:46:47 +00:00
# we generate the internal symbol table only for those systems
# known to work to avoid unexpected build failure. Also, warn
# about unsupported systems when the feature is enabled
# manually.
case $host_os in
freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
MKSYMTBL_PROGRAM="$PERL"
2017-07-19 15:53:01 +10:00
if test "all" = "$want_symtable"; then
2009-11-11 08:46:47 +00:00
ALWAYS_MAKE_SYMTABLE="yes"
fi
;;
*)
2017-07-19 15:53:01 +10:00
if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
2009-11-11 08:46:47 +00:00
then
AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
fi
esac
2009-09-01 18:40:25 +00:00
fi
;;
*)
;;
esac
AC_SUBST(MKSYMTBL_PROGRAM)
AC_SUBST(ALWAYS_MAKE_SYMTABLE)
2001-02-02 02:07:57 +00:00
#
2000-02-23 23:02:28 +00:00
# File name extension for static archive files, for those few places
# where they are treated differently from dynamic ones.
2001-02-02 02:07:57 +00:00
#
2000-02-23 23:02:28 +00:00
SA=a
1999-07-03 21:07:10 +00:00
AC_SUBST(O)
AC_SUBST(A)
2000-02-23 23:02:28 +00:00
AC_SUBST(SA)
2001-03-15 19:12:53 +00:00
AC_SUBST(LIBTOOL_MKDEP_SED)
2004-02-24 01:41:28 +00:00
AC_SUBST(LIBTOOL_MODE_COMPILE)
AC_SUBST(LIBTOOL_MODE_INSTALL)
AC_SUBST(LIBTOOL_MODE_LINK)
2016-11-01 19:17:07 -07:00
AC_SUBST(LIBTOOL_MODE_UNINSTALL)
1999-07-03 21:07:10 +00:00
2013-04-10 13:49:57 -07:00
BIND9_CO_RULE=".c.$O:"
2009-09-01 00:22:28 +00:00
AC_SUBST(BIND9_CO_RULE)
2000-07-25 23:54:09 +00:00
#
# Here begins a very long section to determine the system's networking
2009-01-17 09:35:58 +00:00
# capabilities. The order of the tests is significant.
2000-07-25 23:54:09 +00:00
#
2000-02-11 18:35:11 +00:00
#
# We do the IPv6 compilation checking after libtool so that we can put
# the right suffix on the files.
#
2018-08-21 11:50:23 +02:00
AC_MSG_CHECKING([for IPv6 structures])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
]],
[[
2018-08-21 12:54:15 +02:00
struct sockaddr_in6 sin6;
struct in6_addr in6;
2018-08-21 13:22:40 +02:00
struct in6_pktinfo in6_pi;
2018-08-21 13:48:48 +02:00
struct sockaddr_storage storage;
2018-08-21 12:54:15 +02:00
in6 = in6addr_any;
2018-08-21 13:07:05 +02:00
in6 = in6addr_loopback;
2018-08-21 13:17:00 +02:00
sin6.sin6_scope_id = 0;
2018-08-21 12:54:15 +02:00
return (0);
2018-08-21 11:50:23 +02:00
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([IPv6 support is mandatory])])
2000-01-07 02:44:13 +00:00
2016-08-12 15:31:33 +10:00
#
2017-09-18 08:34:41 +02:00
# Allow forcibly disabling TCP Fast Open support as autodetection might yield
# confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
# comment in lib/isc/unix/socket.c).
2016-08-12 15:31:33 +10:00
#
2017-09-18 08:34:41 +02:00
2018-09-05 12:34:10 +02:00
AC_ARG_ENABLE([tcp_fastopen],
[AS_HELP_STRING([--disable-tcp-fastopen],
[disable TCP Fast Open support [default=yes]])],
[], [enable_tcp_fastopen="yes"])
2017-09-18 08:34:41 +02:00
2018-09-05 12:34:10 +02:00
AS_IF([test "$enable_tcp_fastopen" = "yes"],
[AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])])
2016-08-12 15:31:33 +10:00
2000-07-25 23:54:09 +00:00
#
2000-04-26 21:50:49 +00:00
# Check for some other useful functions that are not ever-present.
2000-07-25 23:54:09 +00:00
#
2018-09-04 21:10:02 +02:00
AC_CHECK_FUNCS([strlcpy strlcat])
2001-12-03 21:52:07 +00:00
2013-01-10 17:34:28 +11:00
AC_SUBST(READLINE_LIB)
2011-12-16 23:01:17 +00:00
AC_ARG_WITH(readline,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-readline[=LIBSPEC]],
[specify readline library [default auto]]),
use_readline="$withval", use_readline="auto")
2016-10-12 11:56:59 +11:00
case "$use_readline" in
2011-12-16 23:01:17 +00:00
no) ;;
2016-10-12 11:56:59 +11:00
*)
2015-04-17 15:27:47 -07:00
saved_LIBS="$LIBS"
2016-10-12 11:56:59 +11:00
case "$use_readline" in
yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
*) try_readline="$use_readline"
esac
for readline in "$try_readline" $or_readline
2015-04-17 15:27:47 -07:00
do
2016-10-12 11:56:59 +11:00
LIBS="$readline"
AC_MSG_NOTICE(checking for readline with $readline)
2015-04-17 15:27:47 -07:00
AC_CHECK_FUNCS(readline)
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2015-04-17 15:27:47 -07:00
then
2016-10-12 11:56:59 +11:00
READLINE_LIB="$readline"
2015-04-17 15:27:47 -07:00
break
fi
for lib in -lterminfo -ltermcap -lncurses -lcurses
do
2016-10-12 11:56:59 +11:00
AC_MSG_NOTICE(checking for readline with $readline $lib)
2015-04-17 15:27:47 -07:00
unset ac_cv_func_readline
2016-10-12 11:56:59 +11:00
LIBS="$readline $lib"
2015-04-17 15:27:47 -07:00
AC_CHECK_FUNCS(readline)
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2015-04-17 15:27:47 -07:00
then
2016-10-12 11:56:59 +11:00
READLINE_LIB="$readline $lib"
2015-04-17 15:27:47 -07:00
break
fi
done
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2016-04-14 13:46:15 -07:00
then
break
fi
2015-04-17 15:27:47 -07:00
done
2017-07-19 15:53:01 +10:00
if test "auto" != "$use_readline" &&
2016-10-12 11:56:59 +11:00
test "X$READLINE_LIB" = "X"
2016-10-11 15:15:56 +11:00
then
AC_MSG_ERROR([The readline library was not found.])
fi
2013-01-10 17:34:28 +11:00
LIBS="$saved_LIBS"
2014-02-10 15:01:06 +11:00
;;
2011-12-16 23:01:17 +00:00
esac
2017-07-19 15:53:01 +10:00
if test "yes" = "$ac_cv_func_readline"
2016-10-27 15:48:51 +11:00
then
case "$READLINE_LIB" in
*edit*)
AC_CHECK_HEADERS(editline/readline.h)
2016-11-18 11:12:42 -08:00
AC_CHECK_HEADERS(edit/readline/readline.h)
AC_CHECK_HEADERS(edit/readline/history.h)
2016-10-27 15:48:51 +11:00
;;
esac
AC_CHECK_HEADERS(readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
fi
2011-12-16 23:01:17 +00:00
2006-12-04 01:54:53 +00:00
#
# Use our own SPNEGO implementation?
#
AC_ARG_ENABLE(isc-spnego,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--disable-isc-spnego],
[use SPNEGO from GSSAPI library]))
2006-12-04 01:54:53 +00:00
if test -n "$USE_GSSAPI"
then
case "$enable_isc_spnego" in
yes|'')
USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
AC_MSG_RESULT(using SPNEGO from lib/dns)
;;
no)
AC_MSG_RESULT(using SPNEGO from GSSAPI library)
;;
esac
fi
AC_SUBST(USE_ISC_SPNEGO)
AC_SUBST(DST_EXTRA_OBJS)
AC_SUBST(DST_EXTRA_SRCS)
2000-02-11 18:35:11 +00:00
#
# Security Stuff
#
2008-12-01 03:53:32 +00:00
# Note it is very recommended to *not* disable chroot(),
# this is only because chroot() was made obsolete by Posix.
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot]))
2008-12-01 03:53:32 +00:00
case "$enable_chroot" in
yes|'')
AC_CHECK_FUNCS(chroot)
;;
no)
;;
esac
2018-06-26 14:52:11 +02:00
LIBCAP_LIBS=""
AC_MSG_CHECKING([whether to enable Linux capabilities])
AC_ARG_ENABLE([linux-caps],
[AS_HELP_STRING([--disable-linux-caps],
[disable Linux capabilities])],
[],
[AS_CASE([$host],
[*-linux*],[enable_linux_caps=yes],
[enable_linux_caps=no])])
AS_IF([test "$enable_linux_caps" = "yes"],
[AC_MSG_RESULT([yes])
AC_CHECK_HEADERS([sys/capability.h],
[],
2018-07-02 08:53:13 +02:00
[AC_MSG_ERROR(m4_normalize([sys/capability.h header is required for Linux capabilities support.
Either install libcap or use --disable-linux-caps.]))])
2018-06-26 14:52:11 +02:00
save_LIBS="$LIBS"
AC_SEARCH_LIBS([cap_set_proc], [cap],
[LIBCAP_LIBS="$ac_cv_search_cap_set_proc"],
2018-07-02 08:53:13 +02:00
[AC_MSG_ERROR(m4_normalize([libcap is required for Linux capabilities support.
Either install libcap or use --disable-linux-caps.]))])
2018-06-26 14:52:11 +02:00
LIBS="$save_LIBS"],
[AC_MSG_RESULT([no])])
AC_SUBST([LIBCAP_LIBS])
2005-02-23 01:09:23 +00:00
AC_CHECK_HEADERS(sys/un.h,
ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
,
ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
)
AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
case "$host" in
*-solaris*)
AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
[Define if connect does not honour the permission on the UNIX domain socket.])
;;
esac
2004-01-07 05:48:15 +00:00
#
# Time Zone Stuff
#
2018-09-05 12:58:02 +02:00
AC_CHECK_FUNCS([tzset])
2004-01-07 05:48:15 +00:00
2009-01-17 09:35:58 +00:00
AC_MSG_CHECKING(for optarg declaration)
2005-06-08 02:09:18 +00:00
AC_TRY_COMPILE([
#include <unistd.h>
],
[optarg = 0;],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
2006-01-05 00:30:34 +00:00
GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2005-06-08 02:09:18 +00:00
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2016-05-05 12:22:26 -07:00
#
# Check for nanoseconds in file stats
#
2018-09-05 12:39:51 +02:00
AC_MSG_CHECKING([for st_mtim.tv_nsec])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/fcntl.h>]],
[[struct stat s;
return(s.st_mtim.tv_nsec);
]])],
[AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])])
2016-05-05 12:22:26 -07:00
2002-11-26 03:53:42 +00:00
#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
2018-09-04 12:35:42 +02:00
AC_CHECK_FUNCS([if_nametoindex])
2002-11-26 03:53:42 +00:00
2017-09-19 16:16:45 +05:30
AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
2008-12-01 03:53:32 +00:00
2018-08-14 09:52:25 +02:00
ISC_ATOMIC_LIBS=""
AC_CHECK_HEADERS(
[stdatomic.h],
[AC_MSG_CHECKING([for memory model aware atomic operations])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdatomic.h>]],
[[atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
)],
[AC_MSG_RESULT([stdatomic.h])
AC_MSG_CHECKING([whether -latomic is needed for 64-bit stdatomic.h functions])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdatomic.h>]],
[[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
)],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
ISC_ATOMIC_LIBS="-latomic"
])
],
[AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, fix your toolchaing.])]
)],
[AC_MSG_CHECKING([for memory model aware atomic operations])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <inttypes.h>]],
[[int32_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
)],
[AC_MSG_RESULT([__atomic builtins])
AC_DEFINE([HAVE___ATOMIC], [1], [define if __atomic builtins are not available])
AC_MSG_CHECKING([whether -latomic is needed for 64-bit __atomic builtins])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <inttypes.h>]],
[[int64_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
)],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
ISC_ATOMIC_LIBS="-latomic"
])
],
[AC_MSG_RESULT([__sync builtins])
])
])
LIBS="$LIBS $ISC_ATOMIC_LIBS"
2005-06-04 05:32:50 +00:00
2018-08-14 10:23:50 +02:00
AC_CHECK_HEADERS([uchar.h])
2018-06-04 13:41:09 +02:00
#
# Check for __builtin_unreachable
#
AC_MSG_CHECKING([compiler support for __builtin_unreachable()])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[__builtin_unreachable();]]
)],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().])
],
[AC_MSG_RESULT([no])
])
2016-02-01 08:59:49 +05:30
#
# Check for __builtin_expect
#
AC_MSG_CHECKING([compiler support for __builtin_expect])
AC_TRY_LINK(, [
2017-11-13 11:36:45 +11:00
return (__builtin_expect(1, 1) ? 1 : 0);
2016-02-01 08:59:49 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_expect=yes
AC_MSG_RESULT(yes)
2016-02-01 08:59:49 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_expect=no
AC_MSG_RESULT(no)
2016-02-01 08:59:49 +05:30
])
2016-10-20 10:26:05 +11:00
if test "yes" = "$have_builtin_expect"; then
2017-11-13 11:36:45 +11:00
AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
2016-02-01 08:59:49 +05:30
fi
2016-07-10 19:46:17 +05:30
#
# Check for __builtin_clz
#
AC_MSG_CHECKING([compiler support for __builtin_clz])
AC_TRY_LINK(, [
2017-11-13 11:36:45 +11:00
return (__builtin_clz(0xff) == 24 ? 1 : 0);
2016-07-10 19:46:17 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_clz=yes
AC_MSG_RESULT(yes)
2016-07-10 19:46:17 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_clz=no
AC_MSG_RESULT(no)
2016-07-10 19:46:17 +05:30
])
2016-10-20 10:26:05 +11:00
if test "yes" = "$have_builtin_clz"; then
2017-11-13 11:36:45 +11:00
AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
2016-07-10 19:46:17 +05:30
fi
2008-04-23 21:32:57 +00:00
#
# Activate "rrset-order fixed" or not?
#
AC_ARG_ENABLE(fixed-rrset,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-fixed-rrset],
[enable fixed rrset ordering [default=no]]),
enable_fixed="$enableval", enable_fixed="no")
2008-04-23 21:32:57 +00:00
case "$enable_fixed" in
yes)
AC_DEFINE(DNS_RDATASET_FIXED, 1,
2009-08-13 01:51:19 +00:00
[Define to enable "rrset-order fixed" syntax.])
2008-04-23 21:32:57 +00:00
;;
no)
;;
*)
;;
esac
2011-01-13 01:59:28 +00:00
#
# Enable response policy rewriting using NS IP addresses
#
AC_ARG_ENABLE(rpz-nsip,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--disable-rpz-nsip],
[disable rpz nsip rules [default=enabled]]),
enable_nsip="$enableval", enable_nsip="yes")
2011-01-13 01:59:28 +00:00
case "$enable_nsip" in
yes)
AC_DEFINE(ENABLE_RPZ_NSIP, 1,
2017-09-11 11:53:42 -07:00
[Define to enable rpz nsip rules.])
2011-01-13 01:59:28 +00:00
;;
no)
;;
*)
;;
esac
#
# Enable response policy rewriting using NS name
#
AC_ARG_ENABLE(rpz-nsdname,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--disable-rpz-nsdname],
[disable rpz nsdname rules [default=enabled]]),
enable_nsdname="$enableval", enable_nsdname="yes")
2011-01-13 01:59:28 +00:00
case "$enable_nsdname" in
yes)
AC_DEFINE(ENABLE_RPZ_NSDNAME, 1,
2017-09-11 11:53:42 -07:00
[Define to enable rpz nsdname rules.])
2011-01-13 01:59:28 +00:00
;;
no)
;;
*)
;;
esac
2015-10-02 12:32:42 -07:00
#
# Activate dnstap?
#
AC_ARG_ENABLE(dnstap,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-dnstap],
[enable dnstap support
(requires fstrm, protobuf-c)]),
use_dnstap=$enableval, use_dnstap=no)
2015-10-02 12:32:42 -07:00
DNSTAP=
DNSTAPSRCS=
DNSTAPOBJS=
DNSTAPTARGETS=
2016-06-24 09:37:04 +10:00
DNSTAP_PB_C_H=
2015-10-02 12:32:42 -07:00
if test "x$use_dnstap" != "xno"; then
2016-06-24 09:37:04 +10:00
AC_ARG_WITH([protobuf-c],
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-protobuf-c=path],
2016-06-24 09:37:04 +10:00
[Path where protobuf-c is installed, for dnstap]), [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([PROTOC_C], [protoc-c], [],
[$PATH$PATH_SEPARATOR$withval/bin])
2016-06-24 09:37:04 +10:00
], [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([PROTOC_C],[protoc-c])
2016-06-24 09:37:04 +10:00
])
2017-05-11 18:30:04 +10:00
if test -z "$PROTOC_C"; then
AC_MSG_ERROR([The protoc-c program was not found.])
fi
2017-11-13 11:36:45 +11:00
AC_ARG_WITH([libfstrm], AS_HELP_STRING([--with-libfstrm=path],
2016-06-24 09:37:04 +10:00
[Path where libfstrm is installed, for dnstap]), [
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture], [], [$PATH$PATH_SEPARATOR$withval/bin])
],[
AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
2016-06-24 09:37:04 +10:00
])
AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
DNSTAP_PB_C_H="dnstap.pb-c.h"
2015-10-02 12:32:42 -07:00
fi
AC_SUBST(DNSTAP)
AC_SUBST(DNSTAPSRCS)
AC_SUBST(DNSTAPOBJS)
AC_SUBST(DNSTAPTARGETS)
2016-06-24 09:37:04 +10:00
AC_SUBST(DNSTAP_PB_C_H)
2015-10-02 12:32:42 -07:00
2005-07-08 04:30:22 +00:00
#
# The following sets up how non-blocking i/o is established.
2018-08-21 10:56:14 +02:00
# cygwin and solaris 2.x (x<5) require special handling.
2005-07-08 04:30:22 +00:00
#
case "$host" in
*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2005-07-11 03:18:34 +00:00
*-solaris2.[[01234]])
2005-07-08 04:30:22 +00:00
AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
AC_DEFINE(USE_FIONBIO_IOCTL, 1,
[Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
;;
*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
[Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
;;
esac
2001-05-02 23:15:38 +00:00
#
2006-01-04 04:15:55 +00:00
# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
# This prevents the source address being set.
#
case "$host" in
*-solaris2.[[012345]]|*-solaris2.5.1)
AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
[Define if you cannot bind() before connect() for TCP sockets.])
;;
esac
#
2001-05-02 23:15:38 +00:00
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
# a developer editing the documentation source.
#
2000-11-15 23:53:00 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for TeX.
2000-11-15 23:53:00 +00:00
#
2005-05-11 05:55:41 +00:00
AC_PATH_PROGS(LATEX, latex, latex)
AC_SUBST(LATEX)
AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
AC_SUBST(PDFLATEX)
2000-11-15 23:53:00 +00:00
2015-10-05 21:59:35 -07:00
AC_PATH_PROGS(DBLATEX, dblatex, dblatex)
AC_SUBST(DBLATEX)
2005-08-17 22:55:57 +00:00
#
# Look for w3m
#
AC_PATH_PROGS(W3M, w3m, w3m)
AC_SUBST(W3M)
2017-04-20 19:21:54 -07:00
#
# Look for pandoc
#
AC_PATH_PROG(PANDOC, pandoc, pandoc)
AC_SUBST(PANDOC)
2001-02-02 22:37:20 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for xsltproc (libxslt)
2001-02-02 22:37:20 +00:00
#
2005-05-11 05:55:41 +00:00
AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
AC_SUBST(XSLTPROC)
#
# Look for xmllint (libxml2)
#
2001-02-02 22:37:20 +00:00
2005-05-11 05:55:41 +00:00
AC_PATH_PROG(XMLLINT, xmllint, xmllint)
AC_SUBST(XMLLINT)
2001-02-02 22:37:20 +00:00
2006-12-22 01:46:19 +00:00
#
# Look for Doxygen
#
AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
AC_SUBST(DOXYGEN)
2015-06-29 18:33:18 +05:30
#
# Look for curl
#
AC_PATH_PROG(CURL, curl, curl)
AC_SUBST(CURL)
2001-07-11 23:35:33 +00:00
#
# 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
2018-08-21 14:35:57 +02:00
# variable VARIABLE is defined to its absolute pathname. Otherwise,
2001-07-11 23:35:33 +00:00
# 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.
2018-08-21 14:35:57 +02:00
#
2001-07-11 23:35:33 +00:00
2018-06-04 08:54:58 +02:00
AC_DEFUN([NOM_PATH_FILE], [
2001-07-11 23:35:33 +00:00
$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)
])
2002-01-26 23:12:39 +00:00
#
2008-01-11 03:11:44 +00:00
# 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).
2002-01-26 23:12:39 +00:00
#
2008-01-11 03:11:44 +00:00
AC_MSG_CHECKING(for Docbook-XSL path)
AC_ARG_WITH(docbook-xsl,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-docbook-xsl[=PATH]],
[specify path for Docbook-XSL stylesheets]),
2008-01-11 03:11:44 +00:00
docbook_path="$withval", docbook_path="auto")
case "$docbook_path" in
auto)
AC_MSG_RESULT(auto)
2018-08-02 00:50:43 +10:00
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 /opt/local/share/xsl/docbook-xsl-nons /usr/share/xml/docbook/stylesheet/docbook-xsl"
2008-01-11 03:11:44 +00:00
;;
*)
docbook_xsl_trees="$withval"
2014-02-10 15:01:06 +11:00
AC_MSG_RESULT($docbook_xsl_trees)
2008-01-11 03:11:44 +00:00
;;
esac
2001-05-15 17:33:32 +00:00
2000-11-15 23:32:21 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for stylesheets we need.
#
2008-01-11 03:11:44 +00:00
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)
2005-05-11 05:55:41 +00:00
2001-03-29 22:54:36 +00:00
#
2015-10-05 21:59:35 -07:00
# Same dance for dblatex
2000-11-16 03:24:48 +00:00
#
2015-10-05 21:59:35 -07:00
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)
2000-11-16 03:24:48 +00:00
2015-09-23 16:47:37 +02:00
#
# IDN support using libidn2
#
2018-03-14 11:30:47 +01:00
LIBIDN2_CFLAGS=
2018-04-03 20:35:29 +02:00
LIBIDN2_LDFLAGS=
2017-08-15 14:36:59 +02:00
LIBIDN2_LIBS=
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
AC_ARG_WITH([libidn2],
[AS_HELP_STRING([--with-libidn2[=PATH]], [enable IDN support using GNU libidn2 [yes|no(default)|path]])],
[with_libidn2="$withval"], [with_libidn2="no"])
AS_CASE([$with_libidn2],
[yes], [PKG_CHECK_MODULES([LIBIDN2], [libidn2],
[AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])])],
[no], [],
[*], [save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
LIBIDN2_CFLAGS="-I$with_libidn2/include"
LIBIDN2_LDFLAGS="-L$with_libidn2/lib"
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
CPPFLAGS="$LIBIDN2_CFLAGS $CPPFLAGS"
LDFLAGS="$LIBIDN2_LDFLAGS $LDFLAGS"
AC_CHECK_HEADERS([idn2.h],
[],
[AC_MSG_ERROR([idn2.h not found])])
AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
[LIBIDN2_LIBS="$ac_cv_search_idn2_to_ascii_lz"
AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])],
[AC_MSG_ERROR([libidn2 requested, but not found])])
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"])
2018-03-14 11:30:47 +01:00
AC_SUBST([LIBIDN2_CFLAGS])
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
AC_SUBST([LIBIDN2_LDFLAGS])
2018-03-14 11:30:47 +01:00
AC_SUBST([LIBIDN2_LIBS])
2015-09-23 16:47:37 +02:00
2018-06-04 08:54:58 +02:00
#
# Check whether to build with cmocka unit testing framework
#
AC_ARG_WITH([cmocka],
2018-06-21 12:18:56 +02:00
[AS_HELP_STRING([--with-cmocka=no],[enable cmocka based tests (default is no)])],
[:],[with_cmocka=no])
2018-06-04 08:54:58 +02:00
AS_CASE([$with_cmocka],
[no],[:],
2018-11-14 22:31:39 +00:00
[yes],[
PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.0.0],
[AC_DEFINE([HAVE_CMOCKA], [1], [Use cmocka])])
UNITTESTS=tests
],
2018-06-04 08:54:58 +02:00
[*],[
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS -I$with_cmocka/include"
LIBS="$LIBS -L$with_cmocka/lib"
AC_CHECK_HEADERS([cmocka.h],
[:],
[AC_MSG_ERROR([cmocka.h not found])],
[#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
])
2018-06-21 14:12:02 +02:00
AC_SEARCH_LIBS([cmocka_set_message_output],
2018-06-04 08:54:58 +02:00
[cmocka],
[
2018-08-17 15:28:42 +02:00
CMOCKA_CFLAGS="-I$with_cmocka/include"
2018-06-04 08:54:58 +02:00
CMOCKA_LIBS="-L$with_cmocka/lib -lcmocka"
2018-11-14 22:31:39 +00:00
UNITTESTS=tests
2018-06-01 09:31:59 +02:00
AC_DEFINE([HAVE_CMOCKA], [1], [Use cmocka])
2018-06-04 08:54:58 +02:00
],
[AC_MSG_ERROR([cmocka unit testing framework not found in $with_cmocka path])])
])
AC_SUBST([CMOCKA_CFLAGS])
AC_SUBST([CMOCKA_LIBS])
2018-11-14 22:31:39 +00:00
AC_SUBST(UNITTESTS)
2018-06-04 08:54:58 +02:00
2018-10-23 11:44:33 +02:00
#
2018-11-15 13:27:09 -08:00
# Check for kyua execution engine if CMocka was requested
2018-10-23 11:44:33 +02:00
# and bail out if execution engine was not found
#
AC_ARG_VAR([KYUA], [path to kyua execution engine])
AS_IF([test "$with_cmocka" != "no"],
[AC_PATH_PROGS([KYUA], [kyua], [])
AS_IF([test -z "$KYUA"],
2018-11-15 13:27:09 -08:00
[AC_MSG_WARN([kyua test execution engine not found])])])
2018-10-23 11:44:33 +02:00
AC_SUBST([KYUA])
2018-06-14 09:05:08 +02:00
#
# Check for -Wl,--wrap= support
#
save_LDFLAGS=$LDFLAGS
LDFLAGS="--wrap=printf"
LD_WRAP_TESTS=false
enable_ld_wrap=no
AC_MSG_CHECKING([for linker support for --wrap option])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <stdio.h>], [__wrap_printf("success"); return (0);])],
[enable_ld_wrap=yes
LD_WRAP_TESTS=true
AC_DEFINE([LD_WRAP], [1], [define if the linker supports --wrap option])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
# AM_CONDITIONAL([LD_WRAP], [test $enable_ld_wrap = yes])
AC_SUBST([LD_WRAP_TESTS])
2018-06-01 09:31:59 +02:00
LDFLAGS=$save_LDFLAGS
2018-06-14 09:05:08 +02:00
2018-10-23 11:44:33 +02:00
#
# Check for i18n
#
2005-09-09 06:17:03 +00:00
AC_CHECK_HEADERS(locale.h)
AC_CHECK_FUNCS(setlocale)
2014-02-18 22:36:14 -08:00
#
# was --with-tuning specified?
#
AC_ARG_WITH(tuning,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-tuning=ARG],
[Specify server tuning (large or default)]),
use_tuning="$withval", use_tuning="no")
2014-02-18 22:36:14 -08:00
case "$use_tuning" in
large)
2014-02-26 19:00:05 -08:00
AC_DEFINE(TUNE_LARGE, 1, [Define to use large-system tuning.])
2014-02-18 22:36:14 -08:00
AC_MSG_RESULT(using large-system tuning)
;;
no|default)
AC_MSG_RESULT(using default tuning)
;;
yes|*)
2014-02-26 19:00:05 -08:00
AC_MSG_ERROR([You must specify "large" or "default" for --with-tuning.])
2014-02-18 22:36:14 -08:00
;;
esac
2015-02-26 16:49:27 +05:30
#
# was --enable-querytrace specified?
#
AC_ARG_ENABLE(querytrace,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-querytrace],
[enable very verbose query trace logging
[default=no]]),
want_querytrace="$enableval", want_querytrace="no")
2015-02-26 16:49:27 +05:30
2016-03-04 11:12:23 +05:30
AC_MSG_CHECKING([whether to enable query trace logging])
2015-02-26 16:49:27 +05:30
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
2018-05-16 11:58:15 -07:00
#
# Was --disable-auto-validation specified?
#
2018-06-06 12:02:40 +02:00
validation_default=auto
2018-05-16 11:58:15 -07:00
AC_ARG_ENABLE(auto-validation,
AS_HELP_STRING([--enable-auto-validation],
[turn on DNSSEC validation by default, using the IANA root key [default=yes]]),
2018-06-06 12:02:40 +02:00
[:],[enable_auto_validation=yes])
AS_IF([test "$enable_auto_validation" = "no"],[validation_default=yes])
AC_DEFINE_UNQUOTED([VALIDATION_DEFAULT], ["$validation_default"], [the default value of dnssec-validation option])
2018-05-16 11:58:15 -07:00
2000-02-11 18:35:11 +00:00
#
# Substitutions
#
1999-02-18 01:24:32 +00:00
AC_SUBST(BIND9_TOP_BUILDDIR)
BIND9_TOP_BUILDDIR=`pwd`
1999-10-05 19:52:30 +00:00
AC_SUBST(BIND9_ISC_BUILDINCLUDE)
2001-03-27 00:44:59 +00:00
AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2001-02-15 04:14:15 +00:00
AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
1999-10-05 19:52:30 +00:00
AC_SUBST(BIND9_DNS_BUILDINCLUDE)
2017-09-08 13:39:09 -07:00
AC_SUBST(BIND9_NS_BUILDINCLUDE)
2001-09-20 15:17:07 +00:00
AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2014-02-16 13:03:17 -08:00
AC_SUBST(BIND9_IRS_BUILDINCLUDE)
1999-10-05 19:52:30 +00:00
if test "X$srcdir" != "X"; then
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2001-03-27 00:44:59 +00:00
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2001-02-15 04:14:15 +00:00
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
1999-10-05 19:52:30 +00:00
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2017-09-08 13:39:09 -07:00
BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include"
2001-09-20 15:17:07 +00:00
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2014-02-16 13:03:17 -08:00
BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include"
1999-10-05 19:52:30 +00:00
else
BIND9_ISC_BUILDINCLUDE=""
2001-03-27 00:44:59 +00:00
BIND9_ISCCC_BUILDINCLUDE=""
2001-02-15 04:14:15 +00:00
BIND9_ISCCFG_BUILDINCLUDE=""
1999-10-05 19:52:30 +00:00
BIND9_DNS_BUILDINCLUDE=""
2017-09-08 13:39:09 -07:00
BIND9_NS_BUILDINCLUDE=""
2001-09-20 15:17:07 +00:00
BIND9_BIND9_BUILDINCLUDE=""
2014-02-16 13:03:17 -08:00
BIND9_IRS_BUILDINCLUDE=""
1999-10-05 19:52:30 +00:00
fi
2001-09-20 15:17:07 +00:00
AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
1999-10-05 19:52:30 +00:00
1998-12-11 20:10:26 +00:00
AC_SUBST_FILE(BIND9_MAKE_RULES)
1999-02-18 01:24:32 +00:00
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
1998-12-11 20:10:26 +00:00
2013-08-15 12:41:52 +10:00
. "$srcdir/version"
2013-03-02 00:16:55 -08:00
BIND9_PRODUCT="PRODUCT=\"${PRODUCT}\""
2013-03-01 16:24:12 -06:00
AC_SUBST(BIND9_PRODUCT)
2013-05-03 15:08:45 -07:00
BIND9_DESCRIPTION="DESCRIPTION=\"${DESCRIPTION}\""
AC_SUBST(BIND9_DESCRIPTION)
2015-11-08 21:34:24 -08:00
BIND9_VERSION="${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
2000-04-27 23:47:49 +00:00
AC_SUBST(BIND9_VERSION)
2012-06-20 14:13:12 -05:00
BIND9_MAJOR="MAJOR=${MAJORVER}.${MINORVER}"
AC_SUBST(BIND9_MAJOR)
2014-10-20 23:34:21 -07:00
BIND9_VERSIONSTRING="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}${DESCRIPTION:+ }${DESCRIPTION}"
AC_SUBST(BIND9_VERSIONSTRING)
2015-10-05 21:59:35 -07:00
BIND9_VERSIONSHORT="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
AC_SUBST(BIND9_VERSIONSHORT)
1998-12-11 20:10:26 +00:00
2016-10-19 17:18:42 +02:00
BIND9_SRCID="SRCID=unset_id"
2013-08-15 12:41:52 +10:00
if test -f "${srcdir}/srcid"; then
. "${srcdir}/srcid"
2012-10-22 12:56:47 -07:00
BIND9_SRCID="SRCID=$SRCID"
2013-08-15 12:41:52 +10:00
elif test -d "${srcdir}/.git"; then
2014-06-17 13:42:32 -07:00
BIND9_SRCID="SRCID="`(cd "${srcdir}";git rev-parse --short HEAD)`
2012-10-22 12:56:47 -07:00
fi
2013-08-15 12:41:52 +10:00
2012-10-22 12:56:47 -07:00
AC_SUBST(BIND9_SRCID)
2008-09-23 17:25:47 +00:00
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)
1999-07-03 21:07:10 +00:00
AC_SUBST_FILE(LIBISC_API)
2013-08-15 12:41:52 +10:00
LIBISC_API="$srcdir/lib/isc/api"
1999-07-03 21:07:10 +00:00
2001-03-27 00:44:59 +00:00
AC_SUBST_FILE(LIBISCCC_API)
2013-08-15 12:41:52 +10:00
LIBISCCC_API="$srcdir/lib/isccc/api"
2001-03-27 00:44:59 +00:00
2001-02-15 04:14:15 +00:00
AC_SUBST_FILE(LIBISCCFG_API)
2013-08-15 12:41:52 +10:00
LIBISCCFG_API="$srcdir/lib/isccfg/api"
2001-02-15 04:14:15 +00:00
1999-07-03 21:07:10 +00:00
AC_SUBST_FILE(LIBDNS_API)
2013-08-15 12:41:52 +10:00
LIBDNS_API="$srcdir/lib/dns/api"
1999-07-03 21:07:10 +00:00
2013-01-24 14:20:48 -08:00
AC_SUBST_FILE(LIBDNS_MAPAPI)
2013-08-15 12:41:52 +10:00
LIBDNS_MAPAPI="$srcdir/lib/dns/mapapi"
2012-06-20 14:13:12 -05:00
2001-09-20 15:17:07 +00:00
AC_SUBST_FILE(LIBBIND9_API)
2013-08-15 12:41:52 +10:00
LIBBIND9_API="$srcdir/lib/bind9/api"
2001-09-20 15:17:07 +00:00
2009-09-01 00:22:28 +00:00
AC_SUBST_FILE(LIBIRS_API)
2013-08-15 12:41:52 +10:00
LIBIRS_API="$srcdir/lib/irs/api"
2009-09-01 00:22:28 +00:00
2017-09-08 13:39:09 -07:00
AC_SUBST_FILE(LIBNS_API)
LIBNS_API="$srcdir/lib/ns/api"
2005-09-05 00:12:29 +00:00
#
# Configure any DLZ drivers.
#
# If config.dlz.in selects one or more DLZ drivers, it will set
2011-03-10 04:36:16 +00:00
# CONTRIB_DLZ to a non-empty value, which will be our clue to
# build DLZ drivers in contrib.
2005-09-05 00:12:29 +00:00
#
# This section has to come after the libtool stuff because it needs to
# know how to name the driver object files.
#
2011-03-10 04:36:16 +00:00
CONTRIB_DLZ=""
2005-09-05 00:12:29 +00:00
DLZ_DRIVER_INCLUDES=""
DLZ_DRIVER_LIBS=""
DLZ_DRIVER_SRCS=""
DLZ_DRIVER_OBJS=""
2010-08-16 04:49:14 +00:00
DLZ_SYSTEM_TEST=""
2017-10-06 19:09:30 -07:00
DLZ_DRIVER_MYSQL_INCLUDES=""
DLZ_DRIVER_MYSQL_LIBS=""
2005-09-05 00:12:29 +00:00
2018-08-21 14:35:57 +02:00
#
2011-03-10 04:36:16 +00:00
# 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=""
2014-02-10 15:01:06 +11:00
SO_LDFLAGS=""
2011-03-10 04:36:16 +00:00
SO_LD=""
SO_TARGETS=""
2016-11-10 11:31:21 +11:00
SO_STRIP="cat"
2011-03-10 04:36:16 +00:00
2018-08-25 11:12:29 +02:00
AC_ARG_WITH([dlopen],
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-dlopen=ARG],
2018-08-24 14:17:34 -07:00
[support dynamically loadable DLZ and DYNDB drivers]),
2018-08-25 11:12:29 +02:00
[], [with_dlopen="auto"])
2018-08-24 14:17:34 -07:00
#
# If PIC is disabled, dlopen must also be
#
2018-08-25 11:12:29 +02:00
AS_IF([test "$pic_mode" = "no"],
[AS_CASE([$with_dlopen],
[auto],[with_dlopen="no"],
[yes],[AC_MSG_ERROR([--with-dlopen requires PIC])])])
AS_CASE([$with_dlopen],
[auto|yes],[
AC_SEARCH_LIBS([dlopen],[dl])
AC_CHECK_FUNCS([dlopen dlclose dlsym],
[with_dlopen="yes"],
[with_dlopen="no"])
])
2011-03-10 04:36:16 +00:00
2018-08-25 11:12:29 +02:00
AS_IF([test "$with_dlopen" = "yes"],
[AS_CASE([$host],
[*-linux*|*-gnu*],[
SO_CFLAGS="-fPIC"
SO_LDFLAGS=""
2018-08-27 09:42:11 +02:00
AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
2018-08-25 11:12:29 +02:00
],[
SO_LDFLAGS="-shared"
2018-08-27 09:42:11 +02:00
SO_LD="${CC}"
2018-08-25 11:12:29 +02:00
])
],
[*-freebsd*|*-openbsd*],[
LDFLAGS="${LDFLAGS} -Wl,-E"
SO_CFLAGS="-fpic"
AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
],[
SO_LDFLAGS="-shared"
SO_LD="${CC}"
])
],
[*-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"
],
[
SO_CFLAGS="-fPIC"
])
AS_IF([test "$GCC" = "yes"],[
SO_CFLAGS="-fPIC"
AS_IF([test -z "$SO_LD"],
[AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
],[
SO_LDFLAGS="-shared"
SO_LD="${CC}"
])
])
])
# If we still don't know how to make shared objects, don't make any.
AS_IF([test -n "$SO_LD"],
[SO_TARGETS="\${SO_TARGETS}"
AC_DEFINE([ISC_DLZ_DLOPEN], [1],
[Define to allow building of objects for dlopen().])
])
])
2005-09-05 00:12:29 +00:00
2015-09-28 23:12:35 -07:00
CFLAGS="$CFLAGS $SO_CFLAGS"
2011-03-10 04:36:16 +00:00
AC_SUBST(SO)
AC_SUBST(SO_CFLAGS)
2014-02-10 15:01:06 +11:00
AC_SUBST(SO_LDFLAGS)
2011-03-10 04:36:16 +00:00
AC_SUBST(SO_LD)
2016-11-10 11:31:21 +11:00
AC_SUBST(SO_STRIP)
2011-03-10 04:36:16 +00:00
AC_SUBST(SO_TARGETS)
2018-08-25 13:15:06 +02:00
#
# Response policy rewriting using DNS Response Policy Service (DNSRPS)
# interface.
#
# DNSRPS can be compiled into BIND everywhere with a reasonably
# modern C compiler. It is enabled on systems with dlopen() and librpz.so.
#
dnsrps_avail=yes
AC_MSG_CHECKING([for librpz __attribute__s])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[
extern void f(char *p __attribute__((unused)), ...)
__attribute__((format(printf,1,2))) __attribute__((__noreturn__));
]])],
[
librpz_have_attr=yes
AC_DEFINE([LIBRPZ_HAVE_ATTR], [1], [have __attribute__s used in librpz.h])
AC_MSG_RESULT([yes])
],[
librpz_have_attr=no
AC_MSG_RESULT([no])
])
AC_ARG_ENABLE([dnsrps-dl],
[AS_HELP_STRING([--enable-dnsrps-dl],
[DNS Response Policy Service delayed link
[default=$librpz_dl]])],
[enable_librpz_dl="$enableval"], [enable_librpz_dl="$with_dlopen"])
AS_IF([test "$enable_librpz_dl" = "yes" -a "$with_dlopen" = "no"],
[AC_MSG_ERROR([DNS Response Policy Service delayed link requires dlopen to be enabled])])
AC_ARG_WITH([dnsrps-libname],
[AS_HELP_STRING([--with-dnsrps-libname],
[DNSRPS provider library name (librpz.so)])],
[librpz_name="$withval"], [librpz_name="librpz.so"])
AC_ARG_WITH([dnsrps-dir],
[AS_HELP_STRING([--with-dnsrps-dir],
[path to DNSRPS provider library])],
[librpz_path="$withval/$librpz_name"], [librpz_path="$librpz_name"])
AC_DEFINE_UNQUOTED([DNSRPS_LIBRPZ_PATH], ["$librpz_path"],
[dnsrps $librpz_name])
AS_IF([test "$enable_librpz_dl" = "yes"],
[
dnsrps_lib_open=2
],[
dnsrps_lib_open=1
# Add librpz.so to linked libraries if we are not using dlopen()
AC_SEARCH_LIBS([librpz_client_create], [rpz], [],
[dnsrps_lib_open=0
dnsrps_avail=no])
])
AC_DEFINE_UNQUOTED([DNSRPS_LIB_OPEN], [$dnsrps_lib_open],
[0=no DNSRPS 1=static link 2=dlopen()])
AC_ARG_ENABLE([dnsrps],
AS_HELP_STRING([--enable-dnsrps],
[enable DNS Response Policy Service API]),
[enable_dnsrps=$enableval], [enable_dnsrps=no])
AS_IF([test "$enable_dnsrps" != "no"],[
AS_IF([test "$dnsrps_avail" != "yes"],
[AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
AS_IF([test "$dnsrps_lib_open" = "0"],
[AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
AC_DEFINE([USE_DNSRPS], [1], [Enable DNS Response Policy Service API])
])
2011-03-10 04:36:16 +00:00
sinclude(contrib/dlz/config.dlz.in)
AC_MSG_CHECKING(contributed DLZ drivers)
2005-09-05 00:12:29 +00:00
2011-03-10 04:36:16 +00:00
if test -n "$CONTRIB_DLZ"
2005-09-05 00:12:29 +00:00
then
AC_MSG_RESULT(yes)
DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
2017-10-06 19:09:30 -07:00
AC_CONFIG_FILES([$DLZ_DRIVER_RULES
contrib/dlz/modules/mysql/Makefile
contrib/dlz/modules/mysqldyn/Makefile])
2005-09-05 00:12:29 +00:00
else
AC_MSG_RESULT(no)
DLZ_DRIVER_RULES=/dev/null
fi
2011-03-10 04:36:16 +00:00
AC_SUBST(CONTRIB_DLZ)
2005-09-05 00:12:29 +00:00
AC_SUBST(DLZ_DRIVER_INCLUDES)
AC_SUBST(DLZ_DRIVER_LIBS)
AC_SUBST(DLZ_DRIVER_SRCS)
AC_SUBST(DLZ_DRIVER_OBJS)
2010-08-16 04:49:14 +00:00
AC_SUBST(DLZ_SYSTEM_TEST)
2017-10-06 19:09:30 -07:00
AC_SUBST(DLZ_DRIVER_MYSQL_INCLUDES)
AC_SUBST(DLZ_DRIVER_MYSQL_LIBS)
2005-09-05 00:12:29 +00:00
AC_SUBST_FILE(DLZ_DRIVER_RULES)
2016-10-20 10:26:05 +11:00
if test "yes" = "$cross_compiling"; then
2006-01-05 00:30:34 +00:00
if test -z "$BUILD_CC"; then
2014-02-21 21:17:23 +11:00
AC_MSG_ERROR([BUILD_CC not set])
2006-01-05 00:30:34 +00:00
fi
BUILD_CFLAGS="$BUILD_CFLAGS"
BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
BUILD_LDFLAGS="$BUILD_LDFLAGS"
BUILD_LIBS="$BUILD_LIBS"
else
2018-08-21 14:35:57 +02:00
BUILD_CC="$CC"
BUILD_CFLAGS="$CFLAGS"
2006-01-05 00:30:34 +00:00
BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
BUILD_LDFLAGS="$LDFLAGS"
BUILD_LIBS="$LIBS"
fi
2006-12-04 01:54:53 +00:00
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"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
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"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
DNS_GSSAPI_LIBS="$NEWFLAGS"
2014-02-13 15:09:08 +11:00
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"
2006-12-04 01:54:53 +00:00
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"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
DNS_CRYPTO_LIBS="$NEWFLAGS"
2006-01-05 00:30:34 +00:00
AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_CPPFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(BUILD_LIBS)
2005-09-05 00:12:29 +00:00
2005-05-11 05:55:41 +00:00
#
# 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],
2006-12-22 01:46:19 +00:00
[chmod a+x isc-config.sh doc/doxygen/doxygen-input-filter])
2005-05-11 05:55:41 +00:00
#
2005-09-05 00:12:29 +00:00
# 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.
2005-05-11 05:55:41 +00:00
#
2005-09-05 00:12:29 +00:00
AC_CONFIG_FILES([
2011-01-11 21:36:22 +00:00
make/Makefile
make/mkdep
1998-12-11 20:10:26 +00:00
Makefile
bin/Makefile
2000-12-13 06:21:42 +00:00
bin/check/Makefile
2009-06-10 00:27:22 +00:00
bin/confgen/Makefile
bin/confgen/unix/Makefile
2014-04-23 11:14:12 -07:00
bin/delv/Makefile
2011-01-11 21:36:22 +00:00
bin/dig/Makefile
bin/dnssec/Makefile
1999-01-19 19:43:25 +00:00
bin/named/Makefile
1999-10-23 01:06:31 +00:00
bin/named/unix/Makefile
2000-06-21 20:57:33 +00:00
bin/nsupdate/Makefile
2011-01-11 21:36:22 +00:00
bin/pkcs11/Makefile
2012-06-28 17:06:00 +10:00
bin/python/Makefile
2016-04-28 00:12:33 -07:00
bin/python/isc/Makefile
bin/python/isc/utils.py
bin/python/isc/tests/Makefile
2012-06-28 17:06:00 +10:00
bin/python/dnssec-checkds.py
2013-03-20 14:31:10 -07:00
bin/python/dnssec-coverage.py
2016-04-28 00:12:33 -07:00
bin/python/dnssec-keymgr.py
2016-06-24 12:20:37 +10:00
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
2011-01-11 21:36:22 +00:00
bin/rndc/Makefile
1999-05-01 01:41:14 +00:00
bin/tests/Makefile
2011-01-11 21:36:22 +00:00
bin/tests/headerdep_test.sh
2018-02-27 12:48:10 -08:00
bin/tests/optional/Makefile
2014-01-14 15:40:56 -08:00
bin/tests/pkcs11/Makefile
bin/tests/pkcs11/benchmarks/Makefile
2000-05-19 21:42:43 +00:00
bin/tests/system/Makefile
2014-09-10 15:31:40 +10:00
bin/tests/system/conf.sh
2011-04-19 22:30:52 +00:00
bin/tests/system/dlz/prereq.sh
2011-03-10 04:36:16 +00:00
bin/tests/system/dlzexternal/Makefile
2018-02-20 15:43:27 -08:00
bin/tests/system/dlzexternal/ns1/dlzs.conf
2015-09-28 23:12:35 -07:00
bin/tests/system/dyndb/Makefile
bin/tests/system/dyndb/driver/Makefile
2015-01-20 16:10:30 -08:00
bin/tests/system/pipelined/Makefile
2014-11-14 15:58:54 -08:00
bin/tests/system/rndc/Makefile
2017-09-11 11:53:42 -07:00
bin/tests/system/rpz/Makefile
2012-06-14 15:44:20 +10:00
bin/tests/system/rsabigexponent/Makefile
2001-01-11 20:46:32 +00:00
bin/tests/system/tkey/Makefile
2010-06-17 05:39:19 +00:00
bin/tests/virtual-time/Makefile
bin/tests/virtual-time/conf.sh
2009-03-02 03:54:10 +00:00
bin/tools/Makefile
2014-02-05 16:17:50 -08:00
contrib/scripts/check-secure-delegation.pl
contrib/scripts/zone-edit.sh
2000-12-01 02:16:28 +00:00
doc/Makefile
2001-01-09 21:28:28 +00:00
doc/arm/Makefile
2017-11-13 11:36:45 +11:00
doc/arm/noteversion.xml
doc/arm/pkgversion.xml
doc/arm/releaseinfo.xml
2011-01-11 21:36:22 +00:00
doc/doxygen/Doxyfile
doc/doxygen/Makefile
doc/doxygen/doxygen-input-filter
2001-07-26 21:31:12 +00:00
doc/misc/Makefile
2017-11-13 11:36:45 +11:00
doc/tex/Makefile
doc/tex/armstyle.sty
2005-07-19 04:55:25 +00:00
doc/xsl/Makefile
2005-05-11 05:55:41 +00:00
doc/xsl/isc-docbook-chunk.xsl
doc/xsl/isc-docbook-html.xsl
doc/xsl/isc-manpage.xsl
2015-01-07 17:26:03 -08:00
doc/xsl/isc-notes-html.xsl
2011-01-11 21:36:22 +00:00
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
2011-02-26 02:26:33 +00:00
lib/dns/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/irs/Makefile
lib/irs/include/Makefile
lib/irs/include/irs/Makefile
lib/irs/include/irs/netdb.h
lib/irs/include/irs/platform.h
2016-10-27 13:17:58 +11:00
lib/irs/tests/Makefile
2018-08-15 11:12:03 +02:00
lib/isc/pthreads/Makefile
lib/isc/pthreads/include/Makefile
lib/isc/pthreads/include/isc/Makefile
2011-01-11 21:36:22 +00:00
lib/isc/Makefile
lib/isc/include/Makefile
lib/isc/include/isc/Makefile
lib/isc/include/isc/platform.h
2014-02-11 21:20:28 -08:00
lib/isc/include/pk11/Makefile
lib/isc/include/pkcs11/Makefile
2011-07-06 01:36:32 +00:00
lib/isc/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/isc/nls/Makefile
lib/isc/unix/Makefile
lib/isc/unix/include/Makefile
lib/isc/unix/include/isc/Makefile
2014-02-11 21:20:28 -08:00
lib/isc/unix/include/pkcs11/Makefile
2011-01-11 21:36:22 +00:00
lib/isccc/Makefile
lib/isccc/include/Makefile
lib/isccc/include/isccc/Makefile
2018-11-10 10:21:44 +11:00
lib/isccc/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/isccfg/Makefile
lib/isccfg/include/Makefile
lib/isccfg/include/isccfg/Makefile
2016-10-10 17:11:21 -07:00
lib/isccfg/tests/Makefile
2017-09-08 13:39:09 -07:00
lib/ns/Makefile
lib/ns/include/Makefile
lib/ns/include/ns/Makefile
lib/ns/tests/Makefile
2013-04-10 13:49:57 -07:00
lib/samples/Makefile
lib/samples/Makefile-postinstall
2011-02-26 02:26:33 +00:00
unit/unittest.sh
2018-07-03 15:45:11 +02:00
fuzz/Makefile
2005-09-05 00:12:29 +00:00
])
#
# Do it
#
AC_OUTPUT
2000-07-04 01:20:53 +00:00
2010-03-18 13:28:32 +00:00
#
# Now that the Makefiles exist we can ensure that everything is rebuilt.
#
AC_ARG_WITH(make-clean,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-make-clean],
[run "make clean" at end of configure [yes|no]]),
2010-03-18 13:28:32 +00:00
make_clean="$withval", make_clean="yes")
case "$make_clean" in
yes)
2017-07-19 15:53:01 +10:00
if test "yes" != "$no_create"
2016-03-18 08:28:21 +11:00
then
2017-07-19 15:53:01 +10:00
if test "yes" = "$silent"
2017-04-20 15:09:28 -07:00
then
2017-11-13 11:36:45 +11:00
make clean > /dev/null
else
make clean
2017-04-20 15:09:28 -07:00
fi
2016-03-18 08:28:21 +11:00
fi
2010-03-18 13:28:32 +00:00
;;
esac
2013-07-10 20:54:08 -07:00
AC_ARG_ENABLE(full-report,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-full-report],
[report values of all configure options]))
2013-07-10 20:54:08 -07:00
2017-04-20 15:09:28 -07:00
report() {
echo "==============================================================================="
echo "Configuration summary:"
echo "-------------------------------------------------------------------------------"
echo "Optional features enabled:"
2018-06-06 11:39:50 +02:00
if test "yes" = "$enable_full_report" -o "standard" = "$locktype"; then
echo " Mutex lock type: $locktype"
2017-04-20 15:09:28 -07:00
fi
2017-06-16 09:07:36 +02:00
test "large" = "$use_tuning" && echo " Large-system tuning (--with-tuning)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dnstap" || \
2017-11-13 11:36:45 +11:00
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_geoip" || echo " GeoIP access control (--with-geoip)"
test "no" = "$use_gssapi" || echo " GSS-API (--with-gssapi)"
2017-07-19 15:53:01 +10:00
if test "yes" = "$enable_full_report" -o "aes" != "$with_cc_alg"; then
2017-11-13 11:36:45 +11:00
echo " Algorithm: $with_cc_alg"
2014-03-10 12:14:35 -07:00
fi
2014-01-18 11:51:07 -08:00
2018-08-21 14:35:57 +02:00
# these lines are only printed if run with --enable-full-report
2017-04-20 15:09:28 -07:00
if test "yes" = "$enable_full_report"; then
2018-08-21 11:28:24 +02:00
test "no" = "$found_ipv6" || echo " IPv6 support (--enable-ipv6)"
2017-11-13 11:36:45 +11:00
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)"
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
test "no" = "$with_libidn2" || echo " IDN support (--with-libidn2)"
2017-04-20 15:09:28 -07:00
fi
2014-01-18 11:51:07 -08:00
2017-09-11 11:53:42 -07:00
test "yes" = "$enable_dnsrps" && \
2017-11-13 11:36:45 +11:00
echo " DNS Response Policy Service interface (--enable-dnsrps)"
2017-04-20 15:09:28 -07:00
test "yes" = "$enable_fixed" && \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2018-11-01 13:43:44 +00:00
test "yes" = "$enable_backtrace" && \
2017-11-13 11:36:45 +11:00
echo " Print backtrace on crash (--enable-backtrace)"
2017-04-20 15:09:28 -07:00
test "minimal" = "$want_symtable" && \
2017-11-13 11:36:45 +11:00
echo " Use symbol table for backtrace, named only (--enable-symtable)"
2017-04-20 15:09:28 -07:00
test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
2017-11-13 11:36:45 +11:00
echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
test "yes" = "$want_querytrace" && \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2018-11-14 22:31:39 +00:00
test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)"
2017-04-20 15:09:28 -07:00
2018-05-16 11:58:15 -07:00
test "no" = "$want_autoval" || echo " DNSSEC validation active by default (--enable-auto-validation)"
2018-06-22 13:47:45 +02:00
test "$CRYPTO" = "pkcs11" && (
echo " Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)"
echo " PKCS#11 module (--with-pkcs11): $with_pkcs11"
)
2017-09-12 19:05:46 -07:00
2017-04-20 15:09:28 -07:00
echo " Dynamically loadable zone (DLZ) drivers:"
test "no" = "$use_dlz_bdb" || \
2017-11-13 11:36:45 +11:00
echo " Berkeley DB (--with-dlz-bdb)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_ldap" || \
2017-11-13 11:36:45 +11:00
echo " LDAP (--with-dlz-ldap)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_mysql" || \
2017-11-13 11:36:45 +11:00
echo " MySQL (--with-dlz-mysql)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_odbc" || \
2017-11-13 11:36:45 +11:00
echo " ODBC (--with-dlz-odbc)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_postgres" || \
2017-11-13 11:36:45 +11:00
echo " Postgres (--with-dlz-postgres)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_filesystem" || \
2017-11-13 11:36:45 +11:00
echo " Filesystem (--with-dlz-filesystem)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_stub" || \
2017-11-13 11:36:45 +11:00
echo " Stub (--with-dlz-stub)"
2017-04-20 15:09:28 -07:00
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"
2017-09-30 10:01:01 -07:00
echo "-------------------------------------------------------------------------------"
2017-04-20 15:09:28 -07:00
echo "Features disabled or unavailable on this platform:"
2018-08-21 11:28:24 +02:00
test "no" = "$found_ipv6" && echo " IPv6 support (--enable-ipv6)"
2017-04-20 15:09:28 -07:00
test "large" = "$use_tuning" || echo " Large-system tuning (--with-tuning)"
test "no" = "$use_dnstap" && \
2017-11-13 11:36:45 +11:00
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_geoip" && echo " GeoIP access control (--with-geoip)"
test "no" = "$use_gssapi" && echo " GSS-API (--with-gssapi)"
2017-09-11 11:53:42 -07:00
test "no" = "$enable_dnsrps" && \
2017-11-13 11:36:45 +11:00
echo " DNS Response Policy Service interface (--enable-dnsrps)"
2017-09-11 11:53:42 -07:00
2017-04-20 15:09:28 -07:00
test "yes" = "$enable_fixed" || \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2017-04-20 15:09:28 -07:00
2018-05-16 11:58:15 -07:00
test "no" = "$want_autoval" && echo " DNSSEC validation requires configuration (--disable-auto-validation)"
2018-06-22 13:47:45 +02:00
test "$CRYPTO" = "pkcs11" || (
echo " Using PKCS#11 for Public-Key Cryptography (--without-native-pkcs11)"
)
2017-04-20 15:09:28 -07:00
2018-11-01 13:43:44 +00:00
test "yes" = "$enable_backtrace" || \
2017-11-13 11:36:45 +11:00
echo " Print backtrace on crash (--enable-backtrace)"
2017-04-20 15:09:28 -07:00
test "yes" = "$want_querytrace" || \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2017-04-20 15:09:28 -07:00
test "yes" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
2018-11-14 22:31:39 +00:00
test "no" = "$with_cmocka" && echo " CMocka Unit Testng Framework (--with-cmocka)"
2017-04-20 15:09:28 -07:00
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)"
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
test "no" = "$with_libidn2" && echo " IDN support (--with-libidn2)"
2017-04-20 15:09:28 -07:00
2017-09-30 10:01:01 -07:00
echo "-------------------------------------------------------------------------------"
echo "Configured paths:"
echo " prefix: $prefix"
echo " sysconfdir: $sysconfdir"
echo " localstatedir: $localstatedir"
2018-09-07 10:59:04 -07:00
echo "-------------------------------------------------------------------------------"
echo "Compiler: $CC"
$CC --version 2>&1 | sed 's/^/ /'
2017-09-30 10:01:01 -07:00
2017-04-20 15:09:28 -07:00
if test "X$ac_unrecognized_opts" != "X"; then
2017-11-13 11:36:45 +11:00
echo "Unrecognized options:"
echo " $ac_unrecognized_opts"
2017-04-20 15:09:28 -07:00
fi
2017-09-30 10:01:01 -07:00
2017-07-19 15:53:01 +10:00
if test "yes" != "$enable_full_report"; then
2017-11-13 11:36:45 +11:00
echo "-------------------------------------------------------------------------------"
echo "For more detail, use --enable-full-report."
2017-04-20 15:09:28 -07:00
fi
echo "==============================================================================="
}
2017-07-19 15:53:01 +10:00
if test "yes" != "$silent"; then
2017-11-13 11:36:45 +11:00
report
2015-12-02 14:02:53 -08:00
fi
2013-07-10 20:54:08 -07:00
2000-07-04 01:20:53 +00:00
# Tell Emacs to edit this file in shell mode.
# Local Variables:
# mode: sh
# End: