1 dnl Process this file with autoconf to produce a configure script.
3 sinclude(ac_prog_cc_no_writeable_strings.m4)
5 AC_INIT(secnet,0.1.18+,secnet@chiark.greenend.org.uk)
6 AC_CONFIG_SRCDIR(secnet.c)
7 AC_CONFIG_HEADER(config.h)
10 AC_REVISION($Id: configure.in,v 1.4 2002/09/09 22:05:02 steve Exp $)
19 AC_CHECK_HEADERS([stdint.h inttypes.h])
20 AC_CHECK_HEADERS([net/if.h net/route.h])
21 AC_CHECK_HEADERS([sys/socket.h])
22 AC_CHECK_HEADERS([linux/if.h], [], [],
23 [#if HAVE_SYS_SOCKET_H
24 # include <sys/socket.h>
27 AC_CHECK_HEADERS([stropts.h sys/sockio.h net/if_tun.h])
29 AC_CHECK_SIZEOF(unsigned long long)
30 AC_CHECK_SIZEOF(unsigned long)
31 AC_CHECK_SIZEOF(unsigned int)
32 AC_CHECK_SIZEOF(unsigned short)
33 AC_CHECK_SIZEOF(unsigned char)
34 AC_PROG_CC_NO_WRITEABLE_STRINGS(WRITESTRINGS)
36 AC_ARG_ENABLE(hacky-parallel,
37 [AS_HELP_STRING([--enable-hacky-parallel],
38 [parallelise slow cryptography (default is no)])], [
41 y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;;
46 AC_DEFUN([REQUIRE_HEADER],[AC_CHECK_HEADER($1,,[AC_MSG_ERROR($1 not found)])])
48 dnl the order in which libraries is checked is important
49 dnl eg. adns on Solaris 2.5.1 depends on -lnsl and -lsocket
50 AC_CHECK_LIB(gmp,mpz_init_set_str)
51 AC_CHECK_LIB(gmp2,mpz_init_set_str)
52 AC_CHECK_LIB(gmp,__gmpz_init_set_str)
53 REQUIRE_HEADER([gmp.h])
54 dnl Would love to barf if no gmp was found, but how to test? Requiring the header will do for now.
55 AC_CHECK_LIB(fl,yywrap)
56 if test "$ac_cv_lib_fl_yywrap" != yes; then
57 AC_MSG_ERROR([A compatible libfl is required])
59 AC_CHECK_LIB(nsl,inet_ntoa)
60 AC_CHECK_LIB(socket,socket)
61 AC_CHECK_LIB(resolv,inet_aton)
62 AC_CHECK_LIB(adns,adns_init)
63 REQUIRE_HEADER([adns.h])
65 dnl check for getopt in standard library
66 AC_REPLACE_FUNCS([snprintf])
68 AC_OUTPUT(Makefile,echo timestamp >stamp-h)
78 /* These used to be in config.h.bot, but are now in configure.in. */
80 #ifdef HAVE_INTTYPES_H
86 #if SIZEOF_UNSIGNED_LONG_LONG==8
87 typedef unsigned long long uint64_t;
88 typedef long long int64_t;
89 #elif SIZEOF_UNSIGNED_LONG==8
90 typedef unsigned long uint64_t;
93 #error I do not know what to use for a uint64_t.
96 /* Give us an unsigned 32-bit data type. */
97 #if SIZEOF_UNSIGNED_LONG==4
98 typedef unsigned long uint32_t;
100 #elif SIZEOF_UNSIGNED_INT==4
101 typedef unsigned int uint32_t;
104 #error I do not know what to use for a uint32_t.
107 /* An unsigned 16-bit data type. */
108 #if SIZEOF_UNSIGNED_INT==2
109 typedef unsigned int uint16_t;
111 #elif SIZEOF_UNSIGNED_SHORT==2
112 typedef unsigned short uint16_t;
113 typedef short int16_t;
115 #error I do not know what to use for a uint16_t.
118 /* An unsigned 8-bit data type */
119 #if SIZEOF_UNSIGNED_CHAR==1
120 typedef unsigned char uint8_t;
122 #error I do not know what to use for a uint8_t.
127 #ifndef HAVE_SNPRINTF
130 #include "snprintf.h"
134 #define NORETURN(_x) void _x __attribute__ ((noreturn))
135 #define FORMAT(_a,_b,_c) __attribute__ ((format (_a,_b,_c)))
137 #define NORETURN(_x) _x
138 #define FORMAT(_a,_b,_c)
141 #endif /* _CONFIG_H */