Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1 | # $Id: configure.in,v 1.307 2001/08/16 00:09:50 mouring Exp $ |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 2 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 3 | AC_INIT(ssh.c) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 4 | |
| 5 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 6 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 7 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 8 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 9 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 10 | # Checks for programs. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 11 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 12 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 13 | AC_PROG_INSTALL |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 14 | AC_PATH_PROG(AR, ar) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 15 | AC_PATH_PROGS(PERL, perl5 perl) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 16 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 17 | AC_PATH_PROG(ENT, ent) |
| 18 | AC_SUBST(ENT) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 19 | AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 20 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 21 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 22 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 23 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 24 | if test -z "$AR" ; then |
| 25 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 26 | fi |
| 27 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 28 | # Use LOGIN_PROGRAM from environment if possible |
| 29 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 30 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 31 | else |
| 32 | # Search for login |
| 33 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 34 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 35 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 36 | fi |
| 37 | fi |
| 38 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 39 | if test -z "$LD" ; then |
| 40 | LD=$CC |
| 41 | fi |
| 42 | AC_SUBST(LD) |
| 43 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 44 | AC_C_INLINE |
Damien Miller | 649d999 | 2001-06-27 23:35:51 +1000 | [diff] [blame] | 45 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
| 46 | CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 47 | fi |
| 48 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 49 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 50 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 51 | *-*-aix*) |
| 52 | AFS_LIBS="-lld" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 53 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 54 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 55 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 56 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 57 | fi |
Damien Miller | d2c208a | 2000-05-17 22:00:02 +1000 | [diff] [blame] | 58 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 59 | AC_DEFINE(BROKEN_GETADDRINFO) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 60 | dnl AIX handles lastlog as part of its login message |
| 61 | AC_DEFINE(DISABLE_LASTLOG) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 62 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 63 | *-*-cygwin*) |
Damien Miller | ef767ac | 2000-10-17 23:14:08 +1100 | [diff] [blame] | 64 | LIBS="$LIBS -lregex /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 65 | AC_DEFINE(HAVE_CYGWIN) |
Ben Lindstrom | ca60a9b | 2001-05-17 03:32:50 +0000 | [diff] [blame] | 66 | AC_DEFINE(USE_PIPES) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 67 | AC_DEFINE(DISABLE_SHADOW) |
| 68 | AC_DEFINE(IPV4_DEFAULT) |
| 69 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Ben Lindstrom | 38e6093 | 2001-02-24 00:55:04 +0000 | [diff] [blame] | 70 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 71 | no_libsocket=1 |
| 72 | no_libnsl=1 |
| 73 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 74 | *-*-dgux*) |
| 75 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 76 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 77 | *-*-darwin*) |
| 78 | AC_DEFINE(BROKEN_GETADDRINFO) |
| 79 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 80 | *-*-hpux10*) |
| 81 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 82 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 83 | fi |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 84 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 85 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 86 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 87 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 88 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 89 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 90 | LIBS="$LIBS -lxnet -lsec" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 91 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 92 | *-*-hpux11*) |
Kevin Steves | 6a7b0de | 2001-06-27 16:32:24 +0000 | [diff] [blame] | 93 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 94 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 95 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 96 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 97 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 98 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 99 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Kevin Steves | 6a7b0de | 2001-06-27 16:32:24 +0000 | [diff] [blame] | 100 | LIBS="$LIBS -lxnet -lsec" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 101 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 102 | *-*-irix5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 103 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 104 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 105 | PATH="$PATH:/usr/etc" |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 106 | no_libsocket=1 |
| 107 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 108 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 109 | ;; |
| 110 | *-*-irix6*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 111 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 112 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 113 | PATH="$PATH:/usr/etc" |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 114 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 115 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 116 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 4a1d916 | 2000-11-21 10:45:31 +0000 | [diff] [blame] | 117 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 118 | no_libsocket=1 |
| 119 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 120 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 121 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 122 | *-*-linux*) |
| 123 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 124 | check_for_libcrypt_later=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 125 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 126 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 127 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 128 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 129 | mips-sony-bsd|mips-sony-newsos4) |
| 130 | AC_DEFINE(HAVE_NEWS4) |
| 131 | SONY=1 |
| 132 | AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT), |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 133 | AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 134 | ) |
| 135 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 136 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 137 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 138 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 139 | *-*-freebsd*) |
| 140 | check_for_libcrypt_later=1 |
| 141 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 142 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 143 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 144 | conf_utmp_location=/etc/utmp |
| 145 | conf_wtmp_location=/usr/adm/wtmp |
| 146 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 147 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 148 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 149 | AC_DEFINE(USE_PIPES) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 150 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 151 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 321ae73 | 2000-12-31 15:00:23 +0000 | [diff] [blame] | 152 | CFLAGS="$CFLAGS" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 153 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 154 | *-*-solaris*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 155 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 866488b | 2001-02-20 18:22:38 +0000 | [diff] [blame] | 156 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 157 | need_dash_r=1 |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 158 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 159 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 160 | AC_DEFINE(LOGIN_NEEDS_TERM) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 161 | # hardwire lastlog location (can't detect it on some versions) |
| 162 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 163 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 164 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 165 | if test "$sol2ver" -ge 8; then |
| 166 | AC_MSG_RESULT(yes) |
| 167 | AC_DEFINE(DISABLE_UTMP) |
| 168 | AC_DEFINE(DISABLE_WTMP) |
| 169 | else |
| 170 | AC_MSG_RESULT(no) |
| 171 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 172 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 173 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 174 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 175 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 176 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 877d8ea | 2001-02-18 15:29:28 +1100 | [diff] [blame] | 177 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 178 | conf_utmp_location=/etc/utmp |
| 179 | conf_wtmp_location=/var/adm/wtmp |
| 180 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 181 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 182 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 183 | *-ncr-sysv*) |
| 184 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
| 185 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 186 | LIBS="$LIBS -lc89 -lnsl -lgen -lsocket" |
Ben Lindstrom | 3432834 | 2001-04-23 22:39:42 +0000 | [diff] [blame] | 187 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 188 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 189 | *-sni-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 190 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 191 | LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 192 | IPADDR_IN_DISPLAY=yes |
| 193 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 194 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Kevin Steves | 52dd468 | 2001-03-08 18:26:57 +0000 | [diff] [blame] | 195 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | b2dc28e | 2000-07-12 09:18:33 +1000 | [diff] [blame] | 196 | LIBS="$LIBS -lgen -lnsl -lucb" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 197 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 198 | *-*-sysv4.2*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 199 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 200 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 201 | enable_suid_ssh=no |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 202 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 203 | ;; |
| 204 | *-*-sysv5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 205 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 206 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 207 | enable_suid_ssh=no |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 208 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 209 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 210 | *-*-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 211 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 212 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 213 | LIBS="$LIBS -lgen -lsocket" |
| 214 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 215 | *-*-sco3.2v4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 216 | CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 217 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 218 | LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 219 | rsh_path="/usr/bin/rcmd" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 220 | RANLIB=true |
| 221 | no_dev_ptmx=1 |
| 222 | AC_DEFINE(BROKEN_SYS_TERMIO_H) |
| 223 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 224 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 225 | AC_DEFINE(DISABLE_SHADOW) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 226 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 227 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 228 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 229 | MANTYPE=man |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 230 | ;; |
| 231 | *-*-sco3.2v5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 232 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 233 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 234 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 235 | no_dev_ptmx=1 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 236 | rsh_path="/usr/bin/rcmd" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 237 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 238 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 239 | AC_DEFINE(DISABLE_SHADOW) |
Ben Lindstrom | 42717bf | 2000-12-28 15:46:20 +0000 | [diff] [blame] | 240 | AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 241 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 242 | MANTYPE=man |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 243 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 244 | *-*-unicos*) |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 245 | no_libsocket=1 |
| 246 | no_libnsl=1 |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 247 | AC_DEFINE(USE_PIPES) |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 248 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib" |
| 249 | LIBS="$LIBS -lgen -lrsc" |
| 250 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 251 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 252 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 253 | no_osfsia="" |
| 254 | AC_ARG_WITH(osfsia, |
| 255 | [ --with-osfsia Enable Digital Unix SIA], |
| 256 | [ |
| 257 | if test "x$withval" = "xno" ; then |
| 258 | AC_MSG_RESULT(disabled) |
| 259 | no_osfsia=1 |
| 260 | fi |
| 261 | ], |
| 262 | ) |
| 263 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 264 | if test -f /etc/sia/matrix.conf; then |
| 265 | AC_MSG_RESULT(yes) |
| 266 | AC_DEFINE(HAVE_OSF_SIA) |
| 267 | AC_DEFINE(DISABLE_LOGIN) |
| 268 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 269 | else |
| 270 | AC_MSG_RESULT(no) |
| 271 | fi |
| 272 | fi |
| 273 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 274 | |
| 275 | *-*-nto-qnx) |
| 276 | AC_DEFINE(USE_PIPES) |
| 277 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
| 278 | AC_DEFINE(MISSING_NFDBITS) |
| 279 | AC_DEFINE(MISSING_HOWMANY) |
| 280 | AC_DEFINE(MISSING_FD_MASK) |
| 281 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 282 | esac |
| 283 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 284 | # Allow user to specify flags |
| 285 | AC_ARG_WITH(cflags, |
| 286 | [ --with-cflags Specify additional flags to pass to compiler], |
| 287 | [ |
| 288 | if test "x$withval" != "xno" ; then |
| 289 | CFLAGS="$CFLAGS $withval" |
| 290 | fi |
| 291 | ] |
| 292 | ) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 293 | AC_ARG_WITH(cppflags, |
| 294 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 295 | [ |
| 296 | if test "x$withval" != "xno"; then |
| 297 | CPPFLAGS="$CPPFLAGS $withval" |
| 298 | fi |
| 299 | ] |
| 300 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 301 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 302 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 303 | [ |
| 304 | if test "x$withval" != "xno" ; then |
| 305 | LDFLAGS="$LDFLAGS $withval" |
| 306 | fi |
| 307 | ] |
| 308 | ) |
| 309 | AC_ARG_WITH(libs, |
| 310 | [ --with-libs Specify additional libraries to link with], |
| 311 | [ |
| 312 | if test "x$withval" != "xno" ; then |
| 313 | LIBS="$LIBS $withval" |
| 314 | fi |
| 315 | ] |
| 316 | ) |
| 317 | |
Ben Lindstrom | 4e5a0aa | 2001-02-15 18:16:22 +0000 | [diff] [blame] | 318 | AC_ARG_WITH(pcre, |
| 319 | [ --with-pcre Override built in regex library with pcre], |
| 320 | [ |
| 321 | |
| 322 | AC_CHECK_LIB(pcre, pcre_info, |
| 323 | [ |
| 324 | AC_DEFINE(HAVE_LIBPCRE) |
| 325 | LIBS="$LIBS -lpcreposix -lpcre" |
| 326 | no_comp_check="yes" |
| 327 | ], |
| 328 | [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ] |
| 329 | ) |
| 330 | ] |
| 331 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 332 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 333 | # Checks for libraries. |
Damien Miller | 22d5aa7 | 2001-02-18 12:49:57 +1100 | [diff] [blame] | 334 | if test -z "$no_libnsl" ; then |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 335 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 336 | fi |
Damien Miller | 22d5aa7 | 2001-02-18 12:49:57 +1100 | [diff] [blame] | 337 | if test -z "$no_libsocket" ; then |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 338 | AC_CHECK_LIB(socket, main, , ) |
| 339 | fi |
| 340 | |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 341 | dnl SCO OS3 needs this for libwrap |
| 342 | AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc) |
| 343 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 344 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen") |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 345 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 346 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 347 | |
Ben Lindstrom | 4e5a0aa | 2001-02-15 18:16:22 +0000 | [diff] [blame] | 348 | # We don't want to check if we did an pcre override. |
| 349 | if test -z "$no_comp_check" ; then |
| 350 | AC_CHECK_FUNC(regcomp, |
| 351 | [ AC_DEFINE(HAVE_REGCOMP)], |
| 352 | [ |
| 353 | AC_CHECK_LIB(pcre, pcre_info, |
| 354 | [ |
| 355 | AC_DEFINE(HAVE_LIBPCRE) |
| 356 | LIBS="$LIBS -lpcreposix -lpcre" |
| 357 | ], |
| 358 | [ |
| 359 | AC_MSG_ERROR([*** No regex library found.]) |
| 360 | ]) |
| 361 | ] |
| 362 | ) |
| 363 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 364 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 365 | dnl UnixWare 2.x |
| 366 | AC_CHECK_FUNC(strcasecmp, |
| 367 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 368 | ) |
| 369 | AC_CHECK_FUNC(utimes, |
| 370 | [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ] |
| 371 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 372 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 373 | AC_FUNC_STRFTIME |
| 374 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 375 | # Checks for header files. |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 376 | AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.h lastlog.h libgen.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h stdint.h strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 377 | |
| 378 | # Check for ALTDIRFUNC glob() extension |
| 379 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 380 | AC_EGREP_CPP(FOUNDIT, |
| 381 | [ |
| 382 | #include <glob.h> |
| 383 | #ifdef GLOB_ALTDIRFUNC |
| 384 | FOUNDIT |
| 385 | #endif |
| 386 | ], |
| 387 | [ |
| 388 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC) |
| 389 | AC_MSG_RESULT(yes) |
| 390 | ], |
| 391 | [ |
| 392 | AC_MSG_RESULT(no) |
| 393 | ] |
| 394 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 395 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 396 | # Check for g.gl_matchc glob() extension |
| 397 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
| 398 | AC_EGREP_CPP(FOUNDIT, |
| 399 | [ |
| 400 | #include <glob.h> |
| 401 | int main(void){glob_t g; g.gl_matchc = 1;} |
| 402 | ], |
| 403 | [ |
| 404 | AC_DEFINE(GLOB_HAS_GL_MATCHC) |
| 405 | AC_MSG_RESULT(yes) |
| 406 | ], |
| 407 | [ |
| 408 | AC_MSG_RESULT(no) |
| 409 | ] |
| 410 | ) |
| 411 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 412 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
| 413 | AC_TRY_RUN( |
| 414 | [ |
| 415 | #include <sys/types.h> |
| 416 | #include <dirent.h> |
| 417 | int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} |
| 418 | ], |
| 419 | [AC_MSG_RESULT(yes)], |
| 420 | [ |
| 421 | AC_MSG_RESULT(no) |
| 422 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
| 423 | ] |
| 424 | ) |
| 425 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 426 | # Check whether user wants S/Key support |
| 427 | SKEY_MSG="no" |
| 428 | AC_ARG_WITH(skey, |
| 429 | [ --with-skey=PATH Enable S/Key support], |
| 430 | [ |
| 431 | if test "x$withval" != "xno" ; then |
| 432 | |
| 433 | if test "x$withval" != "xyes" ; then |
| 434 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 435 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 436 | fi |
| 437 | |
| 438 | AC_DEFINE(SKEY) |
| 439 | LIBS="-lskey $LIBS" |
| 440 | SKEY_MSG="yes" |
| 441 | |
| 442 | AC_CHECK_FUNC(skey_keyinfo, |
| 443 | [], |
| 444 | [ |
| 445 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 446 | ]) |
| 447 | fi |
| 448 | ] |
| 449 | ) |
| 450 | |
| 451 | # Check whether user wants TCP wrappers support |
| 452 | TCPW_MSG="no" |
| 453 | AC_ARG_WITH(tcp-wrappers, |
| 454 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 455 | [ |
| 456 | if test "x$withval" != "xno" ; then |
| 457 | saved_LIBS="$LIBS" |
| 458 | LIBS="-lwrap $LIBS" |
| 459 | AC_MSG_CHECKING(for libwrap) |
| 460 | AC_TRY_LINK( |
| 461 | [ |
| 462 | #include <tcpd.h> |
| 463 | int deny_severity = 0, allow_severity = 0; |
| 464 | ], |
| 465 | [hosts_access(0);], |
| 466 | [ |
| 467 | AC_MSG_RESULT(yes) |
| 468 | AC_DEFINE(LIBWRAP) |
| 469 | TCPW_MSG="yes" |
| 470 | ], |
| 471 | [ |
| 472 | AC_MSG_ERROR([*** libwrap missing]) |
| 473 | ] |
| 474 | ) |
| 475 | fi |
| 476 | ] |
| 477 | ) |
| 478 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 479 | dnl Checks for library functions. |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 480 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock dirname fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getopt getnameinfo getrlimit getrusage getttyent glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty readpassphrase realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid setvbuf sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 481 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 482 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 483 | dnl Checks for libutil functions |
Ben Lindstrom | e2fb8d3 | 2000-12-28 00:07:07 +0000 | [diff] [blame] | 484 | AC_CHECK_HEADERS(libutil.h) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 485 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 486 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 487 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 488 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 489 | dnl Checks for utmpx functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 490 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 491 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 492 | |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 493 | AC_CHECK_FUNC(getuserattr, |
| 494 | [AC_DEFINE(HAVE_GETUSERATTR)], |
| 495 | [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])] |
| 496 | ) |
| 497 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 498 | AC_CHECK_FUNC(login, |
| 499 | [AC_DEFINE(HAVE_LOGIN)], |
| 500 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 501 | ) |
| 502 | |
| 503 | AC_CHECK_FUNC(daemon, |
| 504 | [AC_DEFINE(HAVE_DAEMON)], |
| 505 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 506 | ) |
| 507 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 508 | AC_CHECK_FUNC(getpagesize, |
| 509 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 510 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 511 | ) |
| 512 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 513 | # Check for broken snprintf |
| 514 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 515 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 516 | AC_TRY_RUN( |
| 517 | [ |
| 518 | #include <stdio.h> |
| 519 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 520 | ], |
| 521 | [AC_MSG_RESULT(yes)], |
| 522 | [ |
| 523 | AC_MSG_RESULT(no) |
| 524 | AC_DEFINE(BROKEN_SNPRINTF) |
| 525 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 526 | ] |
| 527 | ) |
| 528 | fi |
| 529 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 530 | AC_FUNC_GETPGRP |
| 531 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 532 | # Check for PAM libs |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 533 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 534 | AC_ARG_WITH(pam, |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 535 | [ --with-pam Enable PAM support ], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 536 | [ |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 537 | if test "x$withval" != "xno" ; then |
| 538 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then |
| 539 | AC_MSG_ERROR([PAM headers not found]) |
| 540 | fi |
| 541 | |
| 542 | AC_CHECK_LIB(dl, dlopen, , ) |
| 543 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 544 | AC_CHECK_FUNCS(pam_getenvlist) |
| 545 | |
| 546 | disable_shadow=yes |
| 547 | PAM_MSG="yes" |
| 548 | |
| 549 | AC_DEFINE(USE_PAM) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 550 | fi |
| 551 | ] |
| 552 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 553 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 554 | # Check for older PAM |
| 555 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 556 | # Check PAM strerror arguments (old PAM) |
| 557 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 558 | AC_TRY_COMPILE( |
| 559 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 560 | #include <stdlib.h> |
| 561 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 562 | ], |
| 563 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 564 | [AC_MSG_RESULT(no)], |
| 565 | [ |
| 566 | AC_DEFINE(HAVE_OLD_PAM) |
| 567 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 568 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 569 | ] |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 570 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 571 | fi |
| 572 | |
| 573 | # The big search for OpenSSL |
| 574 | AC_ARG_WITH(ssl-dir, |
| 575 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 576 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 577 | if test "x$withval" != "xno" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 578 | tryssldir=$withval |
| 579 | fi |
| 580 | ] |
| 581 | ) |
| 582 | |
| 583 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 584 | saved_LDFLAGS="$LDFLAGS" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 585 | saved_CPPFLAGS="$CPPFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 586 | if test "x$prefix" != "xNONE" ; then |
| 587 | tryssldir="$tryssldir $prefix" |
| 588 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 589 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
Damien Miller | a1b61e1 | 2000-09-16 17:02:16 +1100 | [diff] [blame] | 590 | for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 591 | CPPFLAGS="$saved_CPPFLAGS" |
| 592 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 593 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 594 | |
| 595 | # Skip directories if they don't exist |
| 596 | if test ! -z "$ssldir" -a ! -d "$ssldir" ; then |
| 597 | continue; |
| 598 | fi |
| 599 | if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then |
| 600 | # Try to use $ssldir/lib if it exists, otherwise |
| 601 | # $ssldir |
| 602 | if test -d "$ssldir/lib" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 603 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 604 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 605 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 606 | fi |
| 607 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 608 | LDFLAGS="-L$ssldir $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 609 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 610 | LDFLAGS="-R$ssldir $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 611 | fi |
| 612 | fi |
| 613 | # Try to use $ssldir/include if it exists, otherwise |
| 614 | # $ssldir |
| 615 | if test -d "$ssldir/include" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 616 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 617 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 618 | CPPFLAGS="-I$ssldir $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 619 | fi |
| 620 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 621 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 622 | # Basic test to check for compatible version and correct linking |
| 623 | # *does not* test for RSA - that comes later. |
| 624 | AC_TRY_RUN( |
| 625 | [ |
Damien Miller | e59ce62 | 2000-05-01 20:54:17 +1000 | [diff] [blame] | 626 | #include <string.h> |
| 627 | #include <openssl/rand.h> |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 628 | int main(void) |
| 629 | { |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 630 | char a[2048]; |
| 631 | memset(a, 0, sizeof(a)); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 632 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 633 | return(RAND_status() <= 0); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 634 | } |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 635 | ], |
| 636 | [ |
| 637 | found_crypto=1 |
| 638 | break; |
| 639 | ], [] |
| 640 | ) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 641 | |
| 642 | if test ! -z "$found_crypto" ; then |
| 643 | break; |
| 644 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 645 | done |
| 646 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 647 | if test -z "$found_crypto" ; then |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 648 | AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log]) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 649 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 650 | if test -z "$ssldir" ; then |
| 651 | ssldir="(system)" |
| 652 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 653 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 654 | ac_cv_openssldir=$ssldir |
| 655 | ]) |
| 656 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 657 | if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 658 | AC_DEFINE(HAVE_OPENSSL) |
| 659 | dnl Need to recover ssldir - test above runs in subshell |
| 660 | ssldir=$ac_cv_openssldir |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 661 | if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 662 | # Try to use $ssldir/lib if it exists, otherwise |
| 663 | # $ssldir |
| 664 | if test -d "$ssldir/lib" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 665 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 666 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 667 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 668 | fi |
| 669 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 670 | LDFLAGS="-L$ssldir $saved_LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 671 | if test ! -z "$need_dash_r" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 672 | LDFLAGS="-R$ssldir $LDFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 673 | fi |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 674 | fi |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 675 | # Try to use $ssldir/include if it exists, otherwise |
| 676 | # $ssldir |
| 677 | if test -d "$ssldir/include" ; then |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 678 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
Damien Miller | ccdefb6 | 2001-02-19 12:56:39 +1100 | [diff] [blame] | 679 | else |
Damien Miller | b68af62 | 2001-03-28 21:05:26 +1000 | [diff] [blame] | 680 | CPPFLAGS="-I$ssldir $saved_CPPFLAGS" |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 681 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 682 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 683 | fi |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 684 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 685 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 686 | # Now test RSA support |
| 687 | saved_LIBS="$LIBS" |
| 688 | AC_MSG_CHECKING([for RSA support]) |
| 689 | for WANTS_RSAREF in "" 1 ; do |
| 690 | if test -z "$WANTS_RSAREF" ; then |
| 691 | LIBS="$saved_LIBS" |
| 692 | else |
| 693 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 694 | fi |
| 695 | AC_TRY_RUN([ |
| 696 | #include <string.h> |
| 697 | #include <openssl/rand.h> |
| 698 | #include <openssl/rsa.h> |
| 699 | #include <openssl/bn.h> |
| 700 | #include <openssl/sha.h> |
| 701 | int main(void) |
| 702 | { |
| 703 | int num; RSA *key; static unsigned char p_in[] = "blahblah"; |
| 704 | unsigned char c[256], p[256]; |
| 705 | memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); |
| 706 | if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); |
| 707 | num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); |
| 708 | return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); |
| 709 | } |
| 710 | ], |
| 711 | [ |
| 712 | rsa_works=1 |
| 713 | break; |
| 714 | ], []) |
| 715 | done |
Ben Lindstrom | 23fec14 | 2001-06-09 02:16:28 +0000 | [diff] [blame] | 716 | LIBS="$saved_LIBS" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 717 | |
| 718 | if test ! -z "$no_rsa" ; then |
| 719 | AC_MSG_RESULT(disabled) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 720 | RSA_MSG="disabled" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 721 | else |
| 722 | if test -z "$rsa_works" ; then |
| 723 | AC_MSG_WARN([*** No RSA support found *** ]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 724 | RSA_MSG="no" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 725 | else |
| 726 | if test -z "$WANTS_RSAREF" ; then |
| 727 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 728 | RSA_MSG="yes" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 729 | else |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 730 | RSA_MSG="yes (using RSAref)" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 731 | AC_MSG_RESULT(using RSAref) |
Ben Lindstrom | 23fec14 | 2001-06-09 02:16:28 +0000 | [diff] [blame] | 732 | LIBS="$LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 733 | fi |
| 734 | fi |
| 735 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 736 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 737 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 738 | # version in OpenSSL. Skip this for PAM |
| 739 | if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then |
Damien Miller | 95aa2d6 | 2001-03-01 09:16:11 +1100 | [diff] [blame] | 740 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 741 | fi |
| 742 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 743 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 744 | if test ! -z "$SONY" ; then |
| 745 | LIBS="$LIBS -liberty"; |
| 746 | fi |
| 747 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 748 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 749 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 750 | AC_CHECK_SIZEOF(short int, 2) |
| 751 | AC_CHECK_SIZEOF(int, 4) |
| 752 | AC_CHECK_SIZEOF(long int, 4) |
| 753 | AC_CHECK_SIZEOF(long long int, 8) |
| 754 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 755 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 756 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 757 | AC_TRY_COMPILE( |
| 758 | [ #include <sys/types.h> ], |
| 759 | [ u_int a; a = 1;], |
| 760 | [ ac_cv_have_u_int="yes" ], |
| 761 | [ ac_cv_have_u_int="no" ] |
| 762 | ) |
| 763 | ]) |
| 764 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 765 | AC_DEFINE(HAVE_U_INT) |
| 766 | have_u_int=1 |
| 767 | fi |
| 768 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 769 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 770 | AC_TRY_COMPILE( |
| 771 | [ #include <sys/types.h> ], |
| 772 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 773 | [ ac_cv_have_intxx_t="yes" ], |
| 774 | [ ac_cv_have_intxx_t="no" ] |
| 775 | ) |
| 776 | ]) |
| 777 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 778 | AC_DEFINE(HAVE_INTXX_T) |
| 779 | have_intxx_t=1 |
| 780 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 781 | |
| 782 | if (test -z "$have_intxx_t" && \ |
| 783 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 784 | then |
| 785 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
| 786 | AC_TRY_COMPILE( |
| 787 | [ #include <stdint.h> ], |
| 788 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 789 | [ |
| 790 | AC_DEFINE(HAVE_INTXX_T) |
| 791 | AC_MSG_RESULT(yes) |
| 792 | ], |
| 793 | [ AC_MSG_RESULT(no) ] |
| 794 | ) |
| 795 | fi |
| 796 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 797 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 798 | AC_TRY_COMPILE( |
| 799 | [ #include <sys/types.h> ], |
| 800 | [ int64_t a; a = 1;], |
| 801 | [ ac_cv_have_int64_t="yes" ], |
| 802 | [ ac_cv_have_int64_t="no" ] |
| 803 | ) |
| 804 | ]) |
| 805 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 806 | AC_DEFINE(HAVE_INT64_T) |
| 807 | have_int64_t=1 |
| 808 | fi |
| 809 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 810 | if test -z "$have_int64_t" ; then |
| 811 | AC_MSG_CHECKING([for int64_t type in sys/socket.h]) |
| 812 | AC_TRY_COMPILE( |
| 813 | [ #include <sys/socket.h> ], |
| 814 | [ int64_t a; a = 1], |
| 815 | [ |
| 816 | AC_DEFINE(HAVE_INT64_T) |
| 817 | AC_MSG_RESULT(yes) |
| 818 | ], |
| 819 | [ AC_MSG_RESULT(no) ] |
| 820 | ) |
| 821 | fi |
| 822 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 823 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 824 | AC_TRY_COMPILE( |
| 825 | [ #include <sys/types.h> ], |
| 826 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 827 | [ ac_cv_have_u_intxx_t="yes" ], |
| 828 | [ ac_cv_have_u_intxx_t="no" ] |
| 829 | ) |
| 830 | ]) |
| 831 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 832 | AC_DEFINE(HAVE_U_INTXX_T) |
| 833 | have_u_intxx_t=1 |
| 834 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 835 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 836 | if test -z "$have_u_intxx_t" ; then |
| 837 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
| 838 | AC_TRY_COMPILE( |
| 839 | [ #include <sys/socket.h> ], |
| 840 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 841 | [ |
| 842 | AC_DEFINE(HAVE_U_INTXX_T) |
| 843 | AC_MSG_RESULT(yes) |
| 844 | ], |
| 845 | [ AC_MSG_RESULT(no) ] |
| 846 | ) |
| 847 | fi |
| 848 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 849 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 850 | AC_TRY_COMPILE( |
| 851 | [ #include <sys/types.h> ], |
| 852 | [ u_int64_t a; a = 1;], |
| 853 | [ ac_cv_have_u_int64_t="yes" ], |
| 854 | [ ac_cv_have_u_int64_t="no" ] |
| 855 | ) |
| 856 | ]) |
| 857 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 858 | AC_DEFINE(HAVE_U_INT64_T) |
| 859 | have_u_int64_t=1 |
| 860 | fi |
| 861 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 862 | if test -z "$have_u_intxx_t" ; then |
| 863 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 864 | AC_TRY_COMPILE( |
| 865 | [ |
| 866 | #include <sys/types.h> |
| 867 | ], |
| 868 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 869 | [ ac_cv_have_uintxx_t="yes" ], |
| 870 | [ ac_cv_have_uintxx_t="no" ] |
| 871 | ) |
| 872 | ]) |
| 873 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 874 | AC_DEFINE(HAVE_UINTXX_T) |
| 875 | fi |
| 876 | fi |
| 877 | |
| 878 | if test -z "$have_uintxx_t" ; then |
| 879 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
| 880 | AC_TRY_COMPILE( |
| 881 | [ #include <stdint.h> ], |
| 882 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
| 883 | [ |
| 884 | AC_DEFINE(HAVE_UINTXX_T) |
| 885 | AC_MSG_RESULT(yes) |
| 886 | ], |
| 887 | [ AC_MSG_RESULT(no) ] |
| 888 | ) |
| 889 | fi |
| 890 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 891 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 892 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 893 | then |
| 894 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 895 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 896 | [ |
| 897 | #include <sys/bitypes.h> |
| 898 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 899 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 900 | int8_t a; int16_t b; int32_t c; |
| 901 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 902 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 903 | ], |
| 904 | [ |
| 905 | AC_DEFINE(HAVE_U_INTXX_T) |
| 906 | AC_DEFINE(HAVE_INTXX_T) |
| 907 | AC_MSG_RESULT(yes) |
| 908 | ], |
| 909 | [AC_MSG_RESULT(no)] |
| 910 | ) |
| 911 | fi |
| 912 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 913 | AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [ |
| 914 | AC_TRY_COMPILE( |
| 915 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 916 | #include <sys/types.h> |
| 917 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 918 | ], |
| 919 | [socklen_t foo; foo = 1235;], |
| 920 | [ ac_cv_have_socklen_t="yes" ], |
| 921 | [ ac_cv_have_socklen_t="no" ] |
| 922 | ) |
| 923 | ]) |
| 924 | if test "x$ac_cv_have_socklen_t" = "xyes" ; then |
| 925 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 926 | fi |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 927 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 928 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 929 | AC_TRY_COMPILE( |
| 930 | [ |
| 931 | #include <sys/types.h> |
| 932 | ], |
| 933 | [ size_t foo; foo = 1235; ], |
| 934 | [ ac_cv_have_size_t="yes" ], |
| 935 | [ ac_cv_have_size_t="no" ] |
| 936 | ) |
| 937 | ]) |
| 938 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 939 | AC_DEFINE(HAVE_SIZE_T) |
| 940 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 941 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 942 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 943 | AC_TRY_COMPILE( |
| 944 | [ |
| 945 | #include <sys/types.h> |
| 946 | ], |
| 947 | [ ssize_t foo; foo = 1235; ], |
| 948 | [ ac_cv_have_ssize_t="yes" ], |
| 949 | [ ac_cv_have_ssize_t="no" ] |
| 950 | ) |
| 951 | ]) |
| 952 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 953 | AC_DEFINE(HAVE_SSIZE_T) |
| 954 | fi |
| 955 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 956 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 957 | AC_TRY_COMPILE( |
| 958 | [ |
| 959 | #include <time.h> |
| 960 | ], |
| 961 | [ clock_t foo; foo = 1235; ], |
| 962 | [ ac_cv_have_clock_t="yes" ], |
| 963 | [ ac_cv_have_clock_t="no" ] |
| 964 | ) |
| 965 | ]) |
| 966 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
| 967 | AC_DEFINE(HAVE_CLOCK_T) |
| 968 | fi |
| 969 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 970 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 971 | AC_TRY_COMPILE( |
| 972 | [ |
| 973 | #include <sys/types.h> |
| 974 | #include <sys/socket.h> |
| 975 | ], |
| 976 | [ sa_family_t foo; foo = 1235; ], |
| 977 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 978 | [ AC_TRY_COMPILE( |
| 979 | [ |
| 980 | #include <sys/types.h> |
| 981 | #include <sys/socket.h> |
| 982 | #include <netinet/in.h> |
| 983 | ], |
| 984 | [ sa_family_t foo; foo = 1235; ], |
| 985 | [ ac_cv_have_sa_family_t="yes" ], |
| 986 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 987 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 988 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 989 | ) |
| 990 | ]) |
| 991 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 992 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 993 | fi |
| 994 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 995 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 996 | AC_TRY_COMPILE( |
| 997 | [ |
| 998 | #include <sys/types.h> |
| 999 | ], |
| 1000 | [ pid_t foo; foo = 1235; ], |
| 1001 | [ ac_cv_have_pid_t="yes" ], |
| 1002 | [ ac_cv_have_pid_t="no" ] |
| 1003 | ) |
| 1004 | ]) |
| 1005 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 1006 | AC_DEFINE(HAVE_PID_T) |
| 1007 | fi |
| 1008 | |
| 1009 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 1010 | AC_TRY_COMPILE( |
| 1011 | [ |
| 1012 | #include <sys/types.h> |
| 1013 | ], |
| 1014 | [ mode_t foo; foo = 1235; ], |
| 1015 | [ ac_cv_have_mode_t="yes" ], |
| 1016 | [ ac_cv_have_mode_t="no" ] |
| 1017 | ) |
| 1018 | ]) |
| 1019 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 1020 | AC_DEFINE(HAVE_MODE_T) |
| 1021 | fi |
| 1022 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1023 | |
| 1024 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 1025 | AC_TRY_COMPILE( |
| 1026 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1027 | #include <sys/types.h> |
| 1028 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1029 | ], |
| 1030 | [ struct sockaddr_storage s; ], |
| 1031 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 1032 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 1033 | ) |
| 1034 | ]) |
| 1035 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 1036 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 1037 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1038 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1039 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 1040 | AC_TRY_COMPILE( |
| 1041 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1042 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1043 | #include <netinet/in.h> |
| 1044 | ], |
| 1045 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 1046 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 1047 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 1048 | ) |
| 1049 | ]) |
| 1050 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 1051 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 1052 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1053 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1054 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 1055 | AC_TRY_COMPILE( |
| 1056 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1057 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1058 | #include <netinet/in.h> |
| 1059 | ], |
| 1060 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 1061 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 1062 | [ ac_cv_have_struct_in6_addr="no" ] |
| 1063 | ) |
| 1064 | ]) |
| 1065 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 1066 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 1067 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1068 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1069 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 1070 | AC_TRY_COMPILE( |
| 1071 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1072 | #include <sys/types.h> |
| 1073 | #include <sys/socket.h> |
| 1074 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1075 | ], |
| 1076 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 1077 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 1078 | [ ac_cv_have_struct_addrinfo="no" ] |
| 1079 | ) |
| 1080 | ]) |
| 1081 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 1082 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 1083 | fi |
| 1084 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1085 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 1086 | AC_TRY_COMPILE( |
| 1087 | [ #include <sys/time.h> ], |
| 1088 | [ struct timeval tv; tv.tv_sec = 1;], |
| 1089 | [ ac_cv_have_struct_timeval="yes" ], |
| 1090 | [ ac_cv_have_struct_timeval="no" ] |
| 1091 | ) |
| 1092 | ]) |
| 1093 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
| 1094 | AC_DEFINE(HAVE_STRUCT_TIMEVAL) |
| 1095 | have_struct_timeval=1 |
| 1096 | fi |
| 1097 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1098 | # If we don't have int64_t then we can't compile sftp-server. So don't |
| 1099 | # even attempt to do it. |
| 1100 | if test "x$ac_cv_have_int64_t" = "xno" -a \ |
| 1101 | "x$ac_cv_sizeof_long_int" != "x8" -a \ |
| 1102 | "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
| 1103 | NO_SFTP='#' |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1104 | else |
| 1105 | dnl test snprintf (broken on SCO w/gcc) |
| 1106 | AC_TRY_RUN( |
| 1107 | [ |
| 1108 | #include <stdio.h> |
| 1109 | #include <string.h> |
| 1110 | #ifdef HAVE_SNPRINTF |
| 1111 | main() |
| 1112 | { |
| 1113 | char buf[50]; |
| 1114 | char expected_out[50]; |
| 1115 | int mazsize = 50 ; |
| 1116 | #if (SIZEOF_LONG_INT == 8) |
| 1117 | long int num = 0x7fffffffffffffff; |
| 1118 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 1119 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1120 | #endif |
| 1121 | strcpy(expected_out, "9223372036854775807"); |
| 1122 | snprintf(buf, mazsize, "%lld", num); |
| 1123 | if(strcmp(buf, expected_out) != 0) |
| 1124 | exit(1); |
| 1125 | exit(0); |
| 1126 | } |
| 1127 | #else |
| 1128 | main() { exit(0); } |
| 1129 | #endif |
| 1130 | ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] |
| 1131 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1132 | fi |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1133 | AC_SUBST(NO_SFTP) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1134 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1135 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1136 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 1137 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 1138 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 1139 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 1140 | 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] | 1141 | 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] | 1142 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 1143 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) |
Damien Miller | 8e81ed3 | 2000-07-01 13:17:42 +1000 | [diff] [blame] | 1144 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1145 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 1146 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 1147 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 1148 | 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] | 1149 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 1150 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 1151 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 1152 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1153 | AC_STRUCT_ST_BLKSIZE |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1154 | |
Damien Miller | 942da03 | 2000-08-18 13:59:06 +1000 | [diff] [blame] | 1155 | AC_CACHE_CHECK([for sun_len field in struct sockaddr_un], |
| 1156 | ac_cv_have_sun_len_in_struct_sockaddr_un, [ |
| 1157 | AC_TRY_COMPILE( |
| 1158 | [ |
| 1159 | #include <sys/types.h> |
| 1160 | #include <sys/socket.h> |
| 1161 | ], |
| 1162 | [ struct sockaddr_un s; s.sun_len = 1; ], |
| 1163 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ], |
| 1164 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ], |
| 1165 | ) |
| 1166 | ]) |
| 1167 | if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then |
| 1168 | AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN) |
| 1169 | fi |
| 1170 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1171 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 1172 | ac_cv_have_ss_family_in_struct_ss, [ |
| 1173 | AC_TRY_COMPILE( |
| 1174 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1175 | #include <sys/types.h> |
| 1176 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1177 | ], |
| 1178 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 1179 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 1180 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 1181 | ) |
| 1182 | ]) |
| 1183 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 1184 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 1185 | fi |
| 1186 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1187 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 1188 | ac_cv_have___ss_family_in_struct_ss, [ |
| 1189 | AC_TRY_COMPILE( |
| 1190 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1191 | #include <sys/types.h> |
| 1192 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1193 | ], |
| 1194 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 1195 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 1196 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 1197 | ) |
| 1198 | ]) |
| 1199 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 1200 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 1201 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 1202 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1203 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 1204 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 1205 | AC_TRY_COMPILE( |
| 1206 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1207 | #include <pwd.h> |
| 1208 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 1209 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1210 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 1211 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 1212 | ) |
| 1213 | ]) |
| 1214 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 1215 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 1216 | fi |
| 1217 | |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 1218 | AC_CACHE_CHECK([for pw_expire field in struct passwd], |
| 1219 | ac_cv_have_pw_expire_in_struct_passwd, [ |
| 1220 | AC_TRY_COMPILE( |
| 1221 | [ |
| 1222 | #include <pwd.h> |
| 1223 | ], |
| 1224 | [ struct passwd p; p.pw_expire = 0; ], |
| 1225 | [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], |
| 1226 | [ ac_cv_have_pw_expire_in_struct_passwd="no" ] |
| 1227 | ) |
| 1228 | ]) |
| 1229 | if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then |
| 1230 | AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD) |
| 1231 | fi |
| 1232 | |
| 1233 | AC_CACHE_CHECK([for pw_change field in struct passwd], |
| 1234 | ac_cv_have_pw_change_in_struct_passwd, [ |
| 1235 | AC_TRY_COMPILE( |
| 1236 | [ |
| 1237 | #include <pwd.h> |
| 1238 | ], |
| 1239 | [ struct passwd p; p.pw_change = 0; ], |
| 1240 | [ ac_cv_have_pw_change_in_struct_passwd="yes" ], |
| 1241 | [ ac_cv_have_pw_change_in_struct_passwd="no" ] |
| 1242 | ) |
| 1243 | ]) |
| 1244 | if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then |
| 1245 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) |
| 1246 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1247 | |
| 1248 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 1249 | AC_TRY_LINK([], |
| 1250 | [ extern char *__progname; printf("%s", __progname); ], |
| 1251 | [ ac_cv_libc_defines___progname="yes" ], |
| 1252 | [ ac_cv_libc_defines___progname="no" ] |
| 1253 | ) |
| 1254 | ]) |
| 1255 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 1256 | AC_DEFINE(HAVE___PROGNAME) |
| 1257 | fi |
| 1258 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 1259 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 1260 | ac_cv_have_getopt_optreset, [ |
| 1261 | AC_TRY_LINK( |
| 1262 | [ |
| 1263 | #include <getopt.h> |
| 1264 | ], |
| 1265 | [ extern int optreset; optreset = 0; ], |
| 1266 | [ ac_cv_have_getopt_optreset="yes" ], |
| 1267 | [ ac_cv_have_getopt_optreset="no" ] |
| 1268 | ) |
| 1269 | ]) |
| 1270 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
| 1271 | AC_DEFINE(HAVE_GETOPT_OPTRESET) |
| 1272 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1273 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 1274 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 1275 | AC_TRY_LINK([], |
| 1276 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 1277 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 1278 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 1279 | ) |
| 1280 | ]) |
| 1281 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 1282 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 1283 | fi |
| 1284 | |
| 1285 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 1286 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
| 1287 | AC_TRY_LINK([], |
| 1288 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
| 1289 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 1290 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 1291 | ) |
| 1292 | ]) |
| 1293 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 1294 | AC_DEFINE(HAVE_SYS_NERR) |
| 1295 | fi |
| 1296 | |
| 1297 | |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1298 | # Check whether user wants Kerberos support |
| 1299 | KRB4_MSG="no" |
| 1300 | AC_ARG_WITH(kerberos4, |
| 1301 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
| 1302 | [ |
| 1303 | if test "x$withval" != "xno" ; then |
| 1304 | |
| 1305 | if test "x$withval" != "xyes" ; then |
| 1306 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1307 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1308 | if test ! -z "$need_dash_r" ; then |
| 1309 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 1310 | fi |
| 1311 | if test ! -z "$blibpath" ; then |
| 1312 | blibpath="$blibpath:${withval}/lib" |
| 1313 | fi |
| 1314 | else |
| 1315 | if test -d /usr/include/kerberosIV ; then |
| 1316 | CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV" |
| 1317 | fi |
| 1318 | fi |
| 1319 | |
| 1320 | AC_CHECK_HEADERS(krb.h) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1321 | if test "$ac_cv_header_krb_h" != yes; then |
| 1322 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 1323 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1324 | AC_CHECK_LIB(krb, main) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1325 | if test "$ac_cv_lib_krb_main" != yes; then |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1326 | AC_CHECK_LIB(krb4, main) |
| 1327 | if test "$ac_cv_lib_krb4_main" != yes; then |
| 1328 | AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail]) |
| 1329 | else |
| 1330 | KLIBS="-lkrb4" |
| 1331 | fi |
| 1332 | else |
| 1333 | KLIBS="-lkrb" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1334 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1335 | AC_CHECK_LIB(des, des_cbc_encrypt) |
| 1336 | if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then |
| 1337 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
| 1338 | if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then |
| 1339 | AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail]) |
| 1340 | else |
| 1341 | KLIBS="-ldes425" |
| 1342 | fi |
| 1343 | else |
| 1344 | KLIBS="-ldes" |
| 1345 | fi |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1346 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1347 | KRB4=yes |
| 1348 | KRB4_MSG="yes" |
| 1349 | AC_DEFINE(KRB4) |
| 1350 | fi |
| 1351 | ] |
| 1352 | ) |
| 1353 | |
| 1354 | # Check whether user wants AFS support |
| 1355 | AFS_MSG="no" |
| 1356 | AC_ARG_WITH(afs, |
| 1357 | [ --with-afs=PATH Enable AFS support], |
| 1358 | [ |
| 1359 | if test "x$withval" != "xno" ; then |
| 1360 | |
| 1361 | if test "x$withval" != "xyes" ; then |
| 1362 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1363 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1364 | fi |
| 1365 | |
| 1366 | if test -z "$KRB4" ; then |
| 1367 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 1368 | fi |
| 1369 | |
| 1370 | LIBS="-lkafs $LIBS" |
| 1371 | if test ! -z "$AFS_LIBS" ; then |
| 1372 | LIBS="$LIBS $AFS_LIBS" |
| 1373 | fi |
| 1374 | AC_DEFINE(AFS) |
| 1375 | AFS_MSG="yes" |
| 1376 | fi |
| 1377 | ] |
| 1378 | ) |
| 1379 | LIBS="$LIBS $KLIBS" |
| 1380 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1381 | # Looking for programs, paths and files |
| 1382 | AC_ARG_WITH(rsh, |
| 1383 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 1384 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1385 | if test "x$withval" != "$no" ; then |
Damien Miller | 90dcc05 | 2000-07-08 10:17:40 +1000 | [diff] [blame] | 1386 | rsh_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1387 | fi |
| 1388 | ], |
| 1389 | [ |
| 1390 | AC_PATH_PROG(rsh_path, rsh) |
| 1391 | ] |
| 1392 | ) |
| 1393 | |
| 1394 | AC_ARG_WITH(xauth, |
| 1395 | [ --with-xauth=PATH Specify path to xauth program ], |
| 1396 | [ |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 1397 | if test "x$withval" != "xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1398 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1399 | fi |
| 1400 | ], |
| 1401 | [ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1402 | AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1403 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1404 | xauth_path="/usr/openwin/bin/xauth" |
| 1405 | fi |
| 1406 | ] |
| 1407 | ) |
| 1408 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1409 | if test -z "$xauth_path" ; then |
| 1410 | XAUTH_PATH="undefined" |
| 1411 | AC_SUBST(XAUTH_PATH) |
| 1412 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1413 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1414 | XAUTH_PATH=$xauth_path |
| 1415 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1416 | fi |
| 1417 | if test ! -z "$rsh_path" ; then |
| 1418 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 1419 | fi |
| 1420 | |
| 1421 | # Check for mail directory (last resort if we cannot get it from headers) |
| 1422 | if test ! -z "$MAIL" ; then |
| 1423 | maildir=`dirname $MAIL` |
| 1424 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 1425 | fi |
| 1426 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1427 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1428 | AC_CHECK_FILE("/dev/ptmx", |
| 1429 | [ |
| 1430 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 1431 | have_dev_ptmx=1 |
| 1432 | ] |
| 1433 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1434 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1435 | AC_CHECK_FILE("/dev/ptc", |
| 1436 | [ |
| 1437 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 1438 | have_dev_ptc=1 |
| 1439 | ] |
| 1440 | ) |
| 1441 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1442 | # Options from here on. Some of these are preset by platform above |
| 1443 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1444 | # Check for user-specified random device, otherwise check /dev/urandom |
| 1445 | AC_ARG_WITH(random, |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1446 | [ --with-random=FILE read entropy from FILE (default=/dev/urandom)], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1447 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1448 | if test "x$withval" != "xno" ; then |
| 1449 | RANDOM_POOL="$withval"; |
| 1450 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 1451 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1452 | ], |
| 1453 | [ |
| 1454 | # Check for random device |
| 1455 | AC_CHECK_FILE("/dev/urandom", |
| 1456 | [ |
| 1457 | RANDOM_POOL="/dev/urandom"; |
| 1458 | AC_SUBST(RANDOM_POOL) |
| 1459 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 1460 | ] |
| 1461 | ) |
| 1462 | ] |
| 1463 | ) |
| 1464 | |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1465 | # Check for PRNGD/EGD pool file |
| 1466 | AC_ARG_WITH(prngd-port, |
| 1467 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT], |
| 1468 | [ |
| 1469 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
| 1470 | PRNGD_PORT="$withval" |
| 1471 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT) |
| 1472 | fi |
| 1473 | ] |
| 1474 | ) |
| 1475 | |
| 1476 | # Check for PRNGD/EGD pool file |
| 1477 | AC_ARG_WITH(prngd-socket, |
| 1478 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1479 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1480 | if test "x$withval" != "xno" ; then |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1481 | PRNGD_SOCKET="$withval" |
| 1482 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1483 | fi |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1484 | ], |
| 1485 | [ |
| 1486 | # Check for existing socket only if we don't have a random device already |
| 1487 | if test -z "$RANDOM_POOL" ; then |
| 1488 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 1489 | # Insert other locations here |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1490 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1491 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 1492 | PRNGD_SOCKET="$sock" |
| 1493 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1494 | break; |
| 1495 | fi |
| 1496 | done |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1497 | if test ! -z "$PRNGD_SOCKET" ; then |
| 1498 | AC_MSG_RESULT($PRNGD_SOCKET) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 1499 | else |
| 1500 | AC_MSG_RESULT(not found) |
| 1501 | fi |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1502 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1503 | ] |
| 1504 | ) |
| 1505 | |
Damien Miller | 0736c4d | 2001-01-25 10:51:46 +1100 | [diff] [blame] | 1506 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1507 | # detect pathnames for entropy gathering commands, if we need them |
| 1508 | INSTALL_SSH_PRNG_CMDS="" |
| 1509 | rm -f prng_commands |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 1510 | if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1511 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1512 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 1513 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 1514 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 1515 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1516 | OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1517 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
Ben Lindstrom | 6db66ff | 2001-08-06 23:29:16 +0000 | [diff] [blame] | 1518 | OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1519 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 1520 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 1521 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 1522 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 1523 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 1524 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 1525 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 1526 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 1527 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1528 | |
| 1529 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1530 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1531 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 1532 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1533 | |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 1534 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1535 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1536 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1537 | case "$withval" in |
| 1538 | man|cat|doc) |
| 1539 | MANTYPE=$withval |
| 1540 | ;; |
| 1541 | *) |
| 1542 | AC_MSG_ERROR(invalid man type: $withval) |
| 1543 | ;; |
| 1544 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1545 | ] |
| 1546 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1547 | if test -z "$MANTYPE"; then |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1548 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1549 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1550 | MANTYPE=doc |
| 1551 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 1552 | MANTYPE=man |
| 1553 | else |
| 1554 | MANTYPE=cat |
| 1555 | fi |
| 1556 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1557 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1558 | if test "$MANTYPE" = "doc"; then |
| 1559 | mansubdir=man; |
| 1560 | else |
| 1561 | mansubdir=$MANTYPE; |
| 1562 | fi |
| 1563 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1564 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1565 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1566 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 1567 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1568 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1569 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1570 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1571 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1572 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1573 | fi |
| 1574 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1575 | ) |
| 1576 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1577 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1578 | AC_ARG_WITH(shadow, |
| 1579 | [ --without-shadow Disable shadow password support], |
| 1580 | [ |
| 1581 | if test "x$withval" = "xno" ; then |
| 1582 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1583 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1584 | fi |
| 1585 | ] |
| 1586 | ) |
| 1587 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1588 | if test -z "$disable_shadow" ; then |
| 1589 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 1590 | AC_TRY_COMPILE( |
| 1591 | [ |
| 1592 | #include <sys/types.h> |
| 1593 | #include <shadow.h> |
| 1594 | struct spwd sp; |
| 1595 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 1596 | [ sp_expire_available=yes ], [] |
| 1597 | ) |
| 1598 | |
| 1599 | if test "x$sp_expire_available" = "xyes" ; then |
| 1600 | AC_MSG_RESULT(yes) |
| 1601 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 1602 | else |
| 1603 | AC_MSG_RESULT(no) |
| 1604 | fi |
| 1605 | fi |
| 1606 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1607 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 1608 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 1609 | DISPLAY_HACK_MSG="yes" |
| 1610 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1611 | else |
| 1612 | DISPLAY_HACK_MSG="no" |
| 1613 | AC_ARG_WITH(ipaddr-display, |
| 1614 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1615 | [ |
| 1616 | if test "x$withval" != "xno" ; then |
| 1617 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1618 | DISPLAY_HACK_MSG="yes" |
| 1619 | fi |
| 1620 | ] |
| 1621 | ) |
| 1622 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1623 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1624 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1625 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1626 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1627 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 1628 | [ |
| 1629 | if test "x$withval" != "xno" ; then |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1630 | user_path="$withval" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1631 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1632 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1633 | ], |
| 1634 | [ |
| 1635 | AC_TRY_RUN( |
| 1636 | [ |
| 1637 | /* find out what STDPATH is */ |
| 1638 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1639 | #ifdef HAVE_PATHS_H |
| 1640 | # include <paths.h> |
| 1641 | #endif |
| 1642 | #ifndef _PATH_STDPATH |
| 1643 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 1644 | #endif |
| 1645 | #include <sys/types.h> |
| 1646 | #include <sys/stat.h> |
| 1647 | #include <fcntl.h> |
| 1648 | #define DATA "conftest.stdpath" |
| 1649 | |
| 1650 | main() |
| 1651 | { |
| 1652 | FILE *fd; |
| 1653 | int rc; |
| 1654 | |
| 1655 | fd = fopen(DATA,"w"); |
| 1656 | if(fd == NULL) |
| 1657 | exit(1); |
| 1658 | |
| 1659 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 1660 | exit(1); |
| 1661 | |
| 1662 | exit(0); |
| 1663 | } |
| 1664 | ], [ user_path=`cat conftest.stdpath` ], |
| 1665 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 1666 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 1667 | ) |
| 1668 | # make sure $bindir is in USER_PATH so scp will work |
| 1669 | t_bindir=`eval echo ${bindir}` |
| 1670 | case $t_bindir in |
| 1671 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 1672 | esac |
| 1673 | case $t_bindir in |
| 1674 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 1675 | esac |
| 1676 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 1677 | if test $? -ne 0 ; then |
| 1678 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 1679 | if test $? -ne 0 ; then |
| 1680 | user_path=$user_path:$t_bindir |
| 1681 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 1682 | fi |
| 1683 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1684 | ] |
| 1685 | ) |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 1686 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") |
| 1687 | AC_SUBST(user_path) |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1688 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1689 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1690 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1691 | AC_ARG_WITH(ipv4-default, |
| 1692 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 1693 | [ |
| 1694 | if test "x$withval" != "xno" ; then |
| 1695 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1696 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1697 | fi |
| 1698 | ] |
| 1699 | ) |
| 1700 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1701 | AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1702 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1703 | AC_ARG_WITH(4in6, |
| 1704 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 1705 | [ |
| 1706 | if test "x$withval" != "xno" ; then |
| 1707 | AC_MSG_RESULT(yes) |
| 1708 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1709 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1710 | else |
| 1711 | AC_MSG_RESULT(no) |
| 1712 | fi |
| 1713 | ],[ |
| 1714 | if test "x$inet6_default_4in6" = "xyes"; then |
| 1715 | AC_MSG_RESULT([yes (default)]) |
| 1716 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1717 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1718 | else |
| 1719 | AC_MSG_RESULT([no (default)]) |
| 1720 | fi |
| 1721 | ] |
| 1722 | ) |
| 1723 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 1724 | # Whether to enable BSD auth support |
| 1725 | AC_ARG_WITH(bsd-auth, |
| 1726 | [ --with-bsd-auth Enable BSD auth support], |
| 1727 | [ |
| 1728 | if test "x$withval" != "xno" ; then |
| 1729 | AC_DEFINE(BSD_AUTH) |
| 1730 | bsd_auth=yes |
| 1731 | fi |
| 1732 | ] |
| 1733 | ) |
| 1734 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1735 | AC_MSG_CHECKING(whether to install ssh as suid root) |
| 1736 | AC_ARG_ENABLE(suid-ssh, |
| 1737 | [ --enable-suid-ssh Install ssh as suid root (default) |
| 1738 | --disable-suid-ssh Install ssh without suid bit], |
| 1739 | [ case "$enableval" in |
| 1740 | no) |
| 1741 | AC_MSG_RESULT(no) |
| 1742 | SSHMODE=0711 |
| 1743 | ;; |
| 1744 | *) AC_MSG_RESULT(yes) |
Ben Lindstrom | 8e2aa5b | 2001-07-24 17:00:13 +0000 | [diff] [blame] | 1745 | SSHMODE=4711 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1746 | ;; |
| 1747 | esac ], |
| 1748 | AC_MSG_RESULT(yes) |
Ben Lindstrom | 8e2aa5b | 2001-07-24 17:00:13 +0000 | [diff] [blame] | 1749 | SSHMODE=4711 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1750 | ) |
| 1751 | AC_SUBST(SSHMODE) |
| 1752 | |
| 1753 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1754 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1755 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1756 | AC_ARG_WITH(pid-dir, |
| 1757 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 1758 | [ |
| 1759 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1760 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1761 | fi |
| 1762 | ] |
| 1763 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1764 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1765 | # make sure the directory exists |
| 1766 | if test ! -d $piddir ; then |
| 1767 | piddir=`eval echo ${sysconfdir}` |
| 1768 | case $piddir in |
| 1769 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 1770 | esac |
| 1771 | fi |
| 1772 | |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 1773 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1774 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1775 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1776 | dnl allow user to disable some login recording features |
| 1777 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1778 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1779 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 1780 | ) |
| 1781 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1782 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1783 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 1784 | ) |
| 1785 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1786 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1787 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 1788 | ) |
| 1789 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1790 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1791 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 1792 | ) |
| 1793 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1794 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1795 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 1796 | ) |
| 1797 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1798 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1799 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 1800 | ) |
| 1801 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1802 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1803 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 1804 | ) |
| 1805 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1806 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1807 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 1808 | ) |
| 1809 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1810 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 1811 | [ |
| 1812 | if test "x$withval" = "xno" ; then |
| 1813 | AC_DEFINE(DISABLE_LASTLOG) |
| 1814 | else |
| 1815 | conf_lastlog_location=$withval |
| 1816 | fi |
| 1817 | ] |
| 1818 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1819 | |
| 1820 | dnl lastlog, [uw]tmpx? detection |
| 1821 | dnl NOTE: set the paths in the platform section to avoid the |
| 1822 | dnl need for command-line parameters |
| 1823 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 1824 | |
| 1825 | dnl lastlog detection |
| 1826 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 1827 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 1828 | AC_TRY_COMPILE([ |
| 1829 | #include <sys/types.h> |
| 1830 | #include <utmp.h> |
| 1831 | #ifdef HAVE_LASTLOG_H |
| 1832 | # include <lastlog.h> |
| 1833 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1834 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1835 | # include <paths.h> |
| 1836 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1837 | #ifdef HAVE_LOGIN_H |
| 1838 | # include <login.h> |
| 1839 | #endif |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1840 | ], |
| 1841 | [ char *lastlog = LASTLOG_FILE; ], |
| 1842 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1843 | [ |
| 1844 | AC_MSG_RESULT(no) |
| 1845 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 1846 | AC_TRY_COMPILE([ |
| 1847 | #include <sys/types.h> |
| 1848 | #include <utmp.h> |
| 1849 | #ifdef HAVE_LASTLOG_H |
| 1850 | # include <lastlog.h> |
| 1851 | #endif |
| 1852 | #ifdef HAVE_PATHS_H |
| 1853 | # include <paths.h> |
| 1854 | #endif |
| 1855 | ], |
| 1856 | [ char *lastlog = _PATH_LASTLOG; ], |
| 1857 | [ AC_MSG_RESULT(yes) ], |
| 1858 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 1859 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1860 | system_lastlog_path=no |
| 1861 | ]) |
| 1862 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1863 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1864 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1865 | if test -z "$conf_lastlog_location"; then |
| 1866 | if test x"$system_lastlog_path" = x"no" ; then |
| 1867 | for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1868 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1869 | conf_lastlog_location=$f |
| 1870 | fi |
| 1871 | done |
| 1872 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 1873 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 1874 | 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] | 1875 | fi |
| 1876 | fi |
| 1877 | fi |
| 1878 | |
| 1879 | if test -n "$conf_lastlog_location"; then |
| 1880 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 1881 | fi |
| 1882 | |
| 1883 | dnl utmp detection |
| 1884 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 1885 | AC_TRY_COMPILE([ |
| 1886 | #include <sys/types.h> |
| 1887 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1888 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1889 | # include <paths.h> |
| 1890 | #endif |
| 1891 | ], |
| 1892 | [ char *utmp = UTMP_FILE; ], |
| 1893 | [ AC_MSG_RESULT(yes) ], |
| 1894 | [ AC_MSG_RESULT(no) |
| 1895 | system_utmp_path=no ] |
| 1896 | ) |
| 1897 | if test -z "$conf_utmp_location"; then |
| 1898 | if test x"$system_utmp_path" = x"no" ; then |
| 1899 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 1900 | if test -f $f ; then |
| 1901 | conf_utmp_location=$f |
| 1902 | fi |
| 1903 | done |
| 1904 | if test -z "$conf_utmp_location"; then |
| 1905 | AC_DEFINE(DISABLE_UTMP) |
| 1906 | fi |
| 1907 | fi |
| 1908 | fi |
| 1909 | if test -n "$conf_utmp_location"; then |
| 1910 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 1911 | fi |
| 1912 | |
| 1913 | dnl wtmp detection |
| 1914 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 1915 | AC_TRY_COMPILE([ |
| 1916 | #include <sys/types.h> |
| 1917 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1918 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1919 | # include <paths.h> |
| 1920 | #endif |
| 1921 | ], |
| 1922 | [ char *wtmp = WTMP_FILE; ], |
| 1923 | [ AC_MSG_RESULT(yes) ], |
| 1924 | [ AC_MSG_RESULT(no) |
| 1925 | system_wtmp_path=no ] |
| 1926 | ) |
| 1927 | if test -z "$conf_wtmp_location"; then |
| 1928 | if test x"$system_wtmp_path" = x"no" ; then |
| 1929 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1930 | if test -f $f ; then |
| 1931 | conf_wtmp_location=$f |
| 1932 | fi |
| 1933 | done |
| 1934 | if test -z "$conf_wtmp_location"; then |
| 1935 | AC_DEFINE(DISABLE_WTMP) |
| 1936 | fi |
| 1937 | fi |
| 1938 | fi |
| 1939 | if test -n "$conf_wtmp_location"; then |
| 1940 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1941 | fi |
| 1942 | |
| 1943 | |
| 1944 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1945 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1946 | dnl there, though. |
| 1947 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1948 | AC_TRY_COMPILE([ |
| 1949 | #include <sys/types.h> |
| 1950 | #include <utmp.h> |
| 1951 | #ifdef HAVE_UTMPX_H |
| 1952 | #include <utmpx.h> |
| 1953 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1954 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1955 | # include <paths.h> |
| 1956 | #endif |
| 1957 | ], |
| 1958 | [ char *utmpx = UTMPX_FILE; ], |
| 1959 | [ AC_MSG_RESULT(yes) ], |
| 1960 | [ AC_MSG_RESULT(no) |
| 1961 | system_utmpx_path=no ] |
| 1962 | ) |
| 1963 | if test -z "$conf_utmpx_location"; then |
| 1964 | if test x"$system_utmpx_path" = x"no" ; then |
| 1965 | AC_DEFINE(DISABLE_UTMPX) |
| 1966 | fi |
| 1967 | else |
| 1968 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1969 | fi |
| 1970 | |
| 1971 | dnl wtmpx detection |
| 1972 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1973 | AC_TRY_COMPILE([ |
| 1974 | #include <sys/types.h> |
| 1975 | #include <utmp.h> |
| 1976 | #ifdef HAVE_UTMPX_H |
| 1977 | #include <utmpx.h> |
| 1978 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1979 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1980 | # include <paths.h> |
| 1981 | #endif |
| 1982 | ], |
| 1983 | [ char *wtmpx = WTMPX_FILE; ], |
| 1984 | [ AC_MSG_RESULT(yes) ], |
| 1985 | [ AC_MSG_RESULT(no) |
| 1986 | system_wtmpx_path=no ] |
| 1987 | ) |
| 1988 | if test -z "$conf_wtmpx_location"; then |
| 1989 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1990 | AC_DEFINE(DISABLE_WTMPX) |
| 1991 | fi |
| 1992 | else |
| 1993 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1994 | fi |
| 1995 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1996 | |
| 1997 | # Change default command timeout for builtin PRNG |
Damien Miller | 14c12cb | 2000-06-07 22:20:23 +1000 | [diff] [blame] | 1998 | entropy_timeout=200 |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1999 | AC_ARG_WITH(entropy-timeout, |
| 2000 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 2001 | [ |
| 2002 | if test "x$withval" != "xno" ; then |
| 2003 | entropy_timeout=$withval |
| 2004 | fi |
| 2005 | ] |
| 2006 | ) |
| 2007 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 2008 | |
| 2009 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 2010 | if test ! -z "$blibpath" ; then |
| 2011 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 2012 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 2013 | fi |
| 2014 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 2015 | AC_EXEEXT |
| 2016 | |
Ben Lindstrom | 3c06f6a | 2001-01-31 21:52:01 +0000 | [diff] [blame] | 2017 | AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 2018 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2019 | # Print summary of options |
| 2020 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2021 | if test ! -z "$RANDOM_POOL" ; then |
| 2022 | RAND_MSG="Device ($RANDOM_POOL)" |
| 2023 | else |
Damien Miller | d0ccb98 | 2001-03-04 00:29:20 +1100 | [diff] [blame] | 2024 | if test ! -z "$PRNGD_PORT" ; then |
| 2025 | RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)" |
| 2026 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 2027 | RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2028 | else |
| 2029 | RAND_MSG="Builtin (timeout $entropy_timeout)" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 2030 | BUILTIN_RNG=1 |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2031 | fi |
| 2032 | fi |
| 2033 | |
| 2034 | # Someone please show me a better way :) |
| 2035 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 2036 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 2037 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 2038 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 2039 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2040 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2041 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2042 | H=`eval echo ${user_path}` ; H=`eval echo ${H}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2043 | |
| 2044 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 2045 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2046 | echo " User binaries: $B" |
| 2047 | echo " System binaries: $C" |
| 2048 | echo " Configuration files: $D" |
| 2049 | echo " Askpass program: $E" |
| 2050 | echo " Manual pages: $F" |
| 2051 | echo " PID file: $G" |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2052 | echo " sshd default user PATH: $H" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2053 | echo " Random number collection: $RAND_MSG" |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 2054 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2055 | echo " PAM support: ${PAM_MSG}" |
| 2056 | echo " KerberosIV support: $KRB4_MSG" |
| 2057 | echo " AFS support: $AFS_MSG" |
| 2058 | echo " S/KEY support: $SKEY_MSG" |
| 2059 | echo " TCP Wrappers support: $TCPW_MSG" |
| 2060 | echo " MD5 password support: $MD5_MSG" |
| 2061 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
| 2062 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 2063 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 2064 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2065 | if test ! -z "$bsd_auth"; then |
| 2066 | echo " BSD Auth support: yes" |
| 2067 | fi |
| 2068 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2069 | echo "" |
| 2070 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 2071 | echo " Host: ${host}" |
| 2072 | echo " Compiler: ${CC}" |
| 2073 | echo " Compiler flags: ${CFLAGS}" |
| 2074 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 2075 | echo " Linker flags: ${LDFLAGS}" |
| 2076 | echo " Libraries: ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2077 | |
| 2078 | echo "" |
| 2079 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 2080 | if test "x$PAM_MSG" = "xyes" ; then |
| 2081 | echo "PAM is enabled. You may need to install a PAM control file for sshd," |
| 2082 | echo "otherwise password authentication may fail. Example PAM control files" |
| 2083 | echo "can be found in the contrib/ subdirectory" |
| 2084 | echo "" |
| 2085 | fi |
| 2086 | |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 2087 | if test ! -z "$BUILTIN_RNG" ; then |
| 2088 | echo "WARNING: you are using the builtin random number collection service." |
| 2089 | echo "Please read WARNING.RNG and request that your OS vendor includes" |
| 2090 | echo "/dev/random in future versions of their OS." |
| 2091 | echo "" |
| 2092 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2093 | |
| 2094 | if test ! -z "$NO_SFTP"; then |
| 2095 | echo "sftp-server will be disabled. Your compiler does not support" |
| 2096 | echo "64bit integers." |
| 2097 | echo "" |
| 2098 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2099 | |