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