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