Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1 | AC_INIT(ssh.c) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 2 | |
| 3 | AC_CONFIG_HEADER(config.h) |
| 4 | |
| 5 | dnl Checks for programs. |
| 6 | AC_PROG_CC |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 7 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 8 | AC_PROG_RANLIB |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 9 | AC_CHECK_PROG(AR, ar, ar) |
| 10 | if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 11 | |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 12 | dnl Check for OpenSSL/SSLeay directories. |
| 13 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 14 | for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 15 | if test -f "$ssldir/include/openssl/crypto.h"; then |
| 16 | AC_DEFINE(HAVE_OPENSSL) |
| 17 | GOT_SSL="yes" |
| 18 | break |
| 19 | fi |
| 20 | if test -f "$ssldir/include/ssl/crypto.h"; then |
| 21 | AC_DEFINE(HAVE_SSL) |
| 22 | GOT_SSL="yes" |
| 23 | break |
| 24 | fi |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 25 | done |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 26 | if test -z "$GOT_SSL" ; then |
| 27 | AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install]) |
| 28 | fi |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 29 | AC_SUBST(ssldir) |
| 30 | AC_DEFINE_UNQUOTED(ssldir, "$ssldir") |
| 31 | if test "$ssldir" != "/usr"; then |
| 32 | CFLAGS="$CFLAGS -I$ssldir/include" |
| 33 | LIBS="$LIBS -L$ssldir/lib" |
| 34 | fi |
| 35 | LIBS="$LIBS -lssl -lcrypto" |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 36 | AC_MSG_RESULT($ssldir) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 37 | |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 38 | dnl Check for RSAref library. |
| 39 | AC_MSG_CHECKING([for RSAref library]) |
| 40 | saved_LIBS="$LIBS" |
| 41 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 42 | AC_TRY_LINK([], [], |
| 43 | [AC_MSG_RESULT(yes); ], |
| 44 | [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS") |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 45 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 46 | dnl Checks for libraries. |
| 47 | AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***])) |
| 48 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 49 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
| 50 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 51 | AC_CHECK_LIB(socket, main, , ) |
| 52 | |
| 53 | dnl libdl is needed by PAM on Redhat systems |
| 54 | AC_CHECK_LIB(dl, dlopen, , ) |
| 55 | AC_CHECK_LIB(pam, pam_authenticate, , ) |
| 56 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 57 | dnl Checks for header files. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 58 | AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 59 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 60 | dnl Checks for library functions. |
| 61 | AC_PROG_GCC_TRADITIONAL |
Damien Miller | 356a0b0 | 1999-11-08 15:30:59 +1100 | [diff] [blame] | 62 | AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 63 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 64 | dnl Check for ut_host field in utmp |
| 65 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
| 66 | AC_EGREP_HEADER(ut_host, utmp.h, |
| 67 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 68 | [AC_MSG_RESULT(no)] |
| 69 | ) |
| 70 | |
Damien Miller | e0d444c | 1999-11-09 14:23:45 +1100 | [diff] [blame] | 71 | dnl Check whether user wants GNOME ssh-askpass |
| 72 | AC_ARG_WITH(gnome-askpass, |
| 73 | [ --with-gnome-askpass Build and use the GNOME passphrase requester], |
| 74 | [GNOME_ASKPASS="gnome-ssh-askpass"]) |
| 75 | AC_SUBST(GNOME_ASKPASS) |
| 76 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 77 | dnl Check for user-specified random device |
| 78 | AC_ARG_WITH(random, |
| 79 | [ --with-random=FILE read randomness from FILE (default /dev/urandom)], |
| 80 | [ |
| 81 | RANDOM_POOL="$withval"; |
| 82 | AC_DEFINE(RANDOM_POOL, "$RANDOM_POOL") |
| 83 | ], |
| 84 | [ |
| 85 | dnl Check for random device |
| 86 | AC_CHECK_FILE("/dev/urandom", |
| 87 | [ |
| 88 | RANDOM_POOL="/dev/urandom"; |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 89 | AC_SUBST(RANDOM_POOL) |
| 90 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 91 | ] |
| 92 | ) |
| 93 | ] |
| 94 | ) |
| 95 | |
| 96 | dnl Check for EGD pool file |
| 97 | AC_ARG_WITH(egd-pool, |
| 98 | [ --with-egd-pool=FILE read randomness from EGD pool FILE], |
| 99 | [ |
| 100 | RANDOM_POOL="$withval"; |
| 101 | AC_DEFINE(HAVE_EGD) |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 102 | AC_SUBST(RANDOM_POOL) |
| 103 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 104 | ] |
| 105 | ) |
| 106 | |
| 107 | if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then |
| 108 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) |
| 109 | fi |
| 110 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 111 | AC_OUTPUT(Makefile) |