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 |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 42 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 43 | fi |
| 44 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
| 45 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 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" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 64 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 65 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 66 | if test -f /tcb/files/auth/system/default; then |
| 67 | AC_MSG_RESULT(yes) |
| 68 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 69 | LIBS="$LIBS -lsec" |
| 70 | AC_MSG_WARN([This configuration is untested]) |
| 71 | else |
| 72 | AC_MSG_RESULT(no) |
| 73 | AC_DEFINE(DISABLE_SHADOW) |
| 74 | fi |
| 75 | MANTYPE='$(CATMAN)' |
| 76 | mansubdir=cat |
| 77 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 78 | *-*-irix5*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 79 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 80 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 81 | MANTYPE='$(CATMAN)' |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 82 | no_libsocket=1 |
| 83 | no_libnsl=1 |
| 84 | ;; |
| 85 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 86 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 87 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 88 | MANTYPE='$(CATMAN)' |
| 89 | 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] | 90 | no_libsocket=1 |
| 91 | no_libnsl=1 |
| 92 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 93 | *-*-linux*) |
| 94 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 95 | AC_DEFINE(DONT_TRY_OTHER_AF) |
| 96 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 97 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 98 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 99 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 100 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 101 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 102 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 08c788a | 2000-03-16 07:52:29 +1100 | [diff] [blame] | 103 | 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] | 104 | need_dash_r=1 |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame^] | 105 | # hardwire lastlog location (can't detect it on some versions) |
| 106 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 107 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 108 | *-*-sunos4*) |
| 109 | CFLAGS="$CFLAGS -DSUNOS4" |
| 110 | AC_CHECK_FUNCS(getpwanam) |
| 111 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 112 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 113 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 114 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 115 | MANTYPE='$(CATMAN)' |
| 116 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 117 | LIBS="$LIBS -lgen -lsocket" |
| 118 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 119 | esac |
| 120 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 121 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 122 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 123 | 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] | 124 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 125 | if test -z "$no_libsocket" ; then |
| 126 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 127 | fi |
| 128 | if test -z "$no_libnsl" ; then |
| 129 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 130 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 131 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 132 | # Checks for header files. |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame^] | 133 | 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 time.h util.h utmp.h utmpx.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 134 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 135 | # Checks for library functions. |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame^] | 136 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop) |
| 137 | dnl checks for time functions |
| 138 | AC_CHECK_FUNCS(gettimeofday time) |
| 139 | dnl checks for libutil functions |
| 140 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
| 141 | dnl checks for utmp functions |
| 142 | AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent) |
| 143 | AC_CHECK_FUNCS(utmpname) |
| 144 | dnl checks for utmpx functions |
| 145 | AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline ) |
| 146 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 147 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 148 | AC_CHECK_FUNC(login, |
| 149 | [AC_DEFINE(HAVE_LOGIN)], |
| 150 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 151 | ) |
| 152 | |
| 153 | AC_CHECK_FUNC(daemon, |
| 154 | [AC_DEFINE(HAVE_DAEMON)], |
| 155 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 156 | ) |
| 157 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 158 | AC_CHECK_FUNC(getpagesize, |
| 159 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 160 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 161 | ) |
| 162 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 163 | AC_ARG_WITH(pam, |
| 164 | [ --without-pam Disable PAM support ], |
| 165 | [ |
| 166 | if test "x$withval" = "xno" ; then |
| 167 | no_pam=1 |
| 168 | AC_DEFINE(DISABLE_PAM) |
| 169 | fi |
| 170 | ] |
| 171 | ) |
| 172 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then |
| 173 | AC_CHECK_LIB(dl, dlopen, , ) |
| 174 | LIBS="$LIBS -lpam" |
| 175 | |
Damien Miller | 0e65eed | 2000-05-17 22:16:05 +1000 | [diff] [blame] | 176 | AC_CHECK_FUNCS(pam_getenvlist) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 177 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 178 | # Check PAM strerror arguments (old PAM) |
| 179 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 180 | AC_TRY_COMPILE( |
| 181 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 182 | #include <stdlib.h> |
| 183 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 184 | ], |
| 185 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 186 | [AC_MSG_RESULT(no)], |
| 187 | [ |
| 188 | AC_DEFINE(HAVE_OLD_PAM) |
| 189 | AC_MSG_RESULT(yes) |
| 190 | ] |
| 191 | ) |
| 192 | fi |
| 193 | |
| 194 | # The big search for OpenSSL |
| 195 | AC_ARG_WITH(ssl-dir, |
| 196 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 197 | [ |
| 198 | if test "x$withval" != "$xno" ; then |
| 199 | tryssldir=$withval |
| 200 | fi |
| 201 | ] |
| 202 | ) |
| 203 | |
| 204 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 205 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 206 | saved_CFLAGS="$CFLAGS" |
| 207 | if test "x$prefix" != "xNONE" ; then |
| 208 | tryssldir="$tryssldir $prefix" |
| 209 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 210 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 211 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 212 | for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
| 213 | if test ! -z "$ssldir" ; then |
| 214 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 215 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 216 | if test ! -z "$need_dash_r" ; then |
| 217 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
| 218 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 219 | else |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 220 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 221 | fi |
| 222 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 223 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 224 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 225 | # Basic test to check for compatible version and correct linking |
| 226 | # *does not* test for RSA - that comes later. |
| 227 | AC_TRY_RUN( |
| 228 | [ |
Damien Miller | e59ce62 | 2000-05-01 20:54:17 +1000 | [diff] [blame] | 229 | #include <string.h> |
| 230 | #include <openssl/rand.h> |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 231 | int main(void) |
| 232 | { |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 233 | char a[2048]; |
| 234 | memset(a, 0, sizeof(a)); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 235 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 236 | return(RAND_status() <= 0); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 237 | } |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 238 | ], |
| 239 | [ |
| 240 | found_crypto=1 |
| 241 | break; |
| 242 | ], [] |
| 243 | ) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 244 | |
| 245 | if test ! -z "$found_crypto" ; then |
| 246 | break; |
| 247 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 248 | done |
| 249 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 250 | if test -z "$found_crypto" ; then |
| 251 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 252 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 253 | if test -z "$ssldir" ; then |
| 254 | ssldir="(system)" |
| 255 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 256 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 257 | ac_cv_openssldir=$ssldir |
| 258 | ]) |
| 259 | |
| 260 | if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then |
| 261 | AC_DEFINE(HAVE_OPENSSL) |
| 262 | dnl Need to recover ssldir - test above runs in subshell |
| 263 | ssldir=$ac_cv_openssldir |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 264 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 265 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 266 | if test ! -z "$need_dash_r" ; then |
| 267 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 268 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 269 | if test ! -z "$blibpath" ; then |
| 270 | blibpath="$blibpath:$ssldir:$ssldir/lib" |
| 271 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 272 | fi |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 273 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 274 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 275 | # Now test RSA support |
| 276 | saved_LIBS="$LIBS" |
| 277 | AC_MSG_CHECKING([for RSA support]) |
| 278 | for WANTS_RSAREF in "" 1 ; do |
| 279 | if test -z "$WANTS_RSAREF" ; then |
| 280 | LIBS="$saved_LIBS" |
| 281 | else |
| 282 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 283 | fi |
| 284 | AC_TRY_RUN([ |
| 285 | #include <string.h> |
| 286 | #include <openssl/rand.h> |
| 287 | #include <openssl/rsa.h> |
| 288 | #include <openssl/bn.h> |
| 289 | #include <openssl/sha.h> |
| 290 | int main(void) |
| 291 | { |
| 292 | int num; RSA *key; static unsigned char p_in[] = "blahblah"; |
| 293 | unsigned char c[256], p[256]; |
| 294 | memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); |
| 295 | if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); |
| 296 | num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); |
| 297 | return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); |
| 298 | } |
| 299 | ], |
| 300 | [ |
| 301 | rsa_works=1 |
| 302 | break; |
| 303 | ], []) |
| 304 | done |
| 305 | |
| 306 | if test ! -z "$no_rsa" ; then |
| 307 | AC_MSG_RESULT(disabled) |
| 308 | else |
| 309 | if test -z "$rsa_works" ; then |
| 310 | AC_MSG_WARN([*** No RSA support found *** ]) |
| 311 | else |
| 312 | if test -z "$WANTS_RSAREF" ; then |
| 313 | AC_MSG_RESULT(yes) |
| 314 | else |
| 315 | AC_MSG_RESULT(using RSAref) |
| 316 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
| 317 | fi |
| 318 | fi |
| 319 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 320 | |
| 321 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 322 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 323 | AC_CHECK_SIZEOF(short int, 2) |
| 324 | AC_CHECK_SIZEOF(int, 4) |
| 325 | AC_CHECK_SIZEOF(long int, 4) |
| 326 | AC_CHECK_SIZEOF(long long int, 8) |
| 327 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 328 | # More checks for data types |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 329 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 330 | AC_TRY_COMPILE( |
| 331 | [ #include <sys/types.h> ], |
| 332 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 333 | [ ac_cv_have_intxx_t="yes" ], |
| 334 | [ ac_cv_have_intxx_t="no" ] |
| 335 | ) |
| 336 | ]) |
| 337 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 338 | AC_DEFINE(HAVE_INTXX_T) |
| 339 | have_intxx_t=1 |
| 340 | fi |
| 341 | |
| 342 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 343 | AC_TRY_COMPILE( |
| 344 | [ #include <sys/types.h> ], |
| 345 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 346 | [ ac_cv_have_u_intxx_t="yes" ], |
| 347 | [ ac_cv_have_u_intxx_t="no" ] |
| 348 | ) |
| 349 | ]) |
| 350 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 351 | AC_DEFINE(HAVE_U_INTXX_T) |
| 352 | have_u_intxx_t=1 |
| 353 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 354 | |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 355 | |
Damien Miller | eaf9994 | 2000-01-19 13:45:07 +1100 | [diff] [blame] | 356 | 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] | 357 | "x$ac_cv_header_sys_bitypes_h" = "xyes" |
| 358 | then |
| 359 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 360 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 361 | [ |
| 362 | #include <sys/bitypes.h> |
| 363 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 364 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 365 | int8_t a; int16_t b; int32_t c; |
| 366 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 367 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 368 | ], |
| 369 | [ |
| 370 | AC_DEFINE(HAVE_U_INTXX_T) |
| 371 | AC_DEFINE(HAVE_INTXX_T) |
| 372 | AC_MSG_RESULT(yes) |
| 373 | ], |
| 374 | [AC_MSG_RESULT(no)] |
| 375 | ) |
| 376 | fi |
| 377 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 378 | if test -z "$have_u_intxx_t" ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 379 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 380 | AC_TRY_COMPILE( |
| 381 | [ |
| 382 | #include <sys/types.h> |
| 383 | ], |
| 384 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 385 | [ ac_cv_have_uintxx_t="yes" ], |
| 386 | [ ac_cv_have_uintxx_t="no" ] |
| 387 | ) |
| 388 | ]) |
| 389 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 390 | AC_DEFINE(HAVE_UINTXX_T) |
| 391 | fi |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 392 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 393 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 394 | AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [ |
| 395 | AC_TRY_COMPILE( |
| 396 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 397 | #include <sys/types.h> |
| 398 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 399 | ], |
| 400 | [socklen_t foo; foo = 1235;], |
| 401 | [ ac_cv_have_socklen_t="yes" ], |
| 402 | [ ac_cv_have_socklen_t="no" ] |
| 403 | ) |
| 404 | ]) |
| 405 | if test "x$ac_cv_have_socklen_t" = "xyes" ; then |
| 406 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 407 | fi |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 408 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 409 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 410 | AC_TRY_COMPILE( |
| 411 | [ |
| 412 | #include <sys/types.h> |
| 413 | ], |
| 414 | [ size_t foo; foo = 1235; ], |
| 415 | [ ac_cv_have_size_t="yes" ], |
| 416 | [ ac_cv_have_size_t="no" ] |
| 417 | ) |
| 418 | ]) |
| 419 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 420 | AC_DEFINE(HAVE_SIZE_T) |
| 421 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 422 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 423 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 424 | AC_TRY_COMPILE( |
| 425 | [ |
| 426 | #include <sys/types.h> |
| 427 | ], |
| 428 | [ ssize_t foo; foo = 1235; ], |
| 429 | [ ac_cv_have_ssize_t="yes" ], |
| 430 | [ ac_cv_have_ssize_t="no" ] |
| 431 | ) |
| 432 | ]) |
| 433 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 434 | AC_DEFINE(HAVE_SSIZE_T) |
| 435 | fi |
| 436 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 437 | |
| 438 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 439 | AC_TRY_COMPILE( |
| 440 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 441 | #include <sys/types.h> |
| 442 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 443 | ], |
| 444 | [ struct sockaddr_storage s; ], |
| 445 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 446 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 447 | ) |
| 448 | ]) |
| 449 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 450 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 451 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 452 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 453 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 454 | AC_TRY_COMPILE( |
| 455 | [ |
| 456 | #include <netinet/in.h> |
| 457 | ], |
| 458 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 459 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 460 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 461 | ) |
| 462 | ]) |
| 463 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 464 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 465 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 466 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 467 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 468 | AC_TRY_COMPILE( |
| 469 | [ |
| 470 | #include <netinet/in.h> |
| 471 | ], |
| 472 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 473 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 474 | [ ac_cv_have_struct_in6_addr="no" ] |
| 475 | ) |
| 476 | ]) |
| 477 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 478 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 479 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 480 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 481 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 482 | AC_TRY_COMPILE( |
| 483 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 484 | #include <sys/types.h> |
| 485 | #include <sys/socket.h> |
| 486 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 487 | ], |
| 488 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 489 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 490 | [ ac_cv_have_struct_addrinfo="no" ] |
| 491 | ) |
| 492 | ]) |
| 493 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 494 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 495 | fi |
| 496 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 497 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 498 | # Checks for structure members |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 499 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 500 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 501 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 502 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 503 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 504 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP) |
Damien Miller | ad1bc5f | 2000-05-20 14:53:09 +1000 | [diff] [blame] | 505 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 506 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 507 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) |
| 508 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 509 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 510 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 511 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame^] | 512 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 513 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 514 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 515 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
| 516 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 517 | |
| 518 | |
| 519 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 520 | ac_cv_have_ss_family_in_struct_ss, [ |
| 521 | AC_TRY_COMPILE( |
| 522 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 523 | #include <sys/types.h> |
| 524 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 525 | ], |
| 526 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 527 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 528 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 529 | ) |
| 530 | ]) |
| 531 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 532 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 533 | fi |
| 534 | |
| 535 | |
| 536 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 537 | ac_cv_have___ss_family_in_struct_ss, [ |
| 538 | AC_TRY_COMPILE( |
| 539 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 540 | #include <sys/types.h> |
| 541 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 542 | ], |
| 543 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 544 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 545 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 546 | ) |
| 547 | ]) |
| 548 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 549 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 550 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 551 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 552 | |
| 553 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 554 | AC_TRY_LINK([], |
| 555 | [ extern char *__progname; printf("%s", __progname); ], |
| 556 | [ ac_cv_libc_defines___progname="yes" ], |
| 557 | [ ac_cv_libc_defines___progname="no" ] |
| 558 | ) |
| 559 | ]) |
| 560 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 561 | AC_DEFINE(HAVE___PROGNAME) |
| 562 | fi |
| 563 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 564 | |
| 565 | # Looking for programs, paths and files |
| 566 | AC_ARG_WITH(rsh, |
| 567 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 568 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 569 | if test "x$withval" != "$no" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 570 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 571 | fi |
| 572 | ], |
| 573 | [ |
| 574 | AC_PATH_PROG(rsh_path, rsh) |
| 575 | ] |
| 576 | ) |
| 577 | |
| 578 | AC_ARG_WITH(xauth, |
| 579 | [ --with-xauth=PATH Specify path to xauth program ], |
| 580 | [ |
| 581 | if test "x$withval" != "$xno" ; then |
| 582 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") |
| 583 | fi |
| 584 | ], |
| 585 | [ |
| 586 | AC_PATH_PROG(xauth_path, xauth) |
| 587 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then |
| 588 | xauth_path="/usr/openwin/bin/xauth" |
| 589 | fi |
| 590 | ] |
| 591 | ) |
| 592 | |
| 593 | if test ! -z "$xauth_path" ; then |
| 594 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 595 | fi |
| 596 | if test ! -z "$rsh_path" ; then |
| 597 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 598 | fi |
| 599 | |
| 600 | # Check for mail directory (last resort if we cannot get it from headers) |
| 601 | if test ! -z "$MAIL" ; then |
| 602 | maildir=`dirname $MAIL` |
| 603 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 604 | fi |
| 605 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 606 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 607 | AC_CHECK_FILE("/dev/ptmx", |
| 608 | [ |
| 609 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 610 | have_dev_ptmx=1 |
| 611 | ] |
| 612 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 613 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 614 | AC_CHECK_FILE("/dev/ptc", |
| 615 | [ |
| 616 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 617 | have_dev_ptc=1 |
| 618 | ] |
| 619 | ) |
| 620 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 621 | # Options from here on. Some of these are preset by platform above |
| 622 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 623 | # Check for user-specified random device, otherwise check /dev/urandom |
| 624 | AC_ARG_WITH(random, |
| 625 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 626 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 627 | if test "x$withval" != "xno" ; then |
| 628 | RANDOM_POOL="$withval"; |
| 629 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 630 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 631 | ], |
| 632 | [ |
| 633 | # Check for random device |
| 634 | AC_CHECK_FILE("/dev/urandom", |
| 635 | [ |
| 636 | RANDOM_POOL="/dev/urandom"; |
| 637 | AC_SUBST(RANDOM_POOL) |
| 638 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 639 | ] |
| 640 | ) |
| 641 | ] |
| 642 | ) |
| 643 | |
| 644 | # Check for EGD pool file |
| 645 | AC_ARG_WITH(egd-pool, |
| 646 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 647 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 648 | if test "x$withval" != "xno" ; then |
| 649 | EGD_SOCKET="$withval"; |
| 650 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 651 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 652 | ] |
| 653 | ) |
| 654 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 655 | # detect pathnames for entropy gathering commands, if we need them |
| 656 | INSTALL_SSH_PRNG_CMDS="" |
| 657 | rm -f prng_commands |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 658 | if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then |
| 659 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 660 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 661 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 662 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 663 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 664 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 665 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 666 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 667 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 668 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 669 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 670 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 671 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 672 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 673 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
| 674 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 675 | |
| 676 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 677 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 678 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 679 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 680 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 681 | AC_ARG_WITH(catman, |
| 682 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 683 | [ |
| 684 | MANTYPE='$(CATMAN)' |
| 685 | if test x"$withval" != x"yes" ; then |
| 686 | mansubdir=$withval |
| 687 | else |
| 688 | mansubdir=cat |
| 689 | fi |
| 690 | ], [ |
| 691 | if test -z "$MANTYPE" ; then |
| 692 | MANTYPE='$(TROFFMAN)' |
| 693 | mansubdir=man |
| 694 | fi |
| 695 | ] |
| 696 | ) |
| 697 | AC_SUBST(MANTYPE) |
| 698 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 699 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 700 | # Check whether user wants Kerberos support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 701 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 702 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 703 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 704 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 705 | |
| 706 | if test "x$withval" != "$xyes" ; then |
| 707 | CFLAGS="$CFLAGS -I${withval}/include" |
| 708 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 709 | if test ! -z "$need_dash_r" ; then |
| 710 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 711 | fi |
| 712 | if test ! -z "$blibpath" ; then |
| 713 | blibpath="$blibpath:${withval}/lib" |
| 714 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 715 | else |
| 716 | if test -d /usr/include/kerberosIV ; then |
| 717 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 718 | fi |
| 719 | fi |
| 720 | |
| 721 | AC_CHECK_HEADERS(krb.h) |
| 722 | AC_CHECK_LIB(krb, main) |
| 723 | if test "$ac_cv_header_krb_h" != yes; then |
| 724 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 725 | fi |
| 726 | if test "$ac_cv_lib_krb_main" != yes; then |
| 727 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 728 | fi |
| 729 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 730 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 731 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 732 | KRB4=yes |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 733 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 734 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 735 | ] |
| 736 | ) |
| 737 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 738 | # Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 739 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 740 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 741 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 742 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 743 | |
| 744 | if test "x$withval" != "$xyes" ; then |
| 745 | CFLAGS="$CFLAGS -I${withval}/include" |
| 746 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 747 | fi |
| 748 | |
| 749 | if test -z "$KRB4" ; then |
| 750 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 751 | fi |
| 752 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 753 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 754 | if test ! -z "$AFS_LIBS" ; then |
| 755 | LIBS="$LIBS $AFS_LIBS" |
| 756 | fi |
| 757 | AC_DEFINE(AFS) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 758 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 759 | ] |
| 760 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 761 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 762 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 763 | # Check whether user wants S/Key support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 764 | AC_ARG_WITH(skey, |
| 765 | [ --with-skey Enable S/Key support], |
| 766 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 767 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 768 | AC_DEFINE(SKEY) |
| 769 | LIBS="$LIBS -lskey" |
| 770 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 771 | ] |
| 772 | ) |
| 773 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 774 | # Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 775 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 776 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 777 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 778 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 779 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 780 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 781 | AC_MSG_CHECKING(for libwrap) |
| 782 | AC_TRY_LINK( |
| 783 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 784 | #include <tcpd.h> |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 785 | int deny_severity = 0, allow_severity = 0; |
| 786 | ], |
| 787 | [hosts_access(0);], |
| 788 | [ |
| 789 | AC_MSG_RESULT(yes) |
| 790 | AC_DEFINE(LIBWRAP) |
| 791 | ], |
| 792 | [ |
| 793 | AC_MSG_RESULT(no) |
| 794 | AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***]) |
| 795 | LIBS="$saved_LIBS" |
| 796 | ] |
| 797 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 798 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 799 | ] |
| 800 | ) |
| 801 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 802 | # Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 803 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 804 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 805 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 806 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 807 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
| 808 | fi |
| 809 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 810 | ) |
| 811 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 812 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 813 | AC_ARG_WITH(shadow, |
| 814 | [ --without-shadow Disable shadow password support], |
| 815 | [ |
| 816 | if test "x$withval" = "xno" ; then |
| 817 | AC_DEFINE(DISABLE_SHADOW) |
| 818 | fi |
| 819 | ] |
| 820 | ) |
| 821 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 822 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 823 | AC_ARG_WITH(ipaddr-display, |
| 824 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 825 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 826 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 827 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 828 | fi |
| 829 | ] |
| 830 | ) |
| 831 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 832 | # Whether to mess with the default path |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 833 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 834 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 835 | [ |
| 836 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 837 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 838 | fi |
| 839 | ] |
| 840 | ) |
| 841 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 842 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 843 | AC_ARG_WITH(ipv4-default, |
| 844 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 845 | [ |
| 846 | if test "x$withval" != "xno" ; then |
| 847 | AC_DEFINE(IPV4_DEFAULT) |
| 848 | fi |
| 849 | ] |
| 850 | ) |
| 851 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 852 | 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] | 853 | AC_ARG_WITH(4in6, |
| 854 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 855 | [ |
| 856 | if test "x$withval" != "xno" ; then |
| 857 | AC_MSG_RESULT(yes) |
| 858 | AC_DEFINE(IPV4_IN_IPV6) |
| 859 | else |
| 860 | AC_MSG_RESULT(no) |
| 861 | fi |
| 862 | ],[ |
| 863 | if test "x$inet6_default_4in6" = "xyes"; then |
| 864 | AC_MSG_RESULT([yes (default)]) |
| 865 | AC_DEFINE(IPV4_IN_IPV6) |
| 866 | else |
| 867 | AC_MSG_RESULT([no (default)]) |
| 868 | fi |
| 869 | ] |
| 870 | ) |
| 871 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 872 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 873 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 874 | AC_ARG_WITH(pid-dir, |
| 875 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 876 | [ |
| 877 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 878 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 879 | fi |
| 880 | ] |
| 881 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 882 | |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 883 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 884 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 885 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame^] | 886 | dnl allow user to disable some login recording features |
| 887 | AC_ARG_ENABLE(lastlog, |
| 888 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
| 889 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 890 | ) |
| 891 | AC_ARG_ENABLE(utmp, |
| 892 | [ --disable-utmp disable use of utmp even if detected [no]], |
| 893 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 894 | ) |
| 895 | AC_ARG_ENABLE(utmpx, |
| 896 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
| 897 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 898 | ) |
| 899 | AC_ARG_ENABLE(wtmp, |
| 900 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
| 901 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 902 | ) |
| 903 | AC_ARG_ENABLE(wtmpx, |
| 904 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
| 905 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 906 | ) |
| 907 | AC_ARG_ENABLE(libutil, |
| 908 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
| 909 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 910 | ) |
| 911 | AC_ARG_ENABLE(pututline, |
| 912 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
| 913 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 914 | ) |
| 915 | AC_ARG_ENABLE(pututxline, |
| 916 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
| 917 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 918 | ) |
| 919 | AC_ARG_WITH(lastlog, |
| 920 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
| 921 | [ conf_lastlog_location="$withval"; ],) |
| 922 | |
| 923 | dnl lastlog, [uw]tmpx? detection |
| 924 | dnl NOTE: set the paths in the platform section to avoid the |
| 925 | dnl need for command-line parameters |
| 926 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 927 | |
| 928 | dnl lastlog detection |
| 929 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 930 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 931 | AC_TRY_COMPILE([ |
| 932 | #include <sys/types.h> |
| 933 | #include <utmp.h> |
| 934 | #ifdef HAVE_LASTLOG_H |
| 935 | # include <lastlog.h> |
| 936 | #endif |
| 937 | #ifdef PATHS_H |
| 938 | # include <paths.h> |
| 939 | #endif |
| 940 | ], |
| 941 | [ char *lastlog = LASTLOG_FILE; ], |
| 942 | [ AC_MSG_RESULT(yes) ], |
| 943 | [ AC_MSG_RESULT(no) |
| 944 | system_lastlog_path=no ] |
| 945 | ) |
| 946 | if test -z "$conf_lastlog_location"; then |
| 947 | if test x"$system_lastlog_path" = x"no" ; then |
| 948 | for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do |
| 949 | if test -e $f ; then |
| 950 | conf_lastlog_location=$f |
| 951 | fi |
| 952 | done |
| 953 | if test -z "$conf_lastlog_location"; then |
| 954 | AC_MSG_WARN([** Cannot find lastlog - disabling feature **]) |
| 955 | AC_DEFINE(DISABLE_LASTLOG) |
| 956 | fi |
| 957 | fi |
| 958 | fi |
| 959 | |
| 960 | if test -n "$conf_lastlog_location"; then |
| 961 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 962 | fi |
| 963 | |
| 964 | dnl utmp detection |
| 965 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 966 | AC_TRY_COMPILE([ |
| 967 | #include <sys/types.h> |
| 968 | #include <utmp.h> |
| 969 | #ifdef PATHS_H |
| 970 | # include <paths.h> |
| 971 | #endif |
| 972 | ], |
| 973 | [ char *utmp = UTMP_FILE; ], |
| 974 | [ AC_MSG_RESULT(yes) ], |
| 975 | [ AC_MSG_RESULT(no) |
| 976 | system_utmp_path=no ] |
| 977 | ) |
| 978 | if test -z "$conf_utmp_location"; then |
| 979 | if test x"$system_utmp_path" = x"no" ; then |
| 980 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 981 | if test -f $f ; then |
| 982 | conf_utmp_location=$f |
| 983 | fi |
| 984 | done |
| 985 | if test -z "$conf_utmp_location"; then |
| 986 | AC_DEFINE(DISABLE_UTMP) |
| 987 | fi |
| 988 | fi |
| 989 | fi |
| 990 | if test -n "$conf_utmp_location"; then |
| 991 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 992 | fi |
| 993 | |
| 994 | dnl wtmp detection |
| 995 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 996 | AC_TRY_COMPILE([ |
| 997 | #include <sys/types.h> |
| 998 | #include <utmp.h> |
| 999 | #ifdef PATHS_H |
| 1000 | # include <paths.h> |
| 1001 | #endif |
| 1002 | ], |
| 1003 | [ char *wtmp = WTMP_FILE; ], |
| 1004 | [ AC_MSG_RESULT(yes) ], |
| 1005 | [ AC_MSG_RESULT(no) |
| 1006 | system_wtmp_path=no ] |
| 1007 | ) |
| 1008 | if test -z "$conf_wtmp_location"; then |
| 1009 | if test x"$system_wtmp_path" = x"no" ; then |
| 1010 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1011 | if test -f $f ; then |
| 1012 | conf_wtmp_location=$f |
| 1013 | fi |
| 1014 | done |
| 1015 | if test -z "$conf_wtmp_location"; then |
| 1016 | AC_DEFINE(DISABLE_WTMP) |
| 1017 | fi |
| 1018 | fi |
| 1019 | fi |
| 1020 | if test -n "$conf_wtmp_location"; then |
| 1021 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1022 | fi |
| 1023 | |
| 1024 | |
| 1025 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1026 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1027 | dnl there, though. |
| 1028 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1029 | AC_TRY_COMPILE([ |
| 1030 | #include <sys/types.h> |
| 1031 | #include <utmp.h> |
| 1032 | #ifdef HAVE_UTMPX_H |
| 1033 | #include <utmpx.h> |
| 1034 | #endif |
| 1035 | #ifdef PATHS_H |
| 1036 | # include <paths.h> |
| 1037 | #endif |
| 1038 | ], |
| 1039 | [ char *utmpx = UTMPX_FILE; ], |
| 1040 | [ AC_MSG_RESULT(yes) ], |
| 1041 | [ AC_MSG_RESULT(no) |
| 1042 | system_utmpx_path=no ] |
| 1043 | ) |
| 1044 | if test -z "$conf_utmpx_location"; then |
| 1045 | if test x"$system_utmpx_path" = x"no" ; then |
| 1046 | AC_DEFINE(DISABLE_UTMPX) |
| 1047 | fi |
| 1048 | else |
| 1049 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1050 | fi |
| 1051 | |
| 1052 | dnl wtmpx detection |
| 1053 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1054 | AC_TRY_COMPILE([ |
| 1055 | #include <sys/types.h> |
| 1056 | #include <utmp.h> |
| 1057 | #ifdef HAVE_UTMPX_H |
| 1058 | #include <utmpx.h> |
| 1059 | #endif |
| 1060 | #ifdef PATHS_H |
| 1061 | # include <paths.h> |
| 1062 | #endif |
| 1063 | ], |
| 1064 | [ char *wtmpx = WTMPX_FILE; ], |
| 1065 | [ AC_MSG_RESULT(yes) ], |
| 1066 | [ AC_MSG_RESULT(no) |
| 1067 | system_wtmpx_path=no ] |
| 1068 | ) |
| 1069 | if test -z "$conf_wtmpx_location"; then |
| 1070 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1071 | AC_DEFINE(DISABLE_WTMPX) |
| 1072 | fi |
| 1073 | else |
| 1074 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1075 | fi |
| 1076 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1077 | |
| 1078 | # Change default command timeout for builtin PRNG |
| 1079 | entropy_timeout=100 |
| 1080 | AC_ARG_WITH(entropy-timeout, |
| 1081 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1082 | [ |
| 1083 | if test "x$withval" != "xno" ; then |
| 1084 | entropy_timeout=$withval |
| 1085 | fi |
| 1086 | ] |
| 1087 | ) |
| 1088 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1089 | |
| 1090 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1091 | if test ! -z "$blibpath" ; then |
| 1092 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 1093 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 1094 | fi |
| 1095 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1096 | AC_OUTPUT(Makefile ssh_prng_cmds) |
| 1097 | |
| 1098 | |