2 # Process this file with autoconf to produce a configure script.
4 sinclude(acx_nlnetlabs.m4)
6 # must be numbers. ac_defun because of later processing.
7 m4_define([VERSION_MAJOR],[1])
8 m4_define([VERSION_MINOR],[6])
9 m4_define([VERSION_MICRO],[16])
10 AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns)
11 AC_CONFIG_SRCDIR([packet.c])
12 # needed to build correct soname
13 AC_SUBST(LIBTOOL_VERSION_INFO, VERSION_MAJOR:VERSION_MINOR:VERSION_MICRO)
14 AC_SUBST(LDNS_VERSION_MAJOR, [VERSION_MAJOR])
15 AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR])
16 AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO])
19 CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}}
23 # Checks for programs.
28 # Extra (sp)lint flags for NetBSD
31 netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS"
33 *) LINTFLAGS="$LINTFLAGS"
38 AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled])
40 ACX_CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"])
41 ACX_CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"])
43 # routine to copy files
44 # argument 1 is a list of files (relative to the source dir)
45 # argument 2 is a destination directory (relative to the current
47 AC_DEFUN([COPY_FILES],
50 sh $srcdir/install-sh -m 644 $file $2
54 # copy all .h files in the dir at argument 1
55 # (relative to source) to the dir at argument 2
56 # (relative to current dir)
57 AC_DEFUN([COPY_HEADER_FILES],
59 echo "copying header files"
60 COPY_FILES($srcdir/$1/*.h, $2)
63 # Checks for typedefs, structures, and compiler characteristics.
66 if test "x$CFLAGS" = "x" ; then
67 ACX_CHECK_COMPILER_FLAG(g, [CFLAGS="-g"])
68 ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="-O2 $CFLAGS"])
70 ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"])
71 ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"])
72 ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"])
75 AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
78 AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT])
81 ACX_DETERMINE_EXT_FLAGS_UNBOUND
84 AC_CHECK_TYPE(int8_t, char)
85 AC_CHECK_TYPE(int16_t, short)
86 AC_CHECK_TYPE(int32_t, int)
87 AC_CHECK_TYPE(int64_t, long long)
88 AC_CHECK_TYPE(uint8_t, unsigned char)
89 AC_CHECK_TYPE(uint16_t, unsigned short)
90 AC_CHECK_TYPE(uint32_t, unsigned int)
91 AC_CHECK_TYPE(uint64_t, unsigned long long)
94 AC_CHECK_PROG(doxygen, doxygen, doxygen)
96 # check to see if libraries are needed for these functions.
97 AC_SEARCH_LIBS([socket], [socket])
98 AC_SEARCH_LIBS([inet_pton], [nsl])
101 AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill],
102 [Also build drill.]),
103 [],[with_drill="no"])
104 if test x_$with_drill != x_no ; then
105 AC_SUBST(DRILL,[drill])
106 AC_SUBST(INSTALL_DRILL,[install-drill])
107 AC_SUBST(UNINSTALL_DRILL,[uninstall-drill])
108 AC_SUBST(CLEAN_DRILL,[clean-drill])
109 AC_SUBST(LINT_DRILL,[lint-drill])
110 if test -e $srcdir/drill/config.h -o -e drill/config.h ; then
112 A config.h was detected in the drill subdirectory.
113 This does not work with the --with-drill option.
114 Please remove the config.h from the drill subdirectory
115 or do not use the --with-drill option.])
117 DRILL_CONFIG=" drill/drill.1"
120 AC_SUBST(INSTALL_DRILL,[""])
121 AC_SUBST(UNINSTALL_DRILL,[""])
122 AC_SUBST(CLEAN_DRILL,[""])
123 AC_SUBST(LINT_DRILL,[""])
128 AC_ARG_WITH(examples, AC_HELP_STRING([--with-examples],
129 [Also build examples.]),
130 [],[with_examples="no"])
131 if test x_$with_examples != x_no ; then
132 AC_SUBST(EXAMPLES,[examples])
133 AC_SUBST(INSTALL_EXAMPLES,[install-examples])
134 AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples])
135 AC_SUBST(CLEAN_EXAMPLES,[clean-examples])
136 AC_SUBST(LINT_EXAMPLES,[lint-examples])
137 if test -e $srcdir/examples/config.h -o -e examples/config.h ; then
139 A config.h was detected in the examples subdirectory.
140 This does not work with the --with-examples option.
141 Please remove the config.h from the examples subdirectory
142 or do not use the --with-examples option.])
144 EXAMPLES_CONFIG=" examples/ldns-dane.1 examples/ldns-verify-zone.1"
146 AC_SUBST(EXAMPLES,[""])
147 AC_SUBST(INSTALL_EXAMPLES,[""])
148 AC_SUBST(UNINSTALL_EXAMPLES,[""])
149 AC_SUBST(CLEAN_EXAMPLES,[""])
150 AC_SUBST(LINT_EXAMPLES,[""])
154 # add option to disable installation of ldns-config script
155 AC_ARG_ENABLE(ldns-config, [ --disable-ldns-config disable installation of ldns-config (default=enabled)],
156 enable_ldns_config=$enableval, enable_ldns_config=yes)
157 if test "x$enable_ldns_config" = xyes; then
158 AC_SUBST(INSTALL_CONFIG, [install-config])
159 AC_SUBST(INSTALL_CONFIG_MANPAGE, [install-config-manpage])
160 AC_SUBST(UNINSTALL_CONFIG, [uninstall-config])
161 AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [uninstall-config-manpage])
163 AC_SUBST(INSTALL_CONFIG, [""])
164 AC_SUBST(INSTALL_CONFIG_MANPAGE, [""])
165 AC_SUBST(UNINSTALL_CONFIG, [""])
166 AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""])
173 AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns],
174 [generate python library, or --without-pyldns to disable Python support.]),
177 if test x_$withval != x_no; then
178 sinclude(ax_python_devel.m4)
179 ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS
181 AX_PYTHON_DEVEL([>= '2.4.0'])
182 if test ! -z "$ac_python_version"; then
186 # pass additional Python 3 option to SWIG
187 if test `$PYTHON -c "import sys; \
188 ver = sys.version.split()[[0]]; \
189 print(ver >= '3')"` = "True"; then
190 AC_SUBST(SWIGPY3, ["-py3 -DPY3"])
194 if test x_$ldns_have_python != x_no; then
195 sinclude(ax_pkg_swig.m4)
197 # check for >=SWIG-2.0.4 if Python 3.2 used
198 if test `$PYTHON -c "import sys; \
199 ver = sys.version.split()[[0]]; \
200 print(ver >= '3.2')"` = "True"; then
201 AX_PKG_SWIG(2.0.4, [], [AC_MSG_ERROR([SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater.])])
206 if test ! -x "$SWIG"; then
207 AC_MSG_ERROR([failed to find SWIG tool, install it, or do not build pyldns])
209 AC_DEFINE(HAVE_SWIG,1,[Define if you have SWIG libraries and header files.])
210 AC_SUBST(PYLDNS, "pyldns")
211 AC_SUBST(swig, "$SWIG")
215 AC_MSG_RESULT([*** don't have Python, skipping SWIG, no pyldns ***]) # '
218 # xtra cflags for pyldns
219 if test x_$ldns_have_python != x_no; then
220 ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [PYTHON_X_CFLAGS="-fno-strict-aliasing"])
221 ACX_CHECK_COMPILER_FLAG(Wno-missing-field-initializers, [PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"])
222 ACX_CHECK_COMPILER_FLAG(Wno-unused-parameter, [PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"])
223 ACX_CHECK_COMPILER_FLAG(Wno-unused-variable, [PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"])
226 AC_SUBST(PYTHON_X_CFLAGS)
229 AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx],
230 [Do not install the ldnsx python module, or --with-pyldnsx to install it.]),
231 [],[ withval="with_pyldns" ])
232 if test x_$withval != x_no; then
233 if test x_$ldns_with_pyldns != x_no; then
234 AC_SUBST(PYLDNSX, "pyldnsx")
235 ldns_with_pyldnsx=yes
237 if test x_$withval != x_with_pyldns; then
238 AC_MSG_ERROR([--with-pyldns is needed for the ldnsx python module])
243 if test x_$ldns_with_pyldns != x_no; then
244 AC_SUBST(PYLDNSINST, "install-pyldns")dnl
245 AC_SUBST(PYLDNSUNINST, "uninstall-pyldns")
247 AC_SUBST(PYLDNSINST, "")dnl
248 AC_SUBST(PYLDNSUNINST, "")
250 if test x_$ldns_with_pyldnsx != x_no; then
251 AC_SUBST(PYLDNSXINST, "install-pyldnsx")dnl
252 AC_SUBST(PYLDNSXUNINST, "uninstall-pyldnsx")
254 AC_SUBST(PYLDNSXINST, "")dnl
255 AC_SUBST(PYLDNSXUNINST, "")
261 tmp_CPPFLAGS=$CPPFLAGS
265 ACX_WITH_SSL_OPTIONAL
267 AC_CHECK_FUNCS([EVP_sha256])
269 # for macosx, see if glibtool exists and use that
270 # BSD's need to know the version...
271 #AC_CHECK_PROG(glibtool, glibtool, [glibtool], )
272 #AC_CHECK_PROGS(libtool, [libtool15 libtool], [./libtool])
274 AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support]))
275 case "$enable_sha2" in
279 if test "x$HAVE_SSL" != "xyes"; then
280 AC_MSG_ERROR([SHA2 enabled, but no SSL support])
282 AC_MSG_CHECKING(for SHA256 and SHA512)
283 AC_CHECK_FUNC(SHA256_Init, [], [
284 AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2])
286 AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.])
290 AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support]))
291 case "$enable_gost" in
295 if test "x$HAVE_SSL" != "xyes"; then
296 AC_MSG_ERROR([GOST enabled, but no SSL support])
298 AC_MSG_CHECKING(for GOST)
299 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])])
300 AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([No ECC functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-gost])])
301 AC_DEFINE_UNQUOTED([USE_GOST], [1], [Define this to enable GOST support.])
305 AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support]))
306 case "$enable_ecdsa" in
310 if test "x$HAVE_SSL" != "xyes"; then
311 AC_MSG_ERROR([ECDSA enabled, but no SSL support])
313 AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade OpenSSL or rerun with --disable-ecdsa])])
314 AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade OpenSSL or rerun with --disable-ecdsa])])
315 AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [], [AC_MSG_ERROR([OpenSSL does not support the ECDSA curves: please upgrade OpenSSL or rerun with --disable-ecdsa])], [AC_INCLUDES_DEFAULT
316 #include <openssl/evp.h>
318 # we now know we have ECDSA and the required curves.
319 AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
323 AC_SUBST(LIBSSL_CPPFLAGS)
324 AC_SUBST(LIBSSL_LDFLAGS)
325 AC_SUBST(LIBSSL_LIBS)
326 if test "x$HAVE_SSL" = "xyes"; then
327 AC_SUBST(LIBSSL_SSL_LIBS, ["$LIBSSL_LIBS -lssl"])
329 CPPFLAGS=$tmp_CPPFLAGS
334 # add option to disable the evil rpath
337 #AC_RUN_IFELSE([AC_LANG_SOURCE(
342 #char *cp = (char*)&one;
349 #AC_DEFINE(CONFCHECK_LITTLE_ENDIAN, 1, [system appears to be little-endian])
352 # should define WORDS_BIGENDIAN if the system is big-endian
355 # Checks for header files.
359 #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h])
360 # do the very minimum - we can always extend this
361 AC_CHECK_HEADERS([getopt.h stdarg.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT])
362 AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
366 # include <sys/param.h>
370 AC_CHECK_HEADER(sys/socket.h,
372 include_sys_socket_h='#include <sys/socket.h>'
373 AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [define if you have sys/socket.h])
375 include_sys_socket_h=''
376 ],[AC_INCLUDES_DEFAULT
379 # include <sys/param.h>
383 AC_SUBST(include_sys_socket_h)
384 AC_CHECK_HEADER(inttypes.h,
386 include_inttypes_h='#include <inttypes.h>'
387 AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h])
388 AC_SUBST(ldns_build_config_have_inttypes_h, 1)
390 include_inttypes_h=''
391 AC_SUBST(ldns_build_config_have_inttypes_h, 0)
392 ],[AC_INCLUDES_DEFAULT
394 AC_SUBST(include_inttypes_h)
395 AC_CHECK_HEADER(sys/types.h,
397 include_systypes_h='#include <sys/types.h>'
398 AC_DEFINE(HAVE_SYS_TYPES_H, 1, [define if you have sys/types.h])
400 include_systypes_h=''
401 ],[AC_INCLUDES_DEFAULT
403 AC_SUBST(include_systypes_h)
404 AC_CHECK_HEADER(unistd.h,
406 include_unistd_h='#include <unistd.h>'
407 AC_DEFINE(HAVE_UNISTD_H, 1, [define if you have unistd.h])
410 ],[AC_INCLUDES_DEFAULT
412 AC_SUBST(include_unistd_h)
414 AC_CHECK_SIZEOF(time_t,,[
416 #ifdef TIME_WITH_SYS_TIME
417 # include <sys/time.h>
420 # ifdef HAVE_SYS_TIME_H
421 # include <sys/time.h>
428 if test x_$with_examples != x_no; then
429 AC_CHECK_HEADERS([pcap.h],, [AC_INCLUDES_DEFAULT])
430 AC_CHECK_LIB(pcap, pcap_open_offline, [
431 AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl`
432 AC_SUBST([LIBPCAP_LIBS], [-lpcap])
434 AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)])dnl'
435 AC_SUBST([LIBPCAP_LIBS], [])
438 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],,, [
440 #ifdef HAVE_NETINET_IN_SYSTM_H
441 #include <netinet/in_systm.h>
443 #ifdef HAVE_NETINET_IN_H
444 #include <netinet/in.h>
446 #ifdef HAVE_SYS_SOCKET_H
447 #include <sys/socket.h>
455 if test "x$ac_cv_type_socklen_t" = xyes; then
456 AC_SUBST(ldns_build_config_have_socklen_t, 1)
458 AC_SUBST(ldns_build_config_have_socklen_t, 0)
463 AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [
465 # include <sys/types.h>
467 #if HAVE_NETINET_IN_H
468 # include <netinet/in.h>
470 AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], [
472 # include <sys/types.h>
474 #if HAVE_NETINET_IN_H
475 # include <netinet/in.h>
482 AC_REPLACE_FUNCS(b64_pton)
483 AC_REPLACE_FUNCS(b64_ntop)
484 AC_REPLACE_FUNCS(b32_pton)
485 AC_REPLACE_FUNCS(b32_ntop)
486 AC_REPLACE_FUNCS(calloc)
487 AC_REPLACE_FUNCS(timegm)
488 AC_REPLACE_FUNCS(gmtime_r)
489 AC_REPLACE_FUNCS(ctime_r)
490 AC_REPLACE_FUNCS(localtime_r)
491 AC_REPLACE_FUNCS(isblank)
492 AC_REPLACE_FUNCS(isascii)
493 AC_REPLACE_FUNCS(inet_aton)
494 AC_REPLACE_FUNCS(inet_pton)
495 AC_REPLACE_FUNCS(inet_ntop)
496 AC_REPLACE_FUNCS(snprintf)
497 AC_REPLACE_FUNCS(strlcpy)
498 AC_REPLACE_FUNCS(memmove)
500 AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset])
502 ACX_CHECK_GETADDRINFO_WITH_INCLUDES
503 if test $ac_cv_func_getaddrinfo = no; then
504 AC_LIBOBJ([fake-rfc2553])
506 if test "$USE_WINSOCK" = 1; then
507 AC_CHECK_TOOL(WINDRES, windres)
511 #AC_SEARCH_LIBS(RSA_new, [crypto])
513 ACX_CHECK_FORMAT_ATTRIBUTE
514 ACX_CHECK_UNUSED_ATTRIBUTE
516 # check OSX deployment target which is needed
517 if echo $build_os | grep darwin > /dev/null; then
518 export MACOSX_DEPLOYMENT_TARGET="10.4"
521 AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir])
523 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]]), [
524 LDNS_TRUST_ANCHOR_FILE="$withval"
526 if test "x$LDNS_TRUST_ANCHOR_FILE" = "x"; then
527 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
528 if test "x$prefix" = 'xNONE' ; then
529 LDNS_TRUST_ANCHOR_FILE="/etc/unbound/root.key"
531 LDNS_TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key"
534 LDNS_TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key"
538 AC_DEFINE_UNQUOTED([LDNS_TRUST_ANCHOR_FILE], ["$LDNS_TRUST_ANCHOR_FILE"], [Default trust anchor file])
539 AC_SUBST(LDNS_TRUST_ANCHOR_FILE)
540 AC_MSG_NOTICE([Default trust anchor: $LDNS_TRUST_ANCHOR_FILE])
542 AC_ARG_WITH(ca-file, AC_HELP_STRING([--with-ca-file=CAFILE], [File containing CA certificates for ldns-dane]), [
543 AC_DEFINE([HAVE_DANE_CA_FILE], [1], [Is a CAFILE given at configure time])
544 AC_DEFINE_UNQUOTED([LDNS_DANE_CA_FILE], ["$withval"], [Is a CAFILE given at configure time])
545 AC_MSG_NOTICE([Using CAfile: $withval])
546 AC_SUBST(DEFAULT_CAFILE, ["Default is $withval"])
548 AC_DEFINE([HAVE_DANE_CA_FILE], [0], [Is a CAFILE given at configure time])
549 AC_SUBST(DEFAULT_CAFILE, [])
552 AC_ARG_WITH(ca-path, AC_HELP_STRING([--with-ca-path=CAPATH], [Directory containing CA certificate files for ldns-dane]), [
553 AC_DEFINE([HAVE_DANE_CA_PATH], [1], [Is a CAPATH given at configure time])
554 AC_DEFINE_UNQUOTED([LDNS_DANE_CA_PATH], ["$withval"], [Is a CAPATH given at configure time])
555 AC_MSG_NOTICE([Using CApath: $withval])
556 AC_SUBST(DEFAULT_CAPATH, ["Default is $withval"])
558 AC_DEFINE([HAVE_DANE_CA_PATH], [0], [Is a CAPATH given at configure time])
559 AC_SUBST(DEFAULT_CAPATH, [])
568 #ifndef LITTLE_ENDIAN
569 #define LITTLE_ENDIAN 1234
573 #define BIG_ENDIAN 4321
577 #ifdef WORDS_BIGENDIAN
578 #define BYTE_ORDER BIG_ENDIAN
580 #define BYTE_ORDER LITTLE_ENDIAN
581 #endif /* WORDS_BIGENDIAN */
582 #endif /* BYTE_ORDER */
593 #ifdef HAVE_SYS_SOCKET_H
594 #include <sys/socket.h>
597 #ifdef HAVE_NETINET_IN_H
598 #include <netinet/in.h>
601 #ifdef HAVE_ARPA_INET_H
602 #include <arpa/inet.h>
605 #ifdef HAVE_WINSOCK2_H
606 #include <winsock2.h>
609 #ifdef HAVE_WS2TCPIP_H
610 #include <ws2tcpip.h>
613 AHX_CONFIG_W32_FD_SET_T
622 int ldns_b64_ntop(uint8_t const *src, size_t srclength,
623 char *target, size_t targsize);
625 * calculates the size needed to store the result of b64_ntop
628 static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
630 return ((((srcsize + 2) / 3) * 4) + 1);
632 #endif /* !B64_PTON */
634 int ldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
636 * calculates the size needed to store the result of ldns_b64_pton
639 static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
641 return (((((srcsize + 3) / 4) * 3)) + 1);
643 #endif /* !B64_NTOP */
646 /* use windows sleep, in millisecs, instead */
647 #define sleep(x) Sleep((x)*1000)
651 #define srandom(x) srand(x)
652 #define random(x) rand(x)
657 time_t timegm (struct tm *tm);
659 #ifndef HAVE_GMTIME_R
660 struct tm *gmtime_r(const time_t *timep, struct tm *result);
662 #ifndef HAVE_LOCALTIME_R
663 struct tm *localtime_r(const time_t *timep, struct tm *result);
667 #endif /* !HAVE_ISBLANK */
670 #endif /* !HAVE_ISASCII */
671 #ifndef HAVE_SNPRINTF
673 int snprintf (char *str, size_t count, const char *fmt, ...);
674 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
675 #endif /* HAVE_SNPRINTF */
676 #ifndef HAVE_INET_PTON
677 int inet_pton(int af, const char* src, void* dst);
678 #endif /* HAVE_INET_PTON */
679 #ifndef HAVE_INET_NTOP
680 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
682 #ifndef HAVE_INET_ATON
683 int inet_aton(const char *cp, struct in_addr *addr);
686 void *memmove(void *dest, const void *src, size_t n);
689 size_t strlcpy(char *dst, const char *src, size_t siz);
694 #ifndef HAVE_GETADDRINFO
695 #include "compat/fake-rfc2553.h"
698 #define strtoul (unsigned long)strtol
702 if test "x$HAVE_SSL" = "xyes"; then
703 AC_SUBST(ldns_build_config_have_ssl, 1)
705 AC_SUBST(ldns_build_config_have_ssl, 0)
707 if test "x$ac_cv_c_format_attribute" = "xyes"; then
708 AC_SUBST(ldns_build_config_have_attr_format, 1)
710 AC_SUBST(ldns_build_config_have_attr_format, 0)
712 if test "x$ac_cv_c_unused_attribute" = "xyes"; then
713 AC_SUBST(ldns_build_config_have_attr_unused, 1)
715 AC_SUBST(ldns_build_config_have_attr_unused, 0)
718 CONFIG_FILES="Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config $DRILL_CONFIG $EXAMPLES_CONFIG"
719 AC_SUBST(CONFIG_FILES)
720 AC_CONFIG_FILES([$CONFIG_FILES])
722 AC_CONFIG_HEADER([ldns/config.h])
724 COPY_HEADER_FILES(ldns/, ldns/)
726 dnl AC_CONFIG_SUBDIRS([drill])