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