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