# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.69])
+AC_PREREQ([2.70])
# For released versions, this is in x.y.z format.
# For GIT versions, this is x.y.z-git, where x.y.z denotes the next development
werror_extras=
AC_ARG_WITH(werror,
- AC_HELP_STRING([--with-werror], [Compile using -Werror (default=no)]),
+ AS_HELP_STRING([--with-werror],[Compile using -Werror (default=no)]),
[
case "${withval}" in
yes) with_werror=1 ;;
AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
# We use struct, not class, here, because some compilers complain about
# "unused private members", causing a false positive.
- AC_TRY_COMPILE([namespace { struct Foo {}; }
- namespace isc {struct Bar {Foo foo_;};} ],,
- [AC_MSG_RESULT(no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[namespace { struct Foo {}; }
+ namespace isc {struct Bar {Foo foo_;};} ]], [[]])],[AC_MSG_RESULT(no)
werror_ok=1
- KEA_CXXFLAGS="$KEA_CXXFLAGS -Werror"],
- [AC_MSG_RESULT(yes)])
+ KEA_CXXFLAGS="$KEA_CXXFLAGS -Werror"],[AC_MSG_RESULT(yes)])
CXXFLAGS="$CXXFLAGS_SAVED"
fi
# allow building programs with static link. we need to make it selective
# because loadable modules cannot be statically linked.
AC_ARG_ENABLE([static-link],
-AC_HELP_STRING([--enable-static-link],
- [build programs with static link [[default=no]]]),
+AS_HELP_STRING([--enable-static-link],[build programs with static link [[default=no]]]),
[enable_static_link=yes], [enable_static_link=no])
AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
AM_COND_IF([USE_STATIC_LINK], [AC_DEFINE([USE_STATIC_LINK], [1], [Was Kea statically linked?])])
# In OS X 10.9 (and possibly any future versions?) pthread_cond_destroy
# doesn't work as documented, which makes some of unit tests fail.
AC_MSG_CHECKING([OS X versions where destroying locked locks do not fail])
- AC_TRY_COMPILE(
- [#include <Availability.h>],
- [#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Availability.h>]], [[#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#error " OS X >= 10.9"
#endif
#endif
- return 1;],
- [AC_MSG_RESULT([OS X < 10.9])],
- [AC_MSG_RESULT([OS X >= 10.9])
+ return 1;]])],[AC_MSG_RESULT([OS X < 10.9])],[AC_MSG_RESULT([OS X >= 10.9])
kea_undefined_pthread_behavior=yes])
;;
*-freebsd*)
esac
# Made perfdhcp optional.
-AC_ARG_ENABLE(perfdhcp, [AC_HELP_STRING([--enable-perfdhcp],
- [enable perfdhcp, a DHCP benchmarking tool [default=no]])],
+AC_ARG_ENABLE(perfdhcp, [AS_HELP_STRING([--enable-perfdhcp],[enable perfdhcp, a DHCP benchmarking tool [default=no]])],
enable_perfdhcp=$enableval, enable_perfdhcp=no)
DISTCHECK_PERFDHCP_CONFIGURE_FLAG=
AC_MSG_CHECKING(for sa_len in struct sockaddr)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
-#include <sys/socket.h>],
-[struct sockaddr sa; sa.sa_len = 0; return (0);],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
- AC_MSG_RESULT(no))
+#include <sys/socket.h>]], [[struct sockaddr sa; sa.sa_len = 0; return (0);]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],[AC_MSG_RESULT(no)])
usable_regex=
AC_MSG_CHECKING(for usable C++11 regex)
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <regex>
#include <iostream>
int main() {
const std::string string = "This should match!";
const auto result = std::regex_search(string, regex);
return result ? EXIT_SUCCESS : EXIT_FAILURE;
-}],
- [AC_MSG_RESULT(yes)
- usable_regex="yes"],
- [AC_MSG_RESULT(no)
- usable_regex="no"],
- [AC_MSG_RESULT(cross compiling)])
+}]])],[AC_MSG_RESULT(yes)
+ usable_regex="yes"],[AC_MSG_RESULT(no)
+ usable_regex="no"],[AC_MSG_RESULT(cross compiling)])
# When cross-compiling we don't have any way to check if regex is
# usable or not.
# Let's be optimistic and assume it is by testing only the negative case.
# the software is not built with MySQL support enabled.
mysql_config="no"
AC_ARG_WITH([mysql],
- AC_HELP_STRING([--with-mysql=PATH],
- [path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
+ AS_HELP_STRING([--with-mysql=PATH],[path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
[mysql_config="$withval"])
deprec_msg="no"
pg_config="no"
AC_ARG_WITH([pgsql],
- AC_HELP_STRING([--with-pgsql=PATH],
- [path to the PostgreSQL 'pg_config' script]),
+ AS_HELP_STRING([--with-pgsql=PATH],[path to the PostgreSQL 'pg_config' script]),
[pg_config="$withval"])
deprec_msg="no"
cql_config="no"
AC_ARG_WITH([cql],
- AC_HELP_STRING([--with-cql=PATH],
- [path to pkg-config or the Cassandra CQL 'cql_config' script]),
+ AS_HELP_STRING([--with-cql=PATH],[path to pkg-config or the Cassandra CQL 'cql_config' script]),
[cql_config="$withval"])
if test "${cql_config}" = "yes" ; then
DISTCHECK_SYSREPO_CONFIGURE_FLAG=
sysrepo_config="no"
AC_ARG_WITH([sysrepo],
- AC_HELP_STRING([--with-sysrepo=PATH],
- [path to pkg-config or the Sysrepo 'sysrepo_config' script]),
+ AS_HELP_STRING([--with-sysrepo=PATH],[path to pkg-config or the Sysrepo 'sysrepo_config' script]),
[sysrepo_config="$withval"])
if test "${sysrepo_config}" = "yes" ; then
DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=
log4cplus_path="yes"
AC_ARG_WITH([log4cplus],
- AC_HELP_STRING([--with-log4cplus=PATH],
- [specify exact directory of log4cplus library and headers]),
+ AS_HELP_STRING([--with-log4cplus=PATH],[specify exact directory of log4cplus library and headers]),
[log4cplus_path="$withval"])
if test "${log4cplus_path}" = "no" ; then
AC_MSG_ERROR([Need log4cplus])
AC_PATH_PROGS(AWK, gawk awk)
AC_SUBST(AWK)
-AC_ARG_ENABLE(generate_messages, [AC_HELP_STRING([--enable-generate-messages],
- [indicates that the messages files will be regenerated. [default=no]])],
+AC_ARG_ENABLE(generate_messages, [AS_HELP_STRING([--enable-generate-messages],[indicates that the messages files will be regenerated. [default=no]])],
enable_generate_messages=$enableval, enable_generate_messages=no)
AM_CONDITIONAL([GENERATE_MESSAGES], [test x$enable_generate_messages != xno])
fi
fi
-AC_ARG_ENABLE(generate_parser, [AC_HELP_STRING([--enable-generate-parser],
- [indicates that the parsers will be regenerated. This implies that the
+AC_ARG_ENABLE(generate_parser, [AS_HELP_STRING([--enable-generate-parser],[indicates that the parsers will be regenerated. This implies that the
bison and flex are required [default=no]])],
enable_generate_parser=$enableval, enable_generate_parser=no)
# It may likely work with earlier versions, but 2.7 was the oldest one we tested
# it with. We require python only if kea-shell was enabled. It is disabled
# by default to not introduce hard dependency on python.
-AC_ARG_ENABLE(shell, [AC_HELP_STRING([--enable-shell],
- [enable kea-shell, a text management client for Control Agent [default=no]])],
+AC_ARG_ENABLE(shell, [AS_HELP_STRING([--enable-shell],[enable kea-shell, a text management client for Control Agent [default=no]])],
enable_shell=$enableval, enable_shell=no)
-AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
- [regenerate documentation using Sphinx [default=no]])],
+AC_ARG_ENABLE(generate_docs, [AS_HELP_STRING([--enable-generate-docs],[regenerate documentation using Sphinx [default=no]])],
enable_generate_docs=$enableval, enable_generate_docs=no)
AM_PATH_PYTHON([2.7])
AC_ARG_WITH(site-packages,
- AC_HELP_STRING([--with-site-packages],
- [place to install Kea Python module]),
+ AS_HELP_STRING([--with-site-packages],[place to install Kea Python module]),
[pythondir=$withval;
pkgpythondir=${pythondir}/$PACKAGE_NAME])
if test "$pythondir" = "yes"; then
AM_CONDITIONAL(CA_TLS_TEST, test x$ca_tls_test != xno)
AC_ARG_WITH([sphinx],
- AC_HELP_STRING([--with-sphinx=PATH], [path to sphinx-build tool]),
+ AS_HELP_STRING([--with-sphinx=PATH],[path to sphinx-build tool]),
[sphinx_path="$withval"])
AC_ARG_WITH([pdflatex],
- AC_HELP_STRING([--with-pdflatex=PATH], [path to pdflatex tool]),
+ AS_HELP_STRING([--with-pdflatex=PATH],[path to pdflatex tool]),
[pdflatex_path="$withval"])
PDFLATEX=no
AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
AC_ARG_ENABLE(install-configurations,
- [AC_HELP_STRING([--disable-install-configurations],
- [do not install configuration])], install_configurations=$enableval, install_configurations=yes)
+ [AS_HELP_STRING([--disable-install-configurations],[do not install configuration])], install_configurations=$enableval, install_configurations=yes)
AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
-AC_ARG_ENABLE(logger-checks, [AC_HELP_STRING([--enable-logger-checks],
- [check logger messages [default=no]])], enable_logger_checks=$enableval, enable_logger_checks=no)
+AC_ARG_ENABLE(logger-checks, [AS_HELP_STRING([--enable-logger-checks],[check logger messages [default=no]])], enable_logger_checks=$enableval, enable_logger_checks=no)
AM_CONDITIONAL(ENABLE_LOGGER_CHECKS, test x$enable_logger_checks != xno)
AM_COND_IF([ENABLE_LOGGER_CHECKS], [AC_DEFINE([ENABLE_LOGGER_CHECKS], [1], [Check logger messages?])])
found_valgrind="found"
fi
-AC_ARG_ENABLE([fuzzing], [AC_HELP_STRING([--enable-fuzzing],
- [indicates that the code will be built with AFL (American Fuzzy Lop) support.
+AC_ARG_ENABLE([fuzzing], [AS_HELP_STRING([--enable-fuzzing],[indicates that the code will be built with AFL (American Fuzzy Lop) support.
Code built this way is unusable as a regular server. [default=no]])],
[enable_fuzzing=$enableval], [enable_fuzzing=no])
AM_CONDITIONAL([ENABLE_AFL], [test x$enable_fuzzing != xno])
# to reset internal state of getopt(). Failing to do so will result
# in unpredictable output from getopt().
AC_MSG_CHECKING([whether optreset variable is defined in unistd.h])
-AC_TRY_LINK(
- [#include <unistd.h>],
- [extern int optreset; optreset=1;],
- [ AC_MSG_RESULT(yes)
- var_optreset_exists=yes],
- [ AC_MSG_RESULT(no)
- var_optreset_exists=no]
-)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[extern int optreset; optreset=1;]])],[ AC_MSG_RESULT(yes)
+ var_optreset_exists=yes],[ AC_MSG_RESULT(no)
+ var_optreset_exists=no
+])
AM_CONDITIONAL(HAVE_OPTRESET, test "x$var_optreset_exists" != "xno")
AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPTRESET], [1], [Check for optreset?])])
#
# If explicitly specified, use it.
AC_ARG_WITH([boost-include],
- AC_HELP_STRING([--with-boost-include=PATH],
- [specify exact directory for Boost headers]),
+ AS_HELP_STRING([--with-boost-include=PATH],[specify exact directory for Boost headers]),
[boost_include_path="$withval"])
# If not specified, try some common paths.
if test -z "$with_boost_include"; then
# the code and we'll end up using the system header rather than the boost. For
# example, if your boost headers are in /usr/local/include/boost, you should
# use --with-boost-include=/usr/local/include
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <regex.h>
#ifdef BOOST_RE_REGEX_H
#error "boost/regex.h"
-#endif],,,
-[AC_MSG_ERROR([${boost_include_path}/regex.h is used in place of /usr/include/regex.h: when specifying path to boost, please omit the /boost at the end of the include path.])])
+#endif]], [[]])],[],[AC_MSG_ERROR([${boost_include_path}/regex.h is used in place of /usr/include/regex.h: when specifying path to boost, please omit the /boost at the end of the include path.])])
# clang can cause false positives with -Werror without -Qunused-arguments.
# it can be triggered if used with ccache.
# may depend on preceding header files, and if inconsistency happens
# it could lead to a critical disruption.
AC_MSG_CHECKING([whether Boost tries to use threads])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/config.hpp>
#ifdef BOOST_HAS_THREADS
#error "boost will use threads"
-#endif],,
-[AC_MSG_RESULT(no)
- CPPFLAGS_BOOST_THREADCONF="-DBOOST_DISABLE_THREADS=1"],
-[AC_MSG_RESULT(yes)])
+#endif]], [[]])],[AC_MSG_RESULT(no)
+ CPPFLAGS_BOOST_THREADCONF="-DBOOST_DISABLE_THREADS=1"],[AC_MSG_RESULT(yes)])
# Boost offset_ptr is known to not compile on some platforms, depending on
# boost version, its local configuration, and compiler. Detect it.
CXXFLAGS_SAVED="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $CLANG_CXXFLAGS -Werror"
AC_MSG_CHECKING([Boost offset_ptr compiles])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/interprocess/offset_ptr.hpp>
-],,
-[AC_MSG_RESULT(yes)
- BOOST_OFFSET_PTR_WOULDFAIL=no],
-[AC_MSG_RESULT(no)
+]], [[]])],[AC_MSG_RESULT(yes)
+ BOOST_OFFSET_PTR_WOULDFAIL=no],[AC_MSG_RESULT(no)
BOOST_OFFSET_PTR_WOULDFAIL=yes])
CXXFLAGS="$CXXFLAGS_SAVED"
CXXFLAGS="$CXXFLAGS $CLANG_CXXFLAGS -Werror"
AC_MSG_CHECKING([Boost numeric_cast compiles with -Werror])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/numeric/conversion/cast.hpp>
- ],[
+ ]], [[
return (boost::numeric_cast<short>(0));
- ],[AC_MSG_RESULT(yes)
- BOOST_NUMERIC_CAST_WOULDFAIL=no],
- [AC_MSG_RESULT(no)
+ ]])],[AC_MSG_RESULT(yes)
+ BOOST_NUMERIC_CAST_WOULDFAIL=no],[AC_MSG_RESULT(no)
BOOST_NUMERIC_CAST_WOULDFAIL=yes])
CXXFLAGS="$CXXFLAGS_SAVED"
# BOOST_STATIC_ASSERT in versions below Boost 1.54.0 is known to result
# in warnings with GCC 4.8. Detect it.
AC_MSG_CHECKING([BOOST_STATIC_ASSERT compiles])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/static_assert.hpp>
void testfn(void) { BOOST_STATIC_ASSERT(true); }
-],,
-[AC_MSG_RESULT(yes)
- BOOST_STATIC_ASSERT_WOULDFAIL=no],
-[AC_MSG_RESULT(no)
+]], [[]])],[AC_MSG_RESULT(yes)
+ BOOST_STATIC_ASSERT_WOULDFAIL=no],[AC_MSG_RESULT(no)
BOOST_STATIC_ASSERT_WOULDFAIL=yes])
# Get libs when explicitly configured
AC_ARG_WITH([boost-libs],
- AC_HELP_STRING([--with-boost-libs=SPEC],
- [specify Boost libraries to link with, e.g., '-lboost_system']),
+ AS_HELP_STRING([--with-boost-libs=SPEC],[specify Boost libraries to link with, e.g., '-lboost_system']),
[BOOST_LIBS="$withval"
DISTCHECK_BOOST_CONFIGURE_FLAG="$DISTCHECK_BOOST_CONFIGURE_FLAG --with-boost-libs=$withval"])
# Get lib dir when explicitly configured
AC_ARG_WITH([boost-lib-dir],
- AC_HELP_STRING([--with-boost-lib-dir=PATH],
- [specify directory where to find Boost libraries]),
+ AS_HELP_STRING([--with-boost-lib-dir=PATH],[specify directory where to find Boost libraries]),
[BOOST_LIB_DIR="$withval"
DISTCHECK_BOOST_CONFIGURE_FLAG="$DISTCHECK_BOOST_CONFIGURE_FLAG --with-boost-lib-dir=$withval"])
CPPFLAGS="$CPPFLAGS -DBOOST_ERROR_CODE_HEADER_ONLY"
CPPFLAGS="$CPPFLAGS -DBOOST_SYSTEM_NO_DEPRECATED"
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/system/error_code.hpp>
- ],,
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
+ ]], [[]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
AC_MSG_WARN([The Boost system library is required.])
BOOST_LIBS="-lboost_system"
if test "x${BOOST_LIB_DIR}" = "x"; then