summaryrefslogtreecommitdiffstats
path: root/contrib/unbound/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/unbound/configure.ac')
-rw-r--r--contrib/unbound/configure.ac186
1 files changed, 82 insertions, 104 deletions
diff --git a/contrib/unbound/configure.ac b/contrib/unbound/configure.ac
index 180b9d7..5eaab75 100644
--- a/contrib/unbound/configure.ac
+++ b/contrib/unbound/configure.ac
@@ -2,15 +2,22 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
sinclude(acx_nlnetlabs.m4)
-sinclude(acx_pthread.m4)
+sinclude(ax_pthread.m4)
sinclude(acx_python.m4)
sinclude(ac_pkg_swig.m4)
-AC_INIT(unbound, 1.4.20, unbound-bugs@nlnetlabs.nl, unbound)
-
-LIBUNBOUND_CURRENT=3
-LIBUNBOUND_REVISION=5
-LIBUNBOUND_AGE=1
+# must be numbers. ac_defun because of later processing
+m4_define([VERSION_MAJOR],[1])
+m4_define([VERSION_MINOR],[4])
+m4_define([VERSION_MICRO],[22])
+AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound)
+AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR])
+AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR])
+AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO])
+
+LIBUNBOUND_CURRENT=4
+LIBUNBOUND_REVISION=1
+LIBUNBOUND_AGE=2
# 1.0.0 had 0:12:0
# 1.0.1 had 0:13:0
# 1.0.2 had 0:14:0
@@ -45,7 +52,8 @@ LIBUNBOUND_AGE=1
# 1.4.17 had 3:2:1
# 1.4.18 had 3:3:1
# 1.4.19 had 3:4:1
-# 1.4.20 had 4:0:2 # adds libunbound.ttl
+# 1.4.20 had 4:0:2 # adds libunbound.ttl # but shipped 3:5:1
+# 1.4.21 had 4:1:2
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
@@ -71,6 +79,9 @@ AC_SUBST(LIBUNBOUND_AGE)
CFLAGS="$CFLAGS"
AC_AIX
+if test "$ac_cv_header_minix_config_h" = "yes"; then
+ AC_DEFINE(_NETBSD_SOURCE,1, [Enable for compile on Minix])
+fi
dnl
dnl By default set prefix to /usr/local
@@ -275,6 +286,20 @@ ACX_TYPE_IN_ADDR_T
ACX_TYPE_IN_PORT_T
ACX_CHECK_MEMCMP_SIGNED
+AC_CHECK_SIZEOF(time_t,,[
+AC_INCLUDES_DEFAULT
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+])
+
# add option to disable the evil rpath
ACX_ARG_RPATH
AC_SUBST(RUNTIME_PATH)
@@ -371,7 +396,7 @@ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
[ ],[ withval="yes" ])
ub_have_pthreads=no
if test x_$withval != x_no; then
- ACX_PTHREAD([
+ AX_PTHREAD([
AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
@@ -579,7 +604,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/conf.h>
-/* routine to load gost from ldns */
+/* routine to load gost (from sldns) */
int load_gost_id(void)
{
static int gost_id = 0;
@@ -707,6 +732,16 @@ case "$enable_ecdsa" in
;;
esac
+AC_ARG_ENABLE(event-api, AC_HELP_STRING([--enable-event-api], [Enable (experimental) libevent-based libunbound API installed to unbound-event.h]))
+use_unbound_event="no"
+case "$enable_event_api" in
+ yes)
+ use_unbound_event="yes"
+ ;;
+ *)
+ ;;
+esac
+
# check for libevent
AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
[use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]),
@@ -718,7 +753,7 @@ if test x_$withval = x_yes -o x_$withval != x_no; then
fi
for dir in $withval; do
thedir="$dir"
- if test -f "$dir/include/event.h"; then
+ if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then
found_libevent="yes"
dnl assume /usr is in default path.
if test "$thedir" != "/usr"; then
@@ -754,10 +789,16 @@ large outgoing port ranges. ])
fi
else
AC_MSG_RESULT(found in $thedir)
- dnl assume /usr is in default path, do not add "".
- if test "$thedir" != "/usr" -a "$thedir" != ""; then
- LDFLAGS="$LDFLAGS -L$thedir/lib"
- ACX_RUNTIME_PATH_ADD([$thedir/lib])
+ dnl if event2 exists and no event lib in dir itself, use subdir
+ if test ! -f $thedir/lib/libevent.a -a ! -f $thedir/lib/libevent.so -a -d "$thedir/lib/event2"; then
+ LDFLAGS="$LDFLAGS -L$thedir/lib/event2"
+ ACX_RUNTIME_PATH_ADD([$thedir/lib/event2])
+ else
+ dnl assume /usr is in default path, do not add "".
+ if test "$thedir" != "/usr" -a "$thedir" != ""; then
+ LDFLAGS="$LDFLAGS -L$thedir/lib"
+ ACX_RUNTIME_PATH_ADD([$thedir/lib])
+ fi
fi
fi
# check for library used by libevent after 1.3c
@@ -781,6 +822,10 @@ large outgoing port ranges. ])
if test -n "$BAK_LDFLAGS_SET"; then
LDFLAGS="$BAK_LDFLAGS"
fi
+ if test "$use_unbound_event" = "yes"; then
+ AC_SUBST(UNBOUND_EVENT_INSTALL, [unbound-event-install])
+ AC_SUBST(UNBOUND_EVENT_UNINSTALL, [unbound-event-uninstall])
+ fi
else
AC_DEFINE(USE_MINI_EVENT, 1, [Define if you want to use internal select based events])
fi
@@ -812,7 +857,7 @@ AC_CHECK_HEADERS([expat.h],,, [AC_INCLUDES_DEFAULT])
AC_SUBST(staticexe)
staticexe=""
AC_ARG_ENABLE(static-exe, AC_HELP_STRING([--enable-static-exe],
- [ enable to compile executables statically against event, ldns libs, for debug purposes ]),
+ [ enable to compile executables statically against (event) libs, for debug purposes ]),
, )
if test x_$enable_static_exe = x_yes; then
staticexe="-static"
@@ -905,7 +950,7 @@ AC_INCLUDES_DEFAULT
#endif
])
AC_SEARCH_LIBS([setusercontext], [util])
-AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex])
+AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
@@ -917,6 +962,7 @@ AC_REPLACE_FUNCS(inet_aton)
AC_REPLACE_FUNCS(inet_pton)
AC_REPLACE_FUNCS(inet_ntop)
AC_REPLACE_FUNCS(snprintf)
+AC_REPLACE_FUNCS(strlcat)
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(memmove)
AC_REPLACE_FUNCS(gmtime_r)
@@ -993,100 +1039,17 @@ AC_SUBST(SOURCEFILE)
# see if we want to build the library or everything
ALLTARGET="alltargets"
+INSTALLTARGET="install-all"
AC_ARG_WITH(libunbound-only, AC_HELP_STRING([--with-libunbound-only],
[do not build daemon and tool programs]),
[
if test "$withval" = "yes"; then
ALLTARGET="lib"
+ INSTALLTARGET="install-lib"
fi
])
AC_SUBST(ALLTARGET)
-
-# check this after all other compilation checks, since the linking of the lib
-# may break checks after this.
-AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATH],
- [specify prefix of path of ldns library to use]),
- [
- if test "$withval" != "yes"; then
- if test "$withval" != "/usr" -a "$withval" != ""; then
- CPPFLAGS="-I$withval/include $CPPFLAGS"
- LDFLAGS="-L$withval/lib $LDFLAGS"
- ACX_RUNTIME_PATH_ADD([$withval/lib])
- fi
- ldnsdir="$withval"
- AC_SUBST(ldnsdir)
- fi
-])
-
-# check if ldns is good enough
-AC_CHECK_LIB(ldns, ldns_rr_new,,[
- AC_MSG_ERROR([No ldns library found, install the ldns library into system lib dir or use --with-ldns=path to other location. The --with-ldns can point to the make-dir of ldns. Install the package ldns or download source http://www.nlnetlabs.nl/projects/ldns])
-])
-AC_CHECK_FUNC(ldns_buffer_copy)
-if test $USE_NSS = "no"; then
- AC_CHECK_FUNC(ldns_key_buf2rsa_raw)
-else
- dnl ignore test
- ac_cv_func_ldns_key_buf2rsa_raw="yes"
-fi
-AC_CHECK_FUNC(ldns_get_random)
-AC_CHECK_FUNC(ldns_b32_ntop_extended_hex)
-if test x$use_gost = xyes -a x$USE_NSS = xno; then
- AC_CHECK_FUNC(ldns_key_EVP_load_gost_id)
- AC_CHECK_FUNCS([ldns_key_EVP_unload_gost])
-else
- dnl ignore test
- ac_cv_func_ldns_key_EVP_load_gost_id="yes"
-fi
-if test x$use_ecdsa = xyes; then
- AC_CHECK_DECL([LDNS_ECDSAP384SHA384], [], [], [
-AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-#ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-#include <ldns/ldns.h>
- ])
-else
- ac_cv_have_decl_LDNS_ECDSAP384SHA384="yes"
-fi
-AC_CHECK_HEADERS([ldns/ldns.h],,[
- AC_MSG_ERROR([No ldns include file found, install the ldns library development files. Install package ldns-dev or ldns-devel or download source http://www.nlnetlabs.nl/projects/ldns])
- ], [AC_INCLUDES_DEFAULT
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-])
-if test $ac_cv_func_ldns_buffer_copy = yes \
- -a $ac_cv_func_ldns_key_buf2rsa_raw = yes \
- -a $ac_cv_func_ldns_get_random = yes \
- -a $ac_cv_header_ldns_ldns_h = yes \
- -a $ac_cv_func_ldns_b32_ntop_extended_hex = yes \
- -a $ac_cv_func_ldns_key_EVP_load_gost_id = yes \
- -a $ac_cv_have_decl_LDNS_ECDSAP384SHA384 = yes; then
- dnl ldns was found
- :
-else
- AC_MSG_ERROR([ldns library is not recent, update the ldns library, install it into system lib dir or use --with-ldns=path to other location. The --with-ldns can point to the make-dir of ldns. Package libldns or download source http://www.nlnetlabs.nl/projects/ldns])
-fi
+AC_SUBST(INSTALLTARGET)
ACX_STRIP_EXT_FLAGS
LDFLAGS="$LATE_LDFLAGS $LDFLAGS"
@@ -1103,6 +1066,12 @@ dnl includes
# define NDEBUG
#endif
+/** Use small-ldns codebase */
+#define USE_SLDNS 1
+#ifdef HAVE_SSL
+# define LDNS_BUILD_CONFIG_HAVE_SSL 1
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -1113,6 +1082,10 @@ dnl includes
#include <stddef.h>
#endif
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
@@ -1146,6 +1119,12 @@ dnl includes
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
+
+#ifndef USE_WINSOCK
+#define ARG_LL "%ll"
+#else
+#define ARG_LL "%I64"
+#endif
]
AHX_CONFIG_FORMAT_ATTRIBUTE
@@ -1157,6 +1136,7 @@ AHX_CONFIG_INET_PTON(unbound)
AHX_CONFIG_INET_NTOP(unbound)
AHX_CONFIG_INET_ATON(unbound)
AHX_CONFIG_MEMMOVE(unbound)
+AHX_CONFIG_STRLCAT(unbound)
AHX_CONFIG_STRLCPY(unbound)
AHX_CONFIG_GMTIME_R(unbound)
AHX_CONFIG_W32_SLEEP
@@ -1193,8 +1173,6 @@ char *strptime(const char *s, const char *format, struct tm *tm);
# endif
#endif /* CHECKED_INET6 */
-/* maximum nesting of included files */
-#define MAXINCLUDES 10
#ifndef HAVE_GETADDRINFO
struct sockaddr_storage;
#include "compat/fake-rfc2553.h"
OpenPOWER on IntegriCloud