1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id: configure.in,v 1.14 2008/11/27 20:33:44 mrsam Exp $
4 dnl Copyright 1998 - 2002 Double Precision, Inc. See COPYING for
5 dnl distribution information.
7 AC_INIT(random128, 0.10, [courier-users@lists.sourceforge.net])
9 >confdefs.h # Kill PACKAGE_ macros
11 AC_CONFIG_SRCDIR(random128.c)
12 AM_INIT_AUTOMAKE([foreign no-define])
13 LPATH="$PATH:/usr/local/bin"
16 dnl Checks for programs.
17 AM_CONFIG_HEADER(config.h)
18 AC_USE_SYSTEM_EXTENSIONS
22 AC_PATH_PROGS(PS, ps, ps, $LPATH)
23 AC_PATH_PROGS(W, w, w, $LPATH)
28 AC_MSG_ERROR(Cannot find pathname to ps)
33 CFLAGS="-Wall $CFLAGS"
36 CFLAGS="-I.. -I$srcdir/.. $CFLAGS"
38 dnl Checks for libraries.
40 dnl Checks for header files.
42 AC_CHECK_HEADERS(unistd.h fcntl.h)
46 AC_ARG_WITH(random, [ --with-random=/dev/urandom - location of the system random file generator
47 --without-random - there is no system random file generator ],
55 AC_CACHE_CHECK([for random source],random_cv_RANDOM,
57 if test -c /dev/urandom
59 random_cv_RANDOM=/dev/urandom
61 if test -c /dev/random
63 random_cv_RANDOM=/dev/random
65 random_cv_RANDOM="none"
69 random="$random_cv_RANDOM"
76 if test "$random" != "none"
78 AC_DEFINE_UNQUOTED(RANDOM, "$random", [ Entropy source ])
81 AC_CACHE_CHECK([for some good options for ps],random_cv_PS_OPTIONS,
83 for opts in -Afl -Afw -Af -Al -afl -afw -af -al Afl Afw Af Al afl afw af al
85 ps $opts >/dev/null 2>/dev/null || continue
88 random_cv_PS_OPTIONS="$opts"
91 AC_DEFINE_UNQUOTED(PS_OPTIONS,"$random_cv_PS_OPTIONS",
92 [ How to make ps(1) spit out lots of crap ])
93 AC_DEFINE_UNQUOTED(PS,"$PS", [ The PS program ])
97 AC_DEFINE_UNQUOTED(W, "$w", [ The W program ])