2 # Process this file with autoconf to produce a configure script.
6 # 2008-06-27 initial setup
7 # 2008-06-29 add of BIND path checking
8 # 2008-06-30 add of arg checkings
9 # 2008-07-02 additional arg checkings
10 # 2008-07-04 check for getopt_long() added
11 # 2008-08-30 check for unsigned integer types
12 # 2008-10-01 if BIND_UTIL_PATH check failed, use config_zkt.h setting as last resort
13 # 2009-07-30 check for timegm() added
18 ### Package name and current version
19 AC_INIT(ZKT, 0.99c, Holger Zuleger hznet.de)
20 dnl AC_REVISION(Revision: 1.1)
22 ### Files to test to check if src dir contains the package
23 AC_CONFIG_SRCDIR([dnssec-zkt.c])
24 AC_CONFIG_HEADER([config.h])
27 ### Checks for programs.
30 ### find out the path to BIND utils and version
31 AC_PATH_PROG([SIGNZONE_PROG], dnssec-signzone)
32 if test -z "$SIGNZONE_PROG" ; then
33 # AC_MSG_ERROR([*** 'BIND dnssec-signzone dnssec-keygen' missing, please install or fix your \$PATH ***])
34 AC_MSG_WARN([*** 'BIND dnssec-signzone' missing, use default BIND_UTIL_PATH and BIND_VERSION setting out of config_zkt.h ***])
36 bind_util_path=`dirname "$SIGNZONE_PROG"`
37 # define BIND_UTIL_PATH in config.h.in
38 AC_DEFINE_UNQUOTED(BIND_UTIL_PATH, "$bind_util_path/", Path to BIND utilities)
39 # define BIND_VERSION in config.h.in
40 bind_version=`$SIGNZONE_PROG 2>&1 | grep "Version:" | tr -cd "0-9" | sed "s/^\(...\).*/\1/"`
41 AC_DEFINE_UNQUOTED(BIND_VERSION, $bind_version, BIND version as integer number without dots)
44 AC_CHECK_TYPE(uint, unsigned int)
45 AC_CHECK_TYPE(ulong, unsigned long)
46 AC_CHECK_TYPE(ushort, unsigned short)
47 AC_CHECK_TYPE(uchar, unsigned char)
49 ### define configure arguments
50 AC_ARG_ENABLE([printtimezone], AC_HELP_STRING( [--enable-print-timezone], [print out timezone]), [printtimezone=$enableval])
52 test "$printtimezone" = yes && printtimezone=1
53 AC_DEFINE_UNQUOTED(PRINT_TIMEZONE, $printtimezone, print out timezone)
55 AC_ARG_ENABLE([printyear], AC_HELP_STRING( [--enable-print-age], [print age of year]), [printyear=$enableval])
57 test "$printyear" = yes && printyear=1
58 AC_DEFINE_UNQUOTED(PRINT_AGE_OF_YEAR, $printyear, print age of year)
60 AC_ARG_ENABLE([logprogname], AC_HELP_STRING( [--enable-log-progname], [log with progname]), [logprogname=$enableval])
62 test "$logprogname" = yes && logprogname=1
63 AC_DEFINE_UNQUOTED(LOG_WITH_PROGNAME, $logprogname, log with progname)
65 AC_ARG_ENABLE([logtimestamp], AC_HELP_STRING( [--disable-log-timestamp], [do not log with timestamp]), [logtimestamp=$enableval])
67 test "$logtimestamp" = no && logtimestamp=0
68 AC_DEFINE_UNQUOTED(LOG_WITH_TIMESTAMP, $logtimestamp, log with timestamp)
70 AC_ARG_ENABLE([loglevel], AC_HELP_STRING( [--disable-log-level], [do not log with level]), [loglevel=$enableval])
72 test "$loglevel" = no && loglevel=0
73 AC_DEFINE_UNQUOTED(LOG_WITH_LEVEL, $loglevel, log with level)
75 AC_ARG_ENABLE([ttl_in_keyfile], AC_HELP_STRING( [--disable-ttl-in-keyfiles], [do not allow TTL values in keyfiles]), [ttl_in_keyfile=$enableval])
77 test "$ttl_in_keyfile" = no && ttl_in_keyfile=0
78 AC_DEFINE_UNQUOTED(TTL_IN_KEYFILE_ALLOWED, $ttl_in_keyfile, TTL in keyfiles allowed)
80 configpath="/var/named"
81 AC_ARG_ENABLE([configpath],
82 AC_HELP_STRING( [--enable-configpath=PATH], [set path of config file (defaults to /var/named)]),
83 [configpath=$enableval])
86 configpath="/var/named"
94 AC_DEFINE_UNQUOTED(CONFIG_PATH, "$configpath/", [set path of config file (defaults to /var/named)])
99 AC_HELP_STRING( [--disable-tree], [use single linked list instead of binary tree data structure for dnssec-zkt]),
100 [usetree=$enableval])
101 if test "$usetree" = no
106 AC_DEFINE_UNQUOTED(USE_TREE, $usetree, Use TREE data structure for dnssec-zkt)
108 AC_DEFINE_UNQUOTED(ZKT_VERSION, "v$t$PACKAGE_VERSION (c) Feb 2005 - Aug 2009 Holger Zuleger hznet.de", ZKT version string)
110 ### Checks for libraries.
113 ### Checks for header files.
116 AC_CHECK_HEADERS([fcntl.h netdb.h stdlib.h getopt.h string.h strings.h sys/socket.h sys/time.h sys/types.h syslog.h unistd.h utime.h])
119 ### Checks for typedefs, structures, and compiler characteristics.
127 ### Checks for library functions.
128 AC_FUNC_CLOSEDIR_VOID
129 AC_FUNC_ERROR_AT_LINE
136 # 2008-07-04 getopt_long added
137 # 2009-07-30 timegm added
138 AC_CHECK_FUNCS([getopt_long gettimeofday memset putenv socket strcasecmp strchr strdup strerror strncasecmp strrchr tzset utime getuid timegm])
141 AC_CONFIG_FILES([Makefile])