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