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) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4 | AC_CANONICAL_HOST |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 5 | |
| 6 | dnl Checks for programs. |
| 7 | AC_PROG_CC |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 8 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 9 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 10 | AC_PROG_INSTALL |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 11 | AC_CHECK_PROG(AR, ar, ar) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 12 | AC_PATH_PROG(xauth_path, xauth) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 13 | |
| 14 | dnl Use ip address instead of hostname in $DISPLAY |
| 15 | AC_ARG_WITH(rsh, |
| 16 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 17 | [ |
| 18 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 19 | ], |
| 20 | [ |
| 21 | AC_PATH_PROG(rsh_path, rsh) |
| 22 | ] |
| 23 | ) |
| 24 | |
| 25 | if test ! -z "$xauth_path" ; then |
| 26 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 27 | fi |
| 28 | if test ! -z "$rsh_path" ; then |
| 29 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 30 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 31 | |
Damien Miller | 3b9d5e9 | 1999-12-15 09:34:31 +1100 | [diff] [blame] | 32 | dnl Checks for compiler characteristics |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 33 | if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 34 | |
Damien Miller | 3b9d5e9 | 1999-12-15 09:34:31 +1100 | [diff] [blame] | 35 | AC_C_INLINE |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 36 | |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 37 | dnl Check for some target-specific stuff |
| 38 | case "$host" in |
| 39 | *-*-hpux10*) |
| 40 | if test -z "$GCC"; then |
| 41 | CFLAGS="$CFLAGS -Aa" |
| 42 | fi |
| 43 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
| 44 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 45 | AC_DEFINE(USE_UTMPX) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 46 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 47 | if test -f /tcb/files/auth/system/default; then |
| 48 | AC_MSG_RESULT(yes) |
| 49 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 50 | LIBS="$LIBS -lsec" |
| 51 | else |
| 52 | AC_MSG_RESULT(no) |
| 53 | AC_DEFINE(DISABLE_SHADOW) |
| 54 | fi |
| 55 | ;; |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 56 | *-*-solaris*) |
| 57 | AC_DEFINE(USE_UTMPX) |
| 58 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 59 | *-*-irix5*) |
| 60 | AC_DEFINE(CRYPT_H_BREAKS_BUILD) |
| 61 | # CFLAGS="$CFLAGS -shared" |
| 62 | no_libsocket=1 |
| 63 | no_libnsl=1 |
| 64 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 65 | esac |
| 66 | |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 67 | dnl Check for OpenSSL/SSLeay directories. |
| 68 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 69 | 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] | 70 | if test -f "$ssldir/include/openssl/crypto.h"; then |
| 71 | AC_DEFINE(HAVE_OPENSSL) |
| 72 | GOT_SSL="yes" |
| 73 | break |
| 74 | fi |
| 75 | if test -f "$ssldir/include/ssl/crypto.h"; then |
| 76 | AC_DEFINE(HAVE_SSL) |
| 77 | GOT_SSL="yes" |
| 78 | break |
| 79 | fi |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 80 | done |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 81 | if test -z "$GOT_SSL" ; then |
| 82 | AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install]) |
| 83 | fi |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 84 | AC_SUBST(ssldir) |
| 85 | AC_DEFINE_UNQUOTED(ssldir, "$ssldir") |
| 86 | if test "$ssldir" != "/usr"; then |
| 87 | CFLAGS="$CFLAGS -I$ssldir/include" |
Damien Miller | 84093e9 | 1999-12-15 09:06:28 +1100 | [diff] [blame] | 88 | LDFLAGS="$LDFLAGS -L$ssldir/lib" |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 89 | fi |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 90 | AC_MSG_RESULT($ssldir) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 91 | |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 92 | dnl Check for RSAref library. |
| 93 | AC_MSG_CHECKING([for RSAref library]) |
| 94 | saved_LIBS="$LIBS" |
| 95 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 96 | AC_TRY_LINK([], [], |
| 97 | [AC_MSG_RESULT(yes); ], |
| 98 | [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS") |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 99 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 100 | dnl Checks for libraries. |
| 101 | AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***])) |
| 102 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 103 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 104 | AC_CHECK_LIB(crypt, crypt, , ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 105 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 106 | if test -z "$no_libsocket" ; then |
| 107 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 108 | fi |
| 109 | if test -z "$no_libnsl" ; then |
| 110 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 111 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 112 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 113 | dnl Checks for header files. |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 114 | AC_CHECK_HEADERS(bstring.h crypt.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/time.h sys/ttcompat.h util.h utmp.h utmpx.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 115 | |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 116 | dnl Checks for library functions. |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 117 | AC_CHECK_FUNCS(arc4random getpagesize _getpty innetgr md5_crypt mkdtemp openpty setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 118 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 119 | AC_CHECK_FUNC(login, |
| 120 | [AC_DEFINE(HAVE_LOGIN)], |
| 121 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 122 | ) |
| 123 | |
| 124 | AC_CHECK_FUNC(daemon, |
| 125 | [AC_DEFINE(HAVE_DAEMON)], |
| 126 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 127 | ) |
| 128 | |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 129 | dnl Checks for data types |
| 130 | AC_CHECK_SIZEOF(short int, 2) |
| 131 | AC_CHECK_SIZEOF(int, 4) |
| 132 | AC_CHECK_SIZEOF(long int, 4) |
| 133 | AC_CHECK_SIZEOF(long long int, 8) |
| 134 | |
| 135 | dnl More checks for data types |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 136 | AC_MSG_CHECKING([for quad_t]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 137 | AC_TRY_COMPILE( |
| 138 | [#include <sys/types.h>], |
| 139 | [quad_t a; a = 1235;], |
| 140 | [ |
| 141 | AC_DEFINE(HAVE_QUAD_T) |
| 142 | AC_MSG_RESULT(yes) |
| 143 | ], |
| 144 | [AC_MSG_RESULT(no)] |
| 145 | ) |
| 146 | |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 147 | AC_MSG_CHECKING([for intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 148 | AC_TRY_COMPILE( |
| 149 | [#include <sys/types.h>], |
| 150 | [int16_t a; int32_t b; a = 1235; b = 1235;], |
| 151 | [ |
| 152 | AC_DEFINE(HAVE_INTXX_T) |
| 153 | AC_MSG_RESULT(yes) |
| 154 | ], |
| 155 | [AC_MSG_RESULT(no)] |
| 156 | ) |
| 157 | |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 158 | AC_MSG_CHECKING([for u_intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 159 | AC_TRY_COMPILE( |
| 160 | [#include <sys/types.h>], |
| 161 | [u_int16_t c; u_int32_t d; c = 1235; d = 1235;], |
| 162 | [ |
| 163 | AC_DEFINE(HAVE_U_INTXX_T) |
| 164 | AC_MSG_RESULT(yes) |
| 165 | ], |
| 166 | [AC_MSG_RESULT(no)] |
| 167 | ) |
| 168 | |
| 169 | AC_MSG_CHECKING([For uintXX_t types]) |
| 170 | AC_TRY_COMPILE( |
| 171 | [#include <sys/types.h>], |
| 172 | [uint16_t c; uint32_t d; c = 1235; d = 1235;], |
| 173 | [ |
| 174 | AC_DEFINE(HAVE_UINTXX_T) |
| 175 | AC_MSG_RESULT(yes) |
| 176 | ], |
| 177 | [AC_MSG_RESULT(no)] |
| 178 | ) |
| 179 | |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 180 | AC_MSG_CHECKING([For socklen_t]) |
| 181 | AC_TRY_COMPILE( |
| 182 | [#include <sys/types.h>], |
| 183 | [#include <sys/socket.h>], |
| 184 | [socklen_t foo; foo = 1235;], |
| 185 | [ |
| 186 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 187 | AC_MSG_RESULT(yes) |
| 188 | ], |
| 189 | [AC_MSG_RESULT(no)] |
| 190 | ) |
| 191 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 192 | AC_ARG_WITH(pam, |
| 193 | [ --without-pam Disable PAM support ], |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 194 | [ |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 195 | if test "x$withval" = "xno" ; then |
| 196 | no_pam=1 |
| 197 | AC_DEFINE(DISABLE_PAM) |
| 198 | fi |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 199 | ] |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 200 | ) |
| 201 | |
| 202 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then |
| 203 | AC_CHECK_LIB(dl, dlopen, , ) |
| 204 | LIBS="$LIBS -lpam" |
| 205 | dnl Check PAM strerror arguments |
| 206 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 207 | AC_TRY_COMPILE( |
| 208 | [ |
| 209 | #include <stdlib.h> |
| 210 | #include <security/pam_appl.h> |
| 211 | ], |
| 212 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 213 | [AC_MSG_RESULT(no)], |
| 214 | [ |
| 215 | AC_DEFINE(HAVE_OLD_PAM) |
| 216 | AC_MSG_RESULT(yes) |
| 217 | ] |
| 218 | ) |
| 219 | fi |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 220 | |
Damien Miller | 98ac007 | 1999-11-25 13:19:55 +1100 | [diff] [blame] | 221 | AC_MSG_CHECKING([whether to build GNOME ssh-askpass]) |
| 222 | dnl Check whether user wants GNOME ssh-askpass |
| 223 | AC_ARG_WITH(gnome-askpass, |
| 224 | [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)], |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 225 | [ |
| 226 | if test x$withval = xno ; then |
Damien Miller | 98ac007 | 1999-11-25 13:19:55 +1100 | [diff] [blame] | 227 | GNOME_ASKPASS=""; |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 228 | else |
Damien Miller | 98ac007 | 1999-11-25 13:19:55 +1100 | [diff] [blame] | 229 | GNOME_ASKPASS="gnome-ssh-askpass"; |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 230 | fi |
Damien Miller | 98ac007 | 1999-11-25 13:19:55 +1100 | [diff] [blame] | 231 | ]) |
| 232 | AC_SUBST(GNOME_ASKPASS) |
| 233 | |
| 234 | if test -z "$GNOME_ASKPASS" ; then |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 235 | AC_MSG_RESULT(no) |
Damien Miller | 98ac007 | 1999-11-25 13:19:55 +1100 | [diff] [blame] | 236 | else |
| 237 | AC_MSG_RESULT(yes) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 238 | fi |
Damien Miller | e0d444c | 1999-11-09 14:23:45 +1100 | [diff] [blame] | 239 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 240 | dnl Check for user-specified random device |
| 241 | AC_ARG_WITH(random, |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 242 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 243 | [ |
| 244 | RANDOM_POOL="$withval"; |
Damien Miller | 0a6e668 | 1999-11-15 09:56:06 +1100 | [diff] [blame] | 245 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 246 | ], |
| 247 | [ |
| 248 | dnl Check for random device |
| 249 | AC_CHECK_FILE("/dev/urandom", |
| 250 | [ |
| 251 | RANDOM_POOL="/dev/urandom"; |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 252 | AC_SUBST(RANDOM_POOL) |
| 253 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 254 | ] |
| 255 | ) |
| 256 | ] |
| 257 | ) |
| 258 | |
| 259 | dnl Check for EGD pool file |
| 260 | AC_ARG_WITH(egd-pool, |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 261 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 262 | [ |
| 263 | RANDOM_POOL="$withval"; |
| 264 | AC_DEFINE(HAVE_EGD) |
Damien Miller | a82feb3 | 1999-11-11 11:04:17 +1100 | [diff] [blame] | 265 | AC_SUBST(RANDOM_POOL) |
| 266 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 267 | ] |
| 268 | ) |
| 269 | |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 270 | dnl Make sure we have random number support |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 271 | if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then |
| 272 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) |
| 273 | fi |
| 274 | |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 275 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
| 276 | AC_EGREP_HEADER(ut_host, utmp.h, |
| 277 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 278 | [AC_MSG_RESULT(no)] |
| 279 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 280 | AC_MSG_CHECKING([whether utmpx.h has ut_host field]) |
| 281 | AC_EGREP_HEADER(ut_host, utmpx.h, |
| 282 | [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 283 | [AC_MSG_RESULT(no)] |
| 284 | ) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 285 | AC_MSG_CHECKING([whether utmpx.h has syslen field]) |
| 286 | AC_EGREP_HEADER(syslen, utmpx.h, |
| 287 | [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 288 | [AC_MSG_RESULT(no)] |
| 289 | ) |
Damien Miller | 4ff2b9b | 1999-12-28 10:41:12 +1100 | [diff] [blame] | 290 | AC_MSG_CHECKING([whether utmp.h has ut_pid field]) |
| 291 | AC_EGREP_HEADER(ut_pid, utmp.h, |
| 292 | [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 293 | [AC_MSG_RESULT(no)] |
| 294 | ) |
| 295 | AC_MSG_CHECKING([whether utmp.h has ut_type field]) |
| 296 | AC_EGREP_HEADER(ut_type, utmp.h, |
| 297 | [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 298 | [AC_MSG_RESULT(no)] |
| 299 | ) |
| 300 | AC_MSG_CHECKING([whether utmp.h has ut_tv field]) |
| 301 | AC_EGREP_HEADER(ut_tv, utmp.h, |
| 302 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 303 | [AC_MSG_RESULT(no)] |
| 304 | ) |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame^] | 305 | AC_MSG_CHECKING([whether utmp.h has ut_id field]) |
| 306 | AC_EGREP_HEADER(ut_id, utmp.h, |
| 307 | [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 308 | [AC_MSG_RESULT(no)] |
| 309 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 310 | |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 311 | dnl Look for lastlog location |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 312 | AC_ARG_WITH(lastlog, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 313 | [ --with-lastlog=FILE Location of lastlog file], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 314 | [ |
| 315 | if test "x$withval" = "xno" ; then |
| 316 | AC_DEFINE(DISABLE_LASTLOG) |
| 317 | else |
| 318 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval") |
| 319 | fi |
| 320 | ], |
| 321 | [ |
| 322 | AC_MSG_CHECKING([location of lastlog file]) |
| 323 | for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do |
| 324 | if test -f $lastlog ; then |
| 325 | gotlastlog="file" |
| 326 | break |
| 327 | fi |
| 328 | if test -d $lastlog ; then |
| 329 | gotlastlog="dir" |
| 330 | break |
| 331 | fi |
| 332 | done |
| 333 | if test -z "$gotlastlog" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 334 | AC_MSG_RESULT(not found) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 335 | nolastlog=1 |
| 336 | else |
| 337 | if test "x$gotlastlog" = "xdir" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 338 | AC_MSG_RESULT(${lastlog}/) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 339 | AC_DEFINE(LASTLOG_IS_DIR) |
| 340 | AC_MSG_WARN([*** Directory-based lastlogs are not yet supported ***]) |
| 341 | nolastlog=1 |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 342 | else |
| 343 | AC_MSG_RESULT($lastlog) |
| 344 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 345 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 346 | fi |
| 347 | ] |
| 348 | ) |
| 349 | |
| 350 | if test ! -z "$nolastlog" ; then |
| 351 | AC_MSG_WARN([*** Disabling lastlog support *** ]) |
| 352 | AC_DEFINE(DISABLE_LASTLOG) |
| 353 | fi |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 354 | |
Damien Miller | 037a0dc | 1999-12-07 15:38:31 +1100 | [diff] [blame] | 355 | AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)) |
| 356 | AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)) |
| 357 | |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 358 | AC_MSG_CHECKING([whether libc defines __progname]) |
| 359 | AC_TRY_LINK([], |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 360 | [extern char *__progname; printf("%s", __progname);], |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 361 | [ |
| 362 | AC_DEFINE(HAVE___PROGNAME) |
| 363 | AC_MSG_RESULT(yes) |
| 364 | ], |
| 365 | [ |
| 366 | AC_MSG_RESULT(no) |
| 367 | ] |
| 368 | ) |
| 369 | |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 370 | dnl Check whether user wants Kerberos support |
| 371 | AC_ARG_WITH(kerberos4, |
| 372 | [ --with-kerberos4 Enable Kerberos 4 support], |
| 373 | [ |
| 374 | AC_DEFINE(KRB4) |
| 375 | LIBS="$LIBS -lkrb" |
| 376 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 377 | ] |
| 378 | ) |
| 379 | |
| 380 | dnl Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 381 | AC_ARG_WITH(afs, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 382 | [ --with-afs Enable AFS support], |
| 383 | [ |
| 384 | AC_DEFINE(AFS) |
| 385 | LIBS="$LIBS -lkafs" |
| 386 | ] |
| 387 | ) |
| 388 | |
| 389 | dnl Check whether user wants S/Key support |
| 390 | AC_ARG_WITH(skey, |
| 391 | [ --with-skey Enable S/Key support], |
| 392 | [ |
| 393 | AC_DEFINE(SKEY) |
| 394 | LIBS="$LIBS -lskey" |
| 395 | ] |
| 396 | ) |
| 397 | |
| 398 | dnl Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 399 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 400 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 401 | [ |
| 402 | AC_DEFINE(LIBWRAP) |
Damien Miller | d7f6615 | 1999-12-09 10:48:58 +1100 | [diff] [blame] | 403 | LIBWRAP="-lwrap" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 404 | ] |
| 405 | ) |
Damien Miller | d7f6615 | 1999-12-09 10:48:58 +1100 | [diff] [blame] | 406 | AC_SUBST(LIBWRAP) |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 407 | |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 408 | dnl Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 409 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 410 | [ --with-md5-passwords Enable use of MD5 passwords], |
| 411 | [AC_DEFINE(HAVE_MD5_PASSWORDS)] |
| 412 | ) |
| 413 | |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 414 | dnl Check whether to enable utmpx support |
| 415 | AC_ARG_WITH(utmpx, |
| 416 | [ --with-utmpx Enable utmpx support], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 417 | [ |
| 418 | if test "x$withval" != "xno" ; then |
| 419 | AC_DEFINE(USE_UTMPX) |
| 420 | fi |
| 421 | ] |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 422 | ) |
| 423 | |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 424 | dnl Whether to disable shadow password support |
| 425 | AC_ARG_WITH(shadow, |
| 426 | [ --without-shadow Disable shadow password support], |
| 427 | [ |
| 428 | if test "x$withval" = "xno" ; then |
| 429 | AC_DEFINE(DISABLE_SHADOW) |
| 430 | fi |
| 431 | ] |
| 432 | ) |
| 433 | |
| 434 | dnl Use ip address instead of hostname in $DISPLAY |
| 435 | AC_ARG_WITH(ipaddr-display, |
| 436 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 437 | [ |
| 438 | if test "x$withval" = "xno" ; then |
| 439 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 440 | fi |
| 441 | ] |
| 442 | ) |
| 443 | |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 444 | AC_ARG_WITH(path, |
| 445 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 446 | [ |
| 447 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame^] | 448 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 449 | fi |
| 450 | ] |
| 451 | ) |
| 452 | |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 453 | dnl Check for mail directory (last resort if we cannot get it from headers) |
| 454 | if test ! -z "$MAIL" ; then |
| 455 | maildir=`dirname $MAIL` |
| 456 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 457 | fi |
Damien Miller | c6b3bbe | 1999-12-13 08:27:33 +1100 | [diff] [blame] | 458 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 459 | AC_OUTPUT(Makefile) |