.deb version number 1.0pre2-0.4.
[tinc] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/tincd.c)
3 AM_INIT_AUTOMAKE(tinc, 1.0pre2)
4 AM_CONFIG_HEADER(config.h)
5
6 dnl Include the macros from the m4/ directory
7 AM_ACLOCAL_INCLUDE(m4)
8
9 # Enable GNU extensions.
10 # Define this here, not in acconfig's @TOP@ section, since definitions
11 # in the latter don't make it into the configure-time tests.
12 AC_DEFINE([_GNU_SOURCE])
13 AC_DEFINE([__USE_BSD])
14
15 dnl Checks for programs.
16 AC_PROG_CC
17 AC_PROG_CPP
18 AC_PROG_GCC_TRADITIONAL
19 AC_PROG_AWK
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 AC_PROG_MAKE_SET
23 jm_PERL
24 AM_PROG_LIBTOOL
25
26 dnl Checks for libraries.
27
28 dnl Checks for header files.
29 AC_HEADER_STDC
30 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h syslog.h unistd.h gmp.h gmp2/gmp.h \
31 sys/time.h)
32
33 dnl Checks for typedefs, structures, and compiler characteristics.
34 AC_C_CONST
35 AC_TYPE_PID_T
36 AC_TYPE_SIZE_T
37 AC_HEADER_TIME
38 AC_STRUCT_TM
39
40 dnl Checks for library functions.
41 AC_FUNC_MEMCMP
42 AC_FUNC_ALLOCA
43 AC_TYPE_SIGNAL
44 AC_CHECK_FUNCS(ftime socket select strtol strerror)
45 jm_FUNC_MALLOC
46 jm_FUNC_REALLOC
47
48 # Check for the GNU Multi Precision Library
49 libgmp=none
50 AC_CHECK_LIB(gmp2, mpz_powm, [
51   libgmp=gmp2
52 ])
53 AC_CHECK_LIB(gmp3, mpz_powm, [
54   libgmp=gmp3
55 ])
56 AC_CHECK_LIB(gmp, mpz_powm, [
57   libgmp=gmp
58 ])
59
60 if test $libgmp = none; then
61   AC_MSG_ERROR(libgmp is not installed. Please grab it from your
62   nearest GNU mirror and install it (see README))
63 else
64   LIBS="$LIBS -l$libgmp"
65 fi
66
67 AC_CHECK_LIB(dl, dlopen, [
68   LIBS="$LIBS -ldl"
69 ])
70
71 AC_OUTPUT([Makefile src/Makefile cipher/Makefile cipher/blowfish/Makefile
72 doc/Makefile lib/Makefile m4/Makefile redhat/Makefile debian/Makefile])