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 | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 138 | AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove 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 | 0e65eed | 2000-05-17 22:16:05 +1000 | [diff] [blame] | 168 | AC_CHECK_FUNCS(pam_getenvlist) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 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 | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 384 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 385 | AC_TRY_COMPILE( |
| 386 | [ |
| 387 | #include <sys/types.h> |
| 388 | ], |
| 389 | [ ssize_t foo; foo = 1235; ], |
| 390 | [ ac_cv_have_ssize_t="yes" ], |
| 391 | [ ac_cv_have_ssize_t="no" ] |
| 392 | ) |
| 393 | ]) |
| 394 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 395 | AC_DEFINE(HAVE_SSIZE_T) |
| 396 | fi |
| 397 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 398 | |
| 399 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 400 | AC_TRY_COMPILE( |
| 401 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 402 | #include <sys/types.h> |
| 403 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 404 | ], |
| 405 | [ struct sockaddr_storage s; ], |
| 406 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 407 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 408 | ) |
| 409 | ]) |
| 410 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 411 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 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 sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 415 | AC_TRY_COMPILE( |
| 416 | [ |
| 417 | #include <netinet/in.h> |
| 418 | ], |
| 419 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 420 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 421 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 422 | ) |
| 423 | ]) |
| 424 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 425 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 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 in6_addr], ac_cv_have_struct_in6_addr, [ |
| 429 | AC_TRY_COMPILE( |
| 430 | [ |
| 431 | #include <netinet/in.h> |
| 432 | ], |
| 433 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 434 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 435 | [ ac_cv_have_struct_in6_addr="no" ] |
| 436 | ) |
| 437 | ]) |
| 438 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 439 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 440 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 441 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 442 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 443 | AC_TRY_COMPILE( |
| 444 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 445 | #include <sys/types.h> |
| 446 | #include <sys/socket.h> |
| 447 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 448 | ], |
| 449 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 450 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 451 | [ ac_cv_have_struct_addrinfo="no" ] |
| 452 | ) |
| 453 | ]) |
| 454 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 455 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 456 | fi |
| 457 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 458 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 459 | # Checks for structure members |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 460 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 461 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 462 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 463 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 464 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 465 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP) |
| 466 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 467 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) |
| 468 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 469 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 470 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 471 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) |
| 472 | |
| 473 | |
| 474 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 475 | ac_cv_have_ss_family_in_struct_ss, [ |
| 476 | AC_TRY_COMPILE( |
| 477 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 478 | #include <sys/types.h> |
| 479 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 480 | ], |
| 481 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 482 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 483 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 484 | ) |
| 485 | ]) |
| 486 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 487 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 488 | fi |
| 489 | |
| 490 | |
| 491 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 492 | ac_cv_have___ss_family_in_struct_ss, [ |
| 493 | AC_TRY_COMPILE( |
| 494 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 495 | #include <sys/types.h> |
| 496 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 497 | ], |
| 498 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 499 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 500 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 501 | ) |
| 502 | ]) |
| 503 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 504 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 505 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 506 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 507 | |
| 508 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 509 | AC_TRY_LINK([], |
| 510 | [ extern char *__progname; printf("%s", __progname); ], |
| 511 | [ ac_cv_libc_defines___progname="yes" ], |
| 512 | [ ac_cv_libc_defines___progname="no" ] |
| 513 | ) |
| 514 | ]) |
| 515 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 516 | AC_DEFINE(HAVE___PROGNAME) |
| 517 | fi |
| 518 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 519 | |
| 520 | # Looking for programs, paths and files |
| 521 | AC_ARG_WITH(rsh, |
| 522 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 523 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 524 | if test "x$withval" != "$no" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 525 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 526 | fi |
| 527 | ], |
| 528 | [ |
| 529 | AC_PATH_PROG(rsh_path, rsh) |
| 530 | ] |
| 531 | ) |
| 532 | |
| 533 | AC_ARG_WITH(xauth, |
| 534 | [ --with-xauth=PATH Specify path to xauth program ], |
| 535 | [ |
| 536 | if test "x$withval" != "$xno" ; then |
| 537 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") |
| 538 | fi |
| 539 | ], |
| 540 | [ |
| 541 | AC_PATH_PROG(xauth_path, xauth) |
| 542 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then |
| 543 | xauth_path="/usr/openwin/bin/xauth" |
| 544 | fi |
| 545 | ] |
| 546 | ) |
| 547 | |
| 548 | if test ! -z "$xauth_path" ; then |
| 549 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 550 | fi |
| 551 | if test ! -z "$rsh_path" ; then |
| 552 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 553 | fi |
| 554 | |
| 555 | # Check for mail directory (last resort if we cannot get it from headers) |
| 556 | if test ! -z "$MAIL" ; then |
| 557 | maildir=`dirname $MAIL` |
| 558 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 559 | fi |
| 560 | |
| 561 | # Look for lastlog location |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 562 | AC_ARG_WITH(lastlog, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 563 | [ --with-lastlog=FILE Location of lastlog file], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 564 | [ |
| 565 | if test "x$withval" = "xno" ; then |
| 566 | AC_DEFINE(DISABLE_LASTLOG) |
| 567 | else |
| 568 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval") |
| 569 | fi |
| 570 | ], |
| 571 | [ |
| 572 | AC_MSG_CHECKING([location of lastlog file]) |
Damien Miller | 27f4c78 | 2000-01-27 18:22:13 +1100 | [diff] [blame] | 573 | 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] | 574 | if test -f $lastlog ; then |
| 575 | gotlastlog="file" |
| 576 | break |
| 577 | fi |
| 578 | if test -d $lastlog ; then |
| 579 | gotlastlog="dir" |
| 580 | break |
| 581 | fi |
| 582 | done |
| 583 | if test -z "$gotlastlog" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 584 | AC_MSG_RESULT(not found) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 585 | nolastlog=1 |
| 586 | else |
| 587 | if test "x$gotlastlog" = "xdir" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 588 | AC_MSG_RESULT(${lastlog}/) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 589 | AC_DEFINE(LASTLOG_IS_DIR) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 590 | else |
| 591 | AC_MSG_RESULT($lastlog) |
| 592 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 593 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 594 | fi |
| 595 | ] |
| 596 | ) |
| 597 | |
| 598 | if test ! -z "$nolastlog" ; then |
| 599 | AC_MSG_WARN([*** Disabling lastlog support *** ]) |
| 600 | AC_DEFINE(DISABLE_LASTLOG) |
| 601 | fi |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 602 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 603 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 604 | AC_CHECK_FILE("/dev/ptmx", |
| 605 | [ |
| 606 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 607 | have_dev_ptmx=1 |
| 608 | ] |
| 609 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 610 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 611 | AC_CHECK_FILE("/dev/ptc", |
| 612 | [ |
| 613 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 614 | have_dev_ptc=1 |
| 615 | ] |
| 616 | ) |
| 617 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 618 | # Options from here on. Some of these are preset by platform above |
| 619 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 620 | # Check for user-specified random device, otherwise check /dev/urandom |
| 621 | AC_ARG_WITH(random, |
| 622 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 623 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 624 | if test "x$withval" != "xno" ; then |
| 625 | RANDOM_POOL="$withval"; |
| 626 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 627 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 628 | ], |
| 629 | [ |
| 630 | # Check for random device |
| 631 | AC_CHECK_FILE("/dev/urandom", |
| 632 | [ |
| 633 | RANDOM_POOL="/dev/urandom"; |
| 634 | AC_SUBST(RANDOM_POOL) |
| 635 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 636 | ] |
| 637 | ) |
| 638 | ] |
| 639 | ) |
| 640 | |
| 641 | # Check for EGD pool file |
| 642 | AC_ARG_WITH(egd-pool, |
| 643 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 644 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 645 | if test "x$withval" != "xno" ; then |
| 646 | EGD_SOCKET="$withval"; |
| 647 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 648 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 649 | ] |
| 650 | ) |
| 651 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 652 | # detect pathnames for entropy gathering commands, if we need them |
| 653 | INSTALL_SSH_PRNG_CMDS="" |
| 654 | rm -f prng_commands |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 655 | if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then |
| 656 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 657 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 658 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 659 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 660 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 661 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 662 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 663 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 664 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 665 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 666 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 667 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 668 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 669 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 670 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
| 671 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 672 | |
| 673 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 674 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 675 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 676 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 677 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 678 | AC_ARG_WITH(catman, |
| 679 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 680 | [ |
| 681 | MANTYPE='$(CATMAN)' |
| 682 | if test x"$withval" != x"yes" ; then |
| 683 | mansubdir=$withval |
| 684 | else |
| 685 | mansubdir=cat |
| 686 | fi |
| 687 | ], [ |
| 688 | if test -z "$MANTYPE" ; then |
| 689 | MANTYPE='$(TROFFMAN)' |
| 690 | mansubdir=man |
| 691 | fi |
| 692 | ] |
| 693 | ) |
| 694 | AC_SUBST(MANTYPE) |
| 695 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 696 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 697 | # Check whether user wants Kerberos support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 698 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 699 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 700 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 701 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 702 | |
| 703 | if test "x$withval" != "$xyes" ; then |
| 704 | CFLAGS="$CFLAGS -I${withval}/include" |
| 705 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 706 | if test ! -z "$need_dash_r" ; then |
| 707 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 708 | fi |
| 709 | if test ! -z "$blibpath" ; then |
| 710 | blibpath="$blibpath:${withval}/lib" |
| 711 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 712 | else |
| 713 | if test -d /usr/include/kerberosIV ; then |
| 714 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 715 | fi |
| 716 | fi |
| 717 | |
| 718 | AC_CHECK_HEADERS(krb.h) |
| 719 | AC_CHECK_LIB(krb, main) |
| 720 | if test "$ac_cv_header_krb_h" != yes; then |
| 721 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 722 | fi |
| 723 | if test "$ac_cv_lib_krb_main" != yes; then |
| 724 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 725 | fi |
| 726 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 727 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 728 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 729 | KRB4=yes |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 730 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 731 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 732 | ] |
| 733 | ) |
| 734 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 735 | # Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 736 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 737 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 738 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 739 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 740 | |
| 741 | if test "x$withval" != "$xyes" ; then |
| 742 | CFLAGS="$CFLAGS -I${withval}/include" |
| 743 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 744 | fi |
| 745 | |
| 746 | if test -z "$KRB4" ; then |
| 747 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 748 | fi |
| 749 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 750 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 751 | if test ! -z "$AFS_LIBS" ; then |
| 752 | LIBS="$LIBS $AFS_LIBS" |
| 753 | fi |
| 754 | AC_DEFINE(AFS) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 755 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 756 | ] |
| 757 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 758 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 759 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 760 | # Check whether user wants S/Key support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 761 | AC_ARG_WITH(skey, |
| 762 | [ --with-skey Enable S/Key support], |
| 763 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 764 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 765 | AC_DEFINE(SKEY) |
| 766 | LIBS="$LIBS -lskey" |
| 767 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 768 | ] |
| 769 | ) |
| 770 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 771 | # Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 772 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 773 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 774 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 775 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 776 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 777 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 778 | AC_MSG_CHECKING(for libwrap) |
| 779 | AC_TRY_LINK( |
| 780 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 781 | #include <tcpd.h> |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 782 | int deny_severity = 0, allow_severity = 0; |
| 783 | ], |
| 784 | [hosts_access(0);], |
| 785 | [ |
| 786 | AC_MSG_RESULT(yes) |
| 787 | AC_DEFINE(LIBWRAP) |
| 788 | ], |
| 789 | [ |
| 790 | AC_MSG_RESULT(no) |
| 791 | AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***]) |
| 792 | LIBS="$saved_LIBS" |
| 793 | ] |
| 794 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 795 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 796 | ] |
| 797 | ) |
| 798 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 799 | # Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 800 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 801 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 802 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 803 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 804 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
| 805 | fi |
| 806 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 807 | ) |
| 808 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 809 | # Check whether to enable utmpx support |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 810 | AC_ARG_WITH(utmpx, |
| 811 | [ --with-utmpx Enable utmpx support], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 812 | [ |
| 813 | if test "x$withval" != "xno" ; then |
| 814 | AC_DEFINE(USE_UTMPX) |
| 815 | fi |
| 816 | ] |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 817 | ) |
| 818 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 819 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 820 | AC_ARG_WITH(shadow, |
| 821 | [ --without-shadow Disable shadow password support], |
| 822 | [ |
| 823 | if test "x$withval" = "xno" ; then |
| 824 | AC_DEFINE(DISABLE_SHADOW) |
| 825 | fi |
| 826 | ] |
| 827 | ) |
| 828 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 829 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 830 | AC_ARG_WITH(ipaddr-display, |
| 831 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 832 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 833 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 834 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 835 | fi |
| 836 | ] |
| 837 | ) |
| 838 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 839 | # Whether to mess with the default path |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 840 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 841 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 842 | [ |
| 843 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 844 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 845 | fi |
| 846 | ] |
| 847 | ) |
| 848 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 849 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 850 | AC_ARG_WITH(ipv4-default, |
| 851 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 852 | [ |
| 853 | if test "x$withval" != "xno" ; then |
| 854 | AC_DEFINE(IPV4_DEFAULT) |
| 855 | fi |
| 856 | ] |
| 857 | ) |
| 858 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 859 | 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] | 860 | AC_ARG_WITH(4in6, |
| 861 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 862 | [ |
| 863 | if test "x$withval" != "xno" ; then |
| 864 | AC_MSG_RESULT(yes) |
| 865 | AC_DEFINE(IPV4_IN_IPV6) |
| 866 | else |
| 867 | AC_MSG_RESULT(no) |
| 868 | fi |
| 869 | ],[ |
| 870 | if test "x$inet6_default_4in6" = "xyes"; then |
| 871 | AC_MSG_RESULT([yes (default)]) |
| 872 | AC_DEFINE(IPV4_IN_IPV6) |
| 873 | else |
| 874 | AC_MSG_RESULT([no (default)]) |
| 875 | fi |
| 876 | ] |
| 877 | ) |
| 878 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 879 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 880 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 881 | AC_ARG_WITH(pid-dir, |
| 882 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 883 | [ |
| 884 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 885 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 886 | fi |
| 887 | ] |
| 888 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 889 | |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 890 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 891 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 892 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 893 | |
| 894 | # Change default command timeout for builtin PRNG |
| 895 | entropy_timeout=100 |
| 896 | AC_ARG_WITH(entropy-timeout, |
| 897 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 898 | [ |
| 899 | if test "x$withval" != "xno" ; then |
| 900 | entropy_timeout=$withval |
| 901 | fi |
| 902 | ] |
| 903 | ) |
| 904 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 905 | |
| 906 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 907 | if test ! -z "$blibpath" ; then |
| 908 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 909 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 910 | fi |
| 911 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 912 | AC_OUTPUT(Makefile ssh_prng_cmds) |
| 913 | |
| 914 | |