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],[17])
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(LDNS_VERSION_MAJOR, [VERSION_MAJOR])
14 AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR])
15 AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO])
16 AC_SUBST(VERSION_INFO, [VERSION_MAJOR:VERSION_MINOR:VERSION_MICRO])
20 AC_CONFIG_MACRO_DIR([m4])
23 CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}}
26 # Checks for programs.
31 # Extra (sp)lint flags for NetBSD
34 netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS"
36 *) LINTFLAGS="$LINTFLAGS"
41 AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled])
43 ACX_CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"])
44 ACX_CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"])
46 # routine to copy files
47 # argument 1 is a list of files (relative to the source dir)
48 # argument 2 is a destination directory (relative to the current
50 AC_DEFUN([COPY_FILES],
53 sh $srcdir/install-sh -m 644 $file $2
57 # copy all .h files in the dir at argument 1
58 # (relative to source) to the dir at argument 2
59 # (relative to current dir)
60 AC_DEFUN([COPY_HEADER_FILES],
62 echo "copying header files"
63 COPY_FILES($srcdir/$1/*.h, $2)
66 # Checks for typedefs, structures, and compiler characteristics.
69 if test "x$CFLAGS" = "x" ; then
70 ACX_CHECK_COMPILER_FLAG(g, [CFLAGS="-g"])
71 ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="-O2 $CFLAGS"])
73 ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"])
74 ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"])
75 ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"])
76 ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"])
79 AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
82 AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT])
85 ACX_DETERMINE_EXT_FLAGS_UNBOUND
88 AC_CHECK_TYPE(int8_t, char)
89 AC_CHECK_TYPE(int16_t, short)
90 AC_CHECK_TYPE(int32_t, int)
91 AC_CHECK_TYPE(int64_t, long long)
92 AC_CHECK_TYPE(uint8_t, unsigned char)
93 AC_CHECK_TYPE(uint16_t, unsigned short)
94 AC_CHECK_TYPE(uint32_t, unsigned int)
95 AC_CHECK_TYPE(uint64_t, unsigned long long)
98 AC_CHECK_PROG(doxygen, doxygen, doxygen)
100 # check to see if libraries are needed for these functions.
101 AC_SEARCH_LIBS([socket], [socket])
102 AC_SEARCH_LIBS([inet_pton], [nsl])
105 AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill],
106 [Also build drill.]),
107 [],[with_drill="no"])
108 if test x_$with_drill != x_no ; then
109 AC_SUBST(DRILL,[drill])
110 AC_SUBST(INSTALL_DRILL,[install-drill])
111 AC_SUBST(UNINSTALL_DRILL,[uninstall-drill])
112 AC_SUBST(CLEAN_DRILL,[clean-drill])
113 AC_SUBST(LINT_DRILL,[lint-drill])
114 if test -e $srcdir/drill/config.h -o -e drill/config.h ; then
116 A config.h was detected in the drill subdirectory.
117 This does not work with the --with-drill option.
118 Please remove the config.h from the drill subdirectory
119 or do not use the --with-drill option.])
121 DRILL_CONFIG=" drill/drill.1"
124 AC_SUBST(INSTALL_DRILL,[""])
125 AC_SUBST(UNINSTALL_DRILL,[""])
126 AC_SUBST(CLEAN_DRILL,[""])
127 AC_SUBST(LINT_DRILL,[""])
132 AC_ARG_WITH(examples, AC_HELP_STRING([--with-examples],
133 [Also build examples.]),
134 [],[with_examples="no"])
135 if test x_$with_examples != x_no ; then
136 AC_SUBST(EXAMPLES,[examples])
137 AC_SUBST(INSTALL_EXAMPLES,[install-examples])
138 AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples])
139 AC_SUBST(CLEAN_EXAMPLES,[clean-examples])
140 AC_SUBST(LINT_EXAMPLES,[lint-examples])
141 if test -e $srcdir/examples/config.h -o -e examples/config.h ; then
143 A config.h was detected in the examples subdirectory.
144 This does not work with the --with-examples option.
145 Please remove the config.h from the examples subdirectory
146 or do not use the --with-examples option.])
148 EXAMPLES_CONFIG=" examples/ldns-dane.1 examples/ldns-verify-zone.1"
150 AC_SUBST(EXAMPLES,[""])
151 AC_SUBST(INSTALL_EXAMPLES,[""])
152 AC_SUBST(UNINSTALL_EXAMPLES,[""])
153 AC_SUBST(CLEAN_EXAMPLES,[""])
154 AC_SUBST(LINT_EXAMPLES,[""])
158 # add option to disable installation of ldns-config script
159 AC_ARG_ENABLE(ldns-config, AC_HELP_STRING([--disable-ldns-config], [disable installation of ldns-config (default=enabled)]),
160 enable_ldns_config=$enableval, enable_ldns_config=yes)
161 if test "x$enable_ldns_config" = xyes; then
162 AC_SUBST(INSTALL_CONFIG, [install-config])
163 AC_SUBST(INSTALL_CONFIG_MANPAGE, [install-config-manpage])
164 AC_SUBST(UNINSTALL_CONFIG, [uninstall-config])
165 AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [uninstall-config-manpage])
167 AC_SUBST(INSTALL_CONFIG, [""])
168 AC_SUBST(INSTALL_CONFIG_MANPAGE, [""])
169 AC_SUBST(UNINSTALL_CONFIG, [""])
170 AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""])
173 # add option to disable library printing to stderr
174 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)
175 case "$enable_stderr_msgs" in
179 AC_DEFINE_UNQUOTED([STDERR_MSGS], [1], [Define this to enable messages to stderr.])
187 AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns],
188 [generate python library, or --without-pyldns to disable Python support.]),
191 if test x_$withval != x_no; then
192 sinclude(ax_python_devel.m4)
193 ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS
195 AX_PYTHON_DEVEL([>= '2.4.0'])
196 if test ! -z "$ac_python_version"; then
200 # pass additional Python 3 option to SWIG
201 if test `$PYTHON -c "import sys; \
202 ver = sys.version.split()[[0]]; \
203 print(ver >= '3')"` = "True"; then
204 AC_SUBST(SWIGPY3, ["-py3 -DPY3"])
208 if test x_$ldns_have_python != x_no; then
209 sinclude(ax_pkg_swig.m4)
211 # check for >=SWIG-2.0.4 if Python 3.2 used
212 if test `$PYTHON -c "import sys; \
213 ver = sys.version.split()[[0]]; \
214 print(ver >= '3.2')"` = "True"; then
215 AX_PKG_SWIG(2.0.4, [], [AC_MSG_ERROR([SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater.])])
220 if test ! -x "$SWIG"; then
221 AC_MSG_ERROR([failed to find SWIG tool, install it, or do not build pyldns])
223 AC_DEFINE(HAVE_SWIG,1,[Define if you have SWIG libraries and header files.])
224 AC_SUBST(PYLDNS, "pyldns")
225 AC_SUBST(swig, "$SWIG")
229 AC_MSG_RESULT([*** don't have Python, skipping SWIG, no pyldns ***]) # '
232 # xtra cflags for pyldns
233 if test x_$ldns_have_python != x_no; then
234 ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [PYTHON_X_CFLAGS="-fno-strict-aliasing"])
235 ACX_CHECK_COMPILER_FLAG(Wno-missing-field-initializers, [PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"])
236 ACX_CHECK_COMPILER_FLAG(Wno-unused-parameter, [PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"])
237 ACX_CHECK_COMPILER_FLAG(Wno-unused-variable, [PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"])
240 AC_SUBST(PYTHON_X_CFLAGS)
243 AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx],
244 [Do not install the ldnsx python module, or --with-pyldnsx to install it.]),
245 [],[ withval="with_pyldns" ])
246 if test x_$withval != x_no; then
247 if test x_$ldns_with_pyldns != x_no; then
248 AC_SUBST(PYLDNSX, "pyldnsx")
249 ldns_with_pyldnsx=yes
251 if test x_$withval != x_with_pyldns; then
252 AC_MSG_ERROR([--with-pyldns is needed for the ldnsx python module])
257 if test x_$ldns_with_pyldns != x_no; then
258 AC_SUBST(PYLDNSINST, "install-pyldns")dnl
259 AC_SUBST(PYLDNSUNINST, "uninstall-pyldns")
261 AC_SUBST(PYLDNSINST, "")dnl
262 AC_SUBST(PYLDNSUNINST, "")
264 if test x_$ldns_with_pyldnsx != x_no; then
265 AC_SUBST(PYLDNSXINST, "install-pyldnsx")dnl
266 AC_SUBST(PYLDNSXUNINST, "uninstall-pyldnsx")
268 AC_SUBST(PYLDNSXINST, "")dnl
269 AC_SUBST(PYLDNSXUNINST, "")
273 ldns_with_p5_dns_ldns=no
274 AC_ARG_WITH(p5-dns-ldns, AC_HELP_STRING([--with-p5-dns-ldns],
275 [generate DNS::LDNS perl bindings]),
278 if test x_$withval != x_no; then
279 AC_PATH_PROG([PERL], [perl])
280 if test -z "$PERL"; then
281 AC_MSG_ERROR([Cannot find perl in your system path])
283 AC_SUBST(P5_DNS_LDNS, "p5-dns-ldns")dnl
284 AC_SUBST(TEST_P5_DNS_LDNS, "test-p5-dns-ldns")dnl
285 AC_SUBST(INSTALL_P5_DNS_LDNS, "install-p5-dns-ldns")dnl
286 AC_SUBST(UNINSTALL_P5_DNS_LDNS, "uninstall-p5-dns-ldns")dnl
287 AC_SUBST(CLEAN_P5_DNS_LDNS, "clean-p5-dns-ldns")
289 AC_SUBST(P5_DNS_LDNS, "")dnl
290 AC_SUBST(TEST_P5_DNS_LDNS, "")dnl
291 AC_SUBST(INSTALL_P5_DNS_LDNS, "")dnl
292 AC_SUBST(UNINSTALL_P5_DNS_LDNS, "")dnl
293 AC_SUBST(CLEAN_P5_DNS_LDNS, "")
299 tmp_CPPFLAGS=$CPPFLAGS
303 ACX_WITH_SSL_OPTIONAL
305 AC_CHECK_FUNCS([EVP_sha256])
307 # for macosx, see if glibtool exists and use that
308 # BSD's need to know the version...
309 #AC_CHECK_PROG(glibtool, glibtool, [glibtool], )
310 #AC_CHECK_PROGS(libtool, [libtool15 libtool], [./libtool])
312 AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support]))
313 case "$enable_sha2" in
317 if test "x$HAVE_SSL" != "xyes"; then
318 AC_MSG_ERROR([SHA2 enabled, but no SSL support])
320 AC_MSG_CHECKING(for SHA256 and SHA512)
321 AC_CHECK_FUNC(SHA256_Init, [], [
322 AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2])
324 AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.])
328 AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support]))
329 case "$enable_gost" in
333 if test "x$HAVE_SSL" != "xyes"; then
334 AC_MSG_ERROR([GOST enabled, but no SSL support])
336 AC_MSG_CHECKING(for GOST)
337 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])])
338 AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([No ECC functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-gost])])
339 AC_DEFINE_UNQUOTED([USE_GOST], [1], [Define this to enable GOST support.])
343 AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support]))
344 case "$enable_ecdsa" in
348 if test "x$HAVE_SSL" != "xyes"; then
349 AC_MSG_ERROR([ECDSA enabled, but no SSL support])
351 AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade OpenSSL or rerun with --disable-ecdsa])])
352 AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade OpenSSL or rerun with --disable-ecdsa])])
353 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
354 #include <openssl/evp.h>
356 # we now know we have ECDSA and the required curves.
357 AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
361 AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support]))
362 case "$enable_dane" in
364 AC_SUBST(ldns_build_config_use_dane, 0)
367 if test "x$HAVE_SSL" != "xyes"; then
368 AC_MSG_ERROR([DANE enabled, but no SSL support])
370 AC_CHECK_FUNC(X509_check_ca, [], [AC_MSG_ERROR([OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane])])
371 AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.])
372 AC_SUBST(ldns_build_config_use_dane, 1)
376 AC_ARG_ENABLE(rrtype-ninfo, AC_HELP_STRING([--enable-rrtype-ninfo], [Enable draft RR type ninfo.]))
377 case "$enable_rrtype_ninfo" in
379 AC_DEFINE_UNQUOTED([RRTYPE_NINFO], [], [Define this to enable RR type NINFO.])
384 AC_ARG_ENABLE(rrtype-rkey, AC_HELP_STRING([--enable-rrtype-rkey], [Enable draft RR type rkey.]))
385 case "$enable_rrtype_rkey" in
387 AC_DEFINE_UNQUOTED([RRTYPE_RKEY], [], [Define this to enable RR type RKEY.])
392 AC_ARG_ENABLE(rrtype-cds, AC_HELP_STRING([--enable-rrtype-cds], [Enable draft RR type cds.]))
393 case "$enable_rrtype_cds" in
395 AC_DEFINE_UNQUOTED([RRTYPE_CDS], [], [Define this to enable RR type CDS.])
400 AC_ARG_ENABLE(rrtype-uri, AC_HELP_STRING([--enable-rrtype-uri], [Enable draft RR type uri.]))
401 case "$enable_rrtype_uri" in
403 AC_DEFINE_UNQUOTED([RRTYPE_URI], [], [Define this to enable RR type URI.])
408 AC_ARG_ENABLE(rrtype-ta, AC_HELP_STRING([--enable-rrtype-ta], [Enable draft RR type ta.]))
409 case "$enable_rrtype_ta" in
411 AC_DEFINE_UNQUOTED([RRTYPE_TA], [], [Define this to enable RR type TA.])
417 AC_SUBST(LIBSSL_CPPFLAGS)
418 AC_SUBST(LIBSSL_LDFLAGS)
419 AC_SUBST(LIBSSL_LIBS)
420 if test "x$HAVE_SSL" = "xyes"; then
421 AC_SUBST(LIBSSL_SSL_LIBS, ["-lssl $LIBSSL_LIBS"])
423 CPPFLAGS=$tmp_CPPFLAGS
428 # add option to disable the evil rpath
431 #AC_RUN_IFELSE([AC_LANG_SOURCE(
436 #char *cp = (char*)&one;
443 #AC_DEFINE(CONFCHECK_LITTLE_ENDIAN, 1, [system appears to be little-endian])
446 # should define WORDS_BIGENDIAN if the system is big-endian
449 # Checks for header files.
453 #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h])
454 # do the very minimum - we can always extend this
455 AC_CHECK_HEADERS([getopt.h stdarg.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT])
456 AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
460 # include <sys/param.h>
464 AC_CHECK_HEADER(sys/socket.h,
466 include_sys_socket_h='#include <sys/socket.h>'
467 AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [define if you have sys/socket.h])
469 include_sys_socket_h=''
470 ],[AC_INCLUDES_DEFAULT
473 # include <sys/param.h>
477 AC_SUBST(include_sys_socket_h)
478 AC_CHECK_HEADER(inttypes.h,
480 include_inttypes_h='#include <inttypes.h>'
481 AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h])
482 AC_SUBST(ldns_build_config_have_inttypes_h, 1)
484 include_inttypes_h=''
485 AC_SUBST(ldns_build_config_have_inttypes_h, 0)
486 ],[AC_INCLUDES_DEFAULT
488 AC_SUBST(include_inttypes_h)
489 AC_CHECK_HEADER(sys/types.h,
491 include_systypes_h='#include <sys/types.h>'
492 AC_DEFINE(HAVE_SYS_TYPES_H, 1, [define if you have sys/types.h])
494 include_systypes_h=''
495 ],[AC_INCLUDES_DEFAULT
497 AC_SUBST(include_systypes_h)
498 AC_CHECK_HEADER(unistd.h,
500 include_unistd_h='#include <unistd.h>'
501 AC_DEFINE(HAVE_UNISTD_H, 1, [define if you have unistd.h])
504 ],[AC_INCLUDES_DEFAULT
506 AC_SUBST(include_unistd_h)
508 AC_CHECK_SIZEOF(time_t,,[
510 #ifdef TIME_WITH_SYS_TIME
511 # include <sys/time.h>
514 # ifdef HAVE_SYS_TIME_H
515 # include <sys/time.h>
522 if test x_$with_examples != x_no; then
523 AC_CHECK_HEADERS([pcap.h],,, [AC_INCLUDES_DEFAULT])
524 AC_CHECK_LIB(pcap, pcap_open_offline, [
525 AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl`
526 AC_SUBST([LIBPCAP_LIBS], [-lpcap])
528 AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)])dnl'
529 AC_SUBST([LIBPCAP_LIBS], [])
532 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],,, [
534 #ifdef HAVE_NETINET_IN_SYSTM_H
535 #include <netinet/in_systm.h>
537 #ifdef HAVE_NETINET_IN_H
538 #include <netinet/in.h>
540 #ifdef HAVE_SYS_SOCKET_H
541 #include <sys/socket.h>
549 if test "x$ac_cv_type_socklen_t" = xyes; then
550 AC_SUBST(ldns_build_config_have_socklen_t, 1)
552 AC_SUBST(ldns_build_config_have_socklen_t, 0)
555 AC_CHECK_TYPE(ssize_t, int)
556 dnl AC_TYPE_INTPTR_T does not work on all platforms (autoconf)
557 AC_CHECK_TYPE(intptr_t, size_t)
558 AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [
560 # include <sys/types.h>
562 #if HAVE_NETINET_IN_H
563 # include <netinet/in.h>
565 AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], [
567 # include <sys/types.h>
569 #if HAVE_NETINET_IN_H
570 # include <netinet/in.h>
577 AC_REPLACE_FUNCS(b64_pton)
578 AC_REPLACE_FUNCS(b64_ntop)
579 AC_REPLACE_FUNCS(calloc)
580 AC_REPLACE_FUNCS(timegm)
581 AC_REPLACE_FUNCS(gmtime_r)
582 AC_REPLACE_FUNCS(ctime_r)
583 AC_REPLACE_FUNCS(localtime_r)
584 AC_REPLACE_FUNCS(isblank)
585 AC_REPLACE_FUNCS(isascii)
586 AC_REPLACE_FUNCS(inet_aton)
587 AC_REPLACE_FUNCS(inet_pton)
588 AC_REPLACE_FUNCS(inet_ntop)
589 AC_REPLACE_FUNCS(snprintf)
590 AC_REPLACE_FUNCS(strlcpy)
591 AC_REPLACE_FUNCS(memmove)
593 AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton])
594 if test "x$HAVE_B32_NTOP" = "xyes"; then
595 AC_SUBST(ldns_build_config_have_b32_ntop, 1)
597 AC_SUBST(ldns_build_config_have_b32_ntop, 0)
599 if test "x$HAVE_B32_PTON" = "xyes"; then
600 AC_SUBST(ldns_build_config_have_b32_pton, 1)
602 AC_SUBST(ldns_build_config_have_b32_pton, 0)
605 ACX_CHECK_GETADDRINFO_WITH_INCLUDES
606 if test $ac_cv_func_getaddrinfo = no; then
607 AC_LIBOBJ([fake-rfc2553])
609 if test "$USE_WINSOCK" = 1; then
610 AC_CHECK_TOOL(WINDRES, windres)
614 #AC_SEARCH_LIBS(RSA_new, [crypto])
616 ACX_CHECK_FORMAT_ATTRIBUTE
617 ACX_CHECK_UNUSED_ATTRIBUTE
619 # check OSX deployment target which is needed
620 if echo $build_os | grep darwin > /dev/null; then
621 export MACOSX_DEPLOYMENT_TARGET="10.4"
624 AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir])
626 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]]), [
627 LDNS_TRUST_ANCHOR_FILE="$withval"
629 if test "x$LDNS_TRUST_ANCHOR_FILE" = "x"; then
630 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
631 if test "x$prefix" = 'xNONE' ; then
632 LDNS_TRUST_ANCHOR_FILE="/etc/unbound/root.key"
634 LDNS_TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key"
637 LDNS_TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key"
641 AC_DEFINE_UNQUOTED([LDNS_TRUST_ANCHOR_FILE], ["$LDNS_TRUST_ANCHOR_FILE"], [Default trust anchor file])
642 AC_SUBST(LDNS_TRUST_ANCHOR_FILE)
643 AC_MSG_NOTICE([Default trust anchor: $LDNS_TRUST_ANCHOR_FILE])
645 AC_ARG_WITH(ca-file, AC_HELP_STRING([--with-ca-file=CAFILE], [File containing CA certificates for ldns-dane]), [
646 AC_DEFINE([HAVE_DANE_CA_FILE], [1], [Is a CAFILE given at configure time])
647 AC_DEFINE_UNQUOTED([LDNS_DANE_CA_FILE], ["$withval"], [Is a CAFILE given at configure time])
648 AC_MSG_NOTICE([Using CAfile: $withval])
649 AC_SUBST(DEFAULT_CAFILE, ["Default is $withval"])
651 AC_DEFINE([HAVE_DANE_CA_FILE], [0], [Is a CAFILE given at configure time])
652 AC_SUBST(DEFAULT_CAFILE, [])
655 AC_ARG_WITH(ca-path, AC_HELP_STRING([--with-ca-path=CAPATH], [Directory containing CA certificate files for ldns-dane]), [
656 AC_DEFINE([HAVE_DANE_CA_PATH], [1], [Is a CAPATH given at configure time])
657 AC_DEFINE_UNQUOTED([LDNS_DANE_CA_PATH], ["$withval"], [Is a CAPATH given at configure time])
658 AC_MSG_NOTICE([Using CApath: $withval])
659 AC_SUBST(DEFAULT_CAPATH, ["Default is $withval"])
661 AC_DEFINE([HAVE_DANE_CA_PATH], [0], [Is a CAPATH given at configure time])
662 AC_SUBST(DEFAULT_CAPATH, [])
671 #ifndef LITTLE_ENDIAN
672 #define LITTLE_ENDIAN 1234
676 #define BIG_ENDIAN 4321
680 #ifdef WORDS_BIGENDIAN
681 #define BYTE_ORDER BIG_ENDIAN
683 #define BYTE_ORDER LITTLE_ENDIAN
684 #endif /* WORDS_BIGENDIAN */
685 #endif /* BYTE_ORDER */
696 #ifdef HAVE_SYS_SOCKET_H
697 #include <sys/socket.h>
700 #ifdef HAVE_NETINET_IN_H
701 #include <netinet/in.h>
704 #ifdef HAVE_ARPA_INET_H
705 #include <arpa/inet.h>
708 #ifdef HAVE_WINSOCK2_H
709 #include <winsock2.h>
712 #ifdef HAVE_WS2TCPIP_H
713 #include <ws2tcpip.h>
716 AHX_CONFIG_W32_FD_SET_T
724 int ldns_b64_ntop(uint8_t const *src, size_t srclength,
725 char *target, size_t targsize);
727 * calculates the size needed to store the result of b64_ntop
730 static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
732 return ((((srcsize + 2) / 3) * 4) + 1);
734 int ldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
736 * calculates the size needed to store the result of ldns_b64_pton
739 static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
741 return (((((srcsize + 3) / 4) * 3)) + 1);
745 * Given in dnssec_zone.c, also used in dnssec_sign.c:w
748 int ldns_dname_compare_v(const void *a, const void *b);
751 /* use windows sleep, in millisecs, instead */
752 #define sleep(x) Sleep((x)*1000)
756 #define srandom(x) srand(x)
757 #define random(x) rand(x)
762 time_t timegm (struct tm *tm);
764 #ifndef HAVE_GMTIME_R
765 struct tm *gmtime_r(const time_t *timep, struct tm *result);
767 #ifndef HAVE_LOCALTIME_R
768 struct tm *localtime_r(const time_t *timep, struct tm *result);
772 #endif /* !HAVE_ISBLANK */
775 #endif /* !HAVE_ISASCII */
776 #ifndef HAVE_SNPRINTF
778 int snprintf (char *str, size_t count, const char *fmt, ...);
779 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
780 #endif /* HAVE_SNPRINTF */
781 #ifndef HAVE_INET_PTON
782 int inet_pton(int af, const char* src, void* dst);
783 #endif /* HAVE_INET_PTON */
784 #ifndef HAVE_INET_NTOP
785 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
787 #ifndef HAVE_INET_ATON
788 int inet_aton(const char *cp, struct in_addr *addr);
791 void *memmove(void *dest, const void *src, size_t n);
794 size_t strlcpy(char *dst, const char *src, size_t siz);
799 #ifndef HAVE_GETADDRINFO
800 #include "compat/fake-rfc2553.h"
803 #define strtoul (unsigned long)strtol
807 if test "x$HAVE_SSL" = "xyes"; then
808 AC_SUBST(ldns_build_config_have_ssl, 1)
810 AC_SUBST(ldns_build_config_have_ssl, 0)
812 if test "x$ac_cv_c_format_attribute" = "xyes"; then
813 AC_SUBST(ldns_build_config_have_attr_format, 1)
815 AC_SUBST(ldns_build_config_have_attr_format, 0)
817 if test "x$ac_cv_c_unused_attribute" = "xyes"; then
818 AC_SUBST(ldns_build_config_have_attr_unused, 1)
820 AC_SUBST(ldns_build_config_have_attr_unused, 0)
823 CONFIG_FILES="Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config $DRILL_CONFIG $EXAMPLES_CONFIG"
824 AC_SUBST(CONFIG_FILES)
825 AC_CONFIG_FILES([$CONFIG_FILES])
827 AC_CONFIG_HEADER([ldns/config.h])
829 COPY_HEADER_FILES(ldns/, ldns/)
831 dnl AC_CONFIG_SUBDIRS([drill])