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