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