Revert "preauthuserdbcommon.c: Move token-getting code to below callback."
[hcoop/debian/courier-authlib.git] / random128 / configure.in
CommitLineData
d9898ee8 1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.in,v 1.13 2007/02/26 04:13:41 mrsam Exp $
3dnl
4dnl Copyright 1998 - 2002 Double Precision, Inc. See COPYING for
5dnl distribution information.
6
7AC_INIT(random128, 0.10, [courier-users@lists.sourceforge.net])
8
9>confdefs.h # Kill PACKAGE_ macros
10
11AC_CONFIG_SRCDIR(random128.c)
12AM_INIT_AUTOMAKE([foreign no-define])
13LPATH="$PATH:/usr/local/bin"
14
15
16dnl Checks for programs.
17AM_CONFIG_HEADER(config.h)
18AC_AIX
19AC_ISC_POSIX
20AC_MINIX
21AC_PROG_INSTALL
22AC_PROG_LN_S
23AC_PROG_CC
24AC_PATH_PROGS(PS, ps, ps, $LPATH)
25AC_PATH_PROGS(W, w, w, $LPATH)
26AC_PROG_LIBTOOL
27
28if test "$PS" = "ps"
29then
30 AC_MSG_ERROR(Cannot find pathname to ps)
31fi
32
33if test x$GXX = xyes
34then
35 CFLAGS="-Wall $CFLAGS"
36fi
37
38CFLAGS="-I.. -I$srcdir/.. $CFLAGS"
39
40dnl Checks for libraries.
41
42dnl Checks for header files.
43AC_HEADER_SYS_WAIT
44AC_CHECK_HEADERS(unistd.h fcntl.h)
45
46AC_TYPE_PID_T
47
48AC_ARG_WITH(random, [ --with-random=/dev/urandom - location of the system random file generator
49--without-random - there is no system random file generator ],
50 random="$withval",
51 random="y")
52
53case "$random" in
54/*)
55 ;;
56y*|1*)
57 AC_CACHE_CHECK([for random source],random_cv_RANDOM,
58
59 if test -c /dev/urandom
60 then
61 random_cv_RANDOM=/dev/urandom
62 else
63 if test -c /dev/random
64 then
65 random_cv_RANDOM=/dev/random
66 else
67 random_cv_RANDOM="none"
68 fi
69 fi
70 )
71 random="$random_cv_RANDOM"
72 ;;
73*)
74 random="none"
75 ;;
76esac
77
78if test "$random" != "none"
79then
80 AC_DEFINE_UNQUOTED(RANDOM, "$random", [ Entropy source ])
81fi
82
83AC_CACHE_CHECK([for some good options for ps],random_cv_PS_OPTIONS,
84
85 for opts in -Afl -Afw -Af -Al -afl -afw -af -al Afl Afw Af Al afl afw af al
86 do
87 ps $opts >/dev/null 2>/dev/null || continue
88 break
89 done
90 random_cv_PS_OPTIONS="$opts"
91)
92
93AC_DEFINE_UNQUOTED(PS_OPTIONS,"$random_cv_PS_OPTIONS",
94 [ How to make ps(1) spit out lots of crap ])
95AC_DEFINE_UNQUOTED(PS,"$PS", [ The PS program ])
96
97if test "$W" != "w"
98then
99 AC_DEFINE_UNQUOTED(W, "$w", [ The W program ])
100fi
101
102AC_OUTPUT(Makefile)