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 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 6 | # C Compiler features |
| 7 | if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi |
| 8 | AC_C_INLINE |
| 9 | |
| 10 | # Checks for programs. |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 11 | AC_PROG_CC |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 12 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 13 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 14 | AC_PROG_INSTALL |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 15 | AC_CHECK_PROG(AR, ar, ar) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 16 | AC_PATH_PROG(PERL, perl) |
| 17 | AC_SUBST(PERL) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 18 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 19 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 20 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 21 | *-*-aix*) |
| 22 | AFS_LIBS="-lld" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 23 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 24 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 25 | AC_DEFINE(BROKEN_GETADDRINFO) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 26 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 27 | *-*-hpux10*) |
| 28 | if test -z "$GCC"; then |
| 29 | CFLAGS="$CFLAGS -Aa" |
| 30 | fi |
| 31 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 32 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 33 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 34 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 35 | AC_DEFINE(USE_UTMPX) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 36 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 37 | if test -f /tcb/files/auth/system/default; then |
| 38 | AC_MSG_RESULT(yes) |
| 39 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 40 | LIBS="$LIBS -lsec" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 41 | AC_MSG_WARN([This configuration is untested]) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 42 | else |
| 43 | AC_MSG_RESULT(no) |
| 44 | AC_DEFINE(DISABLE_SHADOW) |
| 45 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 46 | MANTYPE='$(CATMAN)' |
| 47 | mansubdir=cat |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 48 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 49 | *-*-irix5*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 50 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 51 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 52 | MANTYPE='$(CATMAN)' |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 53 | no_libsocket=1 |
| 54 | no_libnsl=1 |
| 55 | ;; |
| 56 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 57 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 58 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 59 | MANTYPE='$(CATMAN)' |
| 60 | AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 61 | no_libsocket=1 |
| 62 | no_libnsl=1 |
| 63 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 64 | *-*-linux*) |
| 65 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 66 | AC_DEFINE(DONT_TRY_OTHER_AF) |
| 67 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 68 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 69 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 70 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 71 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 72 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 73 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 74 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 75 | need_dash_r=1 |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 76 | LDFLAGS="-L/usr/ucblib -R/usr/ucblib" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 77 | AC_DEFINE(USE_UTMPX) |
| 78 | ;; |
| 79 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 80 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 81 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 82 | AC_DEFINE(USE_UTMPX) |
| 83 | MANTYPE='$(CATMAN)' |
| 84 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 85 | LIBS="$LIBS -lgen -lsocket" |
| 86 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 87 | esac |
| 88 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 89 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 90 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 91 | 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] | 92 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 93 | if test -z "$no_libsocket" ; then |
| 94 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 95 | fi |
| 96 | if test -z "$no_libnsl" ; then |
| 97 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 98 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 99 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 100 | # Checks for header files. |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 101 | 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/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 102 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 103 | # Checks for library functions. |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 104 | AC_CHECK_FUNCS(arc4random bindresvport_af freeaddrinfo gai_strerror getaddrinfo getnameinfo innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 105 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 106 | AC_CHECK_FUNC(login, |
| 107 | [AC_DEFINE(HAVE_LOGIN)], |
| 108 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 109 | ) |
| 110 | |
| 111 | AC_CHECK_FUNC(daemon, |
| 112 | [AC_DEFINE(HAVE_DAEMON)], |
| 113 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 114 | ) |
| 115 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 116 | AC_CHECK_FUNC(getpagesize, |
| 117 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 118 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 119 | ) |
| 120 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 121 | AC_ARG_WITH(pam, |
| 122 | [ --without-pam Disable PAM support ], |
| 123 | [ |
| 124 | if test "x$withval" = "xno" ; then |
| 125 | no_pam=1 |
| 126 | AC_DEFINE(DISABLE_PAM) |
| 127 | fi |
| 128 | ] |
| 129 | ) |
| 130 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then |
| 131 | AC_CHECK_LIB(dl, dlopen, , ) |
| 132 | LIBS="$LIBS -lpam" |
| 133 | |
| 134 | # Check PAM strerror arguments (old PAM) |
| 135 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 136 | AC_TRY_COMPILE( |
| 137 | [ |
| 138 | #include <stdlib.h> |
| 139 | #include <security/pam_appl.h> |
| 140 | ], |
| 141 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 142 | [AC_MSG_RESULT(no)], |
| 143 | [ |
| 144 | AC_DEFINE(HAVE_OLD_PAM) |
| 145 | AC_MSG_RESULT(yes) |
| 146 | ] |
| 147 | ) |
| 148 | fi |
| 149 | |
| 150 | # The big search for OpenSSL |
| 151 | AC_ARG_WITH(ssl-dir, |
| 152 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 153 | [ |
| 154 | if test "x$withval" != "$xno" ; then |
| 155 | tryssldir=$withval |
| 156 | fi |
| 157 | ] |
| 158 | ) |
| 159 | |
| 160 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 161 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 162 | saved_CFLAGS="$CFLAGS" |
| 163 | if test "x$prefix" != "xNONE" ; then |
| 164 | tryssldir="$tryssldir $prefix" |
| 165 | fi |
| 166 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) |
Damien Miller | 086b171 | 2000-03-14 14:52:19 +1100 | [diff] [blame] | 167 | for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 168 | if test ! -z "$ssldir" ; then |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 169 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 170 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 171 | if test ! -z "$need_dash_r" ; then |
| 172 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 173 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 174 | else |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 175 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 176 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 177 | |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 178 | for WANTS_RSAREF in "" 1 ; do |
| 179 | |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 180 | if test -z "$WANTS_RSAREF" ; then |
| 181 | LIBS="$saved_LIBS -lcrypto" |
| 182 | else |
| 183 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 184 | fi |
| 185 | |
| 186 | AC_TRY_RUN( |
| 187 | [ |
| 188 | #include <openssl/rsa.h> |
| 189 | #include <openssl/bn.h> |
| 190 | #include <openssl/sha.h> |
| 191 | int main(void) |
| 192 | {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed)); |
| 193 | RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL); |
| 194 | return(key==NULL);} |
| 195 | ], |
| 196 | [ |
| 197 | AC_DEFINE(HAVE_OPENSSL) |
| 198 | found_crypto=1 |
| 199 | break; |
| 200 | ], [] |
| 201 | ) |
| 202 | AC_TRY_RUN( |
| 203 | [ |
| 204 | #include <ssl/rsa.h> |
| 205 | #include <ssl/bn.h> |
| 206 | #include <ssl/sha.h> |
| 207 | int main(void) |
| 208 | {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed)); |
| 209 | RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL); |
| 210 | return(key==NULL);} |
| 211 | ], |
| 212 | [ |
| 213 | AC_DEFINE(HAVE_SSL) |
| 214 | found_crypto=1 |
| 215 | break; |
| 216 | ], [] |
| 217 | ) |
| 218 | done |
| 219 | |
| 220 | if test ! -z "$found_crypto" ; then |
| 221 | break; |
| 222 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 223 | done |
| 224 | |
| 225 | if test -z "$found_crypto" ; then |
| 226 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
| 227 | fi |
| 228 | if test -z "$ssldir" ; then |
| 229 | ssldir="(system)" |
| 230 | else |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 231 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 232 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 233 | if test ! -z "$need_dash_r" ; then |
| 234 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 235 | fi |
| 236 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame^] | 237 | if test -z "$WANTS_RSAREF" ; then |
| 238 | LIBS="$saved_LIBS -lcrypto" |
| 239 | else |
| 240 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 241 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 242 | AC_MSG_RESULT($ssldir) |
| 243 | |
| 244 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 245 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 246 | AC_CHECK_SIZEOF(short int, 2) |
| 247 | AC_CHECK_SIZEOF(int, 4) |
| 248 | AC_CHECK_SIZEOF(long int, 4) |
| 249 | AC_CHECK_SIZEOF(long long int, 8) |
| 250 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 251 | # More checks for data types |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 252 | AC_MSG_CHECKING([for intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 253 | AC_TRY_COMPILE( |
| 254 | [#include <sys/types.h>], |
| 255 | [int16_t a; int32_t b; a = 1235; b = 1235;], |
| 256 | [ |
| 257 | AC_DEFINE(HAVE_INTXX_T) |
| 258 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 259 | have_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 260 | ], |
| 261 | [AC_MSG_RESULT(no)] |
| 262 | ) |
| 263 | |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 264 | AC_MSG_CHECKING([for u_intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 265 | AC_TRY_COMPILE( |
| 266 | [#include <sys/types.h>], |
| 267 | [u_int16_t c; u_int32_t d; c = 1235; d = 1235;], |
| 268 | [ |
| 269 | AC_DEFINE(HAVE_U_INTXX_T) |
| 270 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 271 | have_u_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 272 | ], |
| 273 | [AC_MSG_RESULT(no)] |
| 274 | ) |
| 275 | |
Damien Miller | eaf9994 | 2000-01-19 13:45:07 +1100 | [diff] [blame] | 276 | if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \ |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 277 | "x$ac_cv_header_sys_bitypes_h" = "xyes" |
| 278 | then |
| 279 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 280 | AC_TRY_COMPILE( |
| 281 | [#include <sys/bitypes.h>], |
| 282 | [ |
| 283 | u_int16_t c; u_int32_t d; |
| 284 | int16_t e; int32_t f; |
| 285 | c = 1235; d = 1235; |
| 286 | e = 1235; f = 1235; |
| 287 | ], |
| 288 | [ |
| 289 | AC_DEFINE(HAVE_U_INTXX_T) |
| 290 | AC_DEFINE(HAVE_INTXX_T) |
| 291 | AC_MSG_RESULT(yes) |
| 292 | ], |
| 293 | [AC_MSG_RESULT(no)] |
| 294 | ) |
| 295 | fi |
| 296 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 297 | AC_MSG_CHECKING([for uintXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 298 | AC_TRY_COMPILE( |
| 299 | [#include <sys/types.h>], |
| 300 | [uint16_t c; uint32_t d; c = 1235; d = 1235;], |
| 301 | [ |
| 302 | AC_DEFINE(HAVE_UINTXX_T) |
| 303 | AC_MSG_RESULT(yes) |
| 304 | ], |
| 305 | [AC_MSG_RESULT(no)] |
| 306 | ) |
| 307 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 308 | AC_MSG_CHECKING([for socklen_t]) |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 309 | AC_TRY_COMPILE( |
Damien Miller | f3e8be8 | 1999-12-31 08:59:04 +1100 | [diff] [blame] | 310 | [ |
| 311 | #include <sys/types.h> |
| 312 | #include <sys/socket.h> |
| 313 | ], |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 314 | [socklen_t foo; foo = 1235;], |
| 315 | [ |
| 316 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 317 | AC_MSG_RESULT(yes) |
| 318 | ], |
| 319 | [AC_MSG_RESULT(no)] |
| 320 | ) |
| 321 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 322 | AC_MSG_CHECKING([for size_t]) |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 323 | AC_TRY_COMPILE( |
| 324 | [#include <sys/types.h>], |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 325 | [size_t foo; foo = 1235;], |
| 326 | [ |
| 327 | AC_DEFINE(HAVE_SIZE_T) |
| 328 | AC_MSG_RESULT(yes) |
| 329 | ], |
| 330 | [AC_MSG_RESULT(no)] |
| 331 | ) |
| 332 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 333 | AC_MSG_CHECKING([for struct sockaddr_storage]) |
| 334 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 335 | [ |
| 336 | #include <sys/types.h> |
| 337 | #include <sys/socket.h> |
| 338 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 339 | [struct sockaddr_storage s;], |
| 340 | [ |
| 341 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 342 | AC_MSG_RESULT(yes) |
| 343 | ], |
| 344 | [AC_MSG_RESULT(no)] |
| 345 | ) |
| 346 | |
| 347 | AC_MSG_CHECKING([for struct sockaddr_in6]) |
| 348 | AC_TRY_COMPILE( |
| 349 | [#include <netinet/in.h>], |
| 350 | [struct sockaddr_in6 s; s.sin6_family = 0;], |
| 351 | [ |
| 352 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 353 | AC_MSG_RESULT(yes) |
| 354 | ], |
| 355 | [AC_MSG_RESULT(no)] |
| 356 | ) |
| 357 | |
| 358 | AC_MSG_CHECKING([for struct in6_addr]) |
| 359 | AC_TRY_COMPILE( |
| 360 | [#include <netinet/in.h>], |
| 361 | [struct in6_addr s; s.s6_addr[0] = 0;], |
| 362 | [ |
| 363 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 364 | AC_MSG_RESULT(yes) |
| 365 | ], |
| 366 | [AC_MSG_RESULT(no)] |
| 367 | ) |
| 368 | |
| 369 | AC_MSG_CHECKING([for struct addrinfo]) |
| 370 | AC_TRY_COMPILE( |
| 371 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 372 | #include <sys/types.h> |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 373 | #include <sys/socket.h> |
| 374 | #include <netdb.h> |
| 375 | ], |
| 376 | [struct addrinfo s; s.ai_flags = AI_PASSIVE;], |
| 377 | [ |
| 378 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 379 | AC_MSG_RESULT(yes) |
| 380 | ], |
| 381 | [AC_MSG_RESULT(no)] |
| 382 | ) |
| 383 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 384 | # Checks for structure members |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 385 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
| 386 | AC_EGREP_HEADER(ut_host, utmp.h, |
| 387 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 388 | [AC_MSG_RESULT(no)] |
| 389 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 390 | AC_MSG_CHECKING([whether utmpx.h has ut_host field]) |
| 391 | AC_EGREP_HEADER(ut_host, utmpx.h, |
| 392 | [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 393 | [AC_MSG_RESULT(no)] |
| 394 | ) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 395 | AC_MSG_CHECKING([whether utmpx.h has syslen field]) |
| 396 | AC_EGREP_HEADER(syslen, utmpx.h, |
| 397 | [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 398 | [AC_MSG_RESULT(no)] |
| 399 | ) |
Damien Miller | 4ff2b9b | 1999-12-28 10:41:12 +1100 | [diff] [blame] | 400 | AC_MSG_CHECKING([whether utmp.h has ut_pid field]) |
| 401 | AC_EGREP_HEADER(ut_pid, utmp.h, |
| 402 | [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 403 | [AC_MSG_RESULT(no)] |
| 404 | ) |
| 405 | AC_MSG_CHECKING([whether utmp.h has ut_type field]) |
| 406 | AC_EGREP_HEADER(ut_type, utmp.h, |
| 407 | [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 408 | [AC_MSG_RESULT(no)] |
| 409 | ) |
| 410 | AC_MSG_CHECKING([whether utmp.h has ut_tv field]) |
| 411 | AC_EGREP_HEADER(ut_tv, utmp.h, |
| 412 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 413 | [AC_MSG_RESULT(no)] |
| 414 | ) |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 415 | AC_MSG_CHECKING([whether utmp.h has ut_id field]) |
| 416 | AC_EGREP_HEADER(ut_id, utmp.h, |
| 417 | [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 418 | [AC_MSG_RESULT(no)] |
| 419 | ) |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 420 | AC_MSG_CHECKING([whether utmp.h has ut_addr field]) |
| 421 | AC_EGREP_HEADER(ut_addr, utmp.h, |
| 422 | [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 423 | [AC_MSG_RESULT(no)] |
| 424 | ) |
| 425 | AC_MSG_CHECKING([whether utmpx.h has ut_addr field]) |
| 426 | AC_EGREP_HEADER(ut_addr, utmpx.h, |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 427 | [AC_DEFINE(HAVE_ADDR_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 428 | [AC_MSG_RESULT(no)] |
| 429 | ) |
| 430 | AC_MSG_CHECKING([whether utmp.h has ut_addr_v6 field]) |
| 431 | AC_EGREP_HEADER(ut_addr_v6, utmp.h, |
| 432 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 433 | [AC_MSG_RESULT(no)] |
| 434 | ) |
| 435 | AC_MSG_CHECKING([whether utmpx.h has ut_addr_v6 field]) |
| 436 | AC_EGREP_HEADER(ut_addr_v6, utmpx.h, |
| 437 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 438 | [AC_MSG_RESULT(no)] |
| 439 | ) |
| 440 | |
| 441 | AC_MSG_CHECKING([whether struct sockaddr_storage has ss_family field]) |
| 442 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 443 | [ |
| 444 | #include <sys/types.h> |
| 445 | #include <sys/socket.h> |
| 446 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 447 | [struct sockaddr_storage s; s.ss_family = 1;], |
| 448 | [ |
| 449 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 450 | AC_MSG_RESULT(yes) |
| 451 | ], |
| 452 | [AC_MSG_RESULT(no)] |
| 453 | ) |
| 454 | AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family field]) |
| 455 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 456 | [ |
| 457 | #include <sys/types.h> |
| 458 | #include <sys/socket.h> |
| 459 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 460 | [struct sockaddr_storage s; s.__ss_family = 1;], |
| 461 | [ |
| 462 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 463 | AC_MSG_RESULT(yes) |
| 464 | ], |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 465 | [AC_MSG_RESULT(no)] |
| 466 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 467 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 468 | AC_MSG_CHECKING([whether libc defines __progname]) |
| 469 | AC_TRY_LINK([], |
| 470 | [extern char *__progname; printf("%s", __progname);], |
| 471 | [ |
| 472 | AC_DEFINE(HAVE___PROGNAME) |
| 473 | AC_MSG_RESULT(yes) |
| 474 | ], |
| 475 | [ |
| 476 | AC_MSG_RESULT(no) |
| 477 | ] |
| 478 | ) |
| 479 | |
| 480 | # Looking for programs, paths and files |
| 481 | AC_ARG_WITH(rsh, |
| 482 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 483 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 484 | if test "x$withval" != "$no" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 485 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 486 | fi |
| 487 | ], |
| 488 | [ |
| 489 | AC_PATH_PROG(rsh_path, rsh) |
| 490 | ] |
| 491 | ) |
| 492 | |
| 493 | AC_ARG_WITH(xauth, |
| 494 | [ --with-xauth=PATH Specify path to xauth program ], |
| 495 | [ |
| 496 | if test "x$withval" != "$xno" ; then |
| 497 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") |
| 498 | fi |
| 499 | ], |
| 500 | [ |
| 501 | AC_PATH_PROG(xauth_path, xauth) |
| 502 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then |
| 503 | xauth_path="/usr/openwin/bin/xauth" |
| 504 | fi |
| 505 | ] |
| 506 | ) |
| 507 | |
| 508 | if test ! -z "$xauth_path" ; then |
| 509 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 510 | fi |
| 511 | if test ! -z "$rsh_path" ; then |
| 512 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 513 | fi |
| 514 | |
| 515 | # Check for mail directory (last resort if we cannot get it from headers) |
| 516 | if test ! -z "$MAIL" ; then |
| 517 | maildir=`dirname $MAIL` |
| 518 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 519 | fi |
| 520 | |
| 521 | # Look for lastlog location |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 522 | AC_ARG_WITH(lastlog, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 523 | [ --with-lastlog=FILE Location of lastlog file], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 524 | [ |
| 525 | if test "x$withval" = "xno" ; then |
| 526 | AC_DEFINE(DISABLE_LASTLOG) |
| 527 | else |
| 528 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval") |
| 529 | fi |
| 530 | ], |
| 531 | [ |
| 532 | AC_MSG_CHECKING([location of lastlog file]) |
Damien Miller | 27f4c78 | 2000-01-27 18:22:13 +1100 | [diff] [blame] | 533 | for lastlog in /var/log/lastlog /var/adm/lastlog /usr/adm/lastlog /etc/security/lastlog ; do |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 534 | if test -f $lastlog ; then |
| 535 | gotlastlog="file" |
| 536 | break |
| 537 | fi |
| 538 | if test -d $lastlog ; then |
| 539 | gotlastlog="dir" |
| 540 | break |
| 541 | fi |
| 542 | done |
| 543 | if test -z "$gotlastlog" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 544 | AC_MSG_RESULT(not found) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 545 | nolastlog=1 |
| 546 | else |
| 547 | if test "x$gotlastlog" = "xdir" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 548 | AC_MSG_RESULT(${lastlog}/) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 549 | AC_DEFINE(LASTLOG_IS_DIR) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 550 | else |
| 551 | AC_MSG_RESULT($lastlog) |
| 552 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 553 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 554 | fi |
| 555 | ] |
| 556 | ) |
| 557 | |
| 558 | if test ! -z "$nolastlog" ; then |
| 559 | AC_MSG_WARN([*** Disabling lastlog support *** ]) |
| 560 | AC_DEFINE(DISABLE_LASTLOG) |
| 561 | fi |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 562 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 563 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 564 | AC_CHECK_FILE("/dev/ptmx", |
| 565 | [ |
| 566 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 567 | have_dev_ptmx=1 |
| 568 | ] |
| 569 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 570 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 571 | AC_CHECK_FILE("/dev/ptc", |
| 572 | [ |
| 573 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 574 | have_dev_ptc=1 |
| 575 | ] |
| 576 | ) |
| 577 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 578 | # Options from here on. Some of these are preset by platform above |
| 579 | |
| 580 | # Check whether user wants GNOME ssh-askpass |
| 581 | AC_MSG_CHECKING([whether to build GNOME ssh-askpass]) |
| 582 | AC_ARG_WITH(gnome-askpass, |
| 583 | [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)], |
| 584 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 585 | if test "x$withval" = "xno" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 586 | GNOME_ASKPASS=""; |
| 587 | else |
| 588 | GNOME_ASKPASS="gnome-ssh-askpass"; |
| 589 | fi |
| 590 | ]) |
| 591 | AC_SUBST(GNOME_ASKPASS) |
| 592 | |
| 593 | if test -z "$GNOME_ASKPASS" ; then |
| 594 | AC_MSG_RESULT(no) |
| 595 | else |
| 596 | AC_MSG_RESULT(yes) |
| 597 | fi |
| 598 | |
| 599 | # Check for user-specified random device, otherwise check /dev/urandom |
| 600 | AC_ARG_WITH(random, |
| 601 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 602 | [ |
| 603 | RANDOM_POOL="$withval"; |
| 604 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 605 | ], |
| 606 | [ |
| 607 | # Check for random device |
| 608 | AC_CHECK_FILE("/dev/urandom", |
| 609 | [ |
| 610 | RANDOM_POOL="/dev/urandom"; |
| 611 | AC_SUBST(RANDOM_POOL) |
| 612 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 613 | ] |
| 614 | ) |
| 615 | ] |
| 616 | ) |
| 617 | |
| 618 | # Check for EGD pool file |
| 619 | AC_ARG_WITH(egd-pool, |
| 620 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 621 | [ |
| 622 | RANDOM_POOL="$withval"; |
| 623 | AC_DEFINE(HAVE_EGD) |
| 624 | AC_SUBST(RANDOM_POOL) |
| 625 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 626 | ] |
| 627 | ) |
| 628 | |
| 629 | # Make sure we have some random number support |
| 630 | if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then |
| 631 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) |
| 632 | fi |
| 633 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 634 | AC_ARG_WITH(catman, |
| 635 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 636 | [ |
| 637 | MANTYPE='$(CATMAN)' |
| 638 | if test x"$withval" != x"yes" ; then |
| 639 | mansubdir=$withval |
| 640 | else |
| 641 | mansubdir=cat |
| 642 | fi |
| 643 | ], [ |
| 644 | if test -z "$MANTYPE" ; then |
| 645 | MANTYPE='$(TROFFMAN)' |
| 646 | mansubdir=man |
| 647 | fi |
| 648 | ] |
| 649 | ) |
| 650 | AC_SUBST(MANTYPE) |
| 651 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 652 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 653 | # Check whether user wants Kerberos support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 654 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 655 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 656 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 657 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 658 | |
| 659 | if test "x$withval" != "$xyes" ; then |
| 660 | CFLAGS="$CFLAGS -I${withval}/include" |
| 661 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 662 | else |
| 663 | if test -d /usr/include/kerberosIV ; then |
| 664 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 665 | fi |
| 666 | fi |
| 667 | |
| 668 | AC_CHECK_HEADERS(krb.h) |
| 669 | AC_CHECK_LIB(krb, main) |
| 670 | if test "$ac_cv_header_krb_h" != yes; then |
| 671 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 672 | fi |
| 673 | if test "$ac_cv_lib_krb_main" != yes; then |
| 674 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 675 | fi |
| 676 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 677 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 678 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 679 | KRB4=yes |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 680 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 681 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 682 | ] |
| 683 | ) |
| 684 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 685 | # Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 686 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 687 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 688 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 689 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 690 | |
| 691 | if test "x$withval" != "$xyes" ; then |
| 692 | CFLAGS="$CFLAGS -I${withval}/include" |
| 693 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 694 | fi |
| 695 | |
| 696 | if test -z "$KRB4" ; then |
| 697 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 698 | fi |
| 699 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 700 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 701 | if test ! -z "$AFS_LIBS" ; then |
| 702 | LIBS="$LIBS $AFS_LIBS" |
| 703 | fi |
| 704 | AC_DEFINE(AFS) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 705 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 706 | ] |
| 707 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 708 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 709 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 710 | # Check whether user wants S/Key support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 711 | AC_ARG_WITH(skey, |
| 712 | [ --with-skey Enable S/Key support], |
| 713 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 714 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 715 | AC_DEFINE(SKEY) |
| 716 | LIBS="$LIBS -lskey" |
| 717 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 718 | ] |
| 719 | ) |
| 720 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 721 | # Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 722 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 723 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 724 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 725 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 726 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 727 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 728 | AC_MSG_CHECKING(for libwrap) |
| 729 | AC_TRY_LINK( |
| 730 | [ |
| 731 | #include <tcpd.h> |
| 732 | int deny_severity = 0, allow_severity = 0; |
| 733 | ], |
| 734 | [hosts_access(0);], |
| 735 | [ |
| 736 | AC_MSG_RESULT(yes) |
| 737 | AC_DEFINE(LIBWRAP) |
| 738 | ], |
| 739 | [ |
| 740 | AC_MSG_RESULT(no) |
| 741 | AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***]) |
| 742 | LIBS="$saved_LIBS" |
| 743 | ] |
| 744 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 745 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 746 | ] |
| 747 | ) |
| 748 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 749 | # Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 750 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 751 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 752 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 753 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 754 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
| 755 | fi |
| 756 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 757 | ) |
| 758 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 759 | # Check whether to enable utmpx support |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 760 | AC_ARG_WITH(utmpx, |
| 761 | [ --with-utmpx Enable utmpx support], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 762 | [ |
| 763 | if test "x$withval" != "xno" ; then |
| 764 | AC_DEFINE(USE_UTMPX) |
| 765 | fi |
| 766 | ] |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 767 | ) |
| 768 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 769 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 770 | AC_ARG_WITH(shadow, |
| 771 | [ --without-shadow Disable shadow password support], |
| 772 | [ |
| 773 | if test "x$withval" = "xno" ; then |
| 774 | AC_DEFINE(DISABLE_SHADOW) |
| 775 | fi |
| 776 | ] |
| 777 | ) |
| 778 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 779 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 780 | AC_ARG_WITH(ipaddr-display, |
| 781 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 782 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 783 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 784 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 785 | fi |
| 786 | ] |
| 787 | ) |
| 788 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 789 | # Whether to mess with the default path |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 790 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 791 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 792 | [ |
| 793 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 794 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 795 | fi |
| 796 | ] |
| 797 | ) |
| 798 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 799 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 800 | AC_ARG_WITH(ipv4-default, |
| 801 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 802 | [ |
| 803 | if test "x$withval" != "xno" ; then |
| 804 | AC_DEFINE(IPV4_DEFAULT) |
| 805 | fi |
| 806 | ] |
| 807 | ) |
| 808 | |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 809 | AC_MSG_CHECKING([to convert IPv4 in IPv6-mapped addresses]) |
| 810 | AC_ARG_WITH(4in6, |
| 811 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 812 | [ |
| 813 | if test "x$withval" != "xno" ; then |
| 814 | AC_MSG_RESULT(yes) |
| 815 | AC_DEFINE(IPV4_IN_IPV6) |
| 816 | else |
| 817 | AC_MSG_RESULT(no) |
| 818 | fi |
| 819 | ],[ |
| 820 | if test "x$inet6_default_4in6" = "xyes"; then |
| 821 | AC_MSG_RESULT([yes (default)]) |
| 822 | AC_DEFINE(IPV4_IN_IPV6) |
| 823 | else |
| 824 | AC_MSG_RESULT([no (default)]) |
| 825 | fi |
| 826 | ] |
| 827 | ) |
| 828 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 829 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 830 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 831 | AC_ARG_WITH(pid-dir, |
| 832 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 833 | [ |
| 834 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 835 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 836 | fi |
| 837 | ] |
| 838 | ) |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 839 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 840 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 841 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 842 | AC_OUTPUT(Makefile) |