configure.in 1.77 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
dnl Process this file with autoconf to produce a configure script.
AC_INIT(keyexchange.h)
Niels Möller's avatar
Niels Möller committed
3

Niels Möller's avatar
Niels Möller committed
4
5
6
dnl No real versioning yet, use dated snapshots instead.
dnl AM_INIT_AUTOMAKE(lsh, snapshot-`date +%Y-%m-%d`)
AM_INIT_AUTOMAKE(lsh, 17)
Niels Möller's avatar
Niels Möller committed
7

Niels Möller's avatar
Niels Möller committed
8
AM_CONFIG_HEADER(config.h)
Niels Möller's avatar
Niels Möller committed
9

10
11
12
13
14
15
16
17
18
19
20
21
# We want an absolute path to the source-dir.
case "$srcdir" in
    /*)
    ;;
    *)
	oldsrcdir="$srcdir"
	srcdir="`cd \"$srcdir\";pwd`"
	AC_MSG_WARN([ Converted $oldsrcdir to $srcdir,
If this does not work, please use an absolute path to the configure script. ])
    ;;
esac

Niels Möller's avatar
Niels Möller committed
22
23
24
25
26
27
28
29
30
# We want to compile the crypto lib for use with lsh
CPPFLAGS="$CPPFLAGS -I$srcdir/include -DLSH"

# _GNU_SOURCE is needed on some readhat glibc based systems, to get
# proper declarations of crypt(), initgroups() and strsignal().
# Enable it on all systems untill some harm is reported

CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"

Niels Möller's avatar
Niels Möller committed
31
32
33
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
Niels Möller's avatar
Niels Möller committed
34
AC_PROG_RANLIB
Niels Möller's avatar
Niels Möller committed
35
36
37

dnl Checks for libraries.
AC_CHECK_LIB(gmp, mpz_set_d)
38
39
dnl Some debian systems have both gmp1 and gmp2.
AC_CHECK_LIB(gmp2, mpz_set_d)
40
41
42
43
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(xnet, inet_addr)
AC_CHECK_LIB(nsl, hostbyname)
AC_CHECK_LIB(socket, setsockopt)
Niels Möller's avatar
Niels Möller committed
44
45
46

dnl Checks for header files.
AC_HEADER_STDC
47
AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h)
Niels Möller's avatar
Niels Möller committed
48
49
50
AC_CHECK_HEADERS(gmp.h)

dnl Checks for typedefs, structures, and compiler characteristics.
51
52
AC_C_CONST
AC_TYPE_UID_T
Niels Möller's avatar
Niels Möller committed
53
AC_TYPE_SIZE_T
54
55
AC_HEADER_TIME

Niels Möller's avatar
Niels Möller committed
56
57
58
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
Niels Möller's avatar
Niels Möller committed
59
60
dnl FIXME: We should check that a pid_t fits in an int
	
Niels Möller's avatar
Niels Möller committed
61
dnl Checks for library functions.
62
63
64
65
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(select socket strerror strtol)
Niels Möller's avatar
Niels Möller committed
66

Niels Möller's avatar
Niels Möller committed
67
68
69
70
71
AC_REPLACE_FUNCS(poll)

dnl AC_CONFIG_SUBDIRS(lib)

AC_OUTPUT(Makefile lib/Makefile)
72

Niels Möller's avatar
Niels Möller committed
73
dnl syscmd([cd lib && autoconf])