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