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