| 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | dnl |
| 3 | dnl Copyright 1998 - 2002 Double Precision, Inc. See COPYING for |
| 4 | dnl distribution information. |
| 5 | |
| 6 | AC_INIT(random128, 0.10, [courier-users@lists.sourceforge.net]) |
| 7 | |
| 8 | >confdefs.h # Kill PACKAGE_ macros |
| 9 | |
| 10 | AC_CONFIG_SRCDIR(random128.c) |
| 11 | AC_CONFIG_AUX_DIR(../..) |
| 12 | AM_INIT_AUTOMAKE([foreign no-define]) |
| 13 | LPATH="$PATH:/usr/local/bin" |
| 14 | |
| 15 | |
| 16 | dnl Checks for programs. |
| 17 | AC_CONFIG_HEADERS(config.h) |
| 18 | AC_USE_SYSTEM_EXTENSIONS |
| 19 | AC_PROG_INSTALL |
| 20 | AC_PROG_LN_S |
| 21 | AC_PROG_CC |
| 22 | AC_PATH_PROGS(PS, ps, ps, $LPATH) |
| 23 | AC_PATH_PROGS(W, w, w, $LPATH) |
| 24 | AC_PROG_LIBTOOL |
| 25 | |
| 26 | if test "$PS" = "ps" |
| 27 | then |
| 28 | AC_MSG_ERROR(Cannot find pathname to ps) |
| 29 | fi |
| 30 | |
| 31 | if test x$GXX = xyes |
| 32 | then |
| 33 | CFLAGS="-Wall $CFLAGS" |
| 34 | fi |
| 35 | |
| 36 | CFLAGS="-I.. -I$srcdir/.. $CFLAGS" |
| 37 | |
| 38 | dnl Checks for libraries. |
| 39 | |
| 40 | dnl Checks for header files. |
| 41 | AC_HEADER_SYS_WAIT |
| 42 | AC_CHECK_HEADERS(unistd.h fcntl.h) |
| 43 | |
| 44 | AC_TYPE_PID_T |
| 45 | AC_SYS_LARGEFILE |
| 46 | |
| 47 | AC_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 | |
| 52 | case "$random" in |
| 53 | /*) |
| 54 | ;; |
| 55 | y*|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 | ;; |
| 75 | esac |
| 76 | |
| 77 | if test "$random" != "none" |
| 78 | then |
| 79 | AC_DEFINE_UNQUOTED(RANDOM, "$random", [ Entropy source ]) |
| 80 | fi |
| 81 | |
| 82 | AC_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 | |
| 92 | AC_DEFINE_UNQUOTED(PS_OPTIONS,"$random_cv_PS_OPTIONS", |
| 93 | [ How to make ps(1) spit out lots of crap ]) |
| 94 | AC_DEFINE_UNQUOTED(PS,"$PS", [ The PS program ]) |
| 95 | |
| 96 | if test "$W" != "w" |
| 97 | then |
| 98 | AC_DEFINE_UNQUOTED(W, "$w", [ The W program ]) |
| 99 | fi |
| 100 | |
| 101 | AC_OUTPUT(Makefile) |