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