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