sinclude(ac_prog_cc_no_writeable_strings.m4)
-AC_INIT(secnet,0.1.16+,secnet@chiark.greenend.org.uk)
+AC_INIT(secnet,0.1.18+,secnet@chiark.greenend.org.uk)
AC_CONFIG_SRCDIR(secnet.c)
AC_CONFIG_HEADER(config.h)
AC_LANG_C
+# If fink is on the path then it is assumed we should use it.
+AC_PATH_PROG([FINK],[fink])
+if test "x$FINK" != x; then
+ finkdir=`echo $FINK|sed 's,/[[^/]]*/[[^/]]*$,,'`
+ CPPFLAGS="-I$finkdir/include ${CPPFLAGS}"
+ LDFLAGS="-L$finkdir/lib ${LDFLAGS}"
+fi
+
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_SIZEOF(unsigned char)
AC_PROG_CC_NO_WRITEABLE_STRINGS(WRITESTRINGS)
+AC_ARG_ENABLE(hacky-parallel,
+ [AS_HELP_STRING([--enable-hacky-parallel],
+ [parallelise slow cryptography (default is no)])], [
+ case "$enableval" in
+ n|0|no) ;;
+ y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;;
+ *) ;;
+ esac
+])
+
AC_DEFUN([REQUIRE_HEADER],[AC_CHECK_HEADER($1,,[AC_MSG_ERROR($1 not found)])])
dnl the order in which libraries is checked is important
AC_MSG_ERROR([A compatible libfl is required])
fi
AC_CHECK_LIB(nsl,inet_ntoa)
-AC_CHECK_LIB(getopt,getopt_long)
-AC_CHECK_LIB(gnugetopt,getopt_long)
AC_CHECK_LIB(socket,socket)
AC_CHECK_LIB(resolv,inet_aton)
AC_CHECK_LIB(adns,adns_init)
REQUIRE_HEADER([adns.h])
-dnl check for getopt in standard library
-AC_REPLACE_FUNCS([snprintf])
-AC_CHECK_FUNC([getopt_long], [], [AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])])
+AC_MSG_NOTICE([Checking requirements for IPv6 support...])
+enable_ipv6=true
+m4_define(NO_IPV6,[enable_ipv6=false])
+AC_CHECK_DECL(AF_INET6, [],[NO_IPV6],[#include <netinet/in.h>])
+AC_CHECK_FUNC(adns_addr2text, [],[NO_IPV6])
+if $enable_ipv6; then
+ AC_MSG_NOTICE([Enabling IPv6 support])
+ AC_DEFINE(CONFIG_IPV6, 1,
+ [Define to 1 to use IPv6 support in system and adns])
+else
+ AC_MSG_WARN([Disabling IPv6 support])
+fi
AC_OUTPUT(Makefile,echo timestamp >stamp-h)
#endif
#endif
-#ifndef HAVE_SNPRINTF
-#include <stdio.h>
-#include <stdarg.h>
-#include "snprintf.h"
-#endif
-
#ifdef __GNUC__
#define NORETURN(_x) void _x __attribute__ ((noreturn))
#define FORMAT(_a,_b,_c) __attribute__ ((format (_a,_b,_c)))