1 dnl Process this file with autoconf to produce a configure script.
3 dnl This file is part of secnet.
4 dnl See README for full list of copyright holders.
6 dnl secnet is free software; you can redistribute it and/or modify it
7 dnl under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3 of the License, or
9 dnl (at your option) any later version.
11 dnl secnet is distributed in the hope that it will be useful, but
12 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl version 3 along with secnet; if not, see
18 dnl https://www.gnu.org/licenses/gpl.html.
20 sinclude(ac_prog_cc_no_writeable_strings.m4)
22 m4_include(subdirmk/subdirmk.ac)
24 AC_INIT(secnet,0.1.18+,secnet@chiark.greenend.org.uk)
25 AC_CONFIG_SRCDIR(secnet.c)
26 AC_CONFIG_HEADER(config.h)
28 SUBDIRMK_SUBDIRS([test-example mtest stest])
31 AC_REVISION($Id: configure.in,v 1.4 2002/09/09 22:05:02 steve Exp $)
35 # If fink is on the path then it is assumed we should use it.
36 AC_PATH_PROG([FINK],[fink])
37 if test "x$FINK" != x; then
38 finkdir=`echo $FINK|sed 's,/[[^/]]*/[[^/]]*$,,'`
39 CPPFLAGS="-I$finkdir/include ${CPPFLAGS}"
40 LDFLAGS="-L$finkdir/lib ${LDFLAGS}"
47 AC_CHECK_HEADERS([net/if.h net/route.h])
48 AC_CHECK_HEADERS([sys/socket.h])
49 AC_CHECK_HEADERS([linux/if_tun.h], [], [],
50 [#if HAVE_SYS_SOCKET_H
51 # include <sys/socket.h>
54 AC_CHECK_HEADERS([stropts.h sys/sockio.h net/if_tun.h])
56 AC_PROG_CC_NO_WRITEABLE_STRINGS(WRITESTRINGS)
58 AC_ARG_ENABLE(hacky-parallel,
59 [AS_HELP_STRING([--enable-hacky-parallel],
60 [parallelise slow cryptography (default is no)])], [
63 y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;;
68 AC_DEFUN([REQUIRE_HEADER],[AC_CHECK_HEADER($1,,[AC_MSG_ERROR($1 not found)])])
70 dnl the order in which libraries is checked is important
71 dnl eg. adns on Solaris 2.5.1 depends on -lnsl and -lsocket
72 AC_CHECK_LIB(gmp,mpz_init_set_str)
73 AC_CHECK_LIB(gmp2,mpz_init_set_str)
74 AC_CHECK_LIB(gmp,__gmpz_init_set_str)
75 REQUIRE_HEADER([gmp.h])
76 dnl Would love to barf if no gmp was found, but how to test? Requiring the header will do for now.
77 SECNET_C_GETFUNC(inet_ntoa,nsl)
78 AC_CHECK_LIB(socket,socket)
79 SECNET_C_GETFUNC(inet_aton,resolv)
80 AC_CHECK_LIB(adns,adns_init)
81 REQUIRE_HEADER([adns.h])
83 AC_MSG_NOTICE([Checking requirements for IPv6 support...])
85 m4_define(NO_IPV6,[enable_ipv6=false])
86 AC_CHECK_DECL(AF_INET6, [],[NO_IPV6],[#include <netinet/in.h>])
87 AC_CHECK_FUNC(adns_addr2text, [],[NO_IPV6])
89 AC_MSG_NOTICE([Enabling IPv6 support])
90 AC_DEFINE(CONFIG_IPV6, 1,
91 [Define to 1 to use IPv6 support in system and adns])
93 AC_MSG_WARN([Disabling IPv6 support])
96 SUBDIRMK_MAKEFILES(common.make)
99 echo timestamp >config.stamp)
109 /* These used to be in config.h.bot, but are now in configure.in. */
112 #define NORETURN(_x) void _x __attribute__ ((noreturn))
113 #define FORMAT(_a,_b,_c) __attribute__ ((format (_a,_b,_c)))
115 #define NORETURN(_x) _x
116 #define FORMAT(_a,_b,_c)
119 #endif /* _CONFIG_H */