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