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