Home | History | Annotate | Line # | Download | only in dist
configure.ac revision 1.1.1.9
      1      1.1  christos # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      2      1.1  christos #
      3      1.1  christos # This Source Code Form is subject to the terms of the Mozilla Public
      4      1.1  christos # License, v. 2.0. If a copy of the MPL was not distributed with this
      5      1.1  christos # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      6      1.1  christos #
      7      1.1  christos # See the COPYRIGHT file distributed with this work for additional
      8      1.1  christos # information regarding copyright ownership.
      9      1.1  christos 
     10  1.1.1.7  christos AC_INIT(BIND, [9.16], [info (a] isc.org], [], [https://www.isc.org/downloads/])
     11      1.1  christos AC_PREREQ([2.60])
     12      1.1  christos 
     13  1.1.1.7  christos #
     14  1.1.1.7  christos # Enable maintainer mode by default, but allow to disable it in the CI
     15  1.1.1.7  christos #
     16  1.1.1.7  christos AM_MAINTAINER_MODE([enable])
     17  1.1.1.7  christos 
     18      1.1  christos AC_CONFIG_HEADER(config.h)
     19      1.1  christos AC_CONFIG_MACRO_DIR([m4])
     20      1.1  christos 
     21      1.1  christos AC_CANONICAL_HOST
     22  1.1.1.7  christos 
     23  1.1.1.7  christos #
     24  1.1.1.7  christos # Enable system extensions to C and POSIX
     25  1.1.1.7  christos #
     26      1.1  christos AC_USE_SYSTEM_EXTENSIONS
     27      1.1  christos 
     28  1.1.1.7  christos #
     29  1.1.1.7  christos # Enable large file support
     30  1.1.1.7  christos #
     31  1.1.1.7  christos AC_SYS_LARGEFILE
     32  1.1.1.7  christos AC_FUNC_FSEEKO
     33  1.1.1.7  christos 
     34  1.1.1.4  christos LFS_CFLAGS=`getconf LFS_CFLAGS 2>/dev/null`
     35  1.1.1.4  christos LFS_LDFLAGS=`getconf LFS_LDFLAGS 2>/dev/null`
     36  1.1.1.4  christos LFS_LIBS=`getconf LFS_LIBS 2>/dev/null`
     37  1.1.1.4  christos 
     38  1.1.1.4  christos AC_SUBST([LFS_CFLAGS])
     39  1.1.1.4  christos AC_SUBST([LFS_LDFLAGS])
     40  1.1.1.4  christos AC_SUBST([LFS_LIBS])
     41  1.1.1.4  christos 
     42      1.1  christos # Enable RFC 3542 APIs on macOS
     43      1.1  christos AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
     44      1.1  christos 
     45      1.1  christos AC_PROG_MAKE_SET
     46      1.1  christos 
     47      1.1  christos AC_PROG_LIBTOOL
     48      1.1  christos AC_PROG_INSTALL
     49      1.1  christos AC_PROG_LN_S
     50      1.1  christos AX_POSIX_SHELL
     51  1.1.1.8  christos AC_PROG_MKDIR_P
     52      1.1  christos 
     53      1.1  christos AC_SUBST(STD_CINCLUDES)
     54      1.1  christos AC_SUBST(STD_CDEFINES)
     55      1.1  christos AC_SUBST(STD_CWARNINGS)
     56      1.1  christos AC_SUBST(CCOPT)
     57      1.1  christos AC_SUBST(CCNOOPT)
     58      1.1  christos AC_SUBST(BACKTRACECFLAGS)
     59      1.1  christos 
     60      1.1  christos #
     61      1.1  christos # Use pkg-config
     62      1.1  christos #
     63      1.1  christos 
     64      1.1  christos PKG_PROG_PKG_CONFIG
     65  1.1.1.7  christos AS_IF([test -z "$PKG_CONFIG"],
     66  1.1.1.7  christos       [AC_MSG_ERROR([The pkg-config script could not be found or is too old.])])
     67      1.1  christos 
     68  1.1.1.9  christos # [pairwise: --enable-buffer-useinline, --disable-buffer-useinline]
     69      1.1  christos AC_ARG_ENABLE(buffer_useinline,
     70      1.1  christos 	      AS_HELP_STRING([--enable-buffer-useinline],
     71      1.1  christos 		             [define ISC_BUFFER_USEINLINE when compiling
     72      1.1  christos 				[default=yes]]),
     73      1.1  christos 	      if test yes = "${enable}"
     74      1.1  christos 	      then
     75      1.1  christos 		      AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
     76      1.1  christos 			        [Define if you want to use inline buffers])
     77      1.1  christos 	      fi,
     78      1.1  christos 	      AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
     79      1.1  christos 
     80  1.1.1.9  christos # [pairwise: --enable-warn-shadow, --disable-warn-shadow]
     81  1.1.1.7  christos AC_ARG_ENABLE([warn_shadow],
     82  1.1.1.7  christos 	      [AS_HELP_STRING([--enable-warn-shadow],
     83  1.1.1.7  christos 			      [turn on -Wshadow when compiling])])
     84  1.1.1.7  christos 
     85  1.1.1.9  christos # [pairwise: --enable-warn-error, --disable-warn-error]
     86  1.1.1.7  christos AC_ARG_ENABLE([warn_error],
     87  1.1.1.7  christos 	      [AS_HELP_STRING([--enable-warn-error],
     88  1.1.1.7  christos 			      [turn on -Werror when compiling])])
     89  1.1.1.7  christos 
     90  1.1.1.9  christos # [pairwise: --enable-developer, --disable-developer]
     91  1.1.1.7  christos AC_ARG_ENABLE([developer],
     92  1.1.1.7  christos 	      [AS_HELP_STRING([--enable-developer],
     93  1.1.1.7  christos 			      [enable developer build settings])])
     94  1.1.1.7  christos 
     95      1.1  christos XTARGETS=
     96  1.1.1.7  christos AS_IF([test "$enable_developer" = "yes"],
     97  1.1.1.7  christos       [STD_CDEFINES="$STD_CDEFINES -DISC_MEM_DEFAULTFILL=1 -DISC_LIST_CHECKINIT=1"
     98  1.1.1.7  christos        test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
     99  1.1.1.7  christos        test "${enable_querytrace+set}" = set || enable_querytrace=yes
    100  1.1.1.7  christos        test "${with_cmocka+set}" = set || with_cmocka=yes
    101  1.1.1.7  christos        test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
    102  1.1.1.7  christos        test "${enable_symtable+set}" = set || enable_symtable=all
    103  1.1.1.7  christos        test "${enable_warn_error+set}" = set || enable_warn_error=yes
    104  1.1.1.7  christos        test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
    105  1.1.1.7  christos        test "${with_zlib+set}" = set || with_zlib=yes
    106  1.1.1.7  christos        XTARGETS='${XTARGETS}'
    107  1.1.1.7  christos        ])
    108  1.1.1.7  christos AC_SUBST([XTARGETS])
    109      1.1  christos 
    110  1.1.1.9  christos # Fuzzing is not included in pairwise testing as fuzzing tools are
    111  1.1.1.9  christos # not present in the relevant Docker image.
    112  1.1.1.9  christos #
    113  1.1.1.9  christos # [pairwise: skip]
    114      1.1  christos AC_ARG_ENABLE([fuzzing],
    115      1.1  christos 	      [AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer>],
    116      1.1  christos 			      [Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
    117      1.1  christos 	      [],
    118      1.1  christos 	      [enable_fuzzing=no])
    119      1.1  christos 
    120      1.1  christos AC_MSG_CHECKING([whether to enable fuzzing mode])
    121      1.1  christos AS_CASE([$enable_fuzzing],
    122      1.1  christos 	[no],[AC_MSG_RESULT([no])],
    123      1.1  christos 	[afl],[
    124      1.1  christos 	  AC_MSG_RESULT([using AFL])
    125      1.1  christos 	  AC_DEFINE([ENABLE_AFL], [1],
    126      1.1  christos 		    [Define to enable American Fuzzy Lop test harness])
    127      1.1  christos 	  CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
    128      1.1  christos 	  LIBS="$LIBS -lpthread"],
    129      1.1  christos 	[libfuzzer],[
    130      1.1  christos 	  AC_MSG_RESULT([using libFuzzer])
    131      1.1  christos 	  CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer,address,undefined"
    132      1.1  christos 	  LDFLAGS="$LDFLAGS -fsanitize=fuzzer,address,undefined"],
    133      1.1  christos 	[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
    134      1.1  christos 
    135      1.1  christos AS_IF([test "$enable_fuzzing" = "afl"],
    136      1.1  christos       [AC_MSG_CHECKING("for AFL enabled compiler")
    137      1.1  christos        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
    138      1.1  christos 					  [#ifndef __AFL_COMPILER
    139      1.1  christos 					   #error AFL compiler required
    140      1.1  christos 					   #endif
    141      1.1  christos 					  ])],
    142      1.1  christos 			 [AC_MSG_RESULT([yes])],
    143      1.1  christos 			 [AC_MSG_ERROR([set CC=afl-<gcc|clang> when --enable-fuzzing=afl is used])])
    144      1.1  christos       ])
    145      1.1  christos 
    146  1.1.1.9  christos # [pairwise: --enable-mutex-atomics, --disable-mutex-atomics]
    147  1.1.1.7  christos AC_ARG_ENABLE(mutex_atomics,
    148  1.1.1.7  christos 	      AS_HELP_STRING([--enable-mutex-atomics],
    149  1.1.1.7  christos 		             [emulate atomics by mutex-locked variables, useful for debugging
    150  1.1.1.7  christos 				[default=no]]),
    151  1.1.1.7  christos 	      [],
    152  1.1.1.7  christos 	      [enable_mutex_atomics=no])
    153  1.1.1.7  christos 
    154  1.1.1.7  christos AC_MSG_CHECKING([whether to emulate atomics with mutexes])
    155  1.1.1.7  christos case "$enable_mutex_atomics" in
    156  1.1.1.7  christos yes)
    157  1.1.1.7  christos         AC_MSG_RESULT(yes)
    158  1.1.1.7  christos         AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
    159  1.1.1.7  christos         ;;
    160  1.1.1.7  christos no)
    161  1.1.1.7  christos         AC_MSG_RESULT(no)
    162  1.1.1.7  christos         ;;
    163  1.1.1.7  christos *)
    164  1.1.1.7  christos         AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
    165  1.1.1.7  christos         ;;
    166  1.1.1.7  christos esac
    167  1.1.1.7  christos 
    168      1.1  christos #
    169      1.1  christos # Make very sure that these are the first files processed by
    170      1.1  christos # config.status, since we use the processed output as the input for
    171      1.1  christos # AC_SUBST_FILE() substitutions in other files.
    172      1.1  christos #
    173      1.1  christos AC_CONFIG_FILES([make/rules make/includes])
    174      1.1  christos 
    175      1.1  christos AC_PATH_PROG(AR, ar)
    176      1.1  christos ARFLAGS="cruv"
    177      1.1  christos AC_SUBST(AR)
    178      1.1  christos AC_SUBST(ARFLAGS)
    179      1.1  christos 
    180      1.1  christos # The POSIX ln(1) program.  Non-POSIX systems may substitute
    181      1.1  christos # "copy" or something.
    182      1.1  christos LN=ln
    183      1.1  christos AC_SUBST(LN)
    184      1.1  christos 
    185      1.1  christos case "$AR" in
    186      1.1  christos 	"")
    187      1.1  christos 		AC_MSG_ERROR([
    188      1.1  christos ar program not found.  Please fix your PATH to include the directory in
    189      1.1  christos which ar resides, or set AR in the environment with the full path to ar.
    190      1.1  christos ])
    191      1.1  christos 
    192      1.1  christos 		;;
    193      1.1  christos esac
    194      1.1  christos 
    195      1.1  christos #
    196  1.1.1.9  christos # Look for w3m
    197  1.1.1.9  christos #
    198  1.1.1.9  christos AC_PATH_PROGS(W3M, w3m, w3m)
    199  1.1.1.9  christos AC_SUBST(W3M)
    200  1.1.1.9  christos 
    201  1.1.1.9  christos #
    202  1.1.1.9  christos # Look for pandoc
    203  1.1.1.9  christos #
    204  1.1.1.9  christos AC_PATH_PROG(PANDOC, pandoc, pandoc)
    205  1.1.1.9  christos AC_SUBST(PANDOC)
    206  1.1.1.9  christos 
    207  1.1.1.9  christos #
    208      1.1  christos # Perl is optional; it is used only by some of the system test scripts.
    209      1.1  christos # Note: the backtrace feature (see below) uses perl to build the symbol table,
    210      1.1  christos # but it still compiles without perl, in which case an empty table will be used.
    211      1.1  christos #
    212      1.1  christos AC_PATH_PROGS(PERL, perl5 perl)
    213      1.1  christos AC_SUBST(PERL)
    214      1.1  christos 
    215      1.1  christos #
    216      1.1  christos # Python is also optional but required by default so that dnssec-keymgr gets
    217      1.1  christos # installed unless explicitly prevented by the user using --without-python.
    218      1.1  christos #
    219      1.1  christos testminvers='import sys
    220      1.1  christos if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
    221      1.1  christos    exit(1)'
    222      1.1  christos 
    223      1.1  christos testargparse='try: import argparse
    224      1.1  christos except: exit(1)'
    225      1.1  christos 
    226      1.1  christos testply='try: import ply
    227      1.1  christos except: exit(1)'
    228      1.1  christos 
    229  1.1.1.7  christos testsetup='try: from distutils.core import setup
    230  1.1.1.7  christos except: exit(1)'
    231  1.1.1.7  christos 
    232  1.1.1.2  christos default_with_python="python python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
    233  1.1.1.2  christos 
    234  1.1.1.7  christos AC_ARG_VAR([PYTHON], [path to python executable])
    235  1.1.1.7  christos 
    236  1.1.1.9  christos # [pairwise: --with-python, --without-python]
    237      1.1  christos AC_ARG_WITH([python],
    238      1.1  christos 	    AS_HELP_STRING([--with-python=PATH],
    239      1.1  christos 			   [specify path to Python interpreter]),
    240  1.1.1.2  christos 	    [], [with_python=$default_with_python])
    241  1.1.1.9  christos 
    242  1.1.1.9  christos # [pairwise: skip]
    243      1.1  christos AC_ARG_WITH([python-install-dir],
    244      1.1  christos 	    AS_HELP_STRING([--with-python-install-dir=PATH],
    245      1.1  christos 			   [installation directory for Python modules]),
    246      1.1  christos 	    [], with_python_install_dir="")
    247      1.1  christos 
    248  1.1.1.2  christos AS_IF([test "$with_python" = "yes"],
    249  1.1.1.2  christos       [with_python=$default_with_python])
    250  1.1.1.2  christos 
    251      1.1  christos AS_IF([test "$with_python" = "no"],
    252      1.1  christos       [AC_MSG_CHECKING([for Python support])
    253  1.1.1.7  christos        unset PYTHON
    254      1.1  christos        AC_MSG_RESULT([disabled])],
    255      1.1  christos       [for p in $with_python
    256      1.1  christos        do
    257      1.1  christos 	 AS_CASE([$p],
    258      1.1  christos 		 [/*],[PYTHON="$p"])
    259      1.1  christos 
    260      1.1  christos 	 AC_PATH_PROG([PYTHON], [$p])
    261      1.1  christos 	 # Do not cache the result of the check from the previous line.  If the
    262      1.1  christos 	 # first found Python interpreter has missing module dependencies and
    263      1.1  christos 	 # the result of the above check is cached, subsequent module checks
    264      1.1  christos 	 # will erroneously keep on using the cached path to the first found
    265      1.1  christos 	 # Python interpreter instead of different ones.
    266      1.1  christos 	 unset ac_cv_path_PYTHON
    267      1.1  christos 
    268      1.1  christos 	 AS_IF([test -z "$PYTHON"], [continue])
    269      1.1  christos 
    270      1.1  christos 	 AC_MSG_CHECKING([if $PYTHON is python2 version >= 2.7 or python3 version >= 3.2])
    271      1.1  christos 	 AS_IF(["$PYTHON" -c "$testminvers" 2>/dev/null],
    272      1.1  christos 	       [AC_MSG_RESULT([yes])],
    273      1.1  christos 	       [AC_MSG_RESULT([no])
    274      1.1  christos 		unset PYTHON
    275      1.1  christos 		continue])
    276      1.1  christos 
    277      1.1  christos 	 AC_MSG_CHECKING([Python module 'argparse'])
    278      1.1  christos 	 AS_IF(["$PYTHON" -c "$testargparse" 2>/dev/null],
    279      1.1  christos 	       [AC_MSG_RESULT([yes])],
    280      1.1  christos 	       [AC_MSG_RESULT([no])
    281      1.1  christos 		unset PYTHON
    282      1.1  christos 		continue])
    283      1.1  christos 
    284      1.1  christos 	 AC_MSG_CHECKING([Python module 'ply'])
    285      1.1  christos 	 AS_IF(["$PYTHON" -c "$testply" 2>/dev/null],
    286      1.1  christos 	       [AC_MSG_RESULT([yes])],
    287      1.1  christos 	       [AC_MSG_RESULT([no])
    288      1.1  christos 		unset PYTHON
    289      1.1  christos 		continue])
    290      1.1  christos 
    291  1.1.1.7  christos 	 AC_MSG_CHECKING([Python module 'distutils.core setup'])
    292  1.1.1.7  christos 	 AS_IF(["$PYTHON" -c "$testsetup" 2>/dev/null],
    293  1.1.1.7  christos 	       [AC_MSG_RESULT([yes])],
    294  1.1.1.7  christos 	       [AC_MSG_RESULT([no])
    295  1.1.1.7  christos 		unset PYTHON
    296  1.1.1.7  christos 		continue])
    297  1.1.1.7  christos 
    298      1.1  christos 	 # Stop looking any further once we find a Python interpreter
    299      1.1  christos 	 # satisfying all requirements.
    300      1.1  christos 	 break
    301      1.1  christos        done
    302      1.1  christos 
    303      1.1  christos        AS_IF([test "X$PYTHON" = "X"],
    304      1.1  christos 	     [AC_MSG_CHECKING([for Python support])
    305      1.1  christos 	      AC_MSG_RESULT([no])
    306  1.1.1.4  christos 	      AC_MSG_ERROR([m4_normalize(
    307  1.1.1.4  christos 				[Python >= 2.7 or >= 3.2 and the PLY package
    308  1.1.1.4  christos                                  are required for dnssec-keymgr and other
    309  1.1.1.4  christos                                  Python-based tools. PLY may be
    310  1.1.1.4  christos                                  available from your OS package manager
    311  1.1.1.4  christos                                  as python-ply or python3-ply; it can also
    312  1.1.1.4  christos                                  be installed via pip. To build without
    313  1.1.1.4  christos                                  Python/PLY, use --without-python.]
    314  1.1.1.4  christos 			    )])])])
    315      1.1  christos 
    316      1.1  christos PYTHON_TOOLS=''
    317      1.1  christos CHECKDS=''
    318      1.1  christos COVERAGE=''
    319      1.1  christos KEYMGR=''
    320      1.1  christos AS_IF([test "X$PYTHON" != "X"],
    321      1.1  christos       [PYTHON_TOOLS=python
    322      1.1  christos        CHECKDS=checkds
    323      1.1  christos        COVERAGE=coverage
    324      1.1  christos        KEYMGR=keymgr
    325      1.1  christos        PYTHON_INSTALL_DIR="$with_python_install_dir"
    326      1.1  christos        AS_IF([test -n "$with_python_install_dir"],
    327      1.1  christos 	     [PYTHON_INSTALL_LIB="--install-lib=$with_python_install_dir"])])
    328      1.1  christos AC_SUBST(CHECKDS)
    329      1.1  christos AC_SUBST(COVERAGE)
    330      1.1  christos AC_SUBST(KEYMGR)
    331      1.1  christos AC_SUBST(PYTHON_TOOLS)
    332      1.1  christos AC_SUBST(PYTHON_INSTALL_DIR)
    333      1.1  christos AC_SUBST(PYTHON_INSTALL_LIB)
    334      1.1  christos 
    335      1.1  christos #
    336  1.1.1.7  christos # expanded_sysconfdir is needed for replacement in the python utilities
    337  1.1.1.7  christos #
    338      1.1  christos expanded_sysconfdir=`eval echo $sysconfdir`
    339      1.1  christos AC_SUBST(expanded_sysconfdir)
    340      1.1  christos 
    341      1.1  christos #
    342      1.1  christos # Make sure INSTALL uses an absolute path, else it will be wrong in all
    343      1.1  christos # Makefiles, since they use make/rules.in and INSTALL will be adjusted by
    344      1.1  christos # configure based on the location of the file where it is substituted.
    345      1.1  christos # Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
    346      1.1  christos # subdirectory of install-sh, This relative path will be wrong for all
    347      1.1  christos # directories more than one level down from install-sh.
    348      1.1  christos #
    349      1.1  christos case "$INSTALL" in
    350      1.1  christos 	/*)
    351      1.1  christos 		;;
    352      1.1  christos 	*)
    353      1.1  christos 		#
    354      1.1  christos 		# Not all systems have dirname.
    355      1.1  christos 		#
    356      1.1  christos 		changequote({, })
    357      1.1  christos 		ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
    358      1.1  christos 		changequote([, ])
    359      1.1  christos 
    360      1.1  christos 		ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
    361      1.1  christos 		test "X$ac_dir" = "X$ac_prog" && ac_dir=.
    362      1.1  christos 		test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
    363      1.1  christos 		INSTALL="$ac_dir/$ac_prog"
    364      1.1  christos 		;;
    365      1.1  christos esac
    366      1.1  christos 
    367  1.1.1.8  christos AC_PATH_PROGS([PYTEST], [pytest-3 py.test-3 pytest pytest-pypy], [])
    368  1.1.1.7  christos AS_IF([test -z "$PYTEST"],
    369  1.1.1.7  christos       [AC_MSG_WARN([pytest not found, some system tests will be skipped])])
    370  1.1.1.7  christos AC_SUBST([PYTEST])
    371  1.1.1.7  christos 
    372  1.1.1.7  christos 
    373      1.1  christos AC_PROG_CC
    374      1.1  christos AC_PROG_CC_C99
    375      1.1  christos 
    376      1.1  christos #
    377  1.1.1.4  christos # Using Solaris linker with gcc on Solaris breaks Thread Local Storage
    378  1.1.1.4  christos #
    379  1.1.1.4  christos AS_CASE([$host],
    380  1.1.1.4  christos 	[*-solaris*],[
    381  1.1.1.4  christos 	    AS_IF([test "$GCC" = "yes"],
    382  1.1.1.4  christos 		  [LDFLAGS="$LDFLAGS -zrelax=transtls"
    383  1.1.1.4  christos 		   AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
    384  1.1.1.4  christos 		  ])
    385  1.1.1.9  christos 	],
    386  1.1.1.9  christos 	[*-darwin*],[LDFLAGS="$LDFLAGS -Wl,-flat_namespace"])
    387  1.1.1.4  christos 
    388  1.1.1.4  christos #
    389      1.1  christos # CCNOOPT defaults to -O0 on gcc and disables optimization when is last
    390      1.1  christos #
    391      1.1  christos if test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
    392      1.1  christos 	CCNOOPT="-O0"
    393      1.1  christos fi
    394      1.1  christos 
    395      1.1  christos AC_HEADER_STDC
    396      1.1  christos 
    397      1.1  christos 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,,,
    398      1.1  christos [$ac_includes_default
    399      1.1  christos #ifdef HAVE_SYS_PARAM_H
    400      1.1  christos # include <sys/param.h>
    401      1.1  christos #endif
    402      1.1  christos #ifdef HAVE_SYS_SOCKET_H
    403      1.1  christos # include <sys/socket.h>
    404      1.1  christos #endif
    405      1.1  christos ])
    406      1.1  christos 
    407      1.1  christos #
    408      1.1  christos # Check for thread local storage
    409      1.1  christos #
    410      1.1  christos AC_CHECK_HEADERS([threads.h],
    411      1.1  christos 		 [
    412      1.1  christos 		     AC_MSG_CHECKING([for C11 Thread-Local Storage using thread_local])
    413      1.1  christos 		     AC_COMPILE_IFELSE(
    414      1.1  christos 			 [AC_LANG_PROGRAM(
    415      1.1  christos 			      [
    416      1.1  christos 				  #include <threads.h>
    417      1.1  christos 			      ],[
    418      1.1  christos 				  static thread_local int tls = 0;
    419      1.1  christos 				  return (tls);
    420      1.1  christos 			      ])
    421      1.1  christos 			 ],[
    422      1.1  christos 			     AC_MSG_RESULT([yes])
    423      1.1  christos 			     AC_DEFINE([HAVE_THREAD_LOCAL],[1],[Define if thread_local keyword is available])
    424      1.1  christos 			     AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
    425      1.1  christos 			 ],[
    426  1.1.1.7  christos 			     AC_MSG_ERROR([Thread Local Storage support required, update your toolchain to build BIND 9])
    427      1.1  christos 			 ])
    428      1.1  christos 		 ],[
    429      1.1  christos 		     AC_MSG_CHECKING([for Thread-Local Storage using __thread])
    430      1.1  christos 		     AC_COMPILE_IFELSE(
    431      1.1  christos 			 [AC_LANG_PROGRAM(
    432      1.1  christos 			      [
    433      1.1  christos 			      ],[
    434      1.1  christos 				  static __thread int tls = 0;
    435      1.1  christos 				  return (tls);
    436      1.1  christos 			      ])
    437      1.1  christos 			 ],[
    438      1.1  christos 			     AC_MSG_RESULT([yes])
    439      1.1  christos 			     AC_DEFINE([HAVE___THREAD],[1],[Define if __thread keyword is available])
    440      1.1  christos 			     AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
    441      1.1  christos 			 ],[
    442  1.1.1.7  christos 			     AC_MSG_ERROR([Thread Local Storage support required, update your toolchain to build BIND 9])
    443      1.1  christos 			 ])
    444      1.1  christos 		 ])
    445      1.1  christos 
    446      1.1  christos AC_C_CONST
    447      1.1  christos AC_C_INLINE
    448      1.1  christos AC_C_VOLATILE
    449      1.1  christos AC_C_FLEXIBLE_ARRAY_MEMBER
    450      1.1  christos 
    451      1.1  christos #
    452      1.1  christos # Check for yield support on ARM processors
    453      1.1  christos #
    454      1.1  christos AS_CASE([$host],
    455  1.1.1.4  christos 	[arm*],
    456  1.1.1.4  christos 	[AC_MSG_CHECKING([for yield instruction support])
    457  1.1.1.4  christos 	 AC_COMPILE_IFELSE(
    458  1.1.1.4  christos 	     [AC_LANG_PROGRAM([[]],
    459  1.1.1.4  christos 			     [[__asm__ __volatile__ ("yield")]])],
    460  1.1.1.4  christos 	     [AC_MSG_RESULT([yes])
    461  1.1.1.4  christos 	      AC_DEFINE([HAVE_ARM_YIELD], [1],
    462  1.1.1.4  christos 			[define if the ARM yield instruction is available])],
    463  1.1.1.4  christos 	     [AC_MSG_RESULT([no])])])
    464  1.1.1.4  christos 
    465  1.1.1.4  christos #
    466  1.1.1.4  christos # Check for pause support on SPARC processors
    467  1.1.1.4  christos #
    468  1.1.1.4  christos AS_CASE([$host],
    469  1.1.1.4  christos 	[sparc*],
    470  1.1.1.4  christos 	[AC_MSG_CHECKING([for pause instruction support])
    471  1.1.1.4  christos 	 AC_COMPILE_IFELSE(
    472  1.1.1.4  christos 	     [AC_LANG_PROGRAM([[]],
    473  1.1.1.4  christos 			     [[__asm__ __volatile__ ("pause")]])],
    474  1.1.1.4  christos 	     [AC_MSG_RESULT([yes])
    475  1.1.1.4  christos 	      AC_DEFINE([HAVE_SPARC_PAUSE], [1],
    476  1.1.1.4  christos 			[define if the SPARC pause instruction is available])],
    477  1.1.1.4  christos 	     [AC_MSG_RESULT([no])])])
    478      1.1  christos 
    479      1.1  christos AC_CHECK_FUNCS([sysctlbyname])
    480      1.1  christos 
    481      1.1  christos #
    482      1.1  christos # Check for the existence of mmap to enable the fast format zones
    483      1.1  christos #
    484      1.1  christos AC_CHECK_FUNCS(mmap)
    485      1.1  christos 
    486      1.1  christos #
    487      1.1  christos # Older versions of HP/UX don't define seteuid() and setegid()
    488      1.1  christos #
    489      1.1  christos AC_CHECK_FUNCS(seteuid setresuid)
    490      1.1  christos AC_CHECK_FUNCS(setegid setresgid)
    491      1.1  christos 
    492      1.1  christos AC_TYPE_SIZE_T
    493      1.1  christos AC_TYPE_SSIZE_T
    494      1.1  christos AC_TYPE_UINTPTR_T
    495      1.1  christos 
    496      1.1  christos AC_HEADER_TIME
    497      1.1  christos 
    498      1.1  christos #
    499      1.1  christos # check for uname library routine
    500      1.1  christos #
    501      1.1  christos AC_MSG_CHECKING([for uname])
    502      1.1  christos AC_COMPILE_IFELSE(
    503      1.1  christos   [AC_LANG_PROGRAM(
    504      1.1  christos      [[#include <sys/utsname.h>
    505      1.1  christos        #include <stdio.h>
    506      1.1  christos       ]],
    507      1.1  christos      [[
    508      1.1  christos        struct utsname uts;
    509      1.1  christos        uname(&uts);
    510      1.1  christos        printf("running on %s %s %s for %s\n",
    511      1.1  christos 	      uts.sysname, uts.release, uts.version, uts.machine);
    512      1.1  christos      ]])],
    513      1.1  christos   [AC_MSG_RESULT(yes)
    514      1.1  christos    AC_DEFINE([HAVE_UNAME], [1], [define if uname is available])
    515      1.1  christos   ],
    516      1.1  christos   [AC_MSG_RESULT(no)
    517      1.1  christos    AC_MSG_WARN([uname is not correctly supported])
    518      1.1  christos   ])
    519      1.1  christos 
    520      1.1  christos #
    521      1.1  christos # check for GCC noreturn attribute
    522      1.1  christos #
    523      1.1  christos AC_MSG_CHECKING(for GCC noreturn attribute)
    524      1.1  christos AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
    525      1.1  christos 	[AC_MSG_RESULT(yes)
    526      1.1  christos 		ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
    527      1.1  christos 		ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
    528      1.1  christos 	[AC_MSG_RESULT(no)
    529      1.1  christos 		ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
    530      1.1  christos 		ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
    531      1.1  christos AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
    532      1.1  christos AC_SUBST(ISC_PLATFORM_NORETURN_POST)
    533      1.1  christos 
    534      1.1  christos #
    535      1.1  christos # check if we have kqueue
    536      1.1  christos #
    537  1.1.1.9  christos # [pairwise: --enable-kqueue, --disable-kqueue]
    538      1.1  christos AC_ARG_ENABLE([kqueue],
    539      1.1  christos 	      [AS_HELP_STRING([--enable-kqueue],
    540      1.1  christos 			      [use BSD kqueue when available [default=yes]])],
    541      1.1  christos 	      [], enable_kqueue="yes")
    542      1.1  christos 
    543      1.1  christos AS_IF([test "$enable_kqueue" = "yes"],
    544      1.1  christos       [AC_CHECK_FUNCS([kqueue])])
    545      1.1  christos 
    546      1.1  christos #
    547      1.1  christos # check if we have epoll.  Linux kernel 2.4 has epoll_create() which fails,
    548      1.1  christos # so we need to try running the code, not just test its existence.
    549      1.1  christos #
    550  1.1.1.9  christos # [pairwise: --enable-epoll, --disable-epoll]
    551      1.1  christos AC_ARG_ENABLE([epoll],
    552      1.1  christos 	      [AS_HELP_STRING([--enable-epoll],
    553      1.1  christos 			      [use Linux epoll when available [default=auto]])],
    554      1.1  christos 	      [], [enable_epoll="yes"])
    555      1.1  christos 
    556      1.1  christos AS_IF([test "$enable_epoll" = "yes"],
    557      1.1  christos       [AC_CHECK_FUNCS([epoll_create1])])
    558      1.1  christos 
    559      1.1  christos #
    560      1.1  christos # check if we support /dev/poll
    561      1.1  christos #
    562  1.1.1.9  christos # [pairwise: --enable-devpoll, --disable-devpoll]
    563      1.1  christos AC_ARG_ENABLE([devpoll],
    564      1.1  christos 	      [AS_HELP_STRING([--enable-devpoll],
    565      1.1  christos 			      [use /dev/poll when available [default=yes]])],
    566      1.1  christos 	      [], [enable_devpoll="yes"])
    567      1.1  christos AS_IF([test "$enable_devpoll" = "yes"],
    568      1.1  christos       [AC_CHECK_HEADERS([sys/devpoll.h devpoll.h])])
    569      1.1  christos 
    570      1.1  christos #
    571      1.1  christos # Find the machine's endian flavor.
    572      1.1  christos #
    573      1.1  christos AC_C_BIGENDIAN
    574      1.1  christos 
    575      1.1  christos #
    576      1.1  christos # GeoIP support?
    577      1.1  christos #
    578  1.1.1.7  christos # Should be on by default if libmaxminddb exists.
    579  1.1.1.7  christos #
    580  1.1.1.9  christos # [pairwise: skip]
    581  1.1.1.4  christos AC_ARG_WITH([geoip2],
    582  1.1.1.7  christos 	    [AS_HELP_STRING([--with-geoip2],
    583  1.1.1.7  christos 			    [deprecated, use --with-maxminddb])],
    584  1.1.1.7  christos 	    [AC_MSG_WARN([--with-geoip2 is DEPRECATED and will be removed in a future release, use --with-maxminddb instead])],
    585  1.1.1.7  christos 	    [with_geoip2="auto"])
    586  1.1.1.7  christos 
    587  1.1.1.9  christos # [pairwise: --enable-geoip --with-maxminddb=auto, --enable-geoip --with-maxminddb=yes, --disable-geoip]
    588  1.1.1.7  christos AC_ARG_ENABLE([geoip],
    589  1.1.1.7  christos 	      [AS_HELP_STRING([--disable-geoip],
    590  1.1.1.7  christos 			      [support GeoIP2 geolocation ACLs if available [default=yes]])],
    591  1.1.1.7  christos 	      [], [enable_geoip="yes"])
    592  1.1.1.7  christos 
    593  1.1.1.9  christos # [pairwise: skip]
    594  1.1.1.7  christos AC_ARG_WITH([maxminddb],
    595  1.1.1.7  christos 	    [AS_HELP_STRING([--with-maxminddb=PATH],
    596  1.1.1.7  christos 			    [Build with MaxMind GeoIP2 support (auto|yes|no|path) [default=auto]])],
    597  1.1.1.7  christos 	    [], [with_maxminddb="$with_geoip2"])
    598  1.1.1.4  christos 
    599  1.1.1.4  christos GEOIP2LINKSRCS=
    600  1.1.1.4  christos GEOIP2LINKOBJS=
    601  1.1.1.7  christos AS_IF([test "$enable_geoip" = "yes"],
    602  1.1.1.7  christos       [AS_CASE([$with_maxminddb],
    603  1.1.1.7  christos 	       [no],[AC_MSG_ERROR([Use '--disable-geoip' to disable the GeoIP])],
    604  1.1.1.7  christos 	       [auto],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
    605  1.1.1.7  christos 					 [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
    606  1.1.1.7  christos 					  PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
    607  1.1.1.7  christos 					  GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
    608  1.1.1.7  christos 					  GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
    609  1.1.1.7  christos 					 ],[:])],
    610  1.1.1.7  christos 	       [yes],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
    611  1.1.1.7  christos 					[AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
    612  1.1.1.7  christos 					 PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
    613  1.1.1.7  christos 					 GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
    614  1.1.1.7  christos 					 GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
    615  1.1.1.7  christos 					])],
    616  1.1.1.7  christos 	       [ # default
    617  1.1.1.7  christos 		   AX_SAVE_FLAGS([maxminddb])
    618  1.1.1.7  christos 		   MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
    619  1.1.1.7  christos 		   MAXMINDDB_LIBS="-L$with_maxminddb/lib"
    620  1.1.1.7  christos 		   CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
    621  1.1.1.7  christos 		   LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS"
    622  1.1.1.7  christos 		   AC_SEARCH_LIBS([MMDB_open], [maxminddb],
    623  1.1.1.7  christos 				  [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
    624  1.1.1.7  christos 				   GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
    625  1.1.1.7  christos 				   GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
    626  1.1.1.9  christos 				   MAXMINDDB_LIBS="$MAXMINDDB_LIBS $ac_cv_search_MMDB_open"
    627  1.1.1.7  christos 				   AC_MSG_NOTICE([GeoIP2 default database path set to $with_maxminddb/share/GeoIP])
    628  1.1.1.7  christos 				   AS_VAR_COPY([MAXMINDDB_PREFIX], [$with_maxminddb])
    629  1.1.1.7  christos 				  ],
    630  1.1.1.7  christos 				  [AC_MSG_ERROR([GeoIP2 requested, but libmaxminddb not found])])
    631  1.1.1.7  christos 		   AX_RESTORE_FLAGS([maxminddb])
    632  1.1.1.7  christos 	       ])
    633  1.1.1.7  christos        AC_ARG_VAR([MAXMINDDB_PREFIX], [value of prefix for MAXMINDDB, overriding pkg-config])
    634  1.1.1.7  christos ])
    635  1.1.1.7  christos 
    636  1.1.1.4  christos AC_SUBST([MAXMINDDB_CFLAGS])
    637  1.1.1.4  christos AC_SUBST([MAXMINDDB_LIBS])
    638  1.1.1.4  christos AC_SUBST([GEOIP2LINKSRCS])
    639  1.1.1.4  christos AC_SUBST([GEOIP2LINKOBJS])
    640      1.1  christos 
    641      1.1  christos #
    642      1.1  christos # Do we have arc4random(), etc ?
    643      1.1  christos #
    644      1.1  christos AC_CHECK_FUNCS(arc4random arc4random_buf arc4random_uniform getrandom)
    645      1.1  christos 
    646      1.1  christos AX_PTHREAD
    647      1.1  christos 
    648      1.1  christos LIBS="$PTHREAD_LIBS $LIBS"
    649      1.1  christos CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    650      1.1  christos CC="$PTHREAD_CC"
    651      1.1  christos 
    652  1.1.1.7  christos AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize])
    653      1.1  christos 
    654  1.1.1.9  christos # [pairwise: --with-locktype=adaptive, --with-locktype=standard]
    655      1.1  christos AC_ARG_WITH([locktype],
    656      1.1  christos 	    AS_HELP_STRING([--with-locktype=ARG],
    657      1.1  christos 			   [Specify mutex lock type
    658      1.1  christos 			    (adaptive or standard)]),
    659      1.1  christos 	    [], [with_locktype="adaptive"])
    660      1.1  christos 
    661      1.1  christos AS_CASE([$with_locktype],
    662      1.1  christos 	[adaptive],[
    663      1.1  christos 	  AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
    664      1.1  christos 	  AC_COMPILE_IFELSE(
    665      1.1  christos 	    [AC_LANG_PROGRAM(
    666      1.1  christos 	       [[
    667      1.1  christos 		 #ifndef _GNU_SOURCE
    668      1.1  christos 		 #define _GNU_SOURCE
    669      1.1  christos 		 #endif
    670      1.1  christos 		 #include <pthread.h>
    671      1.1  christos 	       ]],
    672      1.1  christos 	       [[
    673      1.1  christos 		 return (PTHREAD_MUTEX_ADAPTIVE_NP);
    674      1.1  christos 	       ]]
    675      1.1  christos 	     )],
    676      1.1  christos 	    [AC_MSG_RESULT([using adaptive lock type])
    677      1.1  christos 	     AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
    678      1.1  christos 		       [Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
    679      1.1  christos 	    [AC_MSG_RESULT([using standard lock type])]
    680      1.1  christos 	  )],
    681      1.1  christos 	[standard],[AC_MSG_RESULT([using standard lock type])],
    682      1.1  christos 	[AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])]
    683      1.1  christos        )
    684      1.1  christos 
    685      1.1  christos AC_CHECK_HEADERS([sched.h])
    686      1.1  christos 
    687      1.1  christos AC_SEARCH_LIBS([sched_yield],[rt])
    688      1.1  christos AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np])
    689      1.1  christos 
    690      1.1  christos AC_CHECK_HEADERS([sys/cpuset.h])
    691      1.1  christos AC_CHECK_HEADERS([sys/procset.h])
    692      1.1  christos AC_CHECK_FUNCS([pthread_setaffinity_np cpuset_setaffinity processor_bind sched_setaffinity])
    693      1.1  christos 
    694      1.1  christos # Look for functions relating to thread naming
    695      1.1  christos AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
    696      1.1  christos AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
    697      1.1  christos 
    698  1.1.1.7  christos # libuv
    699  1.1.1.7  christos AC_MSG_CHECKING(for libuv)
    700  1.1.1.7  christos PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [],
    701  1.1.1.7  christos 		  [AC_MSG_ERROR([libuv not found])])
    702  1.1.1.8  christos AC_SUBST([LIBUV_CFLAGS])
    703  1.1.1.8  christos AC_SUBST([LIBUV_LIBS])
    704  1.1.1.7  christos 
    705  1.1.1.8  christos AX_SAVE_FLAGS([libuv])
    706  1.1.1.7  christos CFLAGS="$CFLAGS $LIBUV_CFLAGS"
    707  1.1.1.8  christos LIBS="$LDFLAGS $LIBUV_LIBS"
    708  1.1.1.7  christos # Those functions are only provided in newer versions of libuv, we'll be emulating them
    709  1.1.1.7  christos # for now
    710  1.1.1.9  christos AC_CHECK_FUNCS([uv_handle_get_data uv_handle_set_data uv_import uv_udp_connect uv_translate_sys_error])
    711  1.1.1.8  christos AX_RESTORE_FLAGS([libuv])
    712  1.1.1.7  christos 
    713      1.1  christos #
    714  1.1.1.3  christos # flockfile is usually provided by pthreads
    715  1.1.1.3  christos #
    716  1.1.1.3  christos AC_CHECK_FUNCS([flockfile getc_unlocked])
    717  1.1.1.3  christos 
    718  1.1.1.3  christos #
    719      1.1  christos # Look for sysconf to allow detection of the number of processors.
    720      1.1  christos #
    721      1.1  christos AC_CHECK_FUNCS([sysconf])
    722      1.1  christos 
    723      1.1  christos AC_SUBST(ALWAYS_DEFINES)
    724      1.1  christos 
    725      1.1  christos AC_MSG_CHECKING(for libtool)
    726  1.1.1.9  christos 
    727  1.1.1.9  christos # [pairwise: --with-libtool, --without-libtool]
    728      1.1  christos AC_ARG_WITH(libtool, AS_HELP_STRING([--with-libtool], [use GNU libtool]),
    729      1.1  christos 	    use_libtool="$withval", use_libtool="no")
    730  1.1.1.8  christos NO_LIBTOOL_ISCLIBS=
    731  1.1.1.8  christos NO_LIBTOOL_DNSLIBS=
    732      1.1  christos case $use_libtool in
    733      1.1  christos 	yes)
    734      1.1  christos 		AC_MSG_RESULT(yes)
    735      1.1  christos 		AM_PROG_LIBTOOL
    736      1.1  christos 		O=lo
    737      1.1  christos 		A=la
    738      1.1  christos 		LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
    739      1.1  christos 		LIBTOOL_MODE_COMPILE='--mode=compile'
    740      1.1  christos 		LIBTOOL_MODE_INSTALL='--mode=install'
    741      1.1  christos 		LIBTOOL_MODE_LINK='--mode=link'
    742      1.1  christos 		LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
    743      1.1  christos 		INSTALL_LIBRARY='${INSTALL_PROGRAM}'
    744  1.1.1.7  christos 		AC_DEFINE([USE_LIBTOOL],[1],[Define if libtool is used for compilation])
    745      1.1  christos 		;;
    746      1.1  christos 	*)
    747      1.1  christos 		AC_MSG_RESULT(no)
    748      1.1  christos 		O=o
    749      1.1  christos 		A=a
    750      1.1  christos 		LIBTOOL=
    751      1.1  christos 		AC_SUBST(LIBTOOL)
    752      1.1  christos 		LIBTOOL_MKDEP_SED=
    753      1.1  christos 		LIBTOOL_MODE_COMPILE=
    754      1.1  christos 		LIBTOOL_MODE_INSTALL=
    755      1.1  christos 		LIBTOOL_MODE_LINK=
    756      1.1  christos 		LIBTOOL_MODE_UNINSTALL=
    757      1.1  christos 		INSTALL_LIBRARY='${INSTALL_DATA}'
    758  1.1.1.8  christos 		NO_LIBTOOL_ISCLIBS='${NO_LIBTOOL_ISCLIBS}'
    759  1.1.1.8  christos 		NO_LIBTOOL_DNSLIBS='${NO_LIBTOOL_DNSLIBS}'
    760      1.1  christos 		;;
    761      1.1  christos esac
    762      1.1  christos AC_SUBST(INSTALL_LIBRARY)
    763  1.1.1.8  christos AC_SUBST(NO_LIBTOOL_ISCLIBS)
    764  1.1.1.8  christos AC_SUBST(NO_LIBTOOL_DNSLIBS)
    765      1.1  christos 
    766      1.1  christos #
    767  1.1.1.7  christos # Do we want to use pthread rwlock?
    768      1.1  christos #
    769  1.1.1.9  christos # [pairwise: --enable-pthread-rwlock, --disable-pthread-rwlock]
    770  1.1.1.7  christos AC_ARG_ENABLE([pthread_rwlock],
    771  1.1.1.7  christos 	      [AS_HELP_STRING([--enable-pthread-rwlock],
    772  1.1.1.7  christos 			      [use pthread rwlock instead of internal rwlock implementation])],
    773  1.1.1.7  christos 	      [], [enable_pthread_rwlock=no])
    774  1.1.1.7  christos 
    775  1.1.1.7  christos AS_IF([test "$enable_pthread_rwlock" = "yes"],
    776  1.1.1.7  christos       [AC_CHECK_FUNCS([pthread_rwlock_rdlock], [],
    777  1.1.1.7  christos 		      [AC_MSG_ERROR([pthread_rwlock_rdlock requested but not found])])
    778  1.1.1.7  christos        AC_DEFINE([USE_PTHREAD_RWLOCK],[1],[Define if you want to use pthread rwlock implementation])
    779  1.1.1.7  christos       ])
    780      1.1  christos 
    781      1.1  christos CRYPTO=OpenSSL
    782      1.1  christos 
    783      1.1  christos #
    784  1.1.1.7  christos # OpenSSL/LibreSSL is mandatory
    785      1.1  christos #
    786  1.1.1.9  christos PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto], [],
    787  1.1.1.7  christos 		  [AX_CHECK_OPENSSL([:],[AC_MSG_FAILURE([OpenSSL/LibreSSL not found])])])
    788  1.1.1.7  christos 
    789  1.1.1.7  christos AX_SAVE_FLAGS([openssl])
    790      1.1  christos 
    791  1.1.1.7  christos CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
    792      1.1  christos LIBS="$LIBS $OPENSSL_LIBS"
    793      1.1  christos 
    794      1.1  christos AC_MSG_CHECKING([for OpenSSL >= 1.0.0 or LibreSSL])
    795      1.1  christos AC_COMPILE_IFELSE(
    796      1.1  christos     [AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],
    797      1.1  christos 		     [[#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
    798      1.1  christos 		       #error OpenSSL >= 1.0.0 or LibreSSL required
    799      1.1  christos 		       #endif
    800      1.1  christos 		      ]])],
    801      1.1  christos     [AC_MSG_RESULT([yes])],
    802      1.1  christos     [AC_MSG_FAILURE([not found])])
    803      1.1  christos 
    804      1.1  christos #
    805      1.1  christos # Check for functions added in OpenSSL or LibreSSL
    806      1.1  christos #
    807      1.1  christos 
    808      1.1  christos AC_CHECK_FUNCS([CRYPTO_zalloc])
    809      1.1  christos AC_CHECK_FUNCS([EVP_CIPHER_CTX_new EVP_CIPHER_CTX_free])
    810      1.1  christos AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free EVP_MD_CTX_reset])
    811      1.1  christos AC_CHECK_FUNCS([HMAC_CTX_new HMAC_CTX_free HMAC_CTX_reset HMAC_CTX_get_md])
    812      1.1  christos 
    813      1.1  christos #
    814      1.1  christos # Check for algorithm support in OpenSSL
    815      1.1  christos #
    816      1.1  christos 
    817      1.1  christos AC_CHECK_FUNCS([ECDSA_sign ECDSA_verify], [:],
    818      1.1  christos 	       [AC_MSG_FAILURE([ECDSA support in OpenSSL is mandatory.])])
    819      1.1  christos 
    820      1.1  christos AC_MSG_CHECKING([for ECDSA P-256 support])
    821      1.1  christos AC_COMPILE_IFELSE(
    822  1.1.1.2  christos     [AC_LANG_PROGRAM([[#include <openssl/evp.h>
    823  1.1.1.2  christos 		       #include <openssl/ec.h>]],
    824  1.1.1.2  christos 		     [[EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);]])],
    825      1.1  christos     [AC_MSG_RESULT([yes])],
    826      1.1  christos     [AC_MSG_FAILURE([not found.  ECDSA P-256 support in OpenSSL is mandatory.])])
    827      1.1  christos 
    828      1.1  christos AC_MSG_CHECKING([for ECDSA P-384 support])
    829      1.1  christos AC_COMPILE_IFELSE(
    830  1.1.1.2  christos     [AC_LANG_PROGRAM([[#include <openssl/evp.h>
    831  1.1.1.2  christos 		       #include <openssl/ec.h>]],
    832  1.1.1.2  christos 		     [[EC_KEY *key = EC_KEY_new_by_curve_name(NID_secp384r1);]])],
    833      1.1  christos     [AC_MSG_RESULT([yes])],
    834      1.1  christos     [AC_MSG_FAILURE([not found.  ECDSA P-384 support in OpenSSL is mandatory.])])
    835      1.1  christos 
    836      1.1  christos AC_MSG_CHECKING([for Ed25519 support])
    837      1.1  christos AC_COMPILE_IFELSE(
    838  1.1.1.2  christos     [AC_LANG_PROGRAM([[#include <openssl/evp.h>
    839  1.1.1.2  christos 		       #include <openssl/ec.h>]],
    840  1.1.1.2  christos 		     [[EC_KEY *key = EC_KEY_new_by_curve_name(NID_ED25519);]])],
    841      1.1  christos     [AC_DEFINE([HAVE_OPENSSL_ED25519], [1], [define if OpenSSL supports Ed25519])
    842      1.1  christos      AC_MSG_RESULT([yes])],
    843      1.1  christos     [AC_MSG_RESULT([no])])
    844      1.1  christos 
    845      1.1  christos AC_MSG_CHECKING([for Ed448 support])
    846  1.1.1.4  christos AC_COMPILE_IFELSE(
    847  1.1.1.4  christos     [AC_LANG_PROGRAM([[#include <openssl/evp.h>
    848  1.1.1.4  christos 		       #include <openssl/ec.h>]],
    849  1.1.1.4  christos 		     [[EC_KEY *key = EC_KEY_new_by_curve_name(NID_ED448);]])],
    850  1.1.1.4  christos     [AC_DEFINE([HAVE_OPENSSL_ED448], [1], [define if OpenSSL supports Ed448])
    851  1.1.1.4  christos      AC_MSG_RESULT([yes])],
    852  1.1.1.4  christos     [AC_MSG_RESULT([no])])
    853      1.1  christos 
    854      1.1  christos #
    855      1.1  christos # Check for OpenSSL SHA-1 support
    856      1.1  christos #
    857      1.1  christos AC_CHECK_FUNCS([EVP_sha1], [:],
    858      1.1  christos 	       [AC_MSG_FAILURE([SHA-1 support in OpenSSL is mandatory.])])
    859      1.1  christos 
    860      1.1  christos #
    861      1.1  christos # Check for OpenSSL SHA-2 support
    862      1.1  christos #
    863      1.1  christos AC_CHECK_FUNCS([EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512], [:],
    864      1.1  christos 	       [AC_MSG_FAILURE([SHA-2 support in OpenSSL is mandatory.])])
    865      1.1  christos 
    866      1.1  christos #
    867      1.1  christos # Check for OpenSSL AES support
    868      1.1  christos #
    869      1.1  christos AC_CHECK_FUNCS([EVP_aes_128_ecb EVP_aes_192_ecb EVP_aes_256_ecb], [:],
    870      1.1  christos 	       [AC_MSG_FAILURE([AES support in OpenSSL is mandatory.])])
    871      1.1  christos 
    872      1.1  christos #
    873      1.1  christos # Check for OpenSSL 1.1.x/LibreSSL functions
    874      1.1  christos #
    875      1.1  christos AC_CHECK_FUNCS([DH_get0_key ECDSA_SIG_get0 RSA_set0_key])
    876      1.1  christos 
    877  1.1.1.9  christos AC_CHECK_FUNCS([TLS_server_method])
    878  1.1.1.9  christos 
    879      1.1  christos #
    880      1.1  christos # Check whether FIPS mode is available and whether we should enable it
    881      1.1  christos #
    882  1.1.1.9  christos # FIPS is not included in pairwise testing as the relevant Docker image
    883  1.1.1.9  christos # does not support FIPS mode.
    884  1.1.1.9  christos #
    885  1.1.1.9  christos # [pairwise: skip]
    886      1.1  christos AC_ARG_ENABLE([fips-mode],
    887      1.1  christos 	      [AS_HELP_STRING([--enable-fips-mode],
    888      1.1  christos 			      [enable FIPS mode in OpenSSL library [default=no]])],
    889      1.1  christos 	      [], [enable_fips_mode="no"])
    890      1.1  christos 
    891      1.1  christos AC_MSG_CHECKING([whether to enable FIPS mode in OpenSSL library])
    892      1.1  christos AS_CASE([$enable_fips_mode],
    893      1.1  christos 	[yes], [AC_MSG_RESULT([yes])
    894      1.1  christos 		AC_CHECK_FUNCS([FIPS_mode],
    895      1.1  christos 			       [], [AC_MSG_FAILURE([OpenSSL FIPS mode requested but not available.])])],
    896      1.1  christos 	[no], [AC_MSG_RESULT([no])])
    897      1.1  christos 
    898  1.1.1.7  christos AX_RESTORE_FLAGS([openssl])
    899      1.1  christos 
    900  1.1.1.7  christos AC_SUBST([OPENSSL_CFLAGS])
    901      1.1  christos AC_SUBST([OPENSSL_LIBS])
    902      1.1  christos 
    903      1.1  christos PKCS11_TOOLS=
    904      1.1  christos PKCS11_TEST=
    905  1.1.1.8  christos PKCS11_MANS=
    906      1.1  christos #
    907      1.1  christos # was --enable-native-pkcs11 specified?
    908      1.1  christos #
    909  1.1.1.9  christos # [pairwise: --enable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --without-dlopen]
    910      1.1  christos AC_ARG_ENABLE(native-pkcs11,
    911      1.1  christos 	      AS_HELP_STRING([--enable-native-pkcs11],
    912      1.1  christos 			     [use native PKCS11 for public-key crypto [default=no]]),
    913      1.1  christos 	      [:], [enable_native_pkcs11="no"])
    914      1.1  christos 
    915      1.1  christos AC_MSG_CHECKING([for PKCS11 for Public-Key Cryptography])
    916      1.1  christos AS_CASE([$enable_native_pkcs11],
    917      1.1  christos 	[no],[AC_MSG_RESULT([no])],
    918      1.1  christos 	[yes],[PKCS11_TOOLS=pkcs11
    919      1.1  christos 	       PKCS11_TEST=pkcs11
    920  1.1.1.8  christos 	       PKCS11_MANS='${pkcs11_man8_MANS}'
    921      1.1  christos 	       CRYPTO=pkcs11
    922      1.1  christos 	       AS_IF([$use_threads],
    923      1.1  christos 		     [:],
    924      1.1  christos 		     [AC_MSG_ERROR([PKCS11 requires threading support])])
    925      1.1  christos 	       AC_MSG_RESULT([yes])
    926      1.1  christos 	       AC_CHECK_FUNCS([getpassphrase])
    927      1.1  christos 	      ])
    928      1.1  christos AC_SUBST([PKCS11_TEST])
    929      1.1  christos AC_SUBST([PKCS11_TOOLS])
    930  1.1.1.8  christos AC_SUBST([PKCS11_MANS])
    931      1.1  christos 
    932  1.1.1.7  christos AC_SUBST([CRYPTO])
    933      1.1  christos AS_CASE([$CRYPTO],
    934      1.1  christos 	[pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])],
    935      1.1  christos 	[AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])])
    936      1.1  christos 
    937      1.1  christos # preparation for automake
    938      1.1  christos # AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"])
    939      1.1  christos 
    940      1.1  christos #
    941      1.1  christos # was --with-pkcs11 specified?
    942      1.1  christos #
    943  1.1.1.9  christos # [pairwise: skip]
    944      1.1  christos AC_ARG_WITH([pkcs11],
    945      1.1  christos 	    [AS_HELP_STRING([--with-pkcs11[=PATH]],
    946      1.1  christos 			    [Build with PKCS11 support [no|path] (PATH is for the PKCS11 provider)])],
    947      1.1  christos 	    [:], [with_pkcs11="undefined"])
    948      1.1  christos 
    949      1.1  christos AS_CASE([$with_pkcs11],
    950      1.1  christos 	[yes|auto],[AC_MSG_ERROR([--with-pkcs11 needs explicit path to the PKCS11 library])],
    951      1.1  christos 	[no|undefined],[with_pkcs11="undefined"])
    952      1.1  christos AC_DEFINE_UNQUOTED([PK11_LIB_LOCATION], ["$with_pkcs11"], [define the default PKCS11 library path])
    953      1.1  christos 
    954      1.1  christos # for PKCS11 benchmarks
    955      1.1  christos 
    956      1.1  christos have_clock_gt=no
    957      1.1  christos AC_CHECK_FUNC(clock_gettime,have_clock_gt=yes,)
    958      1.1  christos if test "no" = "$have_clock_gt"; then
    959      1.1  christos 	AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,)
    960      1.1  christos fi
    961      1.1  christos 
    962      1.1  christos if test "no" != "$have_clock_gt"; then
    963      1.1  christos 	AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.])
    964      1.1  christos fi
    965      1.1  christos 
    966      1.1  christos if test "rt" = "$have_clock_gt"; then
    967      1.1  christos 	LIBS="-lrt $LIBS"
    968      1.1  christos fi
    969      1.1  christos 
    970      1.1  christos AC_MSG_CHECKING(for GSSAPI library)
    971  1.1.1.9  christos 
    972  1.1.1.9  christos # [pairwise: --with-gssapi=yes, --with-gssapi=auto, --without-gssapi]
    973      1.1  christos AC_ARG_WITH(gssapi,
    974      1.1  christos 	    AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
    975      1.1  christos 			   [Specify path for system-supplied GSSAPI
    976  1.1.1.4  christos 				[default=auto]]),
    977  1.1.1.4  christos 	    use_gssapi="$withval", use_gssapi="auto")
    978      1.1  christos 
    979      1.1  christos # first try using krb5-config, if that does not work then fall back to "yes" method.
    980      1.1  christos 
    981      1.1  christos case "$use_gssapi" in
    982      1.1  christos */krb5-config|krb5-config)
    983      1.1  christos     AC_MSG_RESULT(trying $use_gssapi)
    984      1.1  christos     if test krb5-config = "$use_gssapi"
    985      1.1  christos     then
    986      1.1  christos 	AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
    987      1.1  christos     else
    988      1.1  christos 	KRB5_CONFIG="$use_gssapi"
    989      1.1  christos     fi
    990      1.1  christos     gssapi_cflags=`$KRB5_CONFIG --cflags gssapi`
    991      1.1  christos     gssapi_libs=`$KRB5_CONFIG --libs gssapi`
    992      1.1  christos     saved_cppflags="$CPPFLAGS"
    993      1.1  christos     CPPFLAGS="$gssapi_cflags $CPPFLAGS"
    994      1.1  christos     AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
    995      1.1  christos 	[ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
    996      1.1  christos     if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
    997      1.1  christos 	AC_MSG_RESULT([krb5-config: gssapi.h not found])
    998      1.1  christos 	CPPFLAGS="$saved_cppflags"
    999      1.1  christos 	use_gssapi="yes"
   1000      1.1  christos     else
   1001      1.1  christos 	AC_CHECK_HEADERS(krb5/krb5.h krb5.h,
   1002      1.1  christos 	    [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
   1003      1.1  christos 	if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
   1004      1.1  christos 	    AC_MSG_RESULT([krb5-config: krb5.h not found])
   1005      1.1  christos 	    CPPFLAGS="$saved_cppflags"
   1006      1.1  christos 	    use_gssapi="yes"
   1007      1.1  christos 	else
   1008      1.1  christos 	    CPPFLAGS="$saved_cppflags"
   1009      1.1  christos 	    saved_libs="$LIBS"
   1010      1.1  christos 	    LIBS=$gssapi_libs
   1011      1.1  christos 	    AC_MSG_CHECKING([krb5-config linking as $LIBS])
   1012      1.1  christos 	    AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
   1013      1.1  christos 		gssapi_linked=yes, gssapi_linked=no)
   1014      1.1  christos 	    case $gssapi_linked in
   1015      1.1  christos 		yes) AC_MSG_RESULT([krb5-config: linked]);;
   1016      1.1  christos 		no)  AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage])
   1017      1.1  christos 		    use_gssapi="yes"
   1018      1.1  christos 		    ;;
   1019      1.1  christos 	    esac
   1020      1.1  christos 	    LIBS=$saved_libs
   1021      1.1  christos 	fi
   1022      1.1  christos     fi
   1023      1.1  christos     if test "yes" = "$use_gssapi"; then
   1024      1.1  christos 	AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])
   1025      1.1  christos     fi
   1026      1.1  christos     ;;
   1027      1.1  christos esac
   1028      1.1  christos 
   1029      1.1  christos case "$host" in
   1030      1.1  christos *darwin*)
   1031  1.1.1.4  christos 	if test "yes" = "$use_gssapi" -o "auto" = "$use_gssapi"
   1032      1.1  christos 	then
   1033      1.1  christos 		use_gssapi=framework
   1034      1.1  christos 	fi
   1035      1.1  christos 	;;
   1036      1.1  christos esac
   1037      1.1  christos 
   1038      1.1  christos # gssapi is just the framework, we really require kerberos v5, so
   1039      1.1  christos # look for those headers (the gssapi headers must be there, too)
   1040      1.1  christos # The problem with this implementation is that it doesn't allow
   1041      1.1  christos # for the specification of gssapi and krb5 headers in different locations,
   1042      1.1  christos # which probably ought to be fixed although fixing might raise the issue of
   1043      1.1  christos # trying to build with incompatible versions of gssapi and krb5.
   1044  1.1.1.4  christos if test "yes" = "$use_gssapi" -o "auto" = "$use_gssapi"
   1045      1.1  christos then
   1046      1.1  christos 	# first, deal with the obvious
   1047      1.1  christos 	if test \( -f /usr/include/kerberosv5/krb5.h -o \
   1048      1.1  christos 		   -f /usr/include/krb5/krb5.h -o \
   1049      1.1  christos 		   -f /usr/include/krb5.h \)   -a \
   1050      1.1  christos 		\( -f /usr/include/gssapi.h -o \
   1051      1.1  christos 		   -f /usr/include/gssapi/gssapi.h \)
   1052      1.1  christos 	then
   1053      1.1  christos 		use_gssapi=/usr
   1054      1.1  christos 	else
   1055      1.1  christos 	    krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
   1056      1.1  christos 	    for d in $krb5dirs
   1057      1.1  christos 	    do
   1058      1.1  christos 		if test -f $d/include/gssapi/gssapi_krb5.h -o \
   1059      1.1  christos 			-f $d/include/krb5.h
   1060      1.1  christos 		then
   1061      1.1  christos 			if test -f $d/include/gssapi/gssapi.h -o \
   1062      1.1  christos 				-f $d/include/gssapi.h
   1063      1.1  christos 			then
   1064      1.1  christos 				use_gssapi=$d
   1065      1.1  christos 				break
   1066      1.1  christos 			fi
   1067      1.1  christos 		fi
   1068      1.1  christos 	    done
   1069  1.1.1.4  christos 	    if test "auto" = "$use_gssapi"
   1070  1.1.1.4  christos 	    then
   1071  1.1.1.4  christos 		use_gssapi="no"
   1072  1.1.1.4  christos 	    fi
   1073      1.1  christos 	fi
   1074      1.1  christos fi
   1075      1.1  christos 
   1076      1.1  christos case "$use_gssapi" in
   1077      1.1  christos 	no)
   1078      1.1  christos 		AC_MSG_RESULT(disabled)
   1079      1.1  christos 		USE_GSSAPI=''
   1080      1.1  christos 		;;
   1081      1.1  christos 	yes)
   1082      1.1  christos 		AC_MSG_ERROR([--with-gssapi must specify a path])
   1083      1.1  christos 		;;
   1084      1.1  christos 	*/krb5-config|krb5-config)
   1085      1.1  christos 		USE_GSSAPI='-DGSSAPI'
   1086      1.1  christos 		DST_GSSAPI_INC="$gssapi_cflags"
   1087      1.1  christos 		DNS_GSSAPI_LIBS="$gssapi_libs"
   1088      1.1  christos 		;;
   1089      1.1  christos 	framework)
   1090      1.1  christos 		USE_GSSAPI='-DGSSAPI'
   1091      1.1  christos 		ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <Kerberos/Kerberos.h>"
   1092      1.1  christos 		ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <Kerberos/Kerberos.h>"
   1093      1.1  christos 		DNS_GSSAPI_LIBS="-framework Kerberos"
   1094      1.1  christos 		AC_MSG_RESULT(framework)
   1095      1.1  christos 		;;
   1096      1.1  christos 
   1097      1.1  christos 	*)
   1098      1.1  christos 		AC_MSG_RESULT(looking in $use_gssapi/lib)
   1099      1.1  christos 		USE_GSSAPI='-DGSSAPI'
   1100      1.1  christos 		saved_cppflags="$CPPFLAGS"
   1101      1.1  christos 		CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
   1102      1.1  christos 		AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
   1103      1.1  christos 		    [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
   1104      1.1  christos 		     gssapi_hack="#include <$ac_header>"])
   1105      1.1  christos 
   1106      1.1  christos 		if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
   1107      1.1  christos 		    AC_MSG_ERROR([gssapi.h not found])
   1108      1.1  christos 		fi
   1109      1.1  christos 
   1110      1.1  christos 		AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
   1111      1.1  christos 		    [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
   1112      1.1  christos 		     gssapi_krb5_hack="#include <$ac_header>"])
   1113      1.1  christos 
   1114      1.1  christos 		AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
   1115      1.1  christos 		    [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
   1116      1.1  christos 		    krb5_hack="#include <$ac_header>"])
   1117      1.1  christos 
   1118      1.1  christos 		if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
   1119      1.1  christos 		    AC_MSG_ERROR([krb5.h not found])
   1120      1.1  christos 		fi
   1121      1.1  christos 
   1122      1.1  christos 		#
   1123      1.1  christos 		# XXXDCL This probably doesn't work right on all systems.
   1124      1.1  christos 		# It will need to be worked on as problems become evident.
   1125      1.1  christos 		#
   1126      1.1  christos 		# Essentially the problems here relate to two different
   1127      1.1  christos 		# areas.  The first area is building with either KTH
   1128      1.1  christos 		# or MIT Kerberos, particularly when both are present on
   1129      1.1  christos 		# the machine.  The other is static versus dynamic linking.
   1130      1.1  christos 		#
   1131      1.1  christos 		# On the KTH vs MIT issue, Both have libkrb5 that can mess
   1132      1.1  christos 		# up the works if one implementation ends up trying to
   1133      1.1  christos 		# use the other's krb.  This is unfortunately a situation
   1134      1.1  christos 		# that very easily arises.
   1135      1.1  christos 		#
   1136      1.1  christos 		# Dynamic linking when the dependency information is built
   1137      1.1  christos 		# into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
   1138      1.1  christos 		# all such problems go away, but when that setup is not
   1139      1.1  christos 		# present, because either the dynamic libraries lack
   1140      1.1  christos 		# dependencies or static linking is being done, then the
   1141      1.1  christos 		# problems start to show up.
   1142      1.1  christos 		saved_libs="$LIBS"
   1143      1.1  christos 		for TRY_LIBS in \
   1144      1.1  christos 		    "-lgssapi_krb5" \
   1145      1.1  christos 		    "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
   1146      1.1  christos 		    "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
   1147      1.1  christos 		    "-lgssapi" \
   1148      1.1  christos 		    "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
   1149      1.1  christos 		    "-lgssapi -lkrb5 -lcrypt -lasn1 -lroken -lcom_err" \
   1150      1.1  christos 		    "-lgssapi -lkrb5 -lgssapi_krb5 -lcrypt -lasn1 -lroken -lcom_err" \
   1151      1.1  christos 		    "-lgssapi -lkrb5 -lhx509 -lcrypt -lasn1 -lroken -lcom_err" \
   1152      1.1  christos 		    "-lgss -lkrb5"
   1153      1.1  christos 		do
   1154      1.1  christos 		    # Note that this does not include $saved_libs, because
   1155      1.1  christos 		    # on FreeBSD machines this configure script has added
   1156      1.1  christos 		    # -L/usr/local/lib to LIBS, which can make the
   1157      1.1  christos 		    # -lgssapi_krb5 test succeed with shared libraries even
   1158      1.1  christos 		    # when you are trying to build with KTH in /usr/lib.
   1159      1.1  christos 		    if test "/usr" = "$use_gssapi"
   1160      1.1  christos 		    then
   1161      1.1  christos 			    LIBS="$TRY_LIBS $ISC_OPENSSL_LIBS"
   1162      1.1  christos 		    else
   1163      1.1  christos 			    LIBS="-L$use_gssapi/lib $TRY_LIBS $ISC_OPENSSL_LIBS"
   1164      1.1  christos 		    fi
   1165      1.1  christos 		    AC_MSG_CHECKING(linking as $TRY_LIBS)
   1166      1.1  christos 		    AC_TRY_LINK([
   1167      1.1  christos #include <sys/types.h>
   1168      1.1  christos $gssapi_hack
   1169      1.1  christos $gssapi_krb5_hack
   1170      1.1  christos $krb5_hack
   1171      1.1  christos 				] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
   1172      1.1  christos #if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
   1173      1.1  christos gsskrb5_register_acceptor_identity(NULL);
   1174      1.1  christos #endif],
   1175      1.1  christos 				gssapi_linked=yes, gssapi_linked=no)
   1176      1.1  christos 		    case $gssapi_linked in
   1177      1.1  christos 		    yes) AC_MSG_RESULT(yes); break ;;
   1178      1.1  christos 		    no)  AC_MSG_RESULT(no) ;;
   1179      1.1  christos 		    esac
   1180      1.1  christos 		done
   1181      1.1  christos 
   1182      1.1  christos 		CPPFLAGS="$saved_cppflags"
   1183      1.1  christos 
   1184      1.1  christos 		case $gssapi_linked in
   1185      1.1  christos 		no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
   1186      1.1  christos 		esac
   1187      1.1  christos 
   1188      1.1  christos 		#
   1189      1.1  christos 		# XXXDCL Major kludge.  Tries to cope with KTH in /usr/lib
   1190      1.1  christos 		# but MIT in /usr/local/lib and trying to build with KTH.
   1191      1.1  christos 		# /usr/local/lib can end up earlier on the link lines.
   1192      1.1  christos 		# Like most kludges, this one is not only inelegant it
   1193      1.1  christos 		# is also likely to be the wrong thing to do at least as
   1194      1.1  christos 		# many times as it is the right thing.  Something better
   1195      1.1  christos 		# needs to be done.
   1196      1.1  christos 		#
   1197      1.1  christos 		if test "/usr" = "$use_gssapi" -a \
   1198      1.1  christos 			-f /usr/local/lib/libkrb5.a; then
   1199      1.1  christos 		    FIX_KTH_VS_MIT=yes
   1200      1.1  christos 		fi
   1201      1.1  christos 
   1202      1.1  christos 		case "$FIX_KTH_VS_MIT" in
   1203      1.1  christos 		yes)
   1204      1.1  christos 		    case "$enable_static_linking" in
   1205      1.1  christos 		    yes) gssapi_lib_suffix=".a"  ;;
   1206      1.1  christos 		    *)   gssapi_lib_suffix=".so" ;;
   1207      1.1  christos 		    esac
   1208      1.1  christos 
   1209      1.1  christos 		    for lib in $LIBS; do
   1210      1.1  christos 			case $lib in
   1211      1.1  christos 			-L*)
   1212      1.1  christos 			    ;;
   1213      1.1  christos 			-l*)
   1214      1.1  christos 			    new_lib=`echo $lib |
   1215      1.1  christos 				     sed -e s%^-l%$use_gssapi/lib/lib% \
   1216      1.1  christos 					 -e s%$%$gssapi_lib_suffix%`
   1217      1.1  christos 			    NEW_LIBS="$NEW_LIBS $new_lib"
   1218      1.1  christos 			    ;;
   1219      1.1  christos 			*)
   1220      1.1  christos 			   AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
   1221      1.1  christos 			    ;;
   1222      1.1  christos 			esac
   1223      1.1  christos 		    done
   1224      1.1  christos 		    LIBS="$NEW_LIBS"
   1225      1.1  christos 		    ;;
   1226      1.1  christos 		esac
   1227      1.1  christos 
   1228      1.1  christos 		DST_GSSAPI_INC="-I$use_gssapi/include"
   1229      1.1  christos 		DNS_GSSAPI_LIBS="$LIBS"
   1230      1.1  christos 
   1231      1.1  christos 		AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
   1232      1.1  christos 		LIBS="$saved_libs"
   1233      1.1  christos 		;;
   1234      1.1  christos esac
   1235      1.1  christos 
   1236      1.1  christos AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
   1237      1.1  christos AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
   1238      1.1  christos AC_SUBST(ISC_PLATFORM_KRB5HEADER)
   1239      1.1  christos 
   1240      1.1  christos AC_SUBST(USE_GSSAPI)
   1241      1.1  christos AC_SUBST(DST_GSSAPI_INC)
   1242      1.1  christos AC_SUBST(DNS_GSSAPI_LIBS)
   1243      1.1  christos DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS"
   1244      1.1  christos 
   1245      1.1  christos #
   1246      1.1  christos # Applications linking with libdns also need to link with these libraries.
   1247      1.1  christos #
   1248      1.1  christos 
   1249      1.1  christos AC_SUBST(DNS_CRYPTO_LIBS)
   1250      1.1  christos 
   1251      1.1  christos #
   1252      1.1  christos # was --with-lmdb specified?
   1253      1.1  christos #
   1254      1.1  christos AC_MSG_CHECKING(for lmdb library)
   1255  1.1.1.9  christos 
   1256  1.1.1.9  christos # [pairwise: --with-lmdb=auto, --with-lmdb=yes, --without-lmdb]
   1257      1.1  christos AC_ARG_WITH(lmdb,
   1258      1.1  christos 	    AS_HELP_STRING([--with-lmdb[=PATH]],
   1259      1.1  christos 			   [build with LMDB library [yes|no|path]]),
   1260      1.1  christos     use_lmdb="$withval", use_lmdb="auto")
   1261      1.1  christos 
   1262      1.1  christos have_lmdb=""
   1263      1.1  christos case "$use_lmdb" in
   1264      1.1  christos 	no)
   1265  1.1.1.8  christos 		LMDB_LIBS=""
   1266      1.1  christos 		;;
   1267      1.1  christos 	auto|yes)
   1268      1.1  christos 		for d in /usr /usr/local /opt/local
   1269      1.1  christos 		do
   1270      1.1  christos 			if test -f "${d}/include/lmdb.h"
   1271      1.1  christos 			then
   1272      1.1  christos 				if test ${d} != /usr
   1273      1.1  christos 				then
   1274  1.1.1.8  christos 					LMDB_CFLAGS="-I ${d}/include"
   1275  1.1.1.8  christos 					LMDB_LIBS="-L${d}/lib"
   1276      1.1  christos 				fi
   1277      1.1  christos 				have_lmdb="yes"
   1278      1.1  christos 			fi
   1279      1.1  christos 		done
   1280      1.1  christos 		;;
   1281      1.1  christos 	*)
   1282      1.1  christos 		if test -f "${use_lmdb}/include/lmdb.h"
   1283      1.1  christos 		then
   1284  1.1.1.8  christos 			LMDB_CFLAGS="-I${use_lmdb}/include"
   1285  1.1.1.8  christos 			LMDB_LIBS="-L${use_lmdb}/lib"
   1286      1.1  christos 			have_lmdb="yes"
   1287      1.1  christos 		else
   1288      1.1  christos 			AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
   1289      1.1  christos 		fi
   1290      1.1  christos 		;;
   1291      1.1  christos esac
   1292      1.1  christos 
   1293      1.1  christos if test "X${have_lmdb}" != "X"
   1294      1.1  christos then
   1295      1.1  christos 	AC_MSG_RESULT(yes)
   1296  1.1.1.8  christos 	AX_SAVE_FLAGS([lmdb])
   1297  1.1.1.8  christos 	CFLAGS="$CFLAGS $LMDB_CFLAGS"
   1298  1.1.1.8  christos 	LIBS="$LIBS $LMDB_LIBS"
   1299      1.1  christos 	AC_SEARCH_LIBS([mdb_env_create], [lmdb], [],
   1300      1.1  christos 		       [AC_MSG_ERROR([found lmdb include but not library.])
   1301      1.1  christos 			have_lmdb=""])
   1302  1.1.1.8  christos 	LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_create"
   1303  1.1.1.8  christos 	AX_RESTORE_FLAGS([lmdb])
   1304      1.1  christos elif test "X$use_lmdb" = Xyes
   1305      1.1  christos then
   1306      1.1  christos 	AC_MSG_ERROR([include/lmdb.h not found.])
   1307      1.1  christos else
   1308      1.1  christos 	AC_MSG_RESULT(no)
   1309      1.1  christos fi
   1310  1.1.1.8  christos AC_SUBST([LMDB_CFLAGS])
   1311  1.1.1.8  christos AC_SUBST([LMDB_LIBS])
   1312      1.1  christos 
   1313      1.1  christos NZD_TOOLS=""
   1314      1.1  christos NZDSRCS=
   1315      1.1  christos NZDTARGETS=
   1316      1.1  christos if test "X${have_lmdb}" != "X"
   1317      1.1  christos then
   1318      1.1  christos 	AC_DEFINE(HAVE_LMDB, 1, [Define if lmdb was found])
   1319      1.1  christos 	NZD_TOOLS="nzd"
   1320      1.1  christos 	NZDSRCS='${NZDSRCS}'
   1321      1.1  christos 	NZDTARGETS='${NZDTARGETS}'
   1322  1.1.1.8  christos 	NZD_MANS='${nzd_man8_MANS}'
   1323      1.1  christos fi
   1324      1.1  christos AC_SUBST(NZD_TOOLS)
   1325      1.1  christos AC_SUBST(NZDSRCS)
   1326      1.1  christos AC_SUBST(NZDTARGETS)
   1327  1.1.1.8  christos AC_SUBST(NZD_MANS)
   1328      1.1  christos 
   1329      1.1  christos #
   1330      1.1  christos # was --with-libxml2 specified?
   1331      1.1  christos #
   1332  1.1.1.9  christos # [pairwise: --with-libxml2=auto, --with-libxml2=yes, --without-libxml2]
   1333  1.1.1.7  christos AC_ARG_WITH([libxml2],
   1334  1.1.1.7  christos 	    [AS_HELP_STRING([--with-libxml2],
   1335  1.1.1.7  christos 			    [build with libxml2 library [yes|no|auto] (default is auto)])],
   1336  1.1.1.7  christos 	    [], [with_libxml2="auto"])
   1337      1.1  christos 
   1338  1.1.1.7  christos AS_CASE([$with_libxml2],
   1339  1.1.1.7  christos 	[no],[],
   1340  1.1.1.7  christos 	[auto],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
   1341  1.1.1.7  christos 				  [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])],
   1342  1.1.1.7  christos 				  [:])],
   1343  1.1.1.7  christos 	[yes],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
   1344  1.1.1.7  christos 				 [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])])],
   1345  1.1.1.7  christos 	[AC_MSG_ERROR([Specifying libxml2 installation path is not supported, adjust PKG_CONFIG_PATH instead])])
   1346      1.1  christos 
   1347      1.1  christos #
   1348  1.1.1.7  christos # DEPRECATED
   1349      1.1  christos #
   1350  1.1.1.9  christos # [pairwise: skip]
   1351  1.1.1.7  christos AC_ARG_WITH([libjson],
   1352  1.1.1.7  christos 	    [AS_HELP_STRING([--with-libjson],
   1353  1.1.1.7  christos 			    [deprecated, use --with-json-c])],
   1354  1.1.1.7  christos 	    [AC_MSG_WARN([--with-libjson is DEPRECATED and will be removed in a future release, use --with-json-c instead])],
   1355  1.1.1.7  christos 	    [with_libjson="detect"])
   1356      1.1  christos 
   1357      1.1  christos #
   1358  1.1.1.7  christos # was --with-json-c specified?
   1359      1.1  christos #
   1360  1.1.1.9  christos # [pairwise: --with-json-c=detect, --with-json-c=yes, --without-json-c]
   1361  1.1.1.7  christos AC_ARG_WITH([json-c],
   1362  1.1.1.7  christos 	    [AS_HELP_STRING([--with-json-c],
   1363  1.1.1.7  christos 			    [build with json-c library [yes|no|detect] (default is detect)])],
   1364  1.1.1.7  christos 	    [], [with_json_c="$with_libjson"])
   1365      1.1  christos 
   1366  1.1.1.7  christos AS_CASE([$with_json_c],
   1367  1.1.1.7  christos 	[no],[],
   1368  1.1.1.7  christos 	[detect],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
   1369  1.1.1.7  christos 				    [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])],
   1370  1.1.1.7  christos 				    [:])],
   1371  1.1.1.7  christos 	[yes],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
   1372  1.1.1.7  christos 				 [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])])],
   1373  1.1.1.7  christos 	[AC_MSG_ERROR([Specifying json-c installation path is not supported, adjust PKG_CONFIG_PATH instead])]
   1374  1.1.1.7  christos        )
   1375      1.1  christos 
   1376  1.1.1.7  christos AC_SUBST([JSON_C_CFLAGS])
   1377  1.1.1.7  christos AC_SUBST([JSON_C_LIBS])
   1378      1.1  christos 
   1379  1.1.1.9  christos # [pairwise: --with-zlib=auto, --with-zlib=yes, --without-zlib]
   1380  1.1.1.7  christos AC_ARG_WITH([zlib],
   1381  1.1.1.7  christos            [AS_HELP_STRING([--with-zlib],
   1382  1.1.1.7  christos                            [build with zlib for HTTP compression
   1383  1.1.1.7  christos                             [default=yes]])],
   1384  1.1.1.7  christos 	   [], with_zlib="auto")
   1385  1.1.1.7  christos 
   1386  1.1.1.7  christos AS_CASE([$with_zlib],
   1387  1.1.1.7  christos        [no],[],
   1388  1.1.1.7  christos        [auto],[PKG_CHECK_MODULES([ZLIB], [zlib],
   1389  1.1.1.7  christos                                  [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
   1390  1.1.1.7  christos                                  [:])],
   1391  1.1.1.7  christos        [yes],[PKG_CHECK_MODULES([ZLIB], [zlib],
   1392  1.1.1.7  christos                                 [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
   1393  1.1.1.7  christos        [AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])])
   1394  1.1.1.7  christos AC_SUBST([ZLIB_CFLAGS])
   1395  1.1.1.7  christos AC_SUBST([ZLIB_LIBS])
   1396      1.1  christos 
   1397      1.1  christos #
   1398      1.1  christos # In solaris 10, SMF can manage named service
   1399      1.1  christos #
   1400      1.1  christos AC_CHECK_LIB(scf, smf_enable_instance)
   1401      1.1  christos 
   1402      1.1  christos #
   1403      1.1  christos # Additional compiler settings.
   1404      1.1  christos #
   1405      1.1  christos MKDEPCC="$CC"
   1406      1.1  christos 
   1407  1.1.1.7  christos MKDEPCFLAGS="-M"
   1408  1.1.1.7  christos AS_CASE([$host],
   1409  1.1.1.7  christos 	[*-solaris*],[
   1410  1.1.1.7  christos 	    AS_IF([test "$GCC" != "yes"],
   1411  1.1.1.7  christos 		  [MKDEPCFLAGS="-xM"])])
   1412      1.1  christos 
   1413  1.1.1.7  christos AS_IF([test "$GCC" = "yes"],
   1414  1.1.1.7  christos       [STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -Wno-missing-field-initializers"]
   1415  1.1.1.7  christos       )
   1416  1.1.1.7  christos 
   1417  1.1.1.7  christos AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
   1418  1.1.1.7  christos 		      [STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"])
   1419  1.1.1.7  christos AX_CHECK_COMPILE_FLAG([-Werror -fno-delete-null-pointer-checks],
   1420  1.1.1.7  christos 		      [STC_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"])
   1421  1.1.1.7  christos AS_IF([test "$enable_warn_shadow" = "yes"],
   1422  1.1.1.7  christos       [AX_CHECK_COMPILE_FLAG([-Wshadow],
   1423  1.1.1.7  christos 			     [STD_CWARNINGS="$STD_CWARNINGS -Wshadow"])])
   1424  1.1.1.7  christos AS_IF([test "$enable_warn_error" = "yes"],
   1425  1.1.1.7  christos       [AX_CHECK_COMPILE_FLAG([-Werror],
   1426  1.1.1.7  christos 			     [STD_CWARNINGS="$STD_CWARNINGS -Werror"])])
   1427  1.1.1.7  christos 
   1428  1.1.1.7  christos AC_SUBST([MKDEPCC])
   1429  1.1.1.7  christos AC_SUBST([MKDEPCFLAGS])
   1430  1.1.1.7  christos AC_SUBST([MKDEPPROG])
   1431      1.1  christos 
   1432      1.1  christos #
   1433      1.1  christos # -lxnet buys us one big porting headache...  standards, gotta love 'em.
   1434      1.1  christos #
   1435      1.1  christos # AC_CHECK_LIB(xnet, socket, ,
   1436      1.1  christos #    AC_CHECK_LIB(socket, socket)
   1437      1.1  christos # )
   1438      1.1  christos #
   1439      1.1  christos # Use this for now, instead:
   1440      1.1  christos #
   1441      1.1  christos case "$host" in
   1442      1.1  christos 	*-linux*)
   1443      1.1  christos 		;;
   1444      1.1  christos 	*)
   1445      1.1  christos 		AC_CHECK_LIB(socket, socket)
   1446      1.1  christos 		AC_CHECK_LIB(nsl, inet_addr)
   1447      1.1  christos 		;;
   1448      1.1  christos esac
   1449      1.1  christos 
   1450      1.1  christos #
   1451      1.1  christos # Work around Solaris's select() limitations.
   1452      1.1  christos #
   1453      1.1  christos case "$host" in
   1454      1.1  christos 	*-solaris2.[[89]]|*-solaris2.1?)
   1455      1.1  christos 	AC_DEFINE(FD_SETSIZE, 65536,
   1456      1.1  christos 		  [Solaris hack to get select_large_fdset.])
   1457      1.1  christos 	;;
   1458      1.1  christos esac
   1459      1.1  christos 
   1460      1.1  christos #
   1461      1.1  christos # Purify support
   1462      1.1  christos #
   1463      1.1  christos AC_MSG_CHECKING(whether to use purify)
   1464  1.1.1.9  christos 
   1465  1.1.1.9  christos # Purify is not included in pairwise testing as that tool is not present
   1466  1.1.1.9  christos # in the relevant Docker image.
   1467  1.1.1.9  christos #
   1468  1.1.1.9  christos # [pairwise: skip]
   1469      1.1  christos AC_ARG_WITH(purify,
   1470      1.1  christos 	    AS_HELP_STRING([--with-purify[=PATH]],[use Rational purify]),
   1471      1.1  christos 	    use_purify="$withval", use_purify="no")
   1472      1.1  christos 
   1473      1.1  christos case "$use_purify" in
   1474      1.1  christos 	no)
   1475      1.1  christos 		;;
   1476      1.1  christos 	yes)
   1477      1.1  christos 		AC_PATH_PROG(purify_path, purify, purify)
   1478      1.1  christos 		;;
   1479      1.1  christos 	*)
   1480      1.1  christos 		purify_path="$use_purify"
   1481      1.1  christos 		;;
   1482      1.1  christos esac
   1483      1.1  christos 
   1484      1.1  christos case "$use_purify" in
   1485      1.1  christos 	no)
   1486      1.1  christos 		AC_MSG_RESULT(no)
   1487      1.1  christos 		PURIFY=""
   1488      1.1  christos 		;;
   1489      1.1  christos 	*)
   1490      1.1  christos 		if test -f "$purify_path" || test purify = "$purify_path"; then
   1491      1.1  christos 			AC_MSG_RESULT($purify_path)
   1492      1.1  christos 			PURIFYFLAGS="`echo $PURIFYOPTIONS`"
   1493      1.1  christos 			PURIFY="$purify_path $PURIFYFLAGS"
   1494      1.1  christos 		else
   1495      1.1  christos 			AC_MSG_ERROR([$purify_path not found.
   1496      1.1  christos 
   1497      1.1  christos Please choose the proper path with the following command:
   1498      1.1  christos 
   1499      1.1  christos     configure --with-purify=PATH
   1500      1.1  christos ])
   1501      1.1  christos 		fi
   1502      1.1  christos 		;;
   1503      1.1  christos esac
   1504      1.1  christos 
   1505      1.1  christos AC_SUBST(PURIFY)
   1506      1.1  christos 
   1507      1.1  christos #
   1508      1.1  christos # Google/Great Performance Tools CPU Profiler
   1509      1.1  christos #
   1510      1.1  christos AC_MSG_CHECKING(whether to use gperftools profiler)
   1511  1.1.1.9  christos 
   1512  1.1.1.9  christos # Google/Great Performance Tools CPU Profiler is not included in
   1513  1.1.1.9  christos # pairwise testing as that tool is not present in the relevant Docker
   1514  1.1.1.9  christos # image.
   1515  1.1.1.9  christos #
   1516  1.1.1.9  christos # [pairwise: skip]
   1517      1.1  christos AC_ARG_WITH(gperftools-profiler,
   1518      1.1  christos 	    AS_HELP_STRING([--with-gperftools-profiler],
   1519      1.1  christos 			   [use gperftools CPU profiler]),
   1520      1.1  christos 	    use_profiler="$withval", use_profiler="no")
   1521      1.1  christos 
   1522      1.1  christos case $use_profiler in
   1523      1.1  christos 	yes)
   1524      1.1  christos 		AC_MSG_RESULT(yes)
   1525      1.1  christos 		AC_DEFINE([HAVE_GPERFTOOLS_PROFILER], 1,
   1526      1.1  christos 		[Define to use gperftools CPU profiler.])
   1527      1.1  christos 		LIBS="$LIBS -lprofiler"
   1528      1.1  christos 		;;
   1529      1.1  christos 	*)
   1530      1.1  christos 		AC_MSG_RESULT(no)
   1531      1.1  christos 		;;
   1532      1.1  christos esac
   1533      1.1  christos 
   1534      1.1  christos #
   1535      1.1  christos # enable/disable dumping stack backtrace.  Also check if the system supports
   1536      1.1  christos # glibc-compatible backtrace() function.
   1537      1.1  christos #
   1538  1.1.1.9  christos # [pairwise: --enable-backtrace, --disable-backtrace]
   1539      1.1  christos AC_ARG_ENABLE([backtrace],
   1540      1.1  christos 	      [AS_HELP_STRING([--enable-backtrace],
   1541      1.1  christos 			      [log stack backtrace on abort [default=yes]])],
   1542      1.1  christos 	      [], [enable_backtrace="yes"])
   1543      1.1  christos 
   1544      1.1  christos AS_IF([test "$enable_backtrace" = "yes"],
   1545      1.1  christos       [AC_DEFINE([USE_BACKTRACE], [1], [define if we can use backtrace])
   1546      1.1  christos        AC_LINK_IFELSE(
   1547      1.1  christos 	 [AC_LANG_PROGRAM(
   1548      1.1  christos 	    [[#include <execinfo.h>]],
   1549      1.1  christos 	    [[return (backtrace((void **)0, 0));]]
   1550      1.1  christos 	  )],
   1551  1.1.1.9  christos 	 [AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])],
   1552  1.1.1.9  christos 	 [AC_LINK_IFELSE(
   1553  1.1.1.9  christos 	    [AC_LANG_PROGRAM(
   1554  1.1.1.9  christos 	       [[#include <stddef.h>]],
   1555  1.1.1.9  christos 	       [[return _Unwind_Backtrace(NULL, NULL);]]
   1556  1.1.1.9  christos 	     )],
   1557  1.1.1.9  christos 	    [AC_DEFINE([HAVE_UNWIND_BACKTRACE], [1], [define if the compiler supports _Unwind_Backtrace()])]
   1558  1.1.1.9  christos 	  )]
   1559      1.1  christos        )])
   1560      1.1  christos 
   1561  1.1.1.9  christos # [pairwise: --enable-symtable, --disable-symtable]
   1562      1.1  christos AC_ARG_ENABLE(symtable,
   1563      1.1  christos 	      AS_HELP_STRING([--enable-symtable],
   1564      1.1  christos 			     [use internal symbol table for backtrace
   1565      1.1  christos 			      [all|minimal(default)|none]]),
   1566      1.1  christos 		want_symtable="$enableval",  want_symtable="minimal")
   1567      1.1  christos case $want_symtable in
   1568      1.1  christos yes|all|minimal)     # "yes" is a hidden value equivalent to "minimal"
   1569      1.1  christos 	if test "" = "$PERL"
   1570      1.1  christos 	then
   1571      1.1  christos 		AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
   1572      1.1  christos Install perl or explicitly disable the feature by --disable-symtable.])
   1573      1.1  christos 	fi
   1574      1.1  christos 	if test "yes" = "$use_libtool"; then
   1575      1.1  christos 		AC_MSG_WARN([Internal symbol table does not work with libtool.  Disabling symbol table.])
   1576      1.1  christos 	else
   1577      1.1  christos 		# we generate the internal symbol table only for those systems
   1578      1.1  christos 		# known to work to avoid unexpected build failure.  Also, warn
   1579      1.1  christos 		# about unsupported systems when the feature is enabled
   1580      1.1  christos 		#  manually.
   1581      1.1  christos 		case $host_os in
   1582      1.1  christos 		freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
   1583      1.1  christos 			MKSYMTBL_PROGRAM="$PERL"
   1584      1.1  christos 			if test "all" = "$want_symtable"; then
   1585      1.1  christos 				ALWAYS_MAKE_SYMTABLE="yes"
   1586      1.1  christos 			fi
   1587      1.1  christos 			;;
   1588      1.1  christos 		*)
   1589      1.1  christos 			if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
   1590      1.1  christos 			then
   1591      1.1  christos 				AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
   1592      1.1  christos 			fi
   1593      1.1  christos 		esac
   1594      1.1  christos 	fi
   1595      1.1  christos 	;;
   1596      1.1  christos *)
   1597      1.1  christos 	;;
   1598      1.1  christos esac
   1599      1.1  christos AC_SUBST(MKSYMTBL_PROGRAM)
   1600      1.1  christos AC_SUBST(ALWAYS_MAKE_SYMTABLE)
   1601      1.1  christos 
   1602      1.1  christos #
   1603      1.1  christos # File name extension for static archive files, for those few places
   1604      1.1  christos # where they are treated differently from dynamic ones.
   1605      1.1  christos #
   1606      1.1  christos SA=a
   1607      1.1  christos 
   1608      1.1  christos AC_SUBST(O)
   1609      1.1  christos AC_SUBST(A)
   1610      1.1  christos AC_SUBST(SA)
   1611      1.1  christos AC_SUBST(LIBTOOL_MKDEP_SED)
   1612      1.1  christos AC_SUBST(LIBTOOL_MODE_COMPILE)
   1613      1.1  christos AC_SUBST(LIBTOOL_MODE_INSTALL)
   1614      1.1  christos AC_SUBST(LIBTOOL_MODE_LINK)
   1615      1.1  christos AC_SUBST(LIBTOOL_MODE_UNINSTALL)
   1616      1.1  christos 
   1617      1.1  christos BIND9_CO_RULE=".c.$O:"
   1618      1.1  christos AC_SUBST(BIND9_CO_RULE)
   1619      1.1  christos 
   1620      1.1  christos #
   1621      1.1  christos # Here begins a very long section to determine the system's networking
   1622      1.1  christos # capabilities.  The order of the tests is significant.
   1623      1.1  christos #
   1624      1.1  christos 
   1625      1.1  christos #
   1626      1.1  christos # We do the IPv6 compilation checking after libtool so that we can put
   1627      1.1  christos # the right suffix on the files.
   1628      1.1  christos #
   1629      1.1  christos AC_MSG_CHECKING([for IPv6 structures])
   1630      1.1  christos AC_COMPILE_IFELSE(
   1631      1.1  christos   [AC_LANG_PROGRAM(
   1632      1.1  christos      [[
   1633      1.1  christos        #include <sys/types.h>
   1634      1.1  christos        #include <sys/socket.h>
   1635      1.1  christos        #include <netinet/in.h>
   1636      1.1  christos      ]],
   1637      1.1  christos      [[
   1638      1.1  christos        struct sockaddr_in6 sin6;
   1639      1.1  christos        struct in6_addr in6;
   1640      1.1  christos        struct in6_pktinfo in6_pi;
   1641      1.1  christos        struct sockaddr_storage storage;
   1642      1.1  christos        in6 = in6addr_any;
   1643      1.1  christos        in6 = in6addr_loopback;
   1644      1.1  christos        sin6.sin6_scope_id = 0;
   1645      1.1  christos        return (0);
   1646      1.1  christos      ]])],
   1647      1.1  christos   [AC_MSG_RESULT([yes])],
   1648      1.1  christos   [AC_MSG_FAILURE([IPv6 support is mandatory])])
   1649      1.1  christos 
   1650      1.1  christos #
   1651      1.1  christos # Allow forcibly disabling TCP Fast Open support as autodetection might yield
   1652      1.1  christos # confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
   1653      1.1  christos # comment in lib/isc/unix/socket.c).
   1654      1.1  christos #
   1655  1.1.1.9  christos # [pairwise: --enable-tcp-fastopen, --disable-tcp-fastopen]
   1656      1.1  christos AC_ARG_ENABLE([tcp_fastopen],
   1657      1.1  christos 	      [AS_HELP_STRING([--disable-tcp-fastopen],
   1658      1.1  christos 			      [disable TCP Fast Open support [default=yes]])],
   1659      1.1  christos 	     [], [enable_tcp_fastopen="yes"])
   1660      1.1  christos 
   1661      1.1  christos AS_IF([test "$enable_tcp_fastopen" = "yes"],
   1662      1.1  christos       [AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])])
   1663      1.1  christos 
   1664      1.1  christos #
   1665      1.1  christos # Check for some other useful functions that are not ever-present.
   1666      1.1  christos #
   1667      1.1  christos AC_CHECK_FUNCS([strlcpy strlcat])
   1668      1.1  christos 
   1669      1.1  christos AC_SUBST(READLINE_LIB)
   1670  1.1.1.9  christos 
   1671  1.1.1.9  christos # [pairwise: --with-readline=auto, --with-readline=yes, --without-readline]
   1672      1.1  christos AC_ARG_WITH(readline,
   1673      1.1  christos 	    AS_HELP_STRING([--with-readline[=LIBSPEC]],
   1674      1.1  christos 			   [specify readline library [default auto]]),
   1675      1.1  christos 	    use_readline="$withval", use_readline="auto")
   1676      1.1  christos case "$use_readline" in
   1677      1.1  christos no)	;;
   1678      1.1  christos *)
   1679      1.1  christos 	saved_LIBS="$LIBS"
   1680      1.1  christos 	case "$use_readline" in
   1681      1.1  christos 	yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
   1682      1.1  christos 	*) try_readline="$use_readline"
   1683      1.1  christos 	esac
   1684      1.1  christos 	for readline in "$try_readline" $or_readline
   1685      1.1  christos 	do
   1686      1.1  christos 		LIBS="$readline"
   1687      1.1  christos 		AC_MSG_NOTICE(checking for readline with $readline)
   1688      1.1  christos 		AC_CHECK_FUNCS(readline)
   1689      1.1  christos 		if test "yes" = "$ac_cv_func_readline"
   1690      1.1  christos 		then
   1691      1.1  christos 			READLINE_LIB="$readline"
   1692      1.1  christos 			break
   1693      1.1  christos 		fi
   1694      1.1  christos 		for lib in -lterminfo -ltermcap -lncurses -lcurses
   1695      1.1  christos 		do
   1696      1.1  christos 			AC_MSG_NOTICE(checking for readline with $readline $lib)
   1697      1.1  christos 			unset ac_cv_func_readline
   1698      1.1  christos 			LIBS="$readline $lib"
   1699      1.1  christos 			AC_CHECK_FUNCS(readline)
   1700      1.1  christos 			if test "yes" = "$ac_cv_func_readline"
   1701      1.1  christos 			then
   1702      1.1  christos 				READLINE_LIB="$readline $lib"
   1703      1.1  christos 				break
   1704      1.1  christos 			fi
   1705      1.1  christos 		done
   1706      1.1  christos 		if test "yes" = "$ac_cv_func_readline"
   1707      1.1  christos 		then
   1708      1.1  christos 			break
   1709      1.1  christos 		fi
   1710      1.1  christos 	done
   1711      1.1  christos 	if test "auto" != "$use_readline" &&
   1712      1.1  christos 	   test "X$READLINE_LIB" = "X"
   1713      1.1  christos 	then
   1714      1.1  christos 		AC_MSG_ERROR([The readline library was not found.])
   1715      1.1  christos 	fi
   1716      1.1  christos 	LIBS="$saved_LIBS"
   1717      1.1  christos 	;;
   1718      1.1  christos esac
   1719      1.1  christos if test "yes" = "$ac_cv_func_readline"
   1720      1.1  christos then
   1721      1.1  christos 	case "$READLINE_LIB" in
   1722      1.1  christos 	*edit*)
   1723      1.1  christos 		AC_CHECK_HEADERS(editline/readline.h)
   1724      1.1  christos 		AC_CHECK_HEADERS(edit/readline/readline.h)
   1725      1.1  christos 		AC_CHECK_HEADERS(edit/readline/history.h)
   1726      1.1  christos 		;;
   1727      1.1  christos 	esac
   1728      1.1  christos 	AC_CHECK_HEADERS(readline/readline.h)
   1729      1.1  christos 	AC_CHECK_HEADERS(readline/history.h)
   1730      1.1  christos fi
   1731      1.1  christos 
   1732      1.1  christos #
   1733      1.1  christos # Use our own SPNEGO implementation?
   1734      1.1  christos #
   1735  1.1.1.9  christos # [pairwise: --enable-isc-spnego, --disable-isc-spnego]
   1736      1.1  christos AC_ARG_ENABLE(isc-spnego,
   1737      1.1  christos 	      AS_HELP_STRING([--disable-isc-spnego],
   1738      1.1  christos 			     [use SPNEGO from GSSAPI library]))
   1739      1.1  christos 
   1740      1.1  christos if test -n "$USE_GSSAPI"
   1741      1.1  christos then
   1742      1.1  christos 	case "$enable_isc_spnego" in
   1743      1.1  christos 		yes|'')
   1744      1.1  christos 			USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
   1745      1.1  christos 			DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
   1746      1.1  christos 			DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
   1747      1.1  christos 			AC_MSG_RESULT(using SPNEGO from lib/dns)
   1748      1.1  christos 			;;
   1749      1.1  christos 		no)
   1750      1.1  christos 			AC_MSG_RESULT(using SPNEGO from GSSAPI library)
   1751      1.1  christos 			;;
   1752      1.1  christos 	esac
   1753      1.1  christos fi
   1754      1.1  christos 
   1755      1.1  christos AC_SUBST(USE_ISC_SPNEGO)
   1756      1.1  christos 
   1757      1.1  christos AC_SUBST(DST_EXTRA_OBJS)
   1758      1.1  christos AC_SUBST(DST_EXTRA_SRCS)
   1759      1.1  christos 
   1760      1.1  christos #
   1761      1.1  christos # Security Stuff
   1762      1.1  christos #
   1763      1.1  christos # Note it is very recommended to *not* disable chroot(),
   1764      1.1  christos # this is only because chroot() was made obsolete by Posix.
   1765  1.1.1.9  christos #
   1766  1.1.1.9  christos # [pairwise: --enable-chroot, --disable-chroot]
   1767      1.1  christos AC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot]))
   1768      1.1  christos case "$enable_chroot" in
   1769      1.1  christos 	yes|'')
   1770      1.1  christos 		AC_CHECK_FUNCS(chroot)
   1771      1.1  christos 		;;
   1772      1.1  christos 	no)
   1773      1.1  christos 		;;
   1774      1.1  christos esac
   1775      1.1  christos 
   1776      1.1  christos LIBCAP_LIBS=""
   1777      1.1  christos AC_MSG_CHECKING([whether to enable Linux capabilities])
   1778  1.1.1.9  christos 
   1779  1.1.1.9  christos # [pairwise: --enable-linux-caps, --disable-linux-caps]
   1780      1.1  christos AC_ARG_ENABLE([linux-caps],
   1781      1.1  christos 	      [AS_HELP_STRING([--disable-linux-caps],
   1782      1.1  christos 			      [disable Linux capabilities])],
   1783      1.1  christos 	      [],
   1784      1.1  christos 	      [AS_CASE([$host],
   1785      1.1  christos 		       [*-linux*],[enable_linux_caps=yes],
   1786      1.1  christos 		       [enable_linux_caps=no])])
   1787      1.1  christos 
   1788      1.1  christos AS_IF([test "$enable_linux_caps" = "yes"],
   1789      1.1  christos       [AC_MSG_RESULT([yes])
   1790      1.1  christos        AC_CHECK_HEADERS([sys/capability.h],
   1791      1.1  christos 			[],
   1792      1.1  christos 			[AC_MSG_ERROR(m4_normalize([sys/capability.h header is required for Linux capabilities support.
   1793      1.1  christos 						    Either install libcap or use --disable-linux-caps.]))])
   1794  1.1.1.7  christos        AX_SAVE_FLAGS([cap])
   1795      1.1  christos        AC_SEARCH_LIBS([cap_set_proc], [cap],
   1796      1.1  christos 		      [LIBCAP_LIBS="$ac_cv_search_cap_set_proc"],
   1797      1.1  christos 		      [AC_MSG_ERROR(m4_normalize([libcap is required for Linux capabilities support.
   1798      1.1  christos 						  Either install libcap or use --disable-linux-caps.]))])
   1799  1.1.1.7  christos        AX_RESTORE_FLAGS([cap])],
   1800      1.1  christos       [AC_MSG_RESULT([no])])
   1801      1.1  christos AC_SUBST([LIBCAP_LIBS])
   1802      1.1  christos 
   1803      1.1  christos AC_CHECK_HEADERS(sys/un.h,
   1804      1.1  christos ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
   1805      1.1  christos ,
   1806      1.1  christos ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
   1807      1.1  christos )
   1808      1.1  christos AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
   1809      1.1  christos 
   1810      1.1  christos case "$host" in
   1811      1.1  christos *-solaris*)
   1812      1.1  christos 	AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
   1813      1.1  christos 		  [Define if connect does not honour the permission on the UNIX domain socket.])
   1814      1.1  christos 	;;
   1815      1.1  christos esac
   1816      1.1  christos 
   1817      1.1  christos #
   1818      1.1  christos # Time Zone Stuff
   1819      1.1  christos #
   1820      1.1  christos AC_CHECK_FUNCS([tzset])
   1821      1.1  christos 
   1822      1.1  christos AC_MSG_CHECKING(for optarg declaration)
   1823      1.1  christos AC_TRY_COMPILE([
   1824      1.1  christos #include <unistd.h>
   1825      1.1  christos ],
   1826      1.1  christos [optarg = 0;],
   1827      1.1  christos [AC_MSG_RESULT(yes)],
   1828      1.1  christos [AC_MSG_RESULT(no)
   1829      1.1  christos GEN_NEED_OPTARG="-DNEED_OPTARG=1"
   1830      1.1  christos AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
   1831      1.1  christos 
   1832      1.1  christos #
   1833      1.1  christos # Check for nanoseconds in file stats
   1834      1.1  christos #
   1835      1.1  christos AC_MSG_CHECKING([for st_mtim.tv_nsec])
   1836      1.1  christos AC_COMPILE_IFELSE(
   1837      1.1  christos   [AC_LANG_PROGRAM(
   1838      1.1  christos      [[#include <sys/fcntl.h>]],
   1839      1.1  christos      [[struct stat s;
   1840      1.1  christos        return(s.st_mtim.tv_nsec);
   1841      1.1  christos       ]])],
   1842      1.1  christos    [AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])])
   1843      1.1  christos 
   1844      1.1  christos #
   1845      1.1  christos # Check for if_nametoindex() for IPv6 scoped addresses support
   1846      1.1  christos #
   1847      1.1  christos AC_CHECK_FUNCS([if_nametoindex])
   1848      1.1  christos 
   1849      1.1  christos AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
   1850      1.1  christos 
   1851      1.1  christos ISC_ATOMIC_LIBS=""
   1852      1.1  christos AC_CHECK_HEADERS(
   1853      1.1  christos   [stdatomic.h],
   1854      1.1  christos   [AC_MSG_CHECKING([for memory model aware atomic operations])
   1855      1.1  christos    AC_COMPILE_IFELSE(
   1856      1.1  christos      [AC_LANG_PROGRAM(
   1857      1.1  christos 	[[#include <stdatomic.h>]],
   1858      1.1  christos 	[[atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
   1859      1.1  christos       )],
   1860      1.1  christos      [AC_MSG_RESULT([stdatomic.h])
   1861      1.1  christos       AC_MSG_CHECKING([whether -latomic is needed for 64-bit stdatomic.h functions])
   1862      1.1  christos       AC_LINK_IFELSE(
   1863      1.1  christos 	[AC_LANG_PROGRAM(
   1864      1.1  christos 	   [[#include <stdatomic.h>]],
   1865      1.1  christos 	   [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
   1866      1.1  christos 	 )],
   1867      1.1  christos 	[AC_MSG_RESULT([no])],
   1868  1.1.1.3  christos 	[ISC_ATOMIC_LIBS="-latomic"
   1869  1.1.1.7  christos 	 AX_SAVE_FLAGS([atomic])
   1870  1.1.1.3  christos 	 LIBS="$LIBS $ISC_ATOMIC_LIBS"
   1871  1.1.1.3  christos 	 AC_LINK_IFELSE(
   1872  1.1.1.3  christos 	   [AC_LANG_PROGRAM(
   1873  1.1.1.3  christos 	      [[#include <stdatomic.h>]],
   1874  1.1.1.3  christos 	      [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
   1875  1.1.1.3  christos 	    )],
   1876  1.1.1.3  christos 	   [AC_MSG_RESULT([yes])],
   1877  1.1.1.3  christos 	   [AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])])
   1878  1.1.1.7  christos 	 AX_RESTORE_FLAGS([atomic])
   1879      1.1  christos 	])
   1880      1.1  christos      ],
   1881  1.1.1.3  christos      [AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, please fix your toolchain.])]
   1882      1.1  christos    )],
   1883      1.1  christos   [AC_MSG_CHECKING([for memory model aware atomic operations])
   1884      1.1  christos    AC_COMPILE_IFELSE(
   1885      1.1  christos      [AC_LANG_PROGRAM(
   1886      1.1  christos 	[[#include <inttypes.h>]],
   1887      1.1  christos 	[[int32_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
   1888      1.1  christos       )],
   1889      1.1  christos      [AC_MSG_RESULT([__atomic builtins])
   1890      1.1  christos       AC_DEFINE([HAVE___ATOMIC], [1], [define if __atomic builtins are not available])
   1891      1.1  christos       AC_MSG_CHECKING([whether -latomic is needed for 64-bit __atomic builtins])
   1892      1.1  christos       AC_LINK_IFELSE(
   1893      1.1  christos 	[AC_LANG_PROGRAM(
   1894      1.1  christos 	   [[#include <inttypes.h>]],
   1895      1.1  christos 	   [[int64_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
   1896      1.1  christos 	 )],
   1897      1.1  christos 	[AC_MSG_RESULT([no])],
   1898  1.1.1.3  christos 	[ISC_ATOMIC_LIBS="-latomic"
   1899  1.1.1.7  christos 	 AX_SAVE_FLAGS([atomic])
   1900  1.1.1.3  christos 	 LIBS="$LIBS $ISC_ATOMIC_LIBS"
   1901  1.1.1.3  christos 	 AC_LINK_IFELSE(
   1902  1.1.1.3  christos 	   [AC_LANG_PROGRAM(
   1903  1.1.1.3  christos 	      [[#include <inttypes.h>]],
   1904  1.1.1.3  christos 	      [[int64_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
   1905  1.1.1.3  christos 	    )],
   1906  1.1.1.3  christos 	   [AC_MSG_RESULT([yes])],
   1907  1.1.1.3  christos 	   [AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])])
   1908  1.1.1.7  christos 	 AX_RESTORE_FLAGS([atomic])
   1909      1.1  christos 	])
   1910      1.1  christos      ],
   1911      1.1  christos      [AC_MSG_RESULT([__sync builtins])
   1912      1.1  christos      ])
   1913      1.1  christos   ])
   1914      1.1  christos LIBS="$LIBS $ISC_ATOMIC_LIBS"
   1915      1.1  christos 
   1916  1.1.1.7  christos AC_CHECK_HEADERS([stdalign.h])
   1917  1.1.1.7  christos 
   1918      1.1  christos AC_CHECK_HEADERS([uchar.h])
   1919      1.1  christos 
   1920      1.1  christos #
   1921      1.1  christos # Check for __builtin_unreachable
   1922      1.1  christos #
   1923      1.1  christos AC_MSG_CHECKING([compiler support for __builtin_unreachable()])
   1924      1.1  christos AC_LINK_IFELSE(
   1925      1.1  christos   [AC_LANG_PROGRAM(
   1926      1.1  christos      [[]],
   1927      1.1  christos      [[__builtin_unreachable();]]
   1928      1.1  christos    )],
   1929      1.1  christos   [AC_MSG_RESULT([yes])
   1930      1.1  christos    AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().])
   1931      1.1  christos   ],
   1932      1.1  christos   [AC_MSG_RESULT([no])
   1933      1.1  christos   ])
   1934      1.1  christos 
   1935      1.1  christos #
   1936      1.1  christos # Check for __builtin_expect
   1937      1.1  christos #
   1938      1.1  christos AC_MSG_CHECKING([compiler support for __builtin_expect])
   1939      1.1  christos AC_TRY_LINK(, [
   1940      1.1  christos 	return (__builtin_expect(1, 1) ? 1 : 0);
   1941      1.1  christos ], [
   1942      1.1  christos 	have_builtin_expect=yes
   1943      1.1  christos 	AC_MSG_RESULT(yes)
   1944      1.1  christos ], [
   1945      1.1  christos 	have_builtin_expect=no
   1946      1.1  christos 	AC_MSG_RESULT(no)
   1947      1.1  christos ])
   1948      1.1  christos if test "yes" = "$have_builtin_expect"; then
   1949      1.1  christos 	AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
   1950      1.1  christos fi
   1951      1.1  christos 
   1952      1.1  christos #
   1953      1.1  christos # Check for __builtin_clz
   1954      1.1  christos #
   1955      1.1  christos AC_MSG_CHECKING([compiler support for __builtin_clz])
   1956      1.1  christos AC_TRY_LINK(, [
   1957      1.1  christos 	return (__builtin_clz(0xff) == 24 ? 1 : 0);
   1958      1.1  christos ], [
   1959      1.1  christos 	have_builtin_clz=yes
   1960      1.1  christos 	AC_MSG_RESULT(yes)
   1961      1.1  christos ], [
   1962      1.1  christos 	have_builtin_clz=no
   1963      1.1  christos 	AC_MSG_RESULT(no)
   1964      1.1  christos ])
   1965      1.1  christos if test "yes" = "$have_builtin_clz"; then
   1966      1.1  christos 	AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
   1967      1.1  christos fi
   1968      1.1  christos 
   1969      1.1  christos #
   1970      1.1  christos # Activate "rrset-order fixed" or not?
   1971      1.1  christos #
   1972  1.1.1.9  christos # [pairwise: --enable-fixed-rrset, --disable-fixed-rrset]
   1973      1.1  christos AC_ARG_ENABLE(fixed-rrset,
   1974      1.1  christos 	      AS_HELP_STRING([--enable-fixed-rrset],
   1975      1.1  christos 			     [enable fixed rrset ordering [default=no]]),
   1976      1.1  christos 	      enable_fixed="$enableval", enable_fixed="no")
   1977      1.1  christos case "$enable_fixed" in
   1978      1.1  christos 	yes)
   1979      1.1  christos 		AC_DEFINE(DNS_RDATASET_FIXED, 1,
   1980      1.1  christos 			  [Define to enable "rrset-order fixed" syntax.])
   1981      1.1  christos 		;;
   1982      1.1  christos 	no)
   1983      1.1  christos 		;;
   1984      1.1  christos 	*)
   1985      1.1  christos 		;;
   1986      1.1  christos esac
   1987      1.1  christos 
   1988      1.1  christos #
   1989      1.1  christos # Activate dnstap?
   1990      1.1  christos #
   1991  1.1.1.9  christos # [pairwise: --enable-dnstap, --disable-dnstap]
   1992      1.1  christos AC_ARG_ENABLE(dnstap,
   1993      1.1  christos 	      AS_HELP_STRING([--enable-dnstap],
   1994      1.1  christos 			     [enable dnstap support
   1995      1.1  christos 				(requires fstrm, protobuf-c)]),
   1996      1.1  christos 	      use_dnstap=$enableval, use_dnstap=no)
   1997      1.1  christos 
   1998      1.1  christos DNSTAP=
   1999      1.1  christos DNSTAPSRCS=
   2000      1.1  christos DNSTAPOBJS=
   2001      1.1  christos DNSTAPTARGETS=
   2002      1.1  christos if test "x$use_dnstap" != "xno"; then
   2003  1.1.1.9  christos 
   2004  1.1.1.9  christos 	# [pairwise: skip]
   2005      1.1  christos 	AC_ARG_WITH([protobuf-c],
   2006      1.1  christos 		    AS_HELP_STRING([--with-protobuf-c=path],
   2007      1.1  christos 				   [Path where protobuf-c is installed, for dnstap]), [
   2008      1.1  christos 	    # workaround for protobuf-c includes at old dir
   2009      1.1  christos 	    # before protobuf-c-1.0.0
   2010      1.1  christos 	    if test -f $withval/include/google/protobuf-c/protobuf-c.h
   2011      1.1  christos 	    then
   2012  1.1.1.8  christos 		PROTOBUF_C_CFLAGS="-I$withval/include/google"
   2013      1.1  christos 	    else
   2014  1.1.1.8  christos 		PROTOBUF_C_CFLAGS="-I$withval/include"
   2015      1.1  christos 	    fi
   2016  1.1.1.8  christos 	    PROTOBUF_C_LIBS="-L$withval/lib"
   2017      1.1  christos 	    AC_PATH_PROG([PROTOC_C], [protoc-c], [],
   2018      1.1  christos 			 [$PATH$PATH_SEPARATOR$withval/bin])
   2019      1.1  christos 	], [
   2020      1.1  christos 	    # workaround for protobuf-c includes at old dir
   2021      1.1  christos 	    # before protobuf-c-1.0.0
   2022      1.1  christos 	    if test -f /usr/include/google/protobuf-c/protobuf-c.h
   2023      1.1  christos 	    then
   2024  1.1.1.8  christos 		PROTOBUF_C_CFLAGS="-I/usr/include/google"
   2025      1.1  christos 	    else
   2026      1.1  christos 		if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
   2027      1.1  christos 		then
   2028  1.1.1.8  christos 		    PROTOBUF_C_CFLAGS="-I/usr/local/include/google"
   2029  1.1.1.8  christos 		    PROTOBUF_C_LIBS="-L/usr/local/lib"
   2030  1.1.1.8  christos 		elif test -f /opt/local/include/google/protobuf-c/protobuf-c.h
   2031  1.1.1.8  christos 		then
   2032  1.1.1.8  christos 		    PROTOBUF_C_CFLAGS="-I/opt/local/include/google"
   2033  1.1.1.8  christos 		    PROTOBUF_C_LIBS="-L/opt/local/lib"
   2034      1.1  christos 		fi
   2035      1.1  christos 	    fi
   2036      1.1  christos 	    AC_PATH_PROG([PROTOC_C],[protoc-c])
   2037      1.1  christos 	])
   2038      1.1  christos 	if test -z "$PROTOC_C"; then
   2039      1.1  christos 		AC_MSG_ERROR([The protoc-c program was not found.])
   2040      1.1  christos 	fi
   2041  1.1.1.9  christos 
   2042  1.1.1.9  christos 	# [pairwise: skip]
   2043      1.1  christos 	AC_ARG_WITH([libfstrm], AS_HELP_STRING([--with-libfstrm=path],
   2044      1.1  christos 		    [Path where libfstrm is installed, for dnstap]), [
   2045  1.1.1.8  christos 	    FSTRM_CFLAGS="-I$withval/include"
   2046  1.1.1.8  christos 	    FSTRM_LIBS="-L$withval/lib"
   2047      1.1  christos 	    AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture], [], [$PATH$PATH_SEPARATOR$withval/bin])
   2048      1.1  christos 	],[
   2049  1.1.1.8  christos 	    for d in /usr /usr/local /opt/local
   2050  1.1.1.8  christos 	    do
   2051  1.1.1.8  christos 		if test -f "${d}/include/fstrm.h"
   2052  1.1.1.8  christos 		then
   2053  1.1.1.8  christos 		    if test ${d} != /usr
   2054  1.1.1.8  christos 		    then
   2055  1.1.1.8  christos 			FSTRM_CFLAGS="-I${d}/include"
   2056  1.1.1.8  christos 			FSTRM_LIBS="-L${d}/lib"
   2057  1.1.1.8  christos 		    fi
   2058  1.1.1.8  christos 		    have_fstrm="$d"
   2059  1.1.1.8  christos 		    break
   2060  1.1.1.8  christos 		fi
   2061  1.1.1.8  christos 	    done
   2062  1.1.1.8  christos 	    if test -z "$have_fstrm"; then
   2063  1.1.1.8  christos 		AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
   2064  1.1.1.8  christos 	    else
   2065  1.1.1.8  christos 		AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture], [], [$PATH$PATH_SEPARATOR$have_fstrm/bin])
   2066  1.1.1.8  christos 	    fi
   2067      1.1  christos 	])
   2068  1.1.1.8  christos 	AX_SAVE_FLAGS([dnstap])
   2069  1.1.1.8  christos 	CFLAGS="$CFLAGS $PROTOBUF_C_CFLAGS $FSTRM_CFLAGS"
   2070  1.1.1.8  christos 	LIBS="$LDFLAGS $PROTOBUF_C_LIBS $FSTRM_LIBS"
   2071      1.1  christos 
   2072      1.1  christos 	AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
   2073      1.1  christos 		       AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
   2074  1.1.1.8  christos 	FSTRM_LIBS="$FSTRM_LIBS $ac_cv_search_fstrm_iothr_init"
   2075  1.1.1.8  christos 
   2076      1.1  christos 	AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
   2077      1.1  christos 		       AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
   2078  1.1.1.8  christos 	PROTOBUF_C_LIBS="$PROTOBUF_C_LIBS $ac_cv_search_protobuf_c_message_pack"
   2079      1.1  christos 
   2080  1.1.1.8  christos 	AX_RESTORE_FLAGS([dnstap])
   2081      1.1  christos 	AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
   2082      1.1  christos 	DNSTAP=dnstap
   2083      1.1  christos 	DNSTAPSRCS='${DNSTAPSRCS}'
   2084      1.1  christos 	DNSTAPOBJS='${DNSTAPOBJS}'
   2085      1.1  christos 	DNSTAPTARGETS='${DNSTAPTARGETS}'
   2086  1.1.1.8  christos 	DNSTAP_MANS='${dnstap_man1_MANS}'
   2087      1.1  christos fi
   2088      1.1  christos AC_SUBST(DNSTAP)
   2089      1.1  christos AC_SUBST(DNSTAPSRCS)
   2090      1.1  christos AC_SUBST(DNSTAPOBJS)
   2091      1.1  christos AC_SUBST(DNSTAPTARGETS)
   2092  1.1.1.8  christos AC_SUBST(DNSTAP_MANS)
   2093  1.1.1.8  christos AC_SUBST([PROTOBUF_C_CFLAGS])
   2094  1.1.1.8  christos AC_SUBST([PROTOBUF_C_LIBS])
   2095  1.1.1.8  christos AC_SUBST([FSTRM_CFLAGS])
   2096  1.1.1.8  christos AC_SUBST([FSTRM_LIBS])
   2097      1.1  christos 
   2098      1.1  christos #
   2099      1.1  christos #  The following sets up how non-blocking i/o is established.
   2100      1.1  christos #  cygwin and solaris 2.x (x<5) require special handling.
   2101      1.1  christos #
   2102      1.1  christos case "$host" in
   2103      1.1  christos *-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
   2104      1.1  christos *-solaris2.[[01234]])
   2105      1.1  christos 	AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
   2106      1.1  christos 	AC_DEFINE(USE_FIONBIO_IOCTL, 1,
   2107      1.1  christos 		  [Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
   2108      1.1  christos 	;;
   2109      1.1  christos *) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
   2110      1.1  christos 	     [Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
   2111      1.1  christos 	;;
   2112      1.1  christos esac
   2113      1.1  christos #
   2114      1.1  christos # Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
   2115      1.1  christos # This prevents the source address being set.
   2116      1.1  christos #
   2117      1.1  christos case "$host" in
   2118      1.1  christos *-solaris2.[[012345]]|*-solaris2.5.1)
   2119      1.1  christos 	AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
   2120      1.1  christos 		  [Define if you cannot bind() before connect() for TCP sockets.])
   2121      1.1  christos 	;;
   2122      1.1  christos esac
   2123      1.1  christos #
   2124      1.1  christos # The following sections deal with tools used for formatting
   2125      1.1  christos # the documentation.  They are all optional, unless you are
   2126      1.1  christos # a developer editing the documentation source.
   2127      1.1  christos #
   2128      1.1  christos 
   2129      1.1  christos #
   2130  1.1.1.8  christos # The following sections deal with tools used for formatting
   2131  1.1.1.8  christos # the documentation.  They are all optional, unless you are
   2132  1.1.1.8  christos # a developer editing the documentation source.
   2133      1.1  christos #
   2134      1.1  christos 
   2135      1.1  christos #
   2136  1.1.1.8  christos # Look for sphinx-build
   2137      1.1  christos #
   2138  1.1.1.8  christos AC_ARG_VAR([SPHINX_BUILD], [path to sphinx-build binary used to build the documentation])
   2139  1.1.1.8  christos AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], [:])
   2140  1.1.1.8  christos AM_CONDITIONAL([HAVE_SPHINX_BUILD], [test "$SPHINX_BUILD" != ":"])
   2141  1.1.1.8  christos 
   2142  1.1.1.8  christos AC_PATH_PROG([XELATEX], [xelatex], [:])
   2143  1.1.1.8  christos AC_PATH_PROG([LATEXMK], [latexmk], [:])
   2144  1.1.1.8  christos AM_CONDITIONAL([HAVE_XELATEX], [test "$XELATEX" != ":" && test "$LATEXMK" != ":"])
   2145  1.1.1.8  christos 
   2146  1.1.1.8  christos #
   2147  1.1.1.8  christos # Pull release date from CHANGES file last modification date
   2148  1.1.1.8  christos # for reproducible builds
   2149  1.1.1.8  christos #
   2150  1.1.1.8  christos release_date=`date -r CHANGES +%Y-%m-%d`
   2151  1.1.1.8  christos AC_SUBST([RELEASE_DATE], $release_date)
   2152  1.1.1.8  christos 
   2153  1.1.1.8  christos # Don't build the documentation if the sphinx-build is not present
   2154  1.1.1.8  christos PDFTARGET=
   2155  1.1.1.8  christos HTMLTARGET=
   2156  1.1.1.8  christos MANSRCS=
   2157  1.1.1.8  christos AS_IF([test -n "$SPHINX_BUILD"],[
   2158  1.1.1.8  christos 	  MANSRCS='$(MANPAGES_IN)'
   2159  1.1.1.8  christos 	  HTMLTARGET='html dirhtml'
   2160  1.1.1.8  christos 	  AC_PATH_PROGS([PDFLATEX], [pdflatex], [])
   2161  1.1.1.8  christos 	  AC_PATH_PROGS([LATEXMK], [latexmk], [])
   2162  1.1.1.8  christos 	  AS_IF([test -n "$PDFLATEX" && test -n "$LATEXMK"],[
   2163  1.1.1.8  christos 		    PDFTARGET='pdf'
   2164  1.1.1.8  christos 		])
   2165  1.1.1.8  christos       ])
   2166  1.1.1.8  christos AC_SUBST([HTMLTARGET])
   2167  1.1.1.8  christos AC_SUBST([PDFTARGET])
   2168  1.1.1.8  christos AC_SUBST([MANSRCS])
   2169      1.1  christos 
   2170      1.1  christos #
   2171      1.1  christos # Look for Doxygen
   2172      1.1  christos #
   2173  1.1.1.8  christos AC_PATH_PROGS([DOXYGEN], [doxygen])
   2174      1.1  christos AC_SUBST(DOXYGEN)
   2175      1.1  christos 
   2176      1.1  christos #
   2177      1.1  christos # Look for curl
   2178      1.1  christos #
   2179      1.1  christos 
   2180      1.1  christos AC_PATH_PROG(CURL, curl, curl)
   2181      1.1  christos AC_SUBST(CURL)
   2182      1.1  christos 
   2183      1.1  christos #
   2184      1.1  christos # IDN support using libidn2
   2185      1.1  christos #
   2186      1.1  christos 
   2187      1.1  christos LIBIDN2_CFLAGS=
   2188      1.1  christos LIBIDN2_LDFLAGS=
   2189      1.1  christos LIBIDN2_LIBS=
   2190  1.1.1.9  christos 
   2191  1.1.1.9  christos # [pairwise: --with-libidn2=yes, --without-libidn2]
   2192      1.1  christos AC_ARG_WITH([libidn2],
   2193      1.1  christos 	    [AS_HELP_STRING([--with-libidn2[=PATH]], [enable IDN support using GNU libidn2 [yes|no(default)|path]])],
   2194      1.1  christos 	    [with_libidn2="$withval"], [with_libidn2="no"])
   2195      1.1  christos AS_CASE([$with_libidn2],
   2196      1.1  christos 	[yes],	[PKG_CHECK_MODULES([LIBIDN2], [libidn2],
   2197      1.1  christos 				   [AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])])],
   2198      1.1  christos 	[no],	[],
   2199  1.1.1.7  christos 	[*],	[AX_SAVE_FLAGS([libidn2])
   2200      1.1  christos 		 LIBIDN2_CFLAGS="-I$with_libidn2/include"
   2201      1.1  christos 		 LIBIDN2_LDFLAGS="-L$with_libidn2/lib"
   2202      1.1  christos 		 CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
   2203      1.1  christos 		 CPPFLAGS="$LIBIDN2_CFLAGS $CPPFLAGS"
   2204      1.1  christos 		 LDFLAGS="$LIBIDN2_LDFLAGS $LDFLAGS"
   2205      1.1  christos 		 AC_CHECK_HEADERS([idn2.h],
   2206      1.1  christos 				  [],
   2207      1.1  christos 				  [AC_MSG_ERROR([idn2.h not found])])
   2208      1.1  christos 		 AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
   2209      1.1  christos 				[LIBIDN2_LIBS="$ac_cv_search_idn2_to_ascii_lz"
   2210      1.1  christos 				 AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])],
   2211      1.1  christos 				[AC_MSG_ERROR([libidn2 requested, but not found])])
   2212  1.1.1.7  christos 		AX_RESTORE_FLAGS([libidn2])])
   2213      1.1  christos AC_SUBST([LIBIDN2_CFLAGS])
   2214      1.1  christos AC_SUBST([LIBIDN2_LDFLAGS])
   2215      1.1  christos AC_SUBST([LIBIDN2_LIBS])
   2216      1.1  christos 
   2217      1.1  christos #
   2218      1.1  christos # Check whether to build with cmocka unit testing framework
   2219      1.1  christos #
   2220  1.1.1.9  christos # [pairwise: --with-cmocka=detect, --with-cmocka=yes, --without-cmocka]
   2221      1.1  christos AC_ARG_WITH([cmocka],
   2222  1.1.1.2  christos 	    [AS_HELP_STRING([--with-cmocka=detect],[enable CMocka based tests (default is detect)])],
   2223  1.1.1.2  christos 	    [],[with_cmocka=detect])
   2224      1.1  christos 
   2225      1.1  christos AS_CASE([$with_cmocka],
   2226  1.1.1.2  christos 	[no],[],
   2227  1.1.1.2  christos 	[detect],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.0.0],
   2228  1.1.1.8  christos 				    [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])],
   2229  1.1.1.8  christos 				    [with_cmocka=no])],
   2230  1.1.1.2  christos 	[yes],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.0.0],
   2231  1.1.1.8  christos 				 [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])])],
   2232  1.1.1.2  christos 	[AC_MSG_ERROR([Use PKG_CONFIG_PATH to specify path to CMocka library])]
   2233  1.1.1.2  christos        )
   2234      1.1  christos AC_SUBST([CMOCKA_CFLAGS])
   2235      1.1  christos AC_SUBST([CMOCKA_LIBS])
   2236      1.1  christos 
   2237      1.1  christos #
   2238      1.1  christos # Check for kyua execution engine if CMocka was requested
   2239      1.1  christos # and bail out if execution engine was not found
   2240      1.1  christos #
   2241      1.1  christos AC_ARG_VAR([KYUA], [path to kyua execution engine])
   2242      1.1  christos AS_IF([test "$with_cmocka" != "no"],
   2243      1.1  christos       [AC_PATH_PROGS([KYUA], [kyua], [])
   2244      1.1  christos        AS_IF([test -z "$KYUA"],
   2245  1.1.1.8  christos              [AC_MSG_WARN([kyua test execution engine not found])],
   2246  1.1.1.8  christos              [UNITTESTS=tests])])
   2247      1.1  christos AC_SUBST([KYUA])
   2248  1.1.1.8  christos AC_SUBST([UNITTESTS])
   2249      1.1  christos 
   2250      1.1  christos #
   2251  1.1.1.7  christos # Check for -Wl,--wrap= support
   2252  1.1.1.7  christos #
   2253  1.1.1.7  christos 
   2254  1.1.1.7  christos LD_WRAP_TESTS=false
   2255  1.1.1.7  christos AC_MSG_CHECKING([for linker support for --wrap option])
   2256  1.1.1.7  christos AX_SAVE_FLAGS([wrap])
   2257  1.1.1.9  christos LDFLAGS="-Wl,--wrap,exit"
   2258  1.1.1.7  christos AC_LINK_IFELSE(
   2259  1.1.1.7  christos     [AC_LANG_PROGRAM([[#include <stdlib.h>
   2260  1.1.1.7  christos 		       void __real_exit (int status);
   2261  1.1.1.9  christos 		       void __wrap_exit (int status) { __real_exit (0); }
   2262  1.1.1.7  christos 		      ]],
   2263  1.1.1.7  christos 		     [[exit (1);]])],
   2264  1.1.1.7  christos     [LD_WRAP_TESTS=true
   2265  1.1.1.7  christos      AC_DEFINE([LD_WRAP], [1], [define if the linker supports --wrap option])
   2266  1.1.1.7  christos      AC_MSG_RESULT([yes])],
   2267  1.1.1.7  christos     [AC_MSG_RESULT([no])])
   2268  1.1.1.7  christos AX_RESTORE_FLAGS([wrap])
   2269  1.1.1.7  christos 
   2270  1.1.1.7  christos AC_SUBST([LD_WRAP_TESTS])
   2271  1.1.1.7  christos 
   2272  1.1.1.7  christos #
   2273      1.1  christos # Check for i18n
   2274      1.1  christos #
   2275      1.1  christos AC_CHECK_HEADERS(locale.h)
   2276      1.1  christos AC_CHECK_FUNCS(setlocale)
   2277      1.1  christos 
   2278      1.1  christos #
   2279      1.1  christos # was --with-tuning specified?
   2280      1.1  christos #
   2281  1.1.1.9  christos # [pairwise: --with-tuning=small, --without-tuning]
   2282  1.1.1.7  christos AC_ARG_WITH([tuning],
   2283      1.1  christos 	    AS_HELP_STRING([--with-tuning=ARG],
   2284  1.1.1.7  christos 			   [Specify server tuning (default or small)]),
   2285  1.1.1.7  christos 	    [],[with_tuning=no])
   2286      1.1  christos 
   2287  1.1.1.7  christos AS_CASE([$with_tuning],
   2288  1.1.1.7  christos 	[small],[AC_MSG_NOTICE(using small system tuning)],
   2289  1.1.1.7  christos 	[AC_DEFINE(TUNE_LARGE, 1, [Define to use default system tuning.])
   2290  1.1.1.7  christos 	 AC_MSG_NOTICE(using default system tuning)])
   2291      1.1  christos 
   2292      1.1  christos #
   2293      1.1  christos # was --enable-querytrace specified?
   2294      1.1  christos #
   2295  1.1.1.9  christos # [pairwise: --enable-querytrace, --disable-querytrace]
   2296      1.1  christos AC_ARG_ENABLE(querytrace,
   2297      1.1  christos 	      AS_HELP_STRING([--enable-querytrace],
   2298      1.1  christos 			     [enable very verbose query trace logging
   2299      1.1  christos 				[default=no]]),
   2300      1.1  christos 	      want_querytrace="$enableval", want_querytrace="no")
   2301      1.1  christos 
   2302      1.1  christos AC_MSG_CHECKING([whether to enable query trace logging])
   2303      1.1  christos case "$want_querytrace" in
   2304      1.1  christos yes)
   2305      1.1  christos 	AC_MSG_RESULT(yes)
   2306      1.1  christos 	AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
   2307      1.1  christos 	;;
   2308      1.1  christos no)
   2309      1.1  christos 	AC_MSG_RESULT(no)
   2310      1.1  christos 	;;
   2311      1.1  christos *)
   2312      1.1  christos 	AC_MSG_ERROR("--enable-querytrace requires yes or no")
   2313      1.1  christos 	;;
   2314      1.1  christos esac
   2315      1.1  christos 
   2316      1.1  christos #
   2317      1.1  christos # Was --disable-auto-validation specified?
   2318      1.1  christos #
   2319  1.1.1.9  christos 
   2320      1.1  christos validation_default=auto
   2321  1.1.1.9  christos 
   2322  1.1.1.9  christos # [pairwise: --enable-auto-validation, --disable-auto-validation]
   2323      1.1  christos AC_ARG_ENABLE(auto-validation,
   2324      1.1  christos 	      AS_HELP_STRING([--enable-auto-validation],
   2325      1.1  christos 			     [turn on DNSSEC validation by default, using the IANA root key [default=yes]]),
   2326      1.1  christos 	      [:],[enable_auto_validation=yes])
   2327      1.1  christos AS_IF([test "$enable_auto_validation" = "no"],[validation_default=yes])
   2328      1.1  christos AC_DEFINE_UNQUOTED([VALIDATION_DEFAULT], ["$validation_default"], [the default value of dnssec-validation option])
   2329      1.1  christos 
   2330      1.1  christos #
   2331      1.1  christos # Substitutions
   2332      1.1  christos #
   2333      1.1  christos AC_SUBST(BIND9_TOP_BUILDDIR)
   2334      1.1  christos BIND9_TOP_BUILDDIR=`pwd`
   2335      1.1  christos 
   2336      1.1  christos AC_SUBST(BIND9_ISC_BUILDINCLUDE)
   2337      1.1  christos AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
   2338      1.1  christos AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
   2339      1.1  christos AC_SUBST(BIND9_DNS_BUILDINCLUDE)
   2340      1.1  christos AC_SUBST(BIND9_NS_BUILDINCLUDE)
   2341      1.1  christos AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
   2342      1.1  christos AC_SUBST(BIND9_IRS_BUILDINCLUDE)
   2343      1.1  christos if test "X$srcdir" != "X"; then
   2344      1.1  christos 	BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
   2345      1.1  christos 	BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
   2346      1.1  christos 	BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
   2347      1.1  christos 	BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
   2348      1.1  christos 	BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include"
   2349      1.1  christos 	BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
   2350      1.1  christos 	BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include"
   2351      1.1  christos else
   2352      1.1  christos 	BIND9_ISC_BUILDINCLUDE=""
   2353      1.1  christos 	BIND9_ISCCC_BUILDINCLUDE=""
   2354      1.1  christos 	BIND9_ISCCFG_BUILDINCLUDE=""
   2355      1.1  christos 	BIND9_DNS_BUILDINCLUDE=""
   2356      1.1  christos 	BIND9_NS_BUILDINCLUDE=""
   2357      1.1  christos 	BIND9_BIND9_BUILDINCLUDE=""
   2358      1.1  christos 	BIND9_IRS_BUILDINCLUDE=""
   2359      1.1  christos fi
   2360      1.1  christos 
   2361      1.1  christos AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
   2362      1.1  christos BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
   2363      1.1  christos 
   2364      1.1  christos AC_SUBST_FILE(BIND9_MAKE_RULES)
   2365      1.1  christos BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
   2366      1.1  christos 
   2367      1.1  christos . "$srcdir/version"
   2368      1.1  christos BIND9_PRODUCT="PRODUCT=\"${PRODUCT}\""
   2369      1.1  christos AC_SUBST(BIND9_PRODUCT)
   2370      1.1  christos BIND9_DESCRIPTION="DESCRIPTION=\"${DESCRIPTION}\""
   2371      1.1  christos AC_SUBST(BIND9_DESCRIPTION)
   2372      1.1  christos BIND9_VERSION="${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
   2373      1.1  christos AC_SUBST(BIND9_VERSION)
   2374      1.1  christos BIND9_MAJOR="MAJOR=${MAJORVER}.${MINORVER}"
   2375      1.1  christos AC_SUBST(BIND9_MAJOR)
   2376      1.1  christos BIND9_VERSIONSTRING="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}${DESCRIPTION:+ }${DESCRIPTION}"
   2377      1.1  christos AC_SUBST(BIND9_VERSIONSTRING)
   2378      1.1  christos 
   2379      1.1  christos BIND9_SRCID="SRCID=unset_id"
   2380      1.1  christos if test -f "${srcdir}/srcid"; then
   2381      1.1  christos 	. "${srcdir}/srcid"
   2382      1.1  christos 	BIND9_SRCID="SRCID=$SRCID"
   2383      1.1  christos elif test -d "${srcdir}/.git"; then
   2384      1.1  christos 	BIND9_SRCID="SRCID="`(cd "${srcdir}";git rev-parse --short HEAD)`
   2385      1.1  christos fi
   2386      1.1  christos 
   2387      1.1  christos AC_SUBST(BIND9_SRCID)
   2388      1.1  christos 
   2389      1.1  christos if test -z "$ac_configure_args"; then
   2390      1.1  christos 	BIND9_CONFIGARGS="defaults"
   2391      1.1  christos else
   2392      1.1  christos 	for a in $ac_configure_args
   2393      1.1  christos 	do
   2394      1.1  christos 		BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
   2395      1.1  christos 	done
   2396      1.1  christos fi
   2397      1.1  christos BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
   2398      1.1  christos BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
   2399      1.1  christos AC_SUBST(BIND9_CONFIGARGS)
   2400      1.1  christos 
   2401      1.1  christos AC_SUBST_FILE(LIBDNS_MAPAPI)
   2402      1.1  christos LIBDNS_MAPAPI="$srcdir/lib/dns/mapapi"
   2403      1.1  christos 
   2404      1.1  christos #
   2405      1.1  christos # Configure any DLZ drivers.
   2406      1.1  christos #
   2407      1.1  christos # If config.dlz.in selects one or more DLZ drivers, it will set
   2408      1.1  christos # CONTRIB_DLZ to a non-empty value, which will be our clue to
   2409      1.1  christos # build DLZ drivers in contrib.
   2410      1.1  christos #
   2411      1.1  christos # This section has to come after the libtool stuff because it needs to
   2412      1.1  christos # know how to name the driver object files.
   2413      1.1  christos #
   2414      1.1  christos 
   2415      1.1  christos CONTRIB_DLZ=""
   2416      1.1  christos DLZ_DRIVER_INCLUDES=""
   2417      1.1  christos DLZ_DRIVER_LIBS=""
   2418      1.1  christos DLZ_DRIVER_SRCS=""
   2419      1.1  christos DLZ_DRIVER_OBJS=""
   2420      1.1  christos DLZ_SYSTEM_TEST=""
   2421      1.1  christos DLZ_DRIVER_MYSQL_INCLUDES=""
   2422      1.1  christos DLZ_DRIVER_MYSQL_LIBS=""
   2423      1.1  christos 
   2424      1.1  christos #
   2425      1.1  christos # Configure support for building a shared library object
   2426      1.1  christos #
   2427      1.1  christos # Even when libtool is available it can't always be relied upon
   2428      1.1  christos # to build an object that can be dlopen()'ed, but this is necessary
   2429      1.1  christos # for building the dlzexternal system test, so we'll try it the
   2430      1.1  christos # old-fashioned way.
   2431      1.1  christos #
   2432      1.1  christos SO="so"
   2433      1.1  christos SO_CFLAGS=""
   2434      1.1  christos SO_LDFLAGS=""
   2435      1.1  christos SO_LD=""
   2436      1.1  christos SO_TARGETS=""
   2437      1.1  christos SO_STRIP="cat"
   2438      1.1  christos 
   2439  1.1.1.9  christos # [pairwise: skip]
   2440      1.1  christos AC_ARG_WITH([dlopen],
   2441      1.1  christos 	    AS_HELP_STRING([--with-dlopen=ARG],
   2442      1.1  christos 			   [support dynamically loadable DLZ and DYNDB drivers]),
   2443      1.1  christos 	    [], [with_dlopen="auto"])
   2444      1.1  christos 
   2445      1.1  christos 
   2446      1.1  christos #
   2447      1.1  christos # If PIC is disabled, dlopen must also be
   2448      1.1  christos #
   2449      1.1  christos AS_IF([test "$pic_mode" = "no"],
   2450      1.1  christos       [AS_CASE([$with_dlopen],
   2451      1.1  christos 	       [auto],[with_dlopen="no"],
   2452      1.1  christos 	       [yes],[AC_MSG_ERROR([--with-dlopen requires PIC])])])
   2453      1.1  christos 
   2454      1.1  christos AS_CASE([$with_dlopen],
   2455      1.1  christos 	[auto|yes],[
   2456  1.1.1.8  christos 	  # -fsanitize=thread hijacks dlopen and dlclose so use dlsym.
   2457  1.1.1.8  christos 	  AC_SEARCH_LIBS([dlsym],[dl])
   2458      1.1  christos 	  AC_CHECK_FUNCS([dlopen dlclose dlsym],
   2459      1.1  christos 			 [with_dlopen="yes"],
   2460      1.1  christos 			 [with_dlopen="no"])
   2461      1.1  christos 	])
   2462      1.1  christos 
   2463      1.1  christos AS_IF([test "$with_dlopen" = "yes"],
   2464      1.1  christos       [AS_CASE([$host],
   2465      1.1  christos 	       [*-linux*|*-gnu*],[
   2466      1.1  christos 		 LDFLAGS="${LDFLAGS} -Wl,--export-dynamic"
   2467      1.1  christos 		 SO_CFLAGS="-fPIC"
   2468      1.1  christos 		 SO_LDFLAGS=""
   2469      1.1  christos 		 AS_IF([test "$use_libtool" = "yes"],[
   2470      1.1  christos 			 SO_LDFLAGS="-Xcompiler -shared"
   2471      1.1  christos 			 SO_LD="${CC}"
   2472      1.1  christos 		       ],[
   2473      1.1  christos 			 SO_LDFLAGS="-shared"
   2474      1.1  christos 			 SO_LD="${CC}"
   2475      1.1  christos 		       ])
   2476      1.1  christos 	       ],
   2477      1.1  christos 	       [*-freebsd*|*-openbsd*|*-netbsd*],[
   2478      1.1  christos 		 LDFLAGS="${LDFLAGS} -Wl,-E"
   2479      1.1  christos 		 SO_CFLAGS="-fpic"
   2480      1.1  christos 		 AS_IF([test "$use_libtool" = "yes"],[
   2481      1.1  christos 			 SO_LDFLAGS="-Xcompiler -shared"
   2482      1.1  christos 			 SO_LD="${CC}"
   2483      1.1  christos 		       ],[
   2484      1.1  christos 			 SO_LDFLAGS="-shared"
   2485      1.1  christos 			 SO_LD="${CC}"
   2486      1.1  christos 		       ])
   2487      1.1  christos 	       ],
   2488      1.1  christos 	       [*-darwin*],[
   2489      1.1  christos 		 SO_CFLAGS="-fPIC"
   2490      1.1  christos                  SO_LD="${CC}"
   2491      1.1  christos 		 AS_IF([test "$use_libtool" = "yes"],[
   2492      1.1  christos 			 SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
   2493      1.1  christos 		       ],[
   2494      1.1  christos 			 SO_LDFLAGS="-dynamiclib -undefined dynamic_lookup"
   2495      1.1  christos 		       ])
   2496      1.1  christos 	       ],
   2497      1.1  christos 	       [*-solaris*],[
   2498      1.1  christos 		 SO_CFLAGS="-KPIC"
   2499      1.1  christos 		 SO_LDFLAGS="-G -z text"
   2500      1.1  christos 		 SO_LD="ld"
   2501      1.1  christos 	       ],
   2502  1.1.1.4  christos 	       [ia64-hp-hpux*],[
   2503  1.1.1.4  christos 		 SO_CFLAGS="+z"
   2504  1.1.1.4  christos 	         SO_LDFLAGS="-b"
   2505  1.1.1.4  christos 		 SO_LD="${CC}"
   2506  1.1.1.4  christos 	       ],
   2507      1.1  christos 	       [
   2508      1.1  christos 		 SO_CFLAGS="-fPIC"
   2509      1.1  christos 	       ])
   2510      1.1  christos        AS_IF([test "$GCC" = "yes"],[
   2511      1.1  christos 	       SO_CFLAGS="-fPIC"
   2512      1.1  christos 	       AS_IF([test -z "$SO_LD"],
   2513      1.1  christos 		     [AS_IF([test "$use_libtool" = "yes"],[
   2514      1.1  christos 			      SO_LDFLAGS="-Xcompiler -shared"
   2515      1.1  christos 			      SO_LD="${CC}"
   2516      1.1  christos 			    ],[
   2517      1.1  christos 			      SO_LDFLAGS="-shared"
   2518      1.1  christos 			      SO_LD="${CC}"
   2519      1.1  christos 			    ])
   2520      1.1  christos 		     ])
   2521      1.1  christos 	     ])
   2522      1.1  christos        # If we still don't know how to make shared objects, don't make any.
   2523      1.1  christos        AS_IF([test -n "$SO_LD"],
   2524      1.1  christos 	     [SO_TARGETS="\${SO_TARGETS}"
   2525      1.1  christos 	      AC_DEFINE([ISC_DLZ_DLOPEN], [1],
   2526      1.1  christos 			[Define to allow building of objects for dlopen().])
   2527      1.1  christos 	     ])
   2528      1.1  christos       ])
   2529      1.1  christos 
   2530  1.1.1.9  christos AS_IF([test "$with_dlopen" = "no" -a "$enable_native_pkcs11" = "yes"],
   2531  1.1.1.9  christos       [AC_MSG_ERROR([PKCS11 requires dlopen() support])])
   2532  1.1.1.9  christos 
   2533      1.1  christos CFLAGS="$CFLAGS $SO_CFLAGS"
   2534      1.1  christos 
   2535      1.1  christos AC_SUBST(SO)
   2536      1.1  christos AC_SUBST(SO_CFLAGS)
   2537      1.1  christos AC_SUBST(SO_LDFLAGS)
   2538      1.1  christos AC_SUBST(SO_LD)
   2539      1.1  christos AC_SUBST(SO_STRIP)
   2540      1.1  christos AC_SUBST(SO_TARGETS)
   2541      1.1  christos 
   2542      1.1  christos #
   2543      1.1  christos # Response policy rewriting using DNS Response Policy Service (DNSRPS)
   2544      1.1  christos # interface.
   2545      1.1  christos #
   2546      1.1  christos # DNSRPS can be compiled into BIND everywhere with a reasonably
   2547      1.1  christos # modern C compiler.  It is enabled on systems with dlopen() and librpz.so.
   2548      1.1  christos #
   2549      1.1  christos dnsrps_avail=yes
   2550      1.1  christos AC_MSG_CHECKING([for librpz __attribute__s])
   2551      1.1  christos AC_COMPILE_IFELSE(
   2552      1.1  christos   [AC_LANG_PROGRAM(
   2553      1.1  christos      [[]],
   2554      1.1  christos      [[
   2555      1.1  christos        extern void f(char *p __attribute__((unused)), ...)
   2556      1.1  christos        __attribute__((format(printf,1,2))) __attribute__((__noreturn__));
   2557      1.1  christos      ]])],
   2558      1.1  christos   [
   2559      1.1  christos     librpz_have_attr=yes
   2560      1.1  christos     AC_DEFINE([LIBRPZ_HAVE_ATTR], [1], [have __attribute__s used in librpz.h])
   2561      1.1  christos     AC_MSG_RESULT([yes])
   2562      1.1  christos   ],[
   2563      1.1  christos     librpz_have_attr=no
   2564      1.1  christos     AC_MSG_RESULT([no])
   2565      1.1  christos   ])
   2566      1.1  christos 
   2567  1.1.1.9  christos # DNSRPS is not included in pairwise testing as the librpz library is not
   2568  1.1.1.9  christos # present in the relevant Docker image.
   2569  1.1.1.9  christos #
   2570  1.1.1.9  christos # [pairwise: skip]
   2571      1.1  christos AC_ARG_ENABLE([dnsrps-dl],
   2572      1.1  christos 	      [AS_HELP_STRING([--enable-dnsrps-dl],
   2573      1.1  christos 			      [DNS Response Policy Service delayed link
   2574      1.1  christos 			       [default=$librpz_dl]])],
   2575      1.1  christos 	      [enable_librpz_dl="$enableval"], [enable_librpz_dl="$with_dlopen"])
   2576      1.1  christos 
   2577      1.1  christos AS_IF([test "$enable_librpz_dl" = "yes" -a "$with_dlopen" = "no"],
   2578      1.1  christos       [AC_MSG_ERROR([DNS Response Policy Service delayed link requires dlopen to be enabled])])
   2579      1.1  christos 
   2580  1.1.1.9  christos # [pairwise: skip]
   2581      1.1  christos AC_ARG_WITH([dnsrps-libname],
   2582      1.1  christos 	    [AS_HELP_STRING([--with-dnsrps-libname],
   2583      1.1  christos 			    [DNSRPS provider library name (librpz.so)])],
   2584      1.1  christos 	    [librpz_name="$withval"], [librpz_name="librpz.so"])
   2585  1.1.1.9  christos 
   2586  1.1.1.9  christos # [pairwise: skip]
   2587      1.1  christos AC_ARG_WITH([dnsrps-dir],
   2588      1.1  christos 	    [AS_HELP_STRING([--with-dnsrps-dir],
   2589      1.1  christos 			    [path to DNSRPS provider library])],
   2590      1.1  christos 	    [librpz_path="$withval/$librpz_name"], [librpz_path="$librpz_name"])
   2591      1.1  christos AC_DEFINE_UNQUOTED([DNSRPS_LIBRPZ_PATH], ["$librpz_path"],
   2592      1.1  christos 		   [dnsrps $librpz_name])
   2593      1.1  christos AS_IF([test "$enable_librpz_dl" = "yes"],
   2594      1.1  christos       [
   2595      1.1  christos 	dnsrps_lib_open=2
   2596      1.1  christos       ],[
   2597      1.1  christos 	dnsrps_lib_open=1
   2598      1.1  christos 	# Add librpz.so to linked libraries if we are not using dlopen()
   2599      1.1  christos 	AC_SEARCH_LIBS([librpz_client_create], [rpz], [],
   2600      1.1  christos 		[dnsrps_lib_open=0
   2601      1.1  christos 		 dnsrps_avail=no])
   2602      1.1  christos       ])
   2603      1.1  christos AC_DEFINE_UNQUOTED([DNSRPS_LIB_OPEN], [$dnsrps_lib_open],
   2604      1.1  christos 		   [0=no DNSRPS  1=static link  2=dlopen()])
   2605      1.1  christos 
   2606  1.1.1.9  christos # [pairwise: skip]
   2607      1.1  christos AC_ARG_ENABLE([dnsrps],
   2608      1.1  christos 	      AS_HELP_STRING([--enable-dnsrps],
   2609      1.1  christos 			     [enable DNS Response Policy Service API]),
   2610      1.1  christos 	      [enable_dnsrps=$enableval], [enable_dnsrps=no])
   2611      1.1  christos 
   2612      1.1  christos AS_IF([test "$enable_dnsrps" != "no"],[
   2613      1.1  christos 	AS_IF([test "$dnsrps_avail" != "yes"],
   2614      1.1  christos 	      [AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
   2615      1.1  christos 	AS_IF([test "$dnsrps_lib_open" = "0"],
   2616      1.1  christos 	      [AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
   2617      1.1  christos 	AC_DEFINE([USE_DNSRPS], [1], [Enable DNS Response Policy Service API])
   2618      1.1  christos       ])
   2619      1.1  christos 
   2620      1.1  christos sinclude(contrib/dlz/config.dlz.in)
   2621      1.1  christos AC_MSG_CHECKING(contributed DLZ drivers)
   2622      1.1  christos 
   2623      1.1  christos if test -n "$CONTRIB_DLZ"
   2624      1.1  christos then
   2625      1.1  christos 	AC_MSG_RESULT(yes)
   2626      1.1  christos 	DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
   2627      1.1  christos 	AC_CONFIG_FILES([$DLZ_DRIVER_RULES
   2628      1.1  christos 		contrib/dlz/modules/mysql/Makefile
   2629      1.1  christos 		contrib/dlz/modules/mysqldyn/Makefile])
   2630      1.1  christos else
   2631      1.1  christos 	AC_MSG_RESULT(no)
   2632      1.1  christos 	DLZ_DRIVER_RULES=/dev/null
   2633      1.1  christos fi
   2634      1.1  christos 
   2635      1.1  christos AC_SUBST(CONTRIB_DLZ)
   2636      1.1  christos AC_SUBST(DLZ_DRIVER_INCLUDES)
   2637      1.1  christos AC_SUBST(DLZ_DRIVER_LIBS)
   2638      1.1  christos AC_SUBST(DLZ_DRIVER_SRCS)
   2639      1.1  christos AC_SUBST(DLZ_DRIVER_OBJS)
   2640      1.1  christos AC_SUBST(DLZ_SYSTEM_TEST)
   2641      1.1  christos AC_SUBST(DLZ_DRIVER_MYSQL_INCLUDES)
   2642      1.1  christos AC_SUBST(DLZ_DRIVER_MYSQL_LIBS)
   2643      1.1  christos AC_SUBST_FILE(DLZ_DRIVER_RULES)
   2644      1.1  christos 
   2645      1.1  christos if test "yes" = "$cross_compiling"; then
   2646      1.1  christos 	if test -z "$BUILD_CC"; then
   2647      1.1  christos 		AC_MSG_ERROR([BUILD_CC not set])
   2648      1.1  christos 	fi
   2649      1.1  christos 	BUILD_CFLAGS="$BUILD_CFLAGS"
   2650      1.1  christos 	BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
   2651      1.1  christos 	BUILD_LDFLAGS="$BUILD_LDFLAGS"
   2652      1.1  christos 	BUILD_LIBS="$BUILD_LIBS"
   2653      1.1  christos else
   2654      1.1  christos 	BUILD_CC="$CC"
   2655      1.1  christos 	BUILD_CFLAGS="$CFLAGS"
   2656      1.1  christos 	BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
   2657      1.1  christos 	BUILD_LDFLAGS="$LDFLAGS"
   2658      1.1  christos 	BUILD_LIBS="$LIBS"
   2659      1.1  christos fi
   2660      1.1  christos 
   2661      1.1  christos NEWFLAGS=""
   2662      1.1  christos for e in $BUILD_LDFLAGS ; do
   2663      1.1  christos     case $e in
   2664      1.1  christos 	-L*)
   2665      1.1  christos 	    case $host_os in
   2666      1.1  christos 		netbsd*)
   2667      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2668      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2669      1.1  christos 		    ;;
   2670      1.1  christos 		freebsd*)
   2671      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2672      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2673      1.1  christos 		    ;;
   2674      1.1  christos 		solaris*)
   2675      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-R%'`
   2676      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2677      1.1  christos 		    ;;
   2678      1.1  christos 		*)
   2679      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e"
   2680      1.1  christos 		    ;;
   2681      1.1  christos 		esac
   2682      1.1  christos 	    ;;
   2683      1.1  christos 	*)
   2684      1.1  christos 	    NEWFLAGS="$NEWFLAGS $e"
   2685      1.1  christos 	    ;;
   2686      1.1  christos     esac
   2687      1.1  christos done
   2688      1.1  christos BUILD_LDFLAGS="$NEWFLAGS"
   2689      1.1  christos 
   2690      1.1  christos NEWFLAGS=""
   2691      1.1  christos for e in $DNS_GSSAPI_LIBS ; do
   2692      1.1  christos     case $e in
   2693      1.1  christos 	-L*)
   2694      1.1  christos 	    case $host_os in
   2695      1.1  christos 		netbsd*)
   2696      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2697      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2698      1.1  christos 		    ;;
   2699      1.1  christos 		freebsd*)
   2700      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2701      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2702      1.1  christos 		    ;;
   2703      1.1  christos 		solaris*)
   2704      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-R%'`
   2705      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2706      1.1  christos 		    ;;
   2707      1.1  christos 		*)
   2708      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e"
   2709      1.1  christos 		    ;;
   2710      1.1  christos 		esac
   2711      1.1  christos 	    ;;
   2712      1.1  christos 	*)
   2713      1.1  christos 	    NEWFLAGS="$NEWFLAGS $e"
   2714      1.1  christos 	    ;;
   2715      1.1  christos     esac
   2716      1.1  christos done
   2717      1.1  christos DNS_GSSAPI_LIBS="$NEWFLAGS"
   2718      1.1  christos 
   2719      1.1  christos NEWFLAGS=""
   2720      1.1  christos for e in $ISC_OPENSSL_LIBS ; do
   2721      1.1  christos     case $e in
   2722      1.1  christos 	-L*)
   2723      1.1  christos 	    case $host_os in
   2724      1.1  christos 		netbsd*)
   2725      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2726      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2727      1.1  christos 		    ;;
   2728      1.1  christos 		freebsd*)
   2729      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2730      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2731      1.1  christos 		    ;;
   2732      1.1  christos 		solaris*)
   2733      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-R%'`
   2734      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2735      1.1  christos 		    ;;
   2736      1.1  christos 		*)
   2737      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e"
   2738      1.1  christos 		    ;;
   2739      1.1  christos 		esac
   2740      1.1  christos 	    ;;
   2741      1.1  christos 	*)
   2742      1.1  christos 	    NEWFLAGS="$NEWFLAGS $e"
   2743      1.1  christos 	    ;;
   2744      1.1  christos     esac
   2745      1.1  christos done
   2746      1.1  christos ISC_OPENSSL_LIBS="$NEWFLAGS"
   2747      1.1  christos 
   2748      1.1  christos NEWFLAGS=""
   2749      1.1  christos for e in $DNS_CRYPTO_LIBS ; do
   2750      1.1  christos     case $e in
   2751      1.1  christos 	-L*)
   2752      1.1  christos 	    case $host_os in
   2753      1.1  christos 		netbsd*)
   2754      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2755      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2756      1.1  christos 		    ;;
   2757      1.1  christos 		freebsd*)
   2758      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
   2759      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2760      1.1  christos 		    ;;
   2761      1.1  christos 		solaris*)
   2762      1.1  christos 		    ee=`echo $e | sed -e 's%^-L%-R%'`
   2763      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e $ee"
   2764      1.1  christos 		    ;;
   2765      1.1  christos 		*)
   2766      1.1  christos 		    NEWFLAGS="$NEWFLAGS $e"
   2767      1.1  christos 		    ;;
   2768      1.1  christos 		esac
   2769      1.1  christos 	    ;;
   2770      1.1  christos 	*)
   2771      1.1  christos 	    NEWFLAGS="$NEWFLAGS $e"
   2772      1.1  christos 	    ;;
   2773      1.1  christos     esac
   2774      1.1  christos done
   2775      1.1  christos DNS_CRYPTO_LIBS="$NEWFLAGS"
   2776      1.1  christos 
   2777      1.1  christos AC_SUBST(BUILD_CC)
   2778      1.1  christos AC_SUBST(BUILD_CFLAGS)
   2779      1.1  christos AC_SUBST(BUILD_CPPFLAGS)
   2780      1.1  christos AC_SUBST(BUILD_LDFLAGS)
   2781      1.1  christos AC_SUBST(BUILD_LIBS)
   2782      1.1  christos 
   2783      1.1  christos #
   2784      1.1  christos # Commands to run at the end of config.status.
   2785      1.1  christos # Don't just put these into configure, it won't work right if somebody
   2786      1.1  christos # runs config.status directly (which autoconf allows).
   2787      1.1  christos #
   2788      1.1  christos 
   2789      1.1  christos AC_CONFIG_COMMANDS(
   2790      1.1  christos 	[chmod],
   2791  1.1.1.7  christos 	[chmod a+x doc/doxygen/doxygen-input-filter])
   2792      1.1  christos 
   2793      1.1  christos #
   2794      1.1  christos # Files to configure.  These are listed here because we used to
   2795      1.1  christos # specify them as arguments to AC_OUTPUT.  It's (now) ok to move these
   2796      1.1  christos # elsewhere if there's a good reason for doing so.
   2797      1.1  christos #
   2798      1.1  christos 
   2799      1.1  christos AC_CONFIG_FILES([
   2800      1.1  christos 	Makefile
   2801      1.1  christos 	bin/Makefile
   2802      1.1  christos 	bin/check/Makefile
   2803      1.1  christos 	bin/confgen/Makefile
   2804      1.1  christos 	bin/confgen/unix/Makefile
   2805      1.1  christos 	bin/delv/Makefile
   2806      1.1  christos 	bin/dig/Makefile
   2807      1.1  christos 	bin/dnssec/Makefile
   2808      1.1  christos 	bin/named/Makefile
   2809      1.1  christos 	bin/named/unix/Makefile
   2810      1.1  christos 	bin/nsupdate/Makefile
   2811      1.1  christos 	bin/pkcs11/Makefile
   2812      1.1  christos 	bin/plugins/Makefile
   2813      1.1  christos 	bin/python/Makefile
   2814      1.1  christos 	bin/python/dnssec-checkds.py
   2815      1.1  christos 	bin/python/dnssec-coverage.py
   2816      1.1  christos 	bin/python/dnssec-keymgr.py
   2817  1.1.1.7  christos 	bin/python/isc/Makefile
   2818      1.1  christos 	bin/python/isc/__init__.py
   2819      1.1  christos 	bin/python/isc/checkds.py
   2820      1.1  christos 	bin/python/isc/coverage.py
   2821      1.1  christos 	bin/python/isc/dnskey.py
   2822      1.1  christos 	bin/python/isc/eventlist.py
   2823      1.1  christos 	bin/python/isc/keydict.py
   2824      1.1  christos 	bin/python/isc/keyevent.py
   2825      1.1  christos 	bin/python/isc/keymgr.py
   2826      1.1  christos 	bin/python/isc/keyseries.py
   2827      1.1  christos 	bin/python/isc/keyzone.py
   2828      1.1  christos 	bin/python/isc/policy.py
   2829      1.1  christos 	bin/python/isc/rndc.py
   2830  1.1.1.7  christos 	bin/python/isc/tests/Makefile
   2831      1.1  christos 	bin/python/isc/tests/dnskey_test.py
   2832      1.1  christos 	bin/python/isc/tests/policy_test.py
   2833  1.1.1.7  christos 	bin/python/isc/utils.py
   2834      1.1  christos 	bin/rndc/Makefile
   2835      1.1  christos 	bin/tests/Makefile
   2836      1.1  christos 	bin/tests/headerdep_test.sh
   2837      1.1  christos 	bin/tests/optional/Makefile
   2838      1.1  christos 	bin/tests/pkcs11/Makefile
   2839      1.1  christos 	bin/tests/pkcs11/benchmarks/Makefile
   2840      1.1  christos 	bin/tests/system/Makefile
   2841      1.1  christos 	bin/tests/system/conf.sh
   2842      1.1  christos 	bin/tests/system/dlzexternal/Makefile
   2843      1.1  christos 	bin/tests/system/dlzexternal/ns1/dlzs.conf
   2844      1.1  christos 	bin/tests/system/dyndb/Makefile
   2845      1.1  christos 	bin/tests/system/dyndb/driver/Makefile
   2846      1.1  christos 	bin/tests/system/pipelined/Makefile
   2847      1.1  christos 	bin/tests/system/rndc/Makefile
   2848      1.1  christos 	bin/tests/system/rpz/Makefile
   2849      1.1  christos 	bin/tests/system/rsabigexponent/Makefile
   2850      1.1  christos 	bin/tests/system/tkey/Makefile
   2851      1.1  christos 	bin/tools/Makefile
   2852      1.1  christos 	contrib/scripts/check-secure-delegation.pl
   2853      1.1  christos 	contrib/scripts/zone-edit.sh
   2854      1.1  christos 	doc/Makefile
   2855      1.1  christos 	doc/arm/Makefile
   2856      1.1  christos 	doc/doxygen/Doxyfile
   2857      1.1  christos 	doc/doxygen/Makefile
   2858      1.1  christos 	doc/doxygen/doxygen-input-filter
   2859  1.1.1.8  christos 	doc/man/Makefile
   2860      1.1  christos 	doc/misc/Makefile
   2861  1.1.1.7  christos 	fuzz/Makefile
   2862      1.1  christos 	lib/Makefile
   2863      1.1  christos 	lib/bind9/Makefile
   2864      1.1  christos 	lib/bind9/include/Makefile
   2865      1.1  christos 	lib/bind9/include/bind9/Makefile
   2866      1.1  christos 	lib/dns/Makefile
   2867      1.1  christos 	lib/dns/include/Makefile
   2868      1.1  christos 	lib/dns/include/dns/Makefile
   2869      1.1  christos 	lib/dns/include/dst/Makefile
   2870      1.1  christos 	lib/dns/tests/Makefile
   2871      1.1  christos 	lib/irs/Makefile
   2872      1.1  christos 	lib/irs/include/Makefile
   2873      1.1  christos 	lib/irs/include/irs/Makefile
   2874      1.1  christos 	lib/irs/include/irs/netdb.h
   2875      1.1  christos 	lib/irs/include/irs/platform.h
   2876      1.1  christos 	lib/irs/tests/Makefile
   2877      1.1  christos 	lib/isc/Makefile
   2878      1.1  christos 	lib/isc/include/Makefile
   2879      1.1  christos 	lib/isc/include/isc/Makefile
   2880      1.1  christos 	lib/isc/include/isc/platform.h
   2881      1.1  christos 	lib/isc/include/pk11/Makefile
   2882      1.1  christos 	lib/isc/include/pkcs11/Makefile
   2883  1.1.1.7  christos 	lib/isc/netmgr/Makefile
   2884  1.1.1.7  christos 	lib/isc/pthreads/Makefile
   2885  1.1.1.7  christos 	lib/isc/pthreads/include/Makefile
   2886  1.1.1.7  christos 	lib/isc/pthreads/include/isc/Makefile
   2887      1.1  christos 	lib/isc/tests/Makefile
   2888      1.1  christos 	lib/isc/unix/Makefile
   2889      1.1  christos 	lib/isc/unix/include/Makefile
   2890      1.1  christos 	lib/isc/unix/include/isc/Makefile
   2891      1.1  christos 	lib/isccc/Makefile
   2892      1.1  christos 	lib/isccc/include/Makefile
   2893      1.1  christos 	lib/isccc/include/isccc/Makefile
   2894      1.1  christos 	lib/isccc/tests/Makefile
   2895      1.1  christos 	lib/isccfg/Makefile
   2896      1.1  christos 	lib/isccfg/include/Makefile
   2897      1.1  christos 	lib/isccfg/include/isccfg/Makefile
   2898      1.1  christos 	lib/isccfg/tests/Makefile
   2899      1.1  christos 	lib/ns/Makefile
   2900      1.1  christos 	lib/ns/include/Makefile
   2901      1.1  christos 	lib/ns/include/ns/Makefile
   2902      1.1  christos 	lib/ns/tests/Makefile
   2903      1.1  christos 	lib/samples/Makefile
   2904      1.1  christos 	lib/samples/Makefile-postinstall
   2905  1.1.1.7  christos 	make/Makefile
   2906  1.1.1.7  christos 	make/mkdep
   2907      1.1  christos 	unit/unittest.sh
   2908  1.1.1.7  christos 	util/check-make-install
   2909      1.1  christos ])
   2910      1.1  christos 
   2911      1.1  christos #
   2912      1.1  christos # Do it
   2913      1.1  christos #
   2914      1.1  christos 
   2915      1.1  christos AC_OUTPUT
   2916      1.1  christos 
   2917      1.1  christos #
   2918      1.1  christos # Now that the Makefiles exist we can ensure that everything is rebuilt.
   2919      1.1  christos #
   2920  1.1.1.9  christos # [pairwise: --with-make-clean, --without-make-clean]
   2921      1.1  christos AC_ARG_WITH(make-clean,
   2922      1.1  christos 	    AS_HELP_STRING([--with-make-clean],
   2923      1.1  christos 			   [run "make clean" at end of configure [yes|no]]),
   2924      1.1  christos     make_clean="$withval", make_clean="yes")
   2925      1.1  christos case "$make_clean" in
   2926      1.1  christos yes)
   2927      1.1  christos 	if test "yes" != "$no_create"
   2928      1.1  christos 	then
   2929      1.1  christos 		if test "yes" = "$silent"
   2930      1.1  christos 		then
   2931      1.1  christos 			make clean > /dev/null
   2932      1.1  christos 		else
   2933      1.1  christos 			make clean
   2934      1.1  christos 		fi
   2935      1.1  christos 	fi
   2936      1.1  christos 	;;
   2937      1.1  christos esac
   2938      1.1  christos 
   2939  1.1.1.9  christos # [pairwise: --enable-full-report, --disable-full-report]
   2940      1.1  christos AC_ARG_ENABLE(full-report,
   2941      1.1  christos 	      AS_HELP_STRING([--enable-full-report],
   2942      1.1  christos 			     [report values of all configure options]))
   2943      1.1  christos 
   2944      1.1  christos report() {
   2945      1.1  christos     echo "==============================================================================="
   2946      1.1  christos     echo "Configuration summary:"
   2947      1.1  christos     echo "-------------------------------------------------------------------------------"
   2948      1.1  christos     echo "Optional features enabled:"
   2949  1.1.1.7  christos     if test "yes" = "$enable_full_report" -o "standard" = "$with_locktype"; then
   2950  1.1.1.7  christos 	echo "    Mutex lock type: $with_locktype"
   2951      1.1  christos     fi
   2952  1.1.1.7  christos     test "small" = "$with_tuning" && echo "    Small-system tuning (--with-tuning)"
   2953      1.1  christos     test "no" = "$use_dnstap" || \
   2954      1.1  christos 	    echo "    Allow 'dnstap' packet logging (--enable-dnstap)"
   2955  1.1.1.7  christos     test -z "$MAXMINDDB_LIBS" || echo "    GeoIP2 access control (--enable-geoip)"
   2956      1.1  christos     test "no" = "$use_gssapi" || echo "    GSS-API (--with-gssapi)"
   2957      1.1  christos 
   2958      1.1  christos     # these lines are only printed if run with --enable-full-report
   2959      1.1  christos     if test "yes" = "$enable_full_report"; then
   2960      1.1  christos 	test "no" = "$found_ipv6" || echo "    IPv6 support (--enable-ipv6)"
   2961      1.1  christos 	test "X$PYTHON" = "X" || echo "    Python tools (--with-python)"
   2962  1.1.1.7  christos 	test "X$LIBXML2_LIBS" = "X" || echo "    XML statistics (--with-libxml2)"
   2963  1.1.1.7  christos 	test "X$JSON_C_LIBS" = "X" || echo "    JSON statistics (--with-json-c): $JSON_C_CFLAGS $JSON_C_LIBS"
   2964  1.1.1.7  christos 	test "X$ZLIB_LIBS" = "X" || echo "    HTTP zlib compression (--with-zlib)"
   2965      1.1  christos 	test "X$NZD_TOOLS" = "X" || echo "    LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
   2966      1.1  christos 	test "no" = "$with_libidn2" || echo "    IDN support (--with-libidn2)"
   2967      1.1  christos     fi
   2968      1.1  christos 
   2969      1.1  christos     test "yes" = "$enable_dnsrps" && \
   2970      1.1  christos 	echo "    DNS Response Policy Service interface (--enable-dnsrps)"
   2971      1.1  christos     test "yes" = "$enable_fixed" && \
   2972      1.1  christos 	echo "    Allow 'fixed' rrset-order (--enable-fixed-rrset)"
   2973      1.1  christos     test "yes" = "$enable_backtrace" && \
   2974      1.1  christos 	echo "    Print backtrace on crash (--enable-backtrace)"
   2975      1.1  christos     test "minimal" = "$want_symtable" && \
   2976      1.1  christos 	echo "    Use symbol table for backtrace, named only (--enable-symtable)"
   2977      1.1  christos     test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
   2978      1.1  christos 	echo "    Use symbol table for backtrace, all binaries (--enable-symtable=all)"
   2979      1.1  christos     test "no" = "$use_libtool" || echo "    Use GNU libtool (--with-libtool)"
   2980      1.1  christos     test "yes" = "$want_querytrace" && \
   2981      1.1  christos 	echo "    Very verbose query trace logging (--enable-querytrace)"
   2982      1.1  christos     test "no" = "$with_cmocka" || echo "    CMocka Unit Testing Framework (--with-cmocka)"
   2983      1.1  christos 
   2984  1.1.1.4  christos     test "auto" = "$validation_default" && echo "    DNSSEC validation active by default (--enable-auto-validation)"
   2985      1.1  christos 
   2986      1.1  christos     test "$CRYPTO" = "pkcs11" && (
   2987      1.1  christos 	echo "    Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)"
   2988      1.1  christos 	echo "    PKCS#11 module (--with-pkcs11): $with_pkcs11"
   2989      1.1  christos     )
   2990      1.1  christos 
   2991      1.1  christos     echo "    Dynamically loadable zone (DLZ) drivers:"
   2992      1.1  christos     test "no" = "$use_dlz_bdb" || \
   2993      1.1  christos 	echo "        Berkeley DB (--with-dlz-bdb)"
   2994      1.1  christos     test "no" = "$use_dlz_ldap" || \
   2995      1.1  christos 	echo "        LDAP (--with-dlz-ldap)"
   2996      1.1  christos     test "no" = "$use_dlz_mysql" || \
   2997      1.1  christos 	echo "        MySQL (--with-dlz-mysql)"
   2998      1.1  christos     test "no" = "$use_dlz_odbc" || \
   2999      1.1  christos 	echo "        ODBC (--with-dlz-odbc)"
   3000      1.1  christos     test "no" = "$use_dlz_postgres" || \
   3001      1.1  christos 	echo "        Postgres (--with-dlz-postgres)"
   3002      1.1  christos     test "no" = "$use_dlz_filesystem" || \
   3003      1.1  christos 	echo "        Filesystem (--with-dlz-filesystem)"
   3004      1.1  christos     test "no" = "$use_dlz_stub" || \
   3005      1.1  christos 	echo "        Stub (--with-dlz-stub)"
   3006      1.1  christos     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"
   3007      1.1  christos 
   3008      1.1  christos     echo "-------------------------------------------------------------------------------"
   3009      1.1  christos 
   3010      1.1  christos     echo "Features disabled or unavailable on this platform:"
   3011      1.1  christos     test "no" = "$found_ipv6" && echo "    IPv6 support (--enable-ipv6)"
   3012  1.1.1.7  christos     test "small" = "$with_tuning" || echo "    Small-system tuning (--with-tuning)"
   3013      1.1  christos 
   3014      1.1  christos     test "no" = "$use_dnstap" && \
   3015      1.1  christos 	    echo "    Allow 'dnstap' packet logging (--enable-dnstap)"
   3016  1.1.1.7  christos     test -z "$MAXMINDDB_LIBS" && echo "    GeoIP2 access control (--enable-geoip)"
   3017      1.1  christos     test "no" = "$use_gssapi" && echo "    GSS-API (--with-gssapi)"
   3018      1.1  christos 
   3019      1.1  christos     test "no" = "$enable_dnsrps" && \
   3020      1.1  christos 	echo "    DNS Response Policy Service interface (--enable-dnsrps)"
   3021      1.1  christos 
   3022      1.1  christos     test "yes" = "$enable_fixed" || \
   3023      1.1  christos 	echo "    Allow 'fixed' rrset-order (--enable-fixed-rrset)"
   3024      1.1  christos 
   3025  1.1.1.4  christos     test "yes" = "$validation_default" && echo "    DNSSEC validation requires configuration (--enablee-auto-validation)"
   3026      1.1  christos 
   3027      1.1  christos     test "$CRYPTO" = "pkcs11" || (
   3028  1.1.1.4  christos 	echo "    Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)"
   3029      1.1  christos     )
   3030      1.1  christos 
   3031      1.1  christos     test "yes" = "$enable_backtrace" || \
   3032      1.1  christos 	echo "    Print backtrace on crash (--enable-backtrace)"
   3033      1.1  christos     test "yes" = "$want_querytrace" || \
   3034      1.1  christos 	echo "    Very verbose query trace logging (--enable-querytrace)"
   3035      1.1  christos 
   3036      1.1  christos     test "yes" = "$use_libtool" || echo "    Use GNU libtool (--with-libtool)"
   3037  1.1.1.2  christos     test "no" = "$with_cmocka" && echo "    CMocka Unit Testing Framework (--with-cmocka)"
   3038      1.1  christos 
   3039      1.1  christos     test "X$PYTHON" = "X" && echo "    Python tools (--with-python)"
   3040  1.1.1.7  christos     test "X$LIBXML2_LIBS" = "X" && echo "    XML statistics (--with-libxml2)"
   3041  1.1.1.7  christos     test "X$JSON_C_LIBS" = "X" && echo "    JSON statistics (--with-json-c)"
   3042  1.1.1.7  christos     test "X$ZLIB_LIBS" = "X" && echo "    HTTP zlib compression (--with-zlib)"
   3043      1.1  christos     test "X$NZD_TOOLS" = "X" && echo "    LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
   3044      1.1  christos     test "no" = "$with_libidn2" && echo "    IDN support (--with-libidn2)"
   3045      1.1  christos 
   3046      1.1  christos     echo "-------------------------------------------------------------------------------"
   3047      1.1  christos     echo "Configured paths:"
   3048      1.1  christos     echo "    prefix: $prefix"
   3049      1.1  christos     echo "    sysconfdir: $sysconfdir"
   3050      1.1  christos     echo "    localstatedir: $localstatedir"
   3051      1.1  christos     echo "-------------------------------------------------------------------------------"
   3052      1.1  christos     echo "Compiler: $CC"
   3053      1.1  christos     $CC --version 2>&1 | sed 's/^/    /'
   3054      1.1  christos 
   3055      1.1  christos     if test "X$ac_unrecognized_opts" != "X"; then
   3056      1.1  christos 	echo "Unrecognized options:"
   3057      1.1  christos 	echo "    $ac_unrecognized_opts"
   3058      1.1  christos     fi
   3059      1.1  christos 
   3060      1.1  christos     if test "yes" != "$enable_full_report"; then
   3061      1.1  christos 	echo "-------------------------------------------------------------------------------"
   3062      1.1  christos 	echo "For more detail, use --enable-full-report."
   3063      1.1  christos     fi
   3064      1.1  christos     echo "==============================================================================="
   3065      1.1  christos }
   3066      1.1  christos 
   3067      1.1  christos if test "yes" != "$silent"; then
   3068      1.1  christos 	report
   3069      1.1  christos fi
   3070      1.1  christos 
   3071      1.1  christos # Tell Emacs to edit this file in shell mode.
   3072      1.1  christos # Local Variables:
   3073      1.1  christos # mode: sh
   3074      1.1  christos # End:
   3075