1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791
|
dnl Process this file with autoconf to produce a configure script.
dnl
dnl provide it a file to simply check for its existence.
AC_INIT([dnssec-tools-validator], [0.3], [dnssec-tools-users@dnssec-tools.org])
AC_PREREQ([2.59])
AC_CONFIG_HEADER(include/validator/validator-config.h)
AC_MSG_CACHE_INIT()
if test "x$cache_file" = "x/dev/null" ; then
CONFIG_CACHE_FILE=""
else
CONFIG_CACHE_FILE=$cache_file
fi
AC_SUBST(CONFIG_CACHE_FILE)
AC_PATH_PROG([PERLPROG],perl)
AC_PATH_PROG(AR, ar)
AC_PATH_PROG(RM, rm)
AC_PATH_PROG(CP, cp)
# libtool info
# AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
# useful stuff for installation
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# system check
AC_CANONICAL_TARGET
#
# save the configure arguments
#
AC_DEFINE_UNQUOTED(LIBVAL_CONFIGURE_OPTIONS,"$ac_configure_args", [Configure options])
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
########################################
# add in -Dsolaris2, -Dlinux, etc as needed
changequote(, )
PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
changequote([, ])
#
# Check whether we can use -Ux -Dx=x with the expected behaviour
#
AC_MSG_CHECKING([whether to un-define target system token (before redefining)])
OLD_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_EGREP_CPP(yes,[[
#ifdef $PARTIALTARGETOS
yes
#endif
]],
[PARTIALTARGETFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_MSG_RESULT([yes])],
[PARTIALTARGETFLAGS="-D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_MSG_RESULT([no])])
CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
CPPFLAGS="$OLD_CPPFLAGS"
CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
dnl ----------------------------------------------------------------------
AC_MSG_CHECKING([for developer gcc flags])
DEVFLAGS=""
if test -d $srcdir/.svn; then
# disable --enable-shared by default in cvs/developer cases.
# don't do anything if option set via cmdline
if test "${enable_shared+set}" != set; then
enable_shared=no
fi
if test "x$GCC" = "xyes"; then
DEVFLAGS="-Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts"
fi
fi
AC_MSG_RESULT($DEVFLAGS)AC_SUBST(DEVFLAGS)
AC_MSG_CACHE_ADD(Developer flags : $DEVFLAGS)
dnl ----------------------------------------------------------------------
# for some reason $prefix is NONE until much later in the script, so
# fix up val_sysconfdir if no prefix or sysconfdir was specified
val_sysconfdir=`eval echo $sysconfdir`
if test "x$val_sysconfdir" = "xNONE/etc" ; then
val_sysconfdir="${ac_default_prefix}/etc"
fi
val_sysconfdir=`eval echo $sysconfdir`
if test "x$val_sysconfdir" = "xNONE/etc" ; then
val_sysconfdir="${ac_default_prefix}/etc"
fi
AC_MSG_CACHE_ADD(system configuration directory : $val_sysconfdir)
AH_TEMPLATE([VAL_RESOLV_CONF], [Path to resolver configuration])
AC_ARG_WITH(resolv-conf,
[ --with-resolv-conf=FILE resolver config file (SYSCONFDIR/resolv.conf).],
[ac_cv_user_prompt_VAL_RESOLV_CONF=$with_resolv_conf])
AH_TEMPLATE([VAL_ROOT_HINTS], [Path to root hints config file])
AC_ARG_WITH(root-hints,
[ --with-root-hints=FILE root.hints config file.],
[ac_cv_user_prompt_VAL_ROOT_HINTS=$with_root_hints])
VAL_CONFIGURATION_FILE=$val_sysconfdir/dnssec-tools/dnsval.conf
AC_ARG_WITH(dnsval-conf,
[ --with-dnsval-conf=FILE dnsval config file (SYSCONFDIR/dnssec-tools/dnsval.conf).],
[VAL_CONFIGURATION_FILE=$with_dnsval_conf])
AC_DEFINE_UNQUOTED(VAL_CONFIGURATION_FILE,"$VAL_CONFIGURATION_FILE", [dnsval configuration file])
AC_SUBST(VAL_CONFIGURATION_FILE)
AC_MSG_CACHE_ADD(Validator configuration file : $VAL_CONFIGURATION_FILE)
VALIDATOR_TESTCASES=$val_sysconfdir/dnssec-tools/validator-testcases
AC_ARG_WITH(validator-testcases-file,
[ --with-validator-testcases-file=FILE dnsval config file (SYSCONFDIR/dnssec-tools/dnsval.conf).],
[VALIDATOR_TESTCASES=$with_validator_testcases_file])
AC_DEFINE_UNQUOTED(VALIDATOR_TESTCASES,"$VALIDATOR_TESTCASES", [validator testcases configuration file])
AC_SUBST(VALIDATOR_TESTCASES)
dnl ----------------------------------------------------------------------
dnl
#
# otherwise prompted information
#
AC_ARG_WITH(defaults,
[
Miscellaneous:
--with-defaults Use defaults for prompted values.],
defaults="yes",defaults="no")
AC_ARG_ENABLE(defaults,,
AC_MSG_ERROR([ Invalid option. Use --with-defaults/--without-defaults instead ]) )
if test "$defaults" = "yes" ; then
if test "${with_resolv_conf+set}" != set; then
unset ac_cv_user_prompt_VAL_RESOLV_CONF
fi
if test "${with_root_hints+set}" != set; then
unset ac_cv_user_prompt_VAL_ROOT_HINTS
fi
fi
dnl ----------------------------------------------------------------------
dnl
AC_ARG_WITH(cflags,
[ --with-cflags=CFLAGS use CFLAGS as compile time arguments.],
[CFLAGS=$with_cflags; export CFLAGS])
CFLAGS="$CFLAGS -DLIBVAL_CONFIGURED=1"
case $target_os in
solaris*)
AC_MSG_CHECKING([whether we need _REENTRANT for str*_r])
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -D_REENTRANT"
;;
mingw32*)
_WIN32_MSVC=1
SKIP_SYSTEM_CHECKS=1
LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup"
;;
*)
;;
esac
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([LIBVAL_NSEC3], [Define if NSEC3 is required.])
AC_ARG_WITH(nsec3,
[ --without-nsec3 Disable nsec3 support.],
nsec3="$withval", nsec3="yes")
AC_ARG_ENABLE(nsec3,,
AC_MSG_ERROR([ Invalid option. Use --with-nsec3/--without-nsec3 instead ]) )
if test "$nsec3" != "no"; then
AC_DEFINE(LIBVAL_NSEC3, 1)
AC_MSG_CACHE_ADD(NSEC3 support : Yes)
else
AC_MSG_CACHE_ADD(NSEC3 support : No)
fi
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([LIBVAL_DLV], [Define if DLV is required.])
AC_ARG_WITH(dlv,
[ --without-dlv Disable DLV support.],
dlv="$withval", dlv="yes")
AC_ARG_ENABLE(dlv,,
AC_MSG_ERROR([ Invalid option. Use --with-dlv/--without-dlv instead ]) )
if test "$dlv" != "no"; then
AC_DEFINE(LIBVAL_DLV, 1)
AC_MSG_CACHE_ADD(DLV support : Yes)
else
AC_MSG_CACHE_ADD(DLV support : No)
fi
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([VAL_IPV6], [Define if IPV6 is required.])
AC_ARG_WITH(ipv6,
[ --without-ipv6 Disable IPv6 support.],
ipv6="$withval", ipv6="yes")
AC_ARG_ENABLE(ipv6,,
AC_MSG_ERROR([ Invalid option. Use --with-ipv6/--without-ipv6 instead ]) )
if test "$ipv6" != "no"; then
AC_DEFINE(VAL_IPV6, 1)
AC_MSG_CACHE_ADD(IPv6 support : Yes)
else
AC_MSG_CACHE_ADD(IPv6 support : No)
fi
dnl ----------------------------------------------------------------------
dnl openssl
dnl
AC_ARG_WITH(openssl,
[ --with-openssl=PATH Look for openssl in PATH/{lib,include}.],
if test "x$withval" != "xyes"; then
opensslpathset=1
AC_ADD_SEARCH_PATH($withval)
fi
)
dnl openssl defaults to /usr/local/ssl, so add it to the search path.
if test "x$opensslpathset" != "x1"; then
case $build_os in
mingw32*)
AC_ADD_SEARCH_PATH(/c/OpenSSL-Win32)
;;
*)
AC_ADD_SEARCH_PATH(/usr/local/ssl)
;;
esac
fi
AC_ARG_ENABLE(openssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AC_ARG_WITH(ssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AC_ARG_ENABLE(ssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AH_TEMPLATE([HAVE_SHA_256],
[Define if libcrypto implements SHA-256.])
AC_ARG_ENABLE([sha256-check],
AS_HELP_STRING([--disable-sha256-check],
[Make misssing SHA-256 support a warning instead of an error.]))
AC_SEARCH_LIBS(SHA256_Init, [crypto eay32 libeay32 crypt32], AC_DEFINE(HAVE_SHA_256),
AC_SEARCH_LIBS(EVP_md5, [crypto eay32 libeay32 crypt32],
AS_IF([test "x$enable_sha256_check" != "xno"],
[AC_MSG_ERROR(Need openssl version > 0.9.8 for SHA-256 support. Use --disable-sha256-check to bypass this error.)],
[AC_MSG_WARN(Need openssl version > 0.9.8 for SHA-256 support.)]),
AC_MSG_ERROR("OpenSSL not found. get it from http://www.openssl.org.")))
AC_SUBST(LIBS)
AC_CHECK_HEADERS(crypto/sha2.h)
dnl ----------------------------------------------------------------------
AC_ARG_WITH(threads,
[ --without-threads Don't use threads.])
LIBVAL_SUFFIX=""
AH_TEMPLATE([VAL_NO_THREADS],
[Define if you do not want to use threads.])
if test "x$with_threads" = "xno"; then
AC_DEFINE(VAL_NO_THREADS, 1)
AC_MSG_CACHE_ADD(Thread support : No)
else
AC_CHECK_LIB(pthread, pthread_rwlock_init,
[LIBS="$LIBS -lpthread"
LIBVAL_SUFFIX="-threads"
AC_MSG_CACHE_ADD(Thread support : Yes)],
[AC_DEFINE(VAL_NO_THREADS, 1)
AC_MSG_CACHE_ADD(Thread support : No)])
fi
AC_SUBST(LIBS)
AC_SUBST(LIBVAL_SUFFIX)
dnl ----------------------------------------------------------------------
dnl
if test ! -z "$_WIN32_MSVC"; then
LIBS="$LIBS -lgdi32 -lws2_32"
AC_SUBST(LIBS)
fi
dnl ----------------------------------------------------------------------
AC_CHECK_HEADERS(sys/param.h sys/types.h sys/ioctl.h sys/socket.h sys/filio.h sys/file.h sys/fcntl.h netinet/in.h sys/time.h ctype.h getopt.h libgen.h limits.h pthread.h syslog.h)
AC_CHECK_DECLS([getopt_long_only, getopt_long],,,[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
])
dnl ----------------------------------------------------------------------
AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h arpa/inet.h endian.h resolv.h netdb.h errno.h)
AC_CACHE_CHECK(for struct HEADER in arpa/nameser.h and arpa/nameser_compat.h,
ac_cv_nameser_has_header,
[AC_EGREP_CPP(HEADER, [
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#include <arpa/nameser_compat.h>
#endif
], ac_cv_nameser_has_header="yes", ac_cv_nameser_has_header="no")])
if test "x$ac_cv_nameser_has_header" = "xyes" ; then
AC_DEFINE([NAMESER_HAS_HEADER], 1, [Define if <arpa/nameser.h> has HEADER. ])
fi
AC_CHECK_STRUCT_FOR([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
], __ns_msg, _msg_ptr, no)
AH_TEMPLATE([STRUCT___NS_MSG_HAS__MSG_PTR],
[Define if struct __ns_msg had _msg_ptr.])
AC_CHECK_STRUCT_FOR([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
], __ns_msg, _ptr, no)
AH_TEMPLATE([STRUCT___NS_MSG_HAS__PTR],
[Define if struct __ns_msg had _ptr.])
AC_CHECK_TYPES([ns_cert_types],,,[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
])
dnl check for varios ns_* decls (record types or functions)
AC_CHECK_DECLS([ns_t_a,ns_t_kx,ns_r_badsig,ns_parse_ttl,ns_name_pton,ns_name_unpack,ns_name_ntop,ns_samename,ns_t_aaaa,ns_t_dnskey,ns_t_rrsig,ns_t_nsec,ns_t_nsec3,ns_t_dlv,ns_t_ds],,,[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
])
AC_CHECK_DECLS([p_rcode,p_section],,,[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_RESOLV_H
#include <resolv.h>
#endif
])
AC_CHECK_DECLS([struct addrinfo])
dnl ---------------------------------------------------------------------
found_gethostbyaddr=0
AH_TEMPLATE([GETHOSTBYADDR_USES_CHAR_INT], [Define if gethostbyaddr expects a char, int, int])
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
struct hostent *gethostbyaddr(const char *addr, int len, int type);
/* or: gethostbyaddr(__const void *addr, socklen_t len, int type) */
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([char and int])
AC_DEFINE(GETHOSTBYADDR_USES_CHAR_INT, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
if test $found_gethostbyaddr = 0 ; then
dnl ---------------------------------------------------------------------
AH_TEMPLATE([GETHOSTBYADDR_USES_VOID_SOCKLEN], [Define if gethostbyaddr expects void, socklen_t, int]
)
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type);
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([void and socklen_t])
AC_DEFINE(GETHOSTBYADDR_USES_VOID_SOCKLEN, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
if test $found_gethostbyaddr = 0 ; then
dnl ---------------------------------------------------------------------
AH_TEMPLATE([GETHOSTBYADDR_USES_VOID_INT], [Define if gethostbyaddr expects void, int, int])
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
struct hostent *gethostbyaddr(const void *addr, int len, int type);
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([void and int])
AC_DEFINE(GETHOSTBYADDR_USES_VOID_INT, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
dnl ---------------------------------------------------------------------
found_getnameinfo=0
AH_TEMPLATE([GETNAMEINFO_USES_SOCKLEN_AND_UINT], [Define if getnameinfo expects a socklen_t and a unsigned int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
int getnameinfo(const struct sockaddr *sa,
socklen_t len, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags);
int i = 1;
],[
AC_MSG_RESULT([socklen_t and uint])
AC_DEFINE(GETNAMEINFO_USES_SOCKLEN_AND_UINT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
if test $found_getnameinfo = 0 ; then
AH_TEMPLATE([GETNAMEINFO_USES_SOCKLEN_AND_INT], [Define if getnameinfo expects a socklen_t and an int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
int getnameinfo(const struct sockaddr *sa, socklen_t len, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
int flags);
int i = 1;
],[
AC_MSG_RESULT([socklen_t and int])
AC_DEFINE(GETNAMEINFO_USES_SOCKLEN_AND_INT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
if test $found_getnameinfo = 0 ; then
AH_TEMPLATE([GETNAMEINFO_USES_SIZET_AND_INT], [Define if getnameinfo expects a size_t and an int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
int getnameinfo(const struct sockaddr *sa, socklen_t len, char *host,
size_t hostlen, char *serv, size_t servlen,
int flags);
int i = 1;
],[
AC_MSG_RESULT([size_t and int])
AC_DEFINE(GETNAMEINFO_USES_SIZET_AND_INT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
AH_TEMPLATE([R_FUNCS_RETURN_STRUCT],
[Define if gethostbyname_r returns a struct hostent])
AC_MSG_CHECKING([whether gethostbyaddr_r returns an int or a struct hostent])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],
[
struct hostent *
gethostbyname_r(const char * name,struct hostent * result_buf, char * buf,
int buflen, int * h_errnop);
int i = 1;
],[
AC_MSG_RESULT([hostent])
AC_DEFINE(R_FUNCS_RETURN_STRUCT, 1)
], [
AC_MSG_RESULT([int])
]
)
dnl ----------------------------------------------------------------------
dnl check for missing functions
dnl
AC_CHECK_FUNCS(strerror_r)
AC_CHECK_FUNCS(pselect)
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(strtok_r)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(flock)
AC_CHECK_FUNCS(inet_nsap_ntoa)
AC_CHECK_FUNCS(gethostbyname2)
AC_CHECK_FUNCS(hstrerror)
AC_CHECK_FUNCS(freeaddrinfo)
dnl ----------------------------------------------------------------------
case "$host" in
*-*-sunos4*)
AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*]) ;;
esac
dnl ----------------------------------------------------------------------
dnl add any libraries that may be dependencies
AC_CHECK_LIB(nsl, inet_ntop)
dnl check for the socket library
AC_CHECK_LIB(socket, gai_strerror)
AC_SEARCH_LIBS(socket, socket)
dnl ----------------------------------------------------------------------
# Don't test following on windows
if test -z "$SKIP_SYSTEM_CHECKS"; then
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(gettimeofday)
fi # SKIP_SYSTEM_CHECKS
dnl ----------------------------------------------------------------------
AC_SUBST(LIBS)
dnl ----------------------------------------------------------------------
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_TYPES([int8_t, uint8_t, u_int8_t])
AC_CHECK_TYPES([int16_t, uint16_t, u_int16_t])
AC_CHECK_TYPES([int32_t, uint32_t, u_int32_t])
AC_CHECK_TYPES([u_char, u_short, u_long])
dnl ----------------------------------------------------------------------
AH_BOTTOM([
#include "validator/validator-compat.h"
])
dnl ----------------------------------------------------------------------
if test "x$ac_cv_user_prompt_VAL_RESOLV_CONF" = "x" -o "x$ac_cv_user_prompt_VAL_ROOT_HINTS" = "x" ; then
AC_CACHE_CHECK(if you have run configure before, ac_cv_have_warned,
[
if test "x$defaults" = "xno"; then
cat << EOF
************** Configuration Section **************
You are about to be prompted with a series of questions. Answer
them carefully, as they determine how the validator library and related
applications are to function.
After the configure script finishes, you can browse the newly
created include/validator/validator-config.h file for further - less
important - parameters to modify. Be careful if you re-run configure
though, since the file will be overwritten.
-Press return to continue-
EOF
read tmpinput
ac_cv_have_warned="yes"
echo $ECHO_N "disabling above prompt for future runs... $ECHO_C"
else
ac_cv_have_warned="no"
fi
])
else
ac_cv_have_warned="yes"
fi
AC_PROMPT_USER(VAL_RESOLV_CONF,[
*** Resolver configuration location:
Enter the location for the resolver configuration file. If your
existing resolver configuration (typically /etc/resolv.conf) contains
DNSSEC-aware resolvers, you may specify that file. This has the benefit
of only having to remember to update a single file if your resolver
configuration changes.
If you do not wish to modify your default resolver configuration
for any reason (e.g. you are using fast/close non-dnssec aware resolvers
and don't want to impact existing applications), you may use the default,
DNSSEC-Tools specific, location.
Providing a file via the --with-resolv-conf argument to configure will
avoid this prompt.
Location to read resolver configuration],$val_sysconfdir/dnssec-tools/resolv.conf,quoted)
VAL_RESOLV_CONF=$ac_cv_user_prompt_VAL_RESOLV_CONF
AC_SUBST(VAL_RESOLV_CONF)
AC_MSG_CACHE_ADD(libval resolver configuration : $VAL_RESOLV_CONF)
default_hints="$val_sysconfdir/dnssec-tools/root.hints"
if test "x$defaults" != "xyes" ; then
search_dirs="$val_sysconfdir/dnssec-tools $prefix/var/named $prefix/var/named/etc/named $val_sysconfdir/named $val_sysconfdir"
if test "x$prefix" != "x" ; then
search_dirs="$search_dirs /var/named /var/named/etc/named /etc/named /etc"
fi
for dir in $search_dirs ;
do
for file in named.ca named.root named.cache db.cache root.hints ;
do
if test -r "$dir/$file" ; then
default_hints="$dir/$file"
break 2
fi
done
done
fi
AC_PROMPT_USER(VAL_ROOT_HINTS,[
*** Root hints location:
Enter the location of the root hints file, or 'none' to install
and use the copy provided with DNSSEC-Tool (see validator/etc/root.hints).
Providing a file via the --with-root-hints argument to configure will
avoid this prompt.
Location to read root hints configuration],$val_sysconfdir/dnssec-tools/root.hints,quoted)
VAL_ROOT_HINTS=$ac_cv_user_prompt_VAL_ROOT_HINTS
#AC_DEFINE_UNQUOTED(VAL_ROOT_HINTS,"$VAL_ROOT_HINTS")
AC_SUBST(VAL_ROOT_HINTS)
AC_MSG_CACHE_ADD(libval root hints : $VAL_ROOT_HINTS)
AH_TEMPLATE([LIBVAL_INLINE_POLICY], [Define if inline configuration files are to be used.])
dnl inline_val_conf_file=$VAL_CONFIGURATION_FILE
AC_ARG_WITH(inline-dnsval-conf,
[ --with-inline-dnsval-conf=FILE dnsval config file.],
[inline_val_conf_file=$with_inline_dnsval_conf],
[inline_val_conf_file=etc/dnsval.conf])
dnl inline_root_conf_file=$VAL_ROOT_HINTS
AC_ARG_WITH(inline-root-hints,
[ --with-inline-root-hints=FILE root.hints file.],
[inline_root_conf_file=$with_inline_root_hints],
[inline_root_conf_file=etc/root.hints])
dnl inline_resolv_conf_file=$VAL_RESOLV_CONF
AC_ARG_WITH(inline-resolv-conf,
[ --with-inline-resolv-conf=FILE resolv.conf file.],
[inline_resolv_conf_file=$with_inline_resolv_conf],
[inline_resolv_conf_file=etc/resolv.conf])
AC_ARG_WITH(inline-confs,
[ --without-inline-confs Disable use of inline (pre-configured) configuration data.],
[inline_confs=$with_inline_confs],
[inline_confs="yes"])
if test "$inline_confs" = "yes"; then
AC_DEFINE(LIBVAL_INLINE_POLICY, 1)
else
inline_val_conf_file=
inline_root_conf_file=
inline_resolv_conf_file=
fi
VAL_CONF_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Validator inline configuration : $inline_val_conf_file)
else
AC_CHECK_FILE($inline_val_conf_file,
[VAL_CONF_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_val_conf_file`
AC_MSG_CACHE_ADD(Validator inline configuration : $inline_val_conf_file)])
fi
AC_SUBST(VAL_CONF_INLINE_DATA)
ROOT_HINTS_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Root hints inline file : $inline_root_conf_file)
else
AC_CHECK_FILE($inline_root_conf_file,
[ ROOT_HINTS_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_root_conf_file`
AC_MSG_CACHE_ADD(Root hints inline file : $inline_root_conf_file)])
fi
AC_SUBST(ROOT_HINTS_INLINE_DATA)
RESOLV_CONF_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Resolver inline configuration : $inline_resolv_conf_file)
else
AC_CHECK_FILE($inline_resolv_conf_file,
[ RESOLV_CONF_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_resolv_conf_file`
AC_MSG_CACHE_ADD(Resolver inline configuration : $inline_resolv_conf_file)])
fi
AC_SUBST(RESOLV_CONF_INLINE_DATA)
dnl ----------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile:Makefile.top:Makefile.in
libsres/Makefile:Makefile.top:libsres/Makefile.in:Makefile.bot
libval/Makefile:Makefile.top:libval/Makefile.in:Makefile.bot
libval_shim/Makefile:Makefile.top:libval_shim/Makefile.in:Makefile.bot
doc/Makefile:Makefile.top:doc/Makefile.in:Makefile.bot
apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.bot
])
AC_CONFIG_FILES([libval-config:libval-config.in], [chmod +x libval-config])
AC_CONFIG_FILES([libval/val_inline_conf.h:libval/val_inline_conf.h.in])
AC_CONFIG_COMMANDS([default], echo timestamp > stamp-h)
AC_OUTPUT
AC_MSG_CACHE_DISPLAY()
|