Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/configure.ac
# -*- Autoconf -*- | # -*- Autoconf -*- | ||||
# Process this file with autoconf to produce a configure script. | # Process this file with autoconf to produce a configure script. | ||||
AC_PREREQ(2.56) | AC_PREREQ(2.56) | ||||
sinclude(acx_nlnetlabs.m4) | sinclude(acx_nlnetlabs.m4) | ||||
# must be numbers. ac_defun because of later processing. | # must be numbers. ac_defun because of later processing. | ||||
m4_define([VERSION_MAJOR],[1]) | m4_define([VERSION_MAJOR],[1]) | ||||
m4_define([VERSION_MINOR],[7]) | m4_define([VERSION_MINOR],[8]) | ||||
m4_define([VERSION_MICRO],[0]) | m4_define([VERSION_MICRO],[3]) | ||||
AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns) | AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns) | ||||
AC_CONFIG_SRCDIR([packet.c]) | AC_CONFIG_SRCDIR([packet.c]) | ||||
# needed to build correct soname | # needed to build correct soname | ||||
AC_SUBST(LDNS_VERSION_MAJOR, [VERSION_MAJOR]) | AC_SUBST(LDNS_VERSION_MAJOR, [VERSION_MAJOR]) | ||||
AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR]) | AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR]) | ||||
AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO]) | AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO]) | ||||
# Library version | # Library version | ||||
# --------------- | # --------------- | ||||
# current:revision:age | # current:revision:age | ||||
# (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat) | # (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat) | ||||
# if source code changes increment revision | # if source code changes increment revision | ||||
# if any interfaces have been added/removed/changed since last update then | # if any interfaces have been added/removed/changed since last update then | ||||
# increment current and set revision to 0 | # increment current and set revision to 0 | ||||
# if any interfaces have been added since the last public release then increment age | # if any interfaces have been added since the last public release then increment age | ||||
# if any interfaces have been removed or changed since the last public release then | # if any interfaces have been removed or changed since the last public release then | ||||
# set age to 0 | # set age to 0 | ||||
# | # | ||||
# ldns-1.6.17 and before had a .so with version same as VERSION_INFO | # ldns-1.6.17 and before had a .so with version same as VERSION_INFO | ||||
# ldns-1.7.0 will have libversion 2:0:0 | # ldns-1.7.0 had libversion 2:0:0 | ||||
# ldns-1.7.1 had libversion 3:0:0 (though it should have had 3:0:1) | |||||
# ldns-1.8.0 had libversion 4:0:2 (though it should have had 4:0:1) | |||||
# ldns-1.8.1 had libversion 5:0:2 | |||||
# ldns-1.8.1 had libversion 6:0:3 | |||||
# ldns-1.8.2 had libversion 7:0:4 | |||||
# ldns-1.8.3 has libversion 8:0:5 | |||||
# | # | ||||
AC_SUBST(VERSION_INFO, [2:0:0]) | AC_SUBST(VERSION_INFO, [8:0:5]) | ||||
AC_AIX | AC_AIX | ||||
if test "$ac_cv_header_minix_config_h" = "yes"; then | if test "$ac_cv_header_minix_config_h" = "yes"; then | ||||
AC_DEFINE(_NETBSD_SOURCE,1, [Enable for compile on Minix]) | AC_DEFINE(_NETBSD_SOURCE,1, [Enable for compile on Minix]) | ||||
fi | fi | ||||
LT_INIT | LT_INIT | ||||
AC_CONFIG_MACRO_DIR([m4]) | AC_CONFIG_MACRO_DIR([m4]) | ||||
OURCPPFLAGS='' | OURCPPFLAGS='' | ||||
CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}} | CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}} | ||||
CFLAGS="$CFLAGS" | CFLAGS="$CFLAGS" | ||||
# Checks for programs. | # Checks for programs. | ||||
AC_PROG_CC | AC_PROG_CC | ||||
ACX_DEPFLAG | ACX_DEPFLAG | ||||
AC_PROG_MAKE_SET | AC_PROG_MAKE_SET | ||||
# Extra (sp)lint flags for NetBSD | # Extra (sp)lint flags for NetBSD | ||||
AC_CANONICAL_HOST | AC_CANONICAL_HOST | ||||
case "$host_os" in | case "$host_os" in | ||||
netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS" | netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS" | ||||
;; | ;; | ||||
*) LINTFLAGS="$LINTFLAGS" | *) LINTFLAGS="$LINTFLAGS" | ||||
;; | ;; | ||||
esac | esac | ||||
AC_SUBST(LINTFLAGS) | AC_SUBST(LINTFLAGS) | ||||
AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled]) | AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled]) | ||||
Show All 29 Lines | |||||
fi | fi | ||||
ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"]) | ||||
#ACX_CHECK_COMPILER_FLAG(Wshadow, [CFLAGS="-Wshadow $CFLAGS"]) | #ACX_CHECK_COMPILER_FLAG(Wshadow, [CFLAGS="-Wshadow $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wunused-function, [CFLAGS="-Wunused-function $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wunused-function, [CFLAGS="-Wunused-function $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wmissing-prototypes, [CFLAGS="-Wmissing-prototypes $CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wmissing-prototypes, [CFLAGS="-Wmissing-prototypes $CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [CFLAGS="-fno-strict-aliasing $CFLAGS"]) | |||||
AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT]) | AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT]) | ||||
# MinGW32 tests | # MinGW32 tests | ||||
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) | AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) | ||||
# end mingw32 tests | # end mingw32 tests | ||||
# Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH | |||||
AC_CHECK_HEADERS([TargetConditionals.h]) | |||||
ACX_DETERMINE_EXT_FLAGS_UNBOUND | ACX_DETERMINE_EXT_FLAGS_UNBOUND | ||||
AC_C_INLINE | AC_C_INLINE | ||||
AC_CHECK_TYPE(int8_t, char) | AC_CHECK_TYPE(int8_t, char) | ||||
AC_CHECK_TYPE(int16_t, short) | AC_CHECK_TYPE(int16_t, short) | ||||
AC_CHECK_TYPE(int32_t, int) | AC_CHECK_TYPE(int32_t, int) | ||||
AC_CHECK_TYPE(int64_t, long long) | AC_CHECK_TYPE(int64_t, long long) | ||||
AC_CHECK_TYPE(uint8_t, unsigned char) | AC_CHECK_TYPE(uint8_t, unsigned char) | ||||
AC_CHECK_TYPE(uint16_t, unsigned short) | AC_CHECK_TYPE(uint16_t, unsigned short) | ||||
AC_CHECK_TYPE(uint32_t, unsigned int) | AC_CHECK_TYPE(uint32_t, unsigned int) | ||||
AC_CHECK_TYPE(uint64_t, unsigned long long) | AC_CHECK_TYPE(uint64_t, unsigned long long) | ||||
# my own checks | # my own checks | ||||
AC_CHECK_PROG(doxygen, doxygen, doxygen) | AC_CHECK_PROG(doxygen, doxygen, doxygen) | ||||
# check to see if libraries are needed for these functions. | # check to see if libraries are needed for these functions. | ||||
AC_SEARCH_LIBS([socket], [socket]) | AC_CHECK_FUNC([socket], | ||||
AC_SEARCH_LIBS([inet_pton], [nsl]) | [], | ||||
[AC_SEARCH_LIBS([socket], [socket]) | |||||
]) | |||||
# modern Linux provides inet_ntop in -lsocket. | |||||
# modern OS X provides inet_ntop in -lc. | |||||
# modern Solaris provides inet_ntop in -lsocket -lnsl. | |||||
# older Solaris provides inet_ntop in -lresolv. | |||||
AC_CHECK_FUNC([inet_ntop], | |||||
[], | |||||
[AC_SEARCH_LIBS([inet_ntop], [socket c nsl resolv], [ac_cv_func_inet_ntop=yes]) | |||||
]) | |||||
# modern Linux provides inet_pton in -lsocket. | |||||
# modern OS X provides inet_pton in -lc. | |||||
# modern Solaris provides inet_pton in -lsocket -lnsl. | |||||
# older Solaris provides inet_pton in -lresolv. | |||||
AC_CHECK_FUNC([inet_pton], | |||||
[], | |||||
[AC_SEARCH_LIBS([inet_pton], [socket c nsl resolv], [ac_cv_func_inet_pton=yes]) | |||||
]) | |||||
AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill], | AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill], | ||||
[Also build drill.]), | [Also build drill.]), | ||||
[],[with_drill="no"]) | [],[with_drill="no"]) | ||||
if test x_$with_drill != x_no ; then | if test x_$with_drill != x_no ; then | ||||
AC_SUBST(DRILL,[drill]) | AC_SUBST(DRILL,[drill]) | ||||
AC_SUBST(INSTALL_DRILL,[install-drill]) | AC_SUBST(INSTALL_DRILL,[install-drill]) | ||||
AC_SUBST(UNINSTALL_DRILL,[uninstall-drill]) | AC_SUBST(UNINSTALL_DRILL,[uninstall-drill]) | ||||
AC_SUBST(CLEAN_DRILL,[clean-drill]) | AC_SUBST(CLEAN_DRILL,[clean-drill]) | ||||
AC_SUBST(LINT_DRILL,[lint-drill]) | AC_SUBST(LINT_DRILL,[lint-drill]) | ||||
if test -e $srcdir/drill/config.h -o -e drill/config.h ; then | if test -e $srcdir/drill/config.h -o -e drill/config.h ; then | ||||
AC_MSG_ERROR([ | AC_MSG_ERROR([ | ||||
A config.h was detected in the drill subdirectory. | A config.h was detected in the drill subdirectory. | ||||
This does not work with the --with-drill option. | This does not work with the --with-drill option. | ||||
Please remove the config.h from the drill subdirectory | Please remove the config.h from the drill subdirectory | ||||
or do not use the --with-drill option.]) | or do not use the --with-drill option.]) | ||||
fi | fi | ||||
else | else | ||||
AC_SUBST(DRILL,[""]) | AC_SUBST(DRILL,[""]) | ||||
AC_SUBST(INSTALL_DRILL,[""]) | AC_SUBST(INSTALL_DRILL,[""]) | ||||
AC_SUBST(UNINSTALL_DRILL,[""]) | AC_SUBST(UNINSTALL_DRILL,[""]) | ||||
AC_SUBST(CLEAN_DRILL,[""]) | AC_SUBST(CLEAN_DRILL,[""]) | ||||
AC_SUBST(LINT_DRILL,[""]) | AC_SUBST(LINT_DRILL,[""]) | ||||
fi | fi | ||||
AC_ARG_WITH(examples, AC_HELP_STRING([--with-examples], | AC_ARG_WITH(examples, AC_HELP_STRING([--with-examples], | ||||
[Also build examples.]), | [Also build examples.]), | ||||
[],[with_examples="no"]) | [],[with_examples="no"]) | ||||
if test x_$with_examples != x_no ; then | if test x_$with_examples != x_no ; then | ||||
AC_SUBST(EXAMPLES,[examples]) | AC_SUBST(EXAMPLES,[examples]) | ||||
AC_SUBST(INSTALL_EXAMPLES,[install-examples]) | AC_SUBST(INSTALL_EXAMPLES,[install-examples]) | ||||
AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples]) | AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples]) | ||||
AC_SUBST(CLEAN_EXAMPLES,[clean-examples]) | AC_SUBST(CLEAN_EXAMPLES,[clean-examples]) | ||||
AC_SUBST(LINT_EXAMPLES,[lint-examples]) | AC_SUBST(LINT_EXAMPLES,[lint-examples]) | ||||
if test -e $srcdir/examples/config.h -o -e examples/config.h ; then | if test -e $srcdir/examples/config.h -o -e examples/config.h ; then | ||||
AC_MSG_ERROR([ | AC_MSG_ERROR([ | ||||
A config.h was detected in the examples subdirectory. | A config.h was detected in the examples subdirectory. | ||||
This does not work with the --with-examples option. | This does not work with the --with-examples option. | ||||
Please remove the config.h from the examples subdirectory | Please remove the config.h from the examples subdirectory | ||||
or do not use the --with-examples option.]) | or do not use the --with-examples option.]) | ||||
fi | fi | ||||
else | else | ||||
AC_SUBST(EXAMPLES,[""]) | AC_SUBST(EXAMPLES,[""]) | ||||
AC_SUBST(INSTALL_EXAMPLES,[""]) | AC_SUBST(INSTALL_EXAMPLES,[""]) | ||||
AC_SUBST(UNINSTALL_EXAMPLES,[""]) | AC_SUBST(UNINSTALL_EXAMPLES,[""]) | ||||
AC_SUBST(CLEAN_EXAMPLES,[""]) | AC_SUBST(CLEAN_EXAMPLES,[""]) | ||||
AC_SUBST(LINT_EXAMPLES,[""]) | AC_SUBST(LINT_EXAMPLES,[""]) | ||||
Show All 14 Lines | else | ||||
AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""]) | AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""]) | ||||
fi | fi | ||||
# add option to disable library printing to stderr | # add option to disable library printing to stderr | ||||
AC_ARG_ENABLE(stderr-msgs, AC_HELP_STRING([--enable-stderr-msgs], [Enable printing to stderr (default=disabled)]), enable_stderr_msgs=$enableval, enable_stderr_msgs=no) | AC_ARG_ENABLE(stderr-msgs, AC_HELP_STRING([--enable-stderr-msgs], [Enable printing to stderr (default=disabled)]), enable_stderr_msgs=$enableval, enable_stderr_msgs=no) | ||||
case "$enable_stderr_msgs" in | case "$enable_stderr_msgs" in | ||||
no) dnl default | no) dnl default | ||||
;; | ;; | ||||
*) | *) | ||||
AC_DEFINE_UNQUOTED([STDERR_MSGS], [1], [Define this to enable messages to stderr.]) | AC_DEFINE_UNQUOTED([STDERR_MSGS], [1], [Define this to enable messages to stderr.]) | ||||
;; | ;; | ||||
esac | esac | ||||
AX_HAVE_POLL( | AX_HAVE_POLL( | ||||
[AX_CONFIG_FEATURE_ENABLE(poll)], | [AX_CONFIG_FEATURE_ENABLE(poll)], | ||||
[AX_CONFIG_FEATURE_DISABLE(poll)]) | [AX_CONFIG_FEATURE_DISABLE(poll)]) | ||||
AX_CONFIG_FEATURE( | AX_CONFIG_FEATURE( | ||||
[poll], [This platform supports poll(7)], | [poll], [This platform supports poll(7)], | ||||
[HAVE_POLL], [This platform supports poll(7).]) | [HAVE_POLL], [This platform supports poll(7).]) | ||||
# check for python | # check for python | ||||
PYTHON_X_CFLAGS="" | PYTHON_X_CFLAGS="" | ||||
ldns_with_pyldns=no | ldns_with_pyldns=no | ||||
ldns_with_pyldnsx=no | ldns_with_pyldnsx=no | ||||
AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns], | AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns], | ||||
[generate python library, or --without-pyldns to disable Python support.]), | [generate python library, or --without-pyldns to disable Python support.]), | ||||
[],[ withval="no" ]) | [],[ withval="no" ]) | ||||
ldns_have_python=no | ldns_have_python=no | ||||
if test x_$withval != x_no; then | if test x_$withval != x_no; then | ||||
sinclude(ax_python_devel.m4) | sinclude(ax_python_devel.m4) | ||||
ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS | ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS | ||||
AX_PYTHON_DEVEL([>= '2.4.0']) | AX_PYTHON_DEVEL([>= '2.4.0']) | ||||
if test ! -z "$ac_python_version"; then | if test ! -z "$ac_python_version"; then | ||||
Show All 38 Lines | if test x_$withval != x_no; then | ||||
ACX_CHECK_COMPILER_FLAG(Wno-missing-field-initializers, [PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wno-missing-field-initializers, [PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wno-unused-parameter, [PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wno-unused-parameter, [PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"]) | ||||
ACX_CHECK_COMPILER_FLAG(Wno-unused-variable, [PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"]) | ACX_CHECK_COMPILER_FLAG(Wno-unused-variable, [PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"]) | ||||
fi | fi | ||||
fi | fi | ||||
AC_SUBST(PYTHON_X_CFLAGS) | AC_SUBST(PYTHON_X_CFLAGS) | ||||
# Check for pyldnsx | # Check for pyldnsx | ||||
AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx], | AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx], | ||||
[Do not install the ldnsx python module, or --with-pyldnsx to install it.]), | [Do not install the ldnsx python module, or --with-pyldnsx to install it.]), | ||||
[],[ withval="with_pyldns" ]) | [],[ withval="with_pyldns" ]) | ||||
if test x_$withval != x_no; then | if test x_$withval != x_no; then | ||||
if test x_$ldns_with_pyldns != x_no; then | if test x_$ldns_with_pyldns != x_no; then | ||||
AC_SUBST(PYLDNSX, "pyldnsx") | AC_SUBST(PYLDNSX, "pyldnsx") | ||||
ldns_with_pyldnsx=yes | ldns_with_pyldnsx=yes | ||||
else | else | ||||
if test x_$withval != x_with_pyldns; then | if test x_$withval != x_with_pyldns; then | ||||
AC_MSG_ERROR([--with-pyldns is needed for the ldnsx python module]) | AC_MSG_ERROR([--with-pyldns is needed for the ldnsx python module]) | ||||
Show All 13 Lines | if test x_$ldns_with_pyldnsx != x_no; then | ||||
AC_SUBST(PYLDNSXUNINST, "uninstall-pyldnsx") | AC_SUBST(PYLDNSXUNINST, "uninstall-pyldnsx") | ||||
else | else | ||||
AC_SUBST(PYLDNSXINST, "")dnl | AC_SUBST(PYLDNSXINST, "")dnl | ||||
AC_SUBST(PYLDNSXUNINST, "") | AC_SUBST(PYLDNSXUNINST, "") | ||||
fi | fi | ||||
# check for perl | # check for perl | ||||
ldns_with_p5_dns_ldns=no | ldns_with_p5_dns_ldns=no | ||||
AC_ARG_WITH(p5-dns-ldns, AC_HELP_STRING([--with-p5-dns-ldns], | AC_ARG_WITH(p5-dns-ldns, AC_HELP_STRING([--with-p5-dns-ldns], | ||||
[generate DNS::LDNS perl bindings]), | [generate DNS::LDNS perl bindings]), | ||||
[],[ withval="no" ]) | [],[ withval="no" ]) | ||||
ldns_have_perl=no | ldns_have_perl=no | ||||
if test x_$withval != x_no; then | if test x_$withval != x_no; then | ||||
AC_PATH_PROG([PERL], [perl]) | AC_PATH_PROG([PERL], [perl]) | ||||
if test -z "$PERL"; then | if test -z "$PERL"; then | ||||
AC_MSG_ERROR([Cannot find perl in your system path]) | AC_MSG_ERROR([Cannot find perl in your system path]) | ||||
fi | fi | ||||
AC_SUBST(P5_DNS_LDNS, "p5-dns-ldns")dnl | AC_SUBST(P5_DNS_LDNS, "p5-dns-ldns")dnl | ||||
Show All 19 Lines | |||||
ACX_WITH_SSL_OPTIONAL | ACX_WITH_SSL_OPTIONAL | ||||
AC_MSG_CHECKING([for LibreSSL]) | AC_MSG_CHECKING([for LibreSSL]) | ||||
if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then | if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([HAVE_LIBRESSL], [1], [Define if we have LibreSSL]) | AC_DEFINE([HAVE_LIBRESSL], [1], [Define if we have LibreSSL]) | ||||
else | else | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
fi | fi | ||||
AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new EVP_PKEY_base_id DSA_SIG_set0 DSA_SIG_get0 EVP_dss1 DSA_get0_pqg DSA_get0_key]) | AC_CHECK_HEADERS([openssl/ssl.h openssl/evp.h openssl/engine.h openssl/conf.h]) | ||||
AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new DSA_SIG_set0 DSA_SIG_get0 EVP_dss1 DSA_get0_pqg DSA_get0_key EVP_cleanup ENGINE_cleanup ENGINE_free CRYPTO_cleanup_all_ex_data ERR_free_strings CONF_modules_unload OPENSSL_init_ssl OPENSSL_init_crypto ERR_load_crypto_strings CRYPTO_memcmp EVP_PKEY_get_base_id]) | |||||
AC_CHECK_DECLS([EVP_PKEY_base_id], [ | |||||
AC_DEFINE_UNQUOTED([HAVE_EVP_PKEY_BASE_ID], [1], [Define to 1 if you have the EVP_PKEY_base_id function or macro.]) | |||||
], [], [AC_INCLUDES_DEFAULT | |||||
#include <openssl/evp.h> | |||||
]) | |||||
AC_MSG_CHECKING([Checking for OpenSSL >= 3.0.0]) | |||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ | |||||
#include <openssl/ssl.h> | |||||
#if OPENSSL_VERSION_MAJOR >= 3 | |||||
#define SOMETHING | |||||
#else | |||||
This fails compiling. | |||||
So either no OpenSSL at all (the include already failed), or the version < 3.0.0 | |||||
#endif | |||||
], [ | |||||
])], [ | |||||
AC_MSG_RESULT(yes) | |||||
CFLAGS="-DOPENSSL_API_COMPAT=10100 $CFLAGS" | |||||
], [ AC_MSG_RESULT(no) | |||||
]) | |||||
# for macosx, see if glibtool exists and use that | # for macosx, see if glibtool exists and use that | ||||
# BSD's need to know the version... | # BSD's need to know the version... | ||||
#AC_CHECK_PROG(glibtool, glibtool, [glibtool], ) | #AC_CHECK_PROG(glibtool, glibtool, [glibtool], ) | ||||
#AC_CHECK_PROGS(libtool, [libtool15 libtool], [./libtool]) | #AC_CHECK_PROGS(libtool, [libtool15 libtool], [./libtool]) | ||||
AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support])) | AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support])) | ||||
case "$enable_sha2" in | case "$enable_sha2" in | ||||
no) | no) | ||||
;; | ;; | ||||
yes|*) | yes|*) | ||||
if test "x$HAVE_SSL" != "xyes"; then | if test "x$HAVE_SSL" != "xyes"; then | ||||
AC_MSG_ERROR([SHA2 enabled, but no SSL support]) | AC_MSG_ERROR([SHA2 enabled, but no SSL support]) | ||||
fi | fi | ||||
AC_MSG_CHECKING(for SHA256 and SHA512) | AC_MSG_CHECKING(for SHA256 and SHA512) | ||||
AC_CHECK_FUNC(SHA256_Init, [], [ | AC_CHECK_FUNC(SHA256_Init, [], [ | ||||
AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2]) | AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2]) | ||||
]) | ]) | ||||
AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.]) | AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.]) | ||||
;; | ;; | ||||
esac | esac | ||||
# check wether gost also works | # check whether gost also works | ||||
AC_DEFUN([AC_CHECK_GOST_WORKS], | AC_DEFUN([AC_CHECK_GOST_WORKS], | ||||
[AC_REQUIRE([AC_PROG_CC]) | [AC_REQUIRE([AC_PROG_CC]) | ||||
AC_MSG_CHECKING([if GOST works]) | AC_MSG_CHECKING([if GOST works]) | ||||
if test c${cross_compiling} = cno; then | if test c${cross_compiling} = cno; then | ||||
BAKCFLAGS="$CFLAGS" | BAKCFLAGS="$CFLAGS" | ||||
if test -n "$ssldir"; then | if test -n "$ssldir"; then | ||||
if test ! -d "$ssldir/lib" -a -d "$ssldir/lib64"; then | |||||
CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib64" | |||||
else | |||||
CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib" | CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib" | ||||
fi | fi | ||||
fi | |||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[ | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||||
#include <string.h> | #include <string.h> | ||||
#ifdef HAVE_OPENSSL_SSL_H | |||||
#include <openssl/ssl.h> | #include <openssl/ssl.h> | ||||
#endif | |||||
#ifdef HAVE_OPENSSL_EVP_H | |||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
#endif | |||||
#ifdef HAVE_OPENSSL_ENGINE_H | |||||
#include <openssl/engine.h> | #include <openssl/engine.h> | ||||
#endif | |||||
#ifdef HAVE_OPENSSL_CONF_H | |||||
#include <openssl/conf.h> | #include <openssl/conf.h> | ||||
#endif | |||||
/* routine to load gost (from sldns) */ | /* routine to load gost (from sldns) */ | ||||
int load_gost_id(void) | int load_gost_id(void) | ||||
{ | { | ||||
static int gost_id = 0; | static int gost_id = 0; | ||||
const EVP_PKEY_ASN1_METHOD* meth; | const EVP_PKEY_ASN1_METHOD* meth; | ||||
ENGINE* e; | ENGINE* e; | ||||
if(gost_id) return gost_id; | if(gost_id) return gost_id; | ||||
Show All 28 Lines | if(!meth) { | ||||
/* algo not found */ | /* algo not found */ | ||||
ENGINE_finish(e); | ENGINE_finish(e); | ||||
ENGINE_free(e); | ENGINE_free(e); | ||||
return 0; | return 0; | ||||
} | } | ||||
EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); | EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); | ||||
return gost_id; | return gost_id; | ||||
} | } | ||||
int main(void) { | int main(void) { | ||||
EVP_MD_CTX* ctx; | EVP_MD_CTX* ctx; | ||||
const EVP_MD* md; | const EVP_MD* md; | ||||
unsigned char digest[64]; /* its a 256-bit digest, so uses 32 bytes */ | unsigned char digest[64]; /* its a 256-bit digest, so uses 32 bytes */ | ||||
const char* str = "Hello world"; | const char* str = "Hello world"; | ||||
const unsigned char check[] = { | const unsigned char check[] = { | ||||
0x40 , 0xed , 0xf8 , 0x56 , 0x5a , 0xc5 , 0x36 , 0xe1 , | 0x40 , 0xed , 0xf8 , 0x56 , 0x5a , 0xc5 , 0x36 , 0xe1 , | ||||
0x33 , 0x7c , 0x7e , 0x87 , 0x62 , 0x1c , 0x42 , 0xe0 , | 0x33 , 0x7c , 0x7e , 0x87 , 0x62 , 0x1c , 0x42 , 0xe0 , | ||||
0x17 , 0x1b , 0x5e , 0xce , 0xa8 , 0x46 , 0x65 , 0x4d , | 0x17 , 0x1b , 0x5e , 0xce , 0xa8 , 0x46 , 0x65 , 0x4d , | ||||
Show All 33 Lines | case "$enable_gost" in | ||||
*) dnl default | *) dnl default | ||||
if test "x$HAVE_SSL" != "xyes"; then | if test "x$HAVE_SSL" != "xyes"; then | ||||
AC_MSG_ERROR([GOST enabled, but no SSL support]) | AC_MSG_ERROR([GOST enabled, but no SSL support]) | ||||
fi | fi | ||||
AC_MSG_CHECKING(for GOST) | AC_MSG_CHECKING(for GOST) | ||||
AC_CHECK_FUNC(EVP_PKEY_set_type_str, [],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support or rerun with --disable-gost])]) | AC_CHECK_FUNC(EVP_PKEY_set_type_str, [],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support or rerun with --disable-gost])]) | ||||
AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([No ECC functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-gost])]) | AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([No ECC functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-gost])]) | ||||
AC_CHECK_GOST_WORKS | AC_CHECK_GOST_WORKS | ||||
AC_ARG_ENABLE(gost-anyway, AC_HELP_STRING([--enable-gost-anyway], [Enable GOST even whithout a GOST engine installed])) | AC_ARG_ENABLE(gost-anyway, AC_HELP_STRING([--enable-gost-anyway], [Enable GOST even without a GOST engine installed])) | ||||
if test "$ac_cv_c_gost_works" != "no" -o "$enable_gost_anyway" = "yes"; then | if test "$ac_cv_c_gost_works" != "no" -o "$enable_gost_anyway" = "yes"; then | ||||
if test "$ac_cv_c_gost_works" = "no"; then | if test "$ac_cv_c_gost_works" = "no"; then | ||||
AC_MSG_RESULT([no, but compiling with GOST support anyway]) | AC_MSG_RESULT([no, but compiling with GOST support anyway]) | ||||
else | else | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
fi | fi | ||||
use_gost="yes" | use_gost="yes" | ||||
AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.]) | AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.]) | ||||
Show All 22 Lines | #include <openssl/evp.h> | ||||
# we now know we have ECDSA and the required curves. | # we now know we have ECDSA and the required curves. | ||||
AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.]) | AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.]) | ||||
;; | ;; | ||||
esac | esac | ||||
AC_ARG_ENABLE(dsa, AC_HELP_STRING([--disable-dsa], [Disable DSA support])) | AC_ARG_ENABLE(dsa, AC_HELP_STRING([--disable-dsa], [Disable DSA support])) | ||||
case "$enable_dsa" in | case "$enable_dsa" in | ||||
no) | no) | ||||
AC_SUBST(ldns_build_config_use_dsa, 0) | |||||
;; | ;; | ||||
*) dnl default | *) dnl default | ||||
# detect if DSA is supported, and turn it off if not. | # detect if DSA is supported, and turn it off if not. | ||||
AC_CHECK_FUNC(DSA_SIG_new, [ | AC_CHECK_FUNC(DSA_SIG_new, [ | ||||
AC_DEFINE_UNQUOTED([USE_DSA], [1], [Define this to enable DSA support.]) | AC_DEFINE_UNQUOTED([USE_DSA], [1], [Define this to enable DSA support.]) | ||||
AC_SUBST(ldns_build_config_use_dsa, 1) | |||||
], [if test "x$enable_dsa" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support DSA and you used --enable-dsa.]) | ], [if test "x$enable_dsa" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support DSA and you used --enable-dsa.]) | ||||
fi ]) | fi | ||||
AC_SUBST(ldns_build_config_use_dsa, 0)]) | |||||
;; | ;; | ||||
esac | esac | ||||
AC_ARG_ENABLE(ed25519, AC_HELP_STRING([--enable-ed25519], [Enable ED25519 support (experimental)])) | AC_ARG_ENABLE(ed25519, AC_HELP_STRING([--disable-ed25519], [Disable (experimental) ED25519 support. Default is detect])) | ||||
case "$enable_ed25519" in | case "$enable_ed25519" in | ||||
yes) | no) | ||||
if test "x$HAVE_SSL" != "xyes"; then | AC_SUBST(ldns_build_config_use_ed25519, 0) | ||||
AC_MSG_ERROR([ED25519 enabled, but no SSL support]) | ;; | ||||
*) dnl default | |||||
AC_CHECK_DECLS([NID_ED25519], [ | |||||
AC_DEFINE_UNQUOTED([USE_ED25519], [1], [Define this to enable ED25519 support.]) | |||||
AC_SUBST(ldns_build_config_use_ed25519, 1) | |||||
], [if test "x$enable_ed25519" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED25519 and you used --enable-ed25519.]) | |||||
fi | fi | ||||
AC_CHECK_DECLS([NID_X25519], [], [AC_MSG_ERROR([OpenSSL does not support the EDDSA curve: please upgrade OpenSSL or rerun with --disable-ed25519])], [AC_INCLUDES_DEFAULT | AC_SUBST(ldns_build_config_use_ed25519, 0)], [AC_INCLUDES_DEFAULT | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]) | ]) | ||||
AC_DEFINE_UNQUOTED([USE_ED25519], [1], [Define this to enable ED25519 support.]) | |||||
;; | ;; | ||||
*|no) dnl default | |||||
;; | |||||
esac | esac | ||||
AC_ARG_ENABLE(ed448, AC_HELP_STRING([--enable-ed448], [Enable ED448 support (experimental)])) | AC_ARG_ENABLE(ed448, AC_HELP_STRING([--disable-ed448], [Disable (experimental) ED448 support. Default is detect])) | ||||
case "$enable_ed448" in | case "$enable_ed448" in | ||||
yes) | no) | ||||
if test "x$HAVE_SSL" != "xyes"; then | AC_SUBST(ldns_build_config_use_ed448, 0) | ||||
AC_MSG_ERROR([ED448 enabled, but no SSL support]) | ;; | ||||
*) dnl default | |||||
AC_CHECK_DECLS([NID_ED448], [ | |||||
AC_DEFINE_UNQUOTED([USE_ED448], [1], [Define this to enable ED448 support.]) | |||||
AC_SUBST(ldns_build_config_use_ed448, 1) | |||||
], [if test "x$enable_ed448" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support ED448 and you used --enable-ed448.]) | |||||
fi | fi | ||||
AC_CHECK_DECLS([NID_X448], [], [AC_MSG_ERROR([OpenSSL does not support the EDDSA curve: please upgrade OpenSSL or rerun with --disable-ed448])], [AC_INCLUDES_DEFAULT | AC_SUBST(ldns_build_config_use_ed448, 0)], [AC_INCLUDES_DEFAULT | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]) | ]) | ||||
AC_DEFINE_UNQUOTED([USE_ED448], [1], [Define this to enable ED448 support.]) | |||||
;; | ;; | ||||
*|no) dnl default | |||||
;; | |||||
esac | esac | ||||
AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support])) | AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support])) | ||||
AC_ARG_ENABLE(dane-verify, AC_HELP_STRING([--disable-dane-verify], [Disable DANE verify support])) | AC_ARG_ENABLE(dane-verify, AC_HELP_STRING([--disable-dane-verify], [Disable DANE verify support])) | ||||
AC_ARG_ENABLE(dane-ta-usage, AC_HELP_STRING([--disable-dane-ta-usage], [Disable DANE-TA usage type support])) | AC_ARG_ENABLE(dane-ta-usage, AC_HELP_STRING([--disable-dane-ta-usage], [Disable DANE-TA usage type support])) | ||||
AC_ARG_ENABLE(full-dane,, [ | AC_ARG_ENABLE(full-dane,, [ | ||||
enable_dane_ta_usage=yes | enable_dane_ta_usage=yes | ||||
Show All 31 Lines | case "$enable_dane" in | ||||
*) | *) | ||||
AC_SUBST(ldns_build_config_use_dane_verify, 1) | AC_SUBST(ldns_build_config_use_dane_verify, 1) | ||||
AC_DEFINE_UNQUOTED([USE_DANE_VERIFY], [1], [Define this to enable DANE verify support.]) | AC_DEFINE_UNQUOTED([USE_DANE_VERIFY], [1], [Define this to enable DANE verify support.]) | ||||
case "$enable_dane_ta_usage" in | case "$enable_dane_ta_usage" in | ||||
no) | no) | ||||
AC_SUBST(ldns_build_config_use_dane_ta_usage, 0) | AC_SUBST(ldns_build_config_use_dane_ta_usage, 0) | ||||
;; | ;; | ||||
*) dnl default | *) dnl default | ||||
LIBS="-lssl $LIBS" | danetmpLIBS="$LIBS" | ||||
LIBS="-lssl -lcrypto $LIBS" | |||||
AC_CHECK_FUNC(SSL_get0_dane, [], [AC_MSG_ERROR([OpenSSL does not support offline DANE verification (Needed for the DANE-TA usage type). Please upgrade OpenSSL to version >= 1.1.0 or rerun with --disable-dane-verify or --disable-dane-ta-usage])]) | AC_CHECK_FUNC(SSL_get0_dane, [], [AC_MSG_ERROR([OpenSSL does not support offline DANE verification (Needed for the DANE-TA usage type). Please upgrade OpenSSL to version >= 1.1.0 or rerun with --disable-dane-verify or --disable-dane-ta-usage])]) | ||||
LIBSSL_LIBS="$LIBSSL_LIBS -lssl" | LIBSSL_LIBS="-lssl $LIBSSL_LIBS" | ||||
LIBS="$danetmpLIBS" | |||||
AC_SUBST(ldns_build_config_use_dane_ta_usage, 1) | AC_SUBST(ldns_build_config_use_dane_ta_usage, 1) | ||||
AC_DEFINE_UNQUOTED([USE_DANE_TA_USAGE], [1], [Define this to enable DANE-TA usage type support.]) | AC_DEFINE_UNQUOTED([USE_DANE_TA_USAGE], [1], [Define this to enable DANE-TA usage type support.]) | ||||
;; | ;; | ||||
esac | esac | ||||
esac | esac | ||||
;; | ;; | ||||
esac | esac | ||||
Show All 32 Lines | |||||
AC_ARG_ENABLE(rrtype-avc, AC_HELP_STRING([--enable-rrtype-avc], [Enable draft RR type avc.])) | AC_ARG_ENABLE(rrtype-avc, AC_HELP_STRING([--enable-rrtype-avc], [Enable draft RR type avc.])) | ||||
case "$enable_rrtype_avc" in | case "$enable_rrtype_avc" in | ||||
yes) | yes) | ||||
AC_DEFINE_UNQUOTED([RRTYPE_AVC], [], [Define this to enable RR type AVC.]) | AC_DEFINE_UNQUOTED([RRTYPE_AVC], [], [Define this to enable RR type AVC.]) | ||||
;; | ;; | ||||
no|*) | no|*) | ||||
;; | ;; | ||||
esac | esac | ||||
AC_ARG_ENABLE(rrtype-doa, AC_HELP_STRING([--enable-rrtype-doa], [Enable draft RR type DOA.])) | |||||
case "$enable_rrtype_doa" in | |||||
yes) | |||||
AC_DEFINE_UNQUOTED([RRTYPE_DOA], [], [Define this to enable RR type DOA.]) | |||||
;; | |||||
no|*) | |||||
;; | |||||
esac | |||||
AC_ARG_ENABLE(rrtype-amtrelay, AC_HELP_STRING([--enable-rrtype-amtrelay], [Enable draft RR type AMTRELAY.])) | |||||
case "$enable_rrtype_amtrelay" in | |||||
yes) | |||||
AC_DEFINE_UNQUOTED([RRTYPE_AMTRELAY], [], [Define this to enable RR type AMTRELAY.]) | |||||
;; | |||||
no|*) | |||||
;; | |||||
esac | |||||
AC_ARG_ENABLE(rrtype-svcb-https, AC_HELP_STRING([--disable-rrtype-svcb-https], [Disable RR types SVCB and HTTPS.])) | |||||
case "$enable_rrtype_svcb_https" in | |||||
no) | |||||
;; | |||||
yes|*) | |||||
AC_DEFINE_UNQUOTED([RRTYPE_SVCB_HTTPS], [], [Define this to enable RR types SVCB and HTTPS.]) | |||||
;; | |||||
esac | |||||
AC_SUBST(LIBSSL_CPPFLAGS) | AC_SUBST(LIBSSL_CPPFLAGS) | ||||
AC_SUBST(LIBSSL_LDFLAGS) | AC_SUBST(LIBSSL_LDFLAGS) | ||||
AC_SUBST(LIBSSL_LIBS) | AC_SUBST(LIBSSL_LIBS) | ||||
if test "x$HAVE_SSL" = "xyes"; then | if test "x$HAVE_SSL" = "xyes"; then | ||||
AC_SUBST(LIBSSL_SSL_LIBS, ["-lssl $LIBSSL_LIBS"]) | if echo "$LIBSSL_LIBS" | grep -- "-lssl" >/dev/null 2>&1; then | ||||
LIBSSL_SSL_LIBS="$LIBSSL_LIBS" | |||||
else | |||||
LIBSSL_SSL_LIBS="-lssl $LIBSSL_LIBS" | |||||
fi | fi | ||||
AC_SUBST(LIBSSL_SSL_LIBS, "$LIBSSL_SSL_LIBS") | |||||
fi | |||||
CPPFLAGS=$tmp_CPPFLAGS | CPPFLAGS=$tmp_CPPFLAGS | ||||
LDFLAGS=$tmp_LDFLAGS | LDFLAGS=$tmp_LDFLAGS | ||||
LIBS=$tmp_LIBS | LIBS=$tmp_LIBS | ||||
# add option to disable the evil rpath | # add option to disable the evil rpath | ||||
ACX_ARG_RPATH | ACX_ARG_RPATH | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | AC_CHECK_LIB(pcap, pcap_open_offline, [ | ||||
AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl` | AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl` | ||||
AC_SUBST([LIBPCAP_LIBS], [-lpcap]) | AC_SUBST([LIBPCAP_LIBS], [-lpcap]) | ||||
], [ | ], [ | ||||
AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)])dnl' | AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)])dnl' | ||||
AC_SUBST([LIBPCAP_LIBS], []) | AC_SUBST([LIBPCAP_LIBS], []) | ||||
] | ] | ||||
) | ) | ||||
AC_CHECK_HEADERS([netinet/in_systm.h net/if.h netinet/ip.h netinet/udp.h netinet/igmp.h netinet/if_ether.h netinet/ip6.h net/ethernet.h netinet/ip_compat.h],,, [ | AC_CHECK_HEADERS([netinet/in_systm.h net/if.h netinet/ip.h netinet/udp.h netinet/igmp.h netinet/if_ether.h netinet/ip6.h net/ethernet.h netinet/ip_compat.h],,, [ | ||||
AC_INCLUDES_DEFAULT | AC_INCLUDES_DEFAULT | ||||
#ifdef HAVE_NETINET_IN_SYSTM_H | #ifdef HAVE_NETINET_IN_SYSTM_H | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_NETINET_IN_H | #ifdef HAVE_NETINET_IN_H | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_SOCKET_H | #ifdef HAVE_SYS_SOCKET_H | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
Show All 24 Lines | |||||
#if HAVE_SYS_TYPES_H | #if HAVE_SYS_TYPES_H | ||||
# include <sys/types.h> | # include <sys/types.h> | ||||
#endif | #endif | ||||
#if HAVE_NETINET_IN_H | #if HAVE_NETINET_IN_H | ||||
# include <netinet/in.h> | # include <netinet/in.h> | ||||
#endif]) | #endif]) | ||||
ACX_CHECK_SS_FAMILY | ACX_CHECK_SS_FAMILY | ||||
AC_FUNC_MALLOC | # AC_FUNC_MALLOC suffers false failures and causes Asan failures. | ||||
AC_FUNC_REALLOC | # AC_FUNC_MALLOC | ||||
# AC_FUNC_REALLOC | |||||
AC_REPLACE_FUNCS(b64_pton) | AC_REPLACE_FUNCS(b64_pton) | ||||
AC_REPLACE_FUNCS(b64_ntop) | AC_REPLACE_FUNCS(b64_ntop) | ||||
AC_REPLACE_FUNCS(calloc) | AC_REPLACE_FUNCS(calloc) | ||||
AC_REPLACE_FUNCS(timegm) | AC_REPLACE_FUNCS(timegm) | ||||
AC_REPLACE_FUNCS(gmtime_r) | AC_REPLACE_FUNCS(gmtime_r) | ||||
AC_REPLACE_FUNCS(ctime_r) | AC_REPLACE_FUNCS(ctime_r) | ||||
AC_REPLACE_FUNCS(localtime_r) | AC_REPLACE_FUNCS(localtime_r) | ||||
AC_REPLACE_FUNCS(isblank) | AC_REPLACE_FUNCS(isblank) | ||||
AC_REPLACE_FUNCS(isascii) | AC_REPLACE_FUNCS(isascii) | ||||
AC_REPLACE_FUNCS(inet_aton) | AC_REPLACE_FUNCS(inet_aton) | ||||
AC_REPLACE_FUNCS(inet_pton) | AC_REPLACE_FUNCS(inet_pton) | ||||
AC_REPLACE_FUNCS(inet_ntop) | AC_REPLACE_FUNCS(inet_ntop) | ||||
AC_REPLACE_FUNCS(snprintf) | AC_REPLACE_FUNCS(snprintf) | ||||
AC_REPLACE_FUNCS(strlcpy) | AC_REPLACE_FUNCS(strlcpy) | ||||
AC_REPLACE_FUNCS(memmove) | AC_REPLACE_FUNCS(memmove) | ||||
AC_FUNC_FORK | AC_FUNC_FORK | ||||
AC_MSG_CHECKING([compile of fork]) | |||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ | |||||
#include <unistd.h> | |||||
], [ | |||||
(void)fork(); | |||||
])], [ | |||||
AC_MSG_RESULT(yes) | |||||
AC_DEFINE([HAVE_FORK_AVAILABLE], 1, [if fork is available for compile]) | |||||
], [ AC_MSG_RESULT(no) | |||||
]) | |||||
AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton]) | AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton]) | ||||
if test "x$HAVE_B32_NTOP" = "xyes"; then | if test "x$HAVE_B32_NTOP" = "xyes"; then | ||||
AC_SUBST(ldns_build_config_have_b32_ntop, 1) | AC_SUBST(ldns_build_config_have_b32_ntop, 1) | ||||
else | else | ||||
AC_SUBST(ldns_build_config_have_b32_ntop, 0) | AC_SUBST(ldns_build_config_have_b32_ntop, 0) | ||||
fi | fi | ||||
if test "x$HAVE_B32_PTON" = "xyes"; then | if test "x$HAVE_B32_PTON" = "xyes"; then | ||||
AC_SUBST(ldns_build_config_have_b32_pton, 1) | AC_SUBST(ldns_build_config_have_b32_pton, 1) | ||||
Show All 10 Lines | |||||
fi | fi | ||||
ACX_FUNC_IOCTLSOCKET | ACX_FUNC_IOCTLSOCKET | ||||
#AC_SEARCH_LIBS(RSA_new, [crypto]) | #AC_SEARCH_LIBS(RSA_new, [crypto]) | ||||
ACX_CHECK_FORMAT_ATTRIBUTE | ACX_CHECK_FORMAT_ATTRIBUTE | ||||
ACX_CHECK_UNUSED_ATTRIBUTE | ACX_CHECK_UNUSED_ATTRIBUTE | ||||
AC_ARG_WITH(xcode-sdk, AC_HELP_STRING([--with-xcode-sdk], | |||||
[Set xcode SDK version. Default is autodetect]), | |||||
[],[with_xcode_sdk="yes"]) | |||||
if test "x_$with_xcode_sdk" != "x_no" ; then | |||||
# check OSX deployment target, if needed | # check OSX deployment target, if needed | ||||
if echo $build_os | grep darwin > /dev/null; then | if echo $target_os | grep darwin > /dev/null; then | ||||
sdk_p=`xcode-select -print-path`; | sdk_p=`xcode-select -print-path`; | ||||
sdk_v="$( /usr/bin/xcrun --show-sdk-version )"; | if test "x_$with_xcode_sdk" = "x_yes" ; then | ||||
sdk_v="$( /usr/bin/xcrun --show-sdk-version 2>/dev/null )" | |||||
else | |||||
sdk_v="$with_xcode_sdk" | |||||
fi | |||||
# xcrun only got that option in 10.7 | |||||
if test -z "$sdk_v" ; then | |||||
sdk_c="10.6" | |||||
sdk_v="10.6" | |||||
fi | |||||
SYSROOT="$( find ${sdk_p} -name MacOSX${sdk_v}.sdk )" | |||||
case $sdk_v in | case $sdk_v in | ||||
10.9|10.8) sdk_c="10.7";; | 10.9|10.8) sdk_c="10.7";; | ||||
10.11|10.10|*) sdk_c="10.10";; | 10.11|10.10|*) sdk_c="10.10";; | ||||
esac | esac | ||||
export MACOSX_DEPLOYMENT_TARGET="${sdk_c}"; | export MACOSX_DEPLOYMENT_TARGET="${sdk_c}"; | ||||
export CFLAGS="$CFLAGS -mmacosx-version-min=${sdk_c} -isysroot ${sdk_p}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_v}.sdk"; | export CFLAGS="$CFLAGS -mmacosx-version-min=${sdk_c} -isysroot ${SYSROOT}" | ||||
fi | fi | ||||
fi | |||||
AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir]) | AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir]) | ||||
AC_ARG_WITH(trust-anchor, AC_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file for drill and ldns-dane. [default=SYSCONFDIR/unbound/root.key]]), [ | AC_ARG_WITH(trust-anchor, AC_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file for drill and ldns-dane. [default=SYSCONFDIR/unbound/root.key]]), [ | ||||
AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["$withval"]) | AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["$withval"]) | ||||
AC_MSG_NOTICE([Default trust anchor: $withval]) | AC_MSG_NOTICE([Default trust anchor: $withval]) | ||||
],[ | ],[ | ||||
AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["\$(sysconfdir)/unbound/root.key"]) | AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["\$(sysconfdir)/unbound/root.key"]) | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | |||||
void *memmove(void *dest, const void *src, size_t n); | void *memmove(void *dest, const void *src, size_t n); | ||||
#endif | #endif | ||||
#ifndef HAVE_STRLCPY | #ifndef HAVE_STRLCPY | ||||
size_t strlcpy(char *dst, const char *src, size_t siz); | size_t strlcpy(char *dst, const char *src, size_t siz); | ||||
#endif | #endif | ||||
#ifdef USE_WINSOCK | #ifdef USE_WINSOCK | ||||
#define SOCK_INVALID INVALID_SOCKET | #define SOCK_INVALID INVALID_SOCKET | ||||
#define close_socket(_s) do { if (_s > SOCK_INVALID) {closesocket(_s); _s = SOCK_INVALID;} } while(0) | #define close_socket(_s) do { if (_s != SOCK_INVALID) {closesocket(_s); _s = -1;} } while(0) | ||||
#else | #else | ||||
#define SOCK_INVALID -1 | #define SOCK_INVALID -1 | ||||
#define close_socket(_s) do { if (_s > SOCK_INVALID) {close(_s); _s = SOCK_INVALID;} } while(0) | #define close_socket(_s) do { if (_s != SOCK_INVALID) {close(_s); _s = -1;} } while(0) | ||||
#endif | #endif | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#ifndef HAVE_GETADDRINFO | #ifndef HAVE_GETADDRINFO | ||||
#include "compat/fake-rfc2553.h" | #include "compat/fake-rfc2553.h" | ||||
#endif | #endif | ||||
Show All 13 Lines | else | ||||
AC_SUBST(ldns_build_config_have_attr_format, 0) | AC_SUBST(ldns_build_config_have_attr_format, 0) | ||||
fi | fi | ||||
if test "x$ac_cv_c_unused_attribute" = "xyes"; then | if test "x$ac_cv_c_unused_attribute" = "xyes"; then | ||||
AC_SUBST(ldns_build_config_have_attr_unused, 1) | AC_SUBST(ldns_build_config_have_attr_unused, 1) | ||||
else | else | ||||
AC_SUBST(ldns_build_config_have_attr_unused, 0) | AC_SUBST(ldns_build_config_have_attr_unused, 0) | ||||
fi | fi | ||||
CONFIG_FILES="Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config" | CONFIG_FILES="Makefile libdns.doxygen ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config" | ||||
AC_SUBST(CONFIG_FILES) | AC_SUBST(CONFIG_FILES) | ||||
AC_CONFIG_FILES([$CONFIG_FILES]) | AC_CONFIG_FILES([$CONFIG_FILES]) | ||||
AC_CONFIG_HEADER([ldns/config.h]) | AC_CONFIG_HEADER([ldns/config.h]) | ||||
AC_OUTPUT | AC_OUTPUT | ||||
COPY_HEADER_FILES(ldns/, ldns/) | COPY_HEADER_FILES(ldns/, ldns/) | ||||
dnl AC_CONFIG_SUBDIRS([drill]) | dnl AC_CONFIG_SUBDIRS([drill]) | ||||