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