Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.100 2003/01/13 05:55:23 djm Exp $ |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 2 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3 | AC_INIT |
| 4 | AC_CONFIG_SRCDIR([ssh.c]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 5 | |
| 6 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 7 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 8 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 9 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 10 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 11 | # Checks for programs. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 12 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 13 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 14 | AC_PROG_INSTALL |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 15 | AC_PATH_PROG(AR, ar) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 16 | AC_PATH_PROGS(PERL, perl5 perl) |
Tim Rice | d0d7a8b | 2003-01-08 17:22:59 -0800 | [diff] [blame] | 17 | AC_PATH_PROG(SED, sed) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 18 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 19 | AC_PATH_PROG(ENT, ent) |
| 20 | AC_SUBST(ENT) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 21 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 22 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 23 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Tim Rice | 0502a47 | 2002-05-08 16:04:14 -0700 | [diff] [blame] | 24 | AC_PATH_PROG(SH, sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 25 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 26 | # System features |
| 27 | AC_SYS_LARGEFILE |
| 28 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 29 | if test -z "$AR" ; then |
| 30 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 31 | fi |
| 32 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 33 | # Use LOGIN_PROGRAM from environment if possible |
| 34 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 35 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 36 | else |
| 37 | # Search for login |
| 38 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 39 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 40 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 41 | fi |
| 42 | fi |
| 43 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 44 | if test -z "$LD" ; then |
| 45 | LD=$CC |
| 46 | fi |
| 47 | AC_SUBST(LD) |
| 48 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 49 | AC_C_INLINE |
Damien Miller | 649d999 | 2001-06-27 23:35:51 +1000 | [diff] [blame] | 50 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
| 51 | CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 52 | fi |
| 53 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 54 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 55 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 56 | *-*-aix*) |
| 57 | AFS_LIBS="-lld" |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 58 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 59 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 60 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 61 | AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath]) |
| 62 | saved_LDFLAGS="$LDFLAGS" |
| 63 | LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib" |
| 64 | AC_TRY_LINK([], |
| 65 | [], |
| 66 | [ |
| 67 | AC_MSG_RESULT(yes) |
| 68 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 69 | ], |
| 70 | [ AC_MSG_RESULT(no) ] |
| 71 | ) |
| 72 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 73 | fi |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 74 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], |
| 75 | [AC_CHECK_LIB(s,authenticate, |
| 76 | [ AC_DEFINE(WITH_AIXAUTHENTICATE) |
| 77 | LIBS="$LIBS -ls" |
| 78 | ]) |
| 79 | ]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 80 | AC_DEFINE(BROKEN_GETADDRINFO) |
Damien Miller | f5fea44 | 2002-04-23 22:52:45 +1000 | [diff] [blame] | 81 | AC_DEFINE(BROKEN_REALPATH) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 82 | dnl AIX handles lastlog as part of its login message |
| 83 | AC_DEFINE(DISABLE_LASTLOG) |
Kevin Steves | 90d5de7 | 2002-06-22 18:51:48 +0000 | [diff] [blame] | 84 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | ec20196 | 2003-01-13 10:04:58 +1100 | [diff] [blame] | 85 | AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV) |
| 86 | AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0') |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 87 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 88 | *-*-cygwin*) |
Tim Rice | fe1d100 | 2001-11-26 17:19:43 -0800 | [diff] [blame] | 89 | LIBS="$LIBS /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 90 | AC_DEFINE(HAVE_CYGWIN) |
Ben Lindstrom | ca60a9b | 2001-05-17 03:32:50 +0000 | [diff] [blame] | 91 | AC_DEFINE(USE_PIPES) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 92 | AC_DEFINE(DISABLE_SHADOW) |
| 93 | AC_DEFINE(IPV4_DEFAULT) |
| 94 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Ben Lindstrom | 38e6093 | 2001-02-24 00:55:04 +0000 | [diff] [blame] | 95 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Ben Lindstrom | 99a4e14 | 2002-07-09 14:06:40 +0000 | [diff] [blame] | 96 | AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 97 | AC_DEFINE(DISABLE_FD_PASSING) |
Ben Lindstrom | 837461b | 2002-06-12 16:57:14 +0000 | [diff] [blame] | 98 | AC_DEFINE(SETGROUPS_NOOP) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 99 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 100 | *-*-dgux*) |
| 101 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 102 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 103 | *-*-darwin*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 104 | AC_MSG_CHECKING(if we have working getaddrinfo) |
| 105 | AC_TRY_RUN([#include <mach-o/dyld.h> |
| 106 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 107 | exit(0); |
| 108 | else |
| 109 | exit(1); |
| 110 | }], [AC_MSG_RESULT(working)], |
| 111 | [AC_MSG_RESULT(buggy) |
| 112 | AC_DEFINE(BROKEN_GETADDRINFO)], |
| 113 | [AC_MSG_RESULT(assume it is working)]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 114 | ;; |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 115 | *-*-hpux10.26) |
| 116 | if test -z "$GCC"; then |
| 117 | CFLAGS="$CFLAGS -Ae" |
| 118 | fi |
| 119 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" |
| 120 | IPADDR_IN_DISPLAY=yes |
| 121 | AC_DEFINE(HAVE_SECUREWARE) |
| 122 | AC_DEFINE(USE_PIPES) |
| 123 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 124 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 125 | AC_DEFINE(DISABLE_SHADOW) |
| 126 | AC_DEFINE(DISABLE_UTMP) |
Damien Miller | ec20196 | 2003-01-13 10:04:58 +1100 | [diff] [blame] | 127 | AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 128 | LIBS="$LIBS -lsec -lsecpw" |
| 129 | AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 130 | disable_ptmx_check=yes |
| 131 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 132 | *-*-hpux10*) |
| 133 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 134 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 135 | fi |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 136 | 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] | 137 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 138 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 139 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 140 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 141 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 142 | AC_DEFINE(DISABLE_UTMP) |
Damien Miller | ec20196 | 2003-01-13 10:04:58 +1100 | [diff] [blame] | 143 | AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 144 | LIBS="$LIBS -lsec" |
| 145 | AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 146 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 147 | *-*-hpux11*) |
Kevin Steves | 6a7b0de | 2001-06-27 16:32:24 +0000 | [diff] [blame] | 148 | 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] | 149 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 150 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 151 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 152 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 153 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 154 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 155 | AC_DEFINE(DISABLE_UTMP) |
Damien Miller | ec20196 | 2003-01-13 10:04:58 +1100 | [diff] [blame] | 156 | AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 157 | LIBS="$LIBS -lsec" |
| 158 | AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 159 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 160 | *-*-irix5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 161 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 162 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 163 | PATH="$PATH:/usr/etc" |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 164 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 165 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 166 | ;; |
| 167 | *-*-irix6*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 168 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 169 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 170 | PATH="$PATH:/usr/etc" |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 171 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 172 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 173 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 8ff2a8d | 2002-04-06 18:58:31 +0000 | [diff] [blame] | 174 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 175 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 176 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 177 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 178 | *-*-linux*) |
| 179 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 180 | check_for_libcrypt_later=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 181 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 182 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | ec20196 | 2003-01-13 10:04:58 +1100 | [diff] [blame] | 183 | AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV) |
| 184 | AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0') |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 185 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 186 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 187 | mips-sony-bsd|mips-sony-newsos4) |
| 188 | AC_DEFINE(HAVE_NEWS4) |
| 189 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 190 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 191 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 192 | check_for_libcrypt_before=1 |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 193 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 194 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 195 | *-*-freebsd*) |
| 196 | check_for_libcrypt_later=1 |
| 197 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 198 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 199 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 200 | conf_utmp_location=/etc/utmp |
| 201 | conf_wtmp_location=/usr/adm/wtmp |
| 202 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 203 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 204 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 205 | AC_DEFINE(USE_PIPES) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 206 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 207 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 321ae73 | 2000-12-31 15:00:23 +0000 | [diff] [blame] | 208 | CFLAGS="$CFLAGS" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 209 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 210 | *-*-solaris*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 211 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Ben Lindstrom | 866488b | 2001-02-20 18:22:38 +0000 | [diff] [blame] | 212 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 213 | need_dash_r=1 |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 214 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 215 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 216 | AC_DEFINE(LOGIN_NEEDS_TERM) |
Ben Lindstrom | 9527671 | 2001-10-23 17:14:00 +0000 | [diff] [blame] | 217 | AC_DEFINE(PAM_TTY_KLUDGE) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 218 | # hardwire lastlog location (can't detect it on some versions) |
| 219 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 220 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 221 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 222 | if test "$sol2ver" -ge 8; then |
| 223 | AC_MSG_RESULT(yes) |
| 224 | AC_DEFINE(DISABLE_UTMP) |
| 225 | AC_DEFINE(DISABLE_WTMP) |
| 226 | else |
| 227 | AC_MSG_RESULT(no) |
| 228 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 229 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 230 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 231 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 232 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 233 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 234 | conf_utmp_location=/etc/utmp |
| 235 | conf_wtmp_location=/var/adm/wtmp |
| 236 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 237 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 238 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 239 | *-ncr-sysv*) |
| 240 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
| 241 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 242 | LIBS="$LIBS -lc89" |
Kevin Steves | 0bd4b34 | 2002-01-05 23:24:27 +0000 | [diff] [blame] | 243 | AC_DEFINE(USE_PIPES) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 244 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 245 | *-sni-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 246 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 247 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
| 248 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 249 | IPADDR_IN_DISPLAY=yes |
| 250 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 251 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 252 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 253 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 254 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 255 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 256 | *-*-sysv4.2*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 257 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 258 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 259 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 260 | ;; |
| 261 | *-*-sysv5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 262 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 263 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 264 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 265 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 266 | *-*-sysv*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 267 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 268 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 269 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 270 | *-*-sco3.2v4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 271 | CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 272 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 273 | LIBS="$LIBS -los -lprot -lx -ltinfo -lm" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 274 | RANLIB=true |
| 275 | no_dev_ptmx=1 |
| 276 | AC_DEFINE(BROKEN_SYS_TERMIO_H) |
| 277 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 278 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 279 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 280 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 281 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 282 | MANTYPE=man |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 283 | do_sco3_extra_lib_check=yes |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 284 | ;; |
| 285 | *-*-sco3.2v5*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 286 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 287 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 288 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 289 | no_dev_ptmx=1 |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 290 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 291 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 292 | AC_DEFINE(DISABLE_SHADOW) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 293 | AC_DEFINE(DISABLE_FD_PASSING) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 294 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 295 | MANTYPE=man |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 296 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 297 | *-*-unicosmk*) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 298 | AC_DEFINE(USE_PIPES) |
| 299 | AC_DEFINE(DISABLE_FD_PASSING) |
| 300 | LDFLAGS="$LDFLAGS" |
| 301 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 302 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 303 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 304 | *-*-unicos*) |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 305 | AC_DEFINE(USE_PIPES) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 306 | AC_DEFINE(DISABLE_FD_PASSING) |
Tim Rice | 81ed518 | 2002-09-25 17:38:46 -0700 | [diff] [blame] | 307 | AC_DEFINE(NO_SSH_LASTLOG) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 308 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 309 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 310 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 311 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 312 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 313 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 314 | no_osfsia="" |
| 315 | AC_ARG_WITH(osfsia, |
| 316 | [ --with-osfsia Enable Digital Unix SIA], |
| 317 | [ |
| 318 | if test "x$withval" = "xno" ; then |
| 319 | AC_MSG_RESULT(disabled) |
| 320 | no_osfsia=1 |
| 321 | fi |
| 322 | ], |
| 323 | ) |
| 324 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 325 | if test -f /etc/sia/matrix.conf; then |
| 326 | AC_MSG_RESULT(yes) |
| 327 | AC_DEFINE(HAVE_OSF_SIA) |
| 328 | AC_DEFINE(DISABLE_LOGIN) |
| 329 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 330 | else |
| 331 | AC_MSG_RESULT(no) |
| 332 | fi |
| 333 | fi |
Ben Lindstrom | dc3c757 | 2002-10-04 23:54:54 +0000 | [diff] [blame] | 334 | AC_DEFINE(DISABLE_FD_PASSING) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 335 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 336 | |
| 337 | *-*-nto-qnx) |
| 338 | AC_DEFINE(USE_PIPES) |
| 339 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
| 340 | AC_DEFINE(MISSING_NFDBITS) |
| 341 | AC_DEFINE(MISSING_HOWMANY) |
| 342 | AC_DEFINE(MISSING_FD_MASK) |
| 343 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 344 | esac |
| 345 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 346 | # Allow user to specify flags |
| 347 | AC_ARG_WITH(cflags, |
| 348 | [ --with-cflags Specify additional flags to pass to compiler], |
| 349 | [ |
| 350 | if test "x$withval" != "xno" ; then |
| 351 | CFLAGS="$CFLAGS $withval" |
| 352 | fi |
| 353 | ] |
| 354 | ) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 355 | AC_ARG_WITH(cppflags, |
| 356 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 357 | [ |
| 358 | if test "x$withval" != "xno"; then |
| 359 | CPPFLAGS="$CPPFLAGS $withval" |
| 360 | fi |
| 361 | ] |
| 362 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 363 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 364 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 365 | [ |
| 366 | if test "x$withval" != "xno" ; then |
| 367 | LDFLAGS="$LDFLAGS $withval" |
| 368 | fi |
| 369 | ] |
| 370 | ) |
| 371 | AC_ARG_WITH(libs, |
| 372 | [ --with-libs Specify additional libraries to link with], |
| 373 | [ |
| 374 | if test "x$withval" != "xno" ; then |
| 375 | LIBS="$LIBS $withval" |
| 376 | fi |
| 377 | ] |
| 378 | ) |
| 379 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 380 | # Checks for header files. |
| 381 | AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ |
Tim Rice | 81ed518 | 2002-09-25 17:38:46 -0700 | [diff] [blame] | 382 | getopt.h glob.h ia.h lastlog.h limits.h login.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 383 | login_cap.h maillock.h netdb.h netgroup.h \ |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 384 | netinet/in_systm.h paths.h pty.h readpassphrase.h \ |
Ben Lindstrom | 7577fd8 | 2002-03-08 03:11:07 +0000 | [diff] [blame] | 385 | rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 386 | strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ |
Damien Miller | a8ed44b | 2003-01-10 09:53:12 +1100 | [diff] [blame] | 387 | sys/mman.h sys/pstat.h sys/select.h sys/stat.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 388 | sys/stropts.h sys/sysmacros.h sys/time.h \ |
Tim Rice | 81ed518 | 2002-09-25 17:38:46 -0700 | [diff] [blame] | 389 | sys/un.h time.h tmpdir.h ttyent.h usersec.h \ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 390 | util.h utime.h utmp.h utmpx.h) |
| 391 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 392 | # Checks for libraries. |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 393 | AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) |
| 394 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 395 | |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 396 | dnl SCO OS3 needs this for libwrap |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 397 | if test "x$with_tcp_wrappers" != "xno" ; then |
| 398 | if test "x$do_sco3_extra_lib_check" = "xyes" ; then |
| 399 | AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc) |
| 400 | fi |
| 401 | fi |
Damien Miller | df28802 | 2001-02-18 13:07:07 +1100 | [diff] [blame] | 402 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 403 | AC_CHECK_FUNC(getspnam, , |
| 404 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 405 | |
Damien Miller | 150c8b5 | 2002-02-13 23:06:56 +1100 | [diff] [blame] | 406 | AC_ARG_WITH(rpath, |
| 407 | [ --without-rpath Disable auto-added -R linker paths], |
| 408 | [ |
| 409 | if test "x$withval" = "xno" ; then |
| 410 | need_dash_r="" |
| 411 | fi |
| 412 | if test "x$withval" = "xyes" ; then |
| 413 | need_dash_r=1 |
| 414 | fi |
| 415 | ] |
| 416 | ) |
| 417 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 418 | dnl zlib is required |
| 419 | AC_ARG_WITH(zlib, |
| 420 | [ --with-zlib=PATH Use zlib in PATH], |
| 421 | [ |
Kevin Steves | 7dc8197 | 2002-01-22 21:59:31 +0000 | [diff] [blame] | 422 | if test "x$withval" = "xno" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 423 | AC_MSG_ERROR([*** zlib is required ***]) |
| 424 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 425 | if test -d "$withval/lib"; then |
| 426 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 427 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 428 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 429 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 430 | fi |
| 431 | else |
| 432 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 433 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 434 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 435 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 436 | fi |
| 437 | fi |
| 438 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 439 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 440 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 441 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 442 | fi |
| 443 | ] |
| 444 | ) |
| 445 | |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 446 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 447 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 448 | dnl UnixWare 2.x |
| 449 | AC_CHECK_FUNC(strcasecmp, |
| 450 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 451 | ) |
| 452 | AC_CHECK_FUNC(utimes, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 453 | [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES) |
| 454 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 455 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 456 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 457 | dnl Checks for libutil functions |
| 458 | AC_CHECK_HEADERS(libutil.h) |
| 459 | AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)]) |
| 460 | AC_CHECK_FUNCS(logout updwtmp logwtmp) |
| 461 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 462 | AC_FUNC_STRFTIME |
| 463 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 464 | # Check for ALTDIRFUNC glob() extension |
| 465 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 466 | AC_EGREP_CPP(FOUNDIT, |
| 467 | [ |
| 468 | #include <glob.h> |
| 469 | #ifdef GLOB_ALTDIRFUNC |
| 470 | FOUNDIT |
| 471 | #endif |
| 472 | ], |
| 473 | [ |
| 474 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC) |
| 475 | AC_MSG_RESULT(yes) |
| 476 | ], |
| 477 | [ |
| 478 | AC_MSG_RESULT(no) |
| 479 | ] |
| 480 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 481 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 482 | # Check for g.gl_matchc glob() extension |
| 483 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
| 484 | AC_EGREP_CPP(FOUNDIT, |
| 485 | [ |
| 486 | #include <glob.h> |
| 487 | int main(void){glob_t g; g.gl_matchc = 1;} |
| 488 | ], |
| 489 | [ |
| 490 | AC_DEFINE(GLOB_HAS_GL_MATCHC) |
| 491 | AC_MSG_RESULT(yes) |
| 492 | ], |
| 493 | [ |
| 494 | AC_MSG_RESULT(no) |
| 495 | ] |
| 496 | ) |
| 497 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 498 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
| 499 | AC_TRY_RUN( |
| 500 | [ |
| 501 | #include <sys/types.h> |
| 502 | #include <dirent.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 503 | int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 504 | ], |
| 505 | [AC_MSG_RESULT(yes)], |
| 506 | [ |
| 507 | AC_MSG_RESULT(no) |
| 508 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
| 509 | ] |
| 510 | ) |
| 511 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 512 | # Check whether user wants S/Key support |
| 513 | SKEY_MSG="no" |
| 514 | AC_ARG_WITH(skey, |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 515 | [ --with-skey[[=PATH]] Enable S/Key support |
| 516 | (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 517 | [ |
| 518 | if test "x$withval" != "xno" ; then |
| 519 | |
| 520 | if test "x$withval" != "xyes" ; then |
| 521 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 522 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 523 | fi |
| 524 | |
| 525 | AC_DEFINE(SKEY) |
| 526 | LIBS="-lskey $LIBS" |
| 527 | SKEY_MSG="yes" |
| 528 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 529 | AC_MSG_CHECKING([for s/key support]) |
| 530 | AC_TRY_RUN( |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 531 | [ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 532 | #include <stdio.h> |
| 533 | #include <skey.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 534 | int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); } |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 535 | ], |
| 536 | [AC_MSG_RESULT(yes)], |
| 537 | [ |
| 538 | AC_MSG_RESULT(no) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 539 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 540 | ]) |
| 541 | fi |
| 542 | ] |
| 543 | ) |
| 544 | |
| 545 | # Check whether user wants TCP wrappers support |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 546 | TCPW_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 547 | AC_ARG_WITH(tcp-wrappers, |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 548 | [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support |
| 549 | (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 550 | [ |
| 551 | if test "x$withval" != "xno" ; then |
| 552 | saved_LIBS="$LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 553 | saved_LDFLAGS="$LDFLAGS" |
| 554 | saved_CPPFLAGS="$CPPFLAGS" |
| 555 | if test -n "${withval}" -a "${withval}" != "yes"; then |
| 556 | if test -d "${withval}/lib"; then |
| 557 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 558 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 559 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 560 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 561 | fi |
| 562 | else |
| 563 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 564 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 565 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 566 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 567 | fi |
| 568 | fi |
| 569 | if test -d "${withval}/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 570 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 571 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 572 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 573 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 574 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 575 | LIBWRAP="-lwrap" |
| 576 | LIBS="$LIBWRAP $LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 577 | AC_MSG_CHECKING(for libwrap) |
| 578 | AC_TRY_LINK( |
| 579 | [ |
| 580 | #include <tcpd.h> |
| 581 | int deny_severity = 0, allow_severity = 0; |
| 582 | ], |
| 583 | [hosts_access(0);], |
| 584 | [ |
| 585 | AC_MSG_RESULT(yes) |
| 586 | AC_DEFINE(LIBWRAP) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 587 | AC_SUBST(LIBWRAP) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 588 | TCPW_MSG="yes" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 589 | ], |
| 590 | [ |
| 591 | AC_MSG_ERROR([*** libwrap missing]) |
| 592 | ] |
| 593 | ) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 594 | LIBS="$saved_LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 595 | fi |
| 596 | ] |
| 597 | ) |
| 598 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 599 | dnl Checks for library functions. |
Ben Lindstrom | fdee8ef | 2002-04-06 23:52:02 +0000 | [diff] [blame] | 600 | AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 601 | clock fchmod fchown freeaddrinfo futimes gai_strerror \ |
Damien Miller | 771721f | 2002-09-12 10:32:59 +1000 | [diff] [blame] | 602 | getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\ |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 603 | getrlimit getrusage getttyent glob inet_aton inet_ntoa \ |
| 604 | inet_ntop innetgr login_getcapbool md5_crypt memmove \ |
Damien Miller | a8ed44b | 2003-01-10 09:53:12 +1100 | [diff] [blame] | 605 | mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo pstat readpassphrase \ |
Damien Miller | 594a71b | 2002-04-23 20:22:59 +1000 | [diff] [blame] | 606 | realpath recvmsg rresvport_af sendmsg setdtablesize setegid \ |
Ben Lindstrom | 837461b | 2002-06-12 16:57:14 +0000 | [diff] [blame] | 607 | setenv seteuid setgroups setlogin setproctitle setresgid setreuid \ |
Ben Lindstrom | f0bfa83 | 2002-06-21 00:01:18 +0000 | [diff] [blame] | 608 | setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \ |
Damien Miller | b93addb | 2003-01-07 17:04:18 +1100 | [diff] [blame] | 609 | socketpair strerror strlcat strlcpy strmode strvis sysconf \ |
Damien Miller | bc9b7c4 | 2003-01-08 00:06:48 +1100 | [diff] [blame] | 610 | tcgetpgrp truncate utimes vhangup vsnprintf waitpid __b64_ntop \ |
| 611 | _getpty) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 612 | |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 613 | dnl Make sure strsep prototype is defined before defining HAVE_STRSEP |
| 614 | AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)]) |
| 615 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 616 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 617 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 618 | AC_CHECK_LIB(gen, dirname,[ |
| 619 | AC_CACHE_CHECK([for broken dirname], |
| 620 | ac_cv_have_broken_dirname, [ |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 621 | save_LIBS="$LIBS" |
| 622 | LIBS="$LIBS -lgen" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 623 | AC_TRY_RUN( |
| 624 | [ |
| 625 | #include <libgen.h> |
| 626 | #include <string.h> |
| 627 | |
| 628 | int main(int argc, char **argv) { |
| 629 | char *s, buf[32]; |
| 630 | |
| 631 | strncpy(buf,"/etc", 32); |
| 632 | s = dirname(buf); |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 633 | if (!s || strncmp(s, "/", 32) != 0) { |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 634 | exit(1); |
| 635 | } else { |
| 636 | exit(0); |
| 637 | } |
| 638 | } |
| 639 | ], |
| 640 | [ ac_cv_have_broken_dirname="no" ], |
| 641 | [ ac_cv_have_broken_dirname="yes" ] |
| 642 | ) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 643 | LIBS="$save_LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 644 | ]) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 645 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 646 | LIBS="$LIBS -lgen" |
| 647 | AC_DEFINE(HAVE_DIRNAME) |
Tim Rice | 17b93e5 | 2001-10-23 22:36:54 -0700 | [diff] [blame] | 648 | AC_CHECK_HEADERS(libgen.h) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 649 | fi |
| 650 | ]) |
| 651 | ]) |
| 652 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 653 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 654 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 655 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 656 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 657 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 658 | dnl Checks for utmpx functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 659 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 660 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 661 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 662 | AC_CHECK_FUNC(daemon, |
| 663 | [AC_DEFINE(HAVE_DAEMON)], |
| 664 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 665 | ) |
| 666 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 667 | AC_CHECK_FUNC(getpagesize, |
| 668 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 669 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 670 | ) |
| 671 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 672 | # Check for broken snprintf |
| 673 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 674 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 675 | AC_TRY_RUN( |
| 676 | [ |
| 677 | #include <stdio.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 678 | int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 679 | ], |
| 680 | [AC_MSG_RESULT(yes)], |
| 681 | [ |
| 682 | AC_MSG_RESULT(no) |
| 683 | AC_DEFINE(BROKEN_SNPRINTF) |
| 684 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 685 | ] |
| 686 | ) |
| 687 | fi |
| 688 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 689 | dnl see whether mkstemp() requires XXXXXX |
| 690 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 691 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
| 692 | AC_TRY_RUN( |
| 693 | [ |
| 694 | #include <stdlib.h> |
| 695 | main() { char template[]="conftest.mkstemp-test"; |
| 696 | if (mkstemp(template) == -1) |
| 697 | exit(1); |
| 698 | unlink(template); exit(0); |
| 699 | } |
| 700 | ], |
| 701 | [ |
| 702 | AC_MSG_RESULT(no) |
| 703 | ], |
| 704 | [ |
| 705 | AC_MSG_RESULT(yes) |
| 706 | AC_DEFINE(HAVE_STRICT_MKSTEMP) |
| 707 | ], |
| 708 | [ |
| 709 | AC_MSG_RESULT(yes) |
| 710 | AC_DEFINE(HAVE_STRICT_MKSTEMP) |
| 711 | ] |
| 712 | ) |
| 713 | fi |
| 714 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 715 | AC_FUNC_GETPGRP |
| 716 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 717 | # Check for PAM libs |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 718 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 719 | AC_ARG_WITH(pam, |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 720 | [ --with-pam Enable PAM support ], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 721 | [ |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 722 | if test "x$withval" != "xno" ; then |
| 723 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then |
| 724 | AC_MSG_ERROR([PAM headers not found]) |
| 725 | fi |
| 726 | |
| 727 | AC_CHECK_LIB(dl, dlopen, , ) |
| 728 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 729 | AC_CHECK_FUNCS(pam_getenvlist) |
| 730 | |
| 731 | disable_shadow=yes |
| 732 | PAM_MSG="yes" |
| 733 | |
| 734 | AC_DEFINE(USE_PAM) |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 735 | if test $ac_cv_lib_dl_dlopen = yes; then |
| 736 | LIBPAM="-lpam -ldl" |
| 737 | else |
| 738 | LIBPAM="-lpam" |
| 739 | fi |
| 740 | AC_SUBST(LIBPAM) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 741 | fi |
| 742 | ] |
| 743 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 744 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 745 | # Check for older PAM |
| 746 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 747 | # Check PAM strerror arguments (old PAM) |
| 748 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 749 | AC_TRY_COMPILE( |
| 750 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 751 | #include <stdlib.h> |
| 752 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 753 | ], |
| 754 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 755 | [AC_MSG_RESULT(no)], |
| 756 | [ |
| 757 | AC_DEFINE(HAVE_OLD_PAM) |
| 758 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 759 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 760 | ] |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 761 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 762 | fi |
| 763 | |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 764 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 765 | # because the system crypt() is more featureful. |
| 766 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 767 | AC_CHECK_LIB(crypt, crypt) |
| 768 | fi |
| 769 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 770 | # Search for OpenSSL |
| 771 | saved_CPPFLAGS="$CPPFLAGS" |
| 772 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 773 | AC_ARG_WITH(ssl-dir, |
| 774 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 775 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 776 | if test "x$withval" != "xno" ; then |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 777 | if test -d "$withval/lib"; then |
| 778 | if test -n "${need_dash_r}"; then |
| 779 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 780 | else |
| 781 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 782 | fi |
| 783 | else |
| 784 | if test -n "${need_dash_r}"; then |
| 785 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 786 | else |
| 787 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 788 | fi |
| 789 | fi |
| 790 | if test -d "$withval/include"; then |
| 791 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 792 | else |
| 793 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 794 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 795 | fi |
| 796 | ] |
| 797 | ) |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 798 | LIBS="$LIBS -lcrypto" |
| 799 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 800 | [ |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 801 | dnl Check default openssl install dir |
| 802 | if test -n "${need_dash_r}"; then |
| 803 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 804 | else |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 805 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 806 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 807 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 808 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
| 809 | [ |
| 810 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 811 | ] |
| 812 | ) |
| 813 | ] |
| 814 | ) |
| 815 | |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 816 | # Determine OpenSSL header version |
| 817 | AC_MSG_CHECKING([OpenSSL header version]) |
| 818 | AC_TRY_RUN( |
| 819 | [ |
| 820 | #include <stdio.h> |
| 821 | #include <string.h> |
| 822 | #include <openssl/opensslv.h> |
| 823 | #define DATA "conftest.sslincver" |
| 824 | int main(void) { |
| 825 | FILE *fd; |
| 826 | int rc; |
| 827 | |
| 828 | fd = fopen(DATA,"w"); |
| 829 | if(fd == NULL) |
| 830 | exit(1); |
| 831 | |
| 832 | if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) |
| 833 | exit(1); |
| 834 | |
| 835 | exit(0); |
| 836 | } |
| 837 | ], |
| 838 | [ |
| 839 | ssl_header_ver=`cat conftest.sslincver` |
| 840 | AC_MSG_RESULT($ssl_header_ver) |
| 841 | ], |
| 842 | [ |
| 843 | AC_MSG_RESULT(not found) |
| 844 | AC_MSG_ERROR(OpenSSL version header not found.) |
| 845 | ] |
| 846 | ) |
| 847 | |
| 848 | # Determine OpenSSL library version |
| 849 | AC_MSG_CHECKING([OpenSSL library version]) |
| 850 | AC_TRY_RUN( |
| 851 | [ |
| 852 | #include <stdio.h> |
| 853 | #include <string.h> |
| 854 | #include <openssl/opensslv.h> |
| 855 | #include <openssl/crypto.h> |
| 856 | #define DATA "conftest.ssllibver" |
| 857 | int main(void) { |
| 858 | FILE *fd; |
| 859 | int rc; |
| 860 | |
| 861 | fd = fopen(DATA,"w"); |
| 862 | if(fd == NULL) |
| 863 | exit(1); |
| 864 | |
| 865 | if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0) |
| 866 | exit(1); |
| 867 | |
| 868 | exit(0); |
| 869 | } |
| 870 | ], |
| 871 | [ |
| 872 | ssl_library_ver=`cat conftest.ssllibver` |
| 873 | AC_MSG_RESULT($ssl_library_ver) |
| 874 | ], |
| 875 | [ |
| 876 | AC_MSG_RESULT(not found) |
| 877 | AC_MSG_ERROR(OpenSSL library not found.) |
| 878 | ] |
| 879 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 880 | |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 881 | # Sanity check OpenSSL headers |
| 882 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 883 | AC_TRY_RUN( |
| 884 | [ |
| 885 | #include <string.h> |
| 886 | #include <openssl/opensslv.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 887 | int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 888 | ], |
| 889 | [ |
| 890 | AC_MSG_RESULT(yes) |
| 891 | ], |
| 892 | [ |
| 893 | AC_MSG_RESULT(no) |
| 894 | AC_MSG_ERROR(Your OpenSSL headers do not match your library) |
| 895 | ] |
| 896 | ) |
| 897 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 898 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 899 | # version in OpenSSL. Skip this for PAM |
| 900 | 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] | 901 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 902 | fi |
| 903 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 904 | |
| 905 | ### Configure cryptographic random number support |
| 906 | |
| 907 | # Check wheter OpenSSL seeds itself |
| 908 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 909 | AC_TRY_RUN( |
| 910 | [ |
| 911 | #include <string.h> |
| 912 | #include <openssl/rand.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 913 | int main(void) { exit(RAND_status() == 1 ? 0 : 1); } |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 914 | ], |
| 915 | [ |
| 916 | OPENSSL_SEEDS_ITSELF=yes |
| 917 | AC_MSG_RESULT(yes) |
| 918 | ], |
| 919 | [ |
| 920 | AC_MSG_RESULT(no) |
| 921 | # Default to use of the rand helper if OpenSSL doesn't |
| 922 | # seed itself |
| 923 | USE_RAND_HELPER=yes |
| 924 | ] |
| 925 | ) |
| 926 | |
| 927 | |
| 928 | # Do we want to force the use of the rand helper? |
| 929 | AC_ARG_WITH(rand-helper, |
| 930 | [ --with-rand-helper Use subprocess to gather strong randomness ], |
| 931 | [ |
| 932 | if test "x$withval" = "xno" ; then |
| 933 | # Force use of OpenSSL's internal RNG, even if |
| 934 | # the previous test showed it to be unseeded. |
| 935 | if test -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 936 | AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG]) |
| 937 | OPENSSL_SEEDS_ITSELF=yes |
| 938 | USE_RAND_HELPER="" |
| 939 | fi |
| 940 | else |
| 941 | USE_RAND_HELPER=yes |
| 942 | fi |
| 943 | ], |
| 944 | ) |
| 945 | |
| 946 | # Which randomness source do we use? |
| 947 | if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then |
| 948 | # OpenSSL only |
| 949 | AC_DEFINE(OPENSSL_PRNG_ONLY) |
| 950 | RAND_MSG="OpenSSL internal ONLY" |
| 951 | INSTALL_SSH_RAND_HELPER="" |
Tim Rice | 1e2c600 | 2002-01-30 22:14:03 -0800 | [diff] [blame] | 952 | elif test ! -z "$USE_RAND_HELPER" ; then |
| 953 | # install rand helper |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 954 | RAND_MSG="ssh-rand-helper" |
| 955 | INSTALL_SSH_RAND_HELPER="yes" |
| 956 | fi |
| 957 | AC_SUBST(INSTALL_SSH_RAND_HELPER) |
| 958 | |
| 959 | ### Configuration of ssh-rand-helper |
| 960 | |
| 961 | # PRNGD TCP socket |
| 962 | AC_ARG_WITH(prngd-port, |
| 963 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 964 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 965 | case "$withval" in |
| 966 | no) |
| 967 | withval="" |
| 968 | ;; |
| 969 | [[0-9]]*) |
| 970 | ;; |
| 971 | *) |
| 972 | AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port) |
| 973 | ;; |
| 974 | esac |
| 975 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 976 | PRNGD_PORT="$withval" |
| 977 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT) |
| 978 | fi |
| 979 | ] |
| 980 | ) |
| 981 | |
| 982 | # PRNGD Unix domain socket |
| 983 | AC_ARG_WITH(prngd-socket, |
| 984 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 985 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 986 | case "$withval" in |
| 987 | yes) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 988 | withval="/var/run/egd-pool" |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 989 | ;; |
| 990 | no) |
| 991 | withval="" |
| 992 | ;; |
| 993 | /*) |
| 994 | ;; |
| 995 | *) |
| 996 | AC_MSG_ERROR(You must specify an absolute path to the entropy socket) |
| 997 | ;; |
| 998 | esac |
| 999 | |
| 1000 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1001 | if test ! -z "$PRNGD_PORT" ; then |
| 1002 | AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket) |
| 1003 | fi |
Damien Miller | 6385ba0 | 2002-01-23 08:12:36 +1100 | [diff] [blame] | 1004 | if test ! -r "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1005 | AC_MSG_WARN(Entropy socket is not readable) |
| 1006 | fi |
| 1007 | PRNGD_SOCKET="$withval" |
| 1008 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 1009 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1010 | ], |
| 1011 | [ |
| 1012 | # Check for existing socket only if we don't have a random device already |
| 1013 | if test "$USE_RAND_HELPER" = yes ; then |
| 1014 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 1015 | # Insert other locations here |
| 1016 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 1017 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 1018 | PRNGD_SOCKET="$sock" |
| 1019 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 1020 | break; |
| 1021 | fi |
| 1022 | done |
| 1023 | if test ! -z "$PRNGD_SOCKET" ; then |
| 1024 | AC_MSG_RESULT($PRNGD_SOCKET) |
| 1025 | else |
| 1026 | AC_MSG_RESULT(not found) |
| 1027 | fi |
| 1028 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1029 | ] |
| 1030 | ) |
| 1031 | |
| 1032 | # Change default command timeout for hashing entropy source |
| 1033 | entropy_timeout=200 |
| 1034 | AC_ARG_WITH(entropy-timeout, |
| 1035 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1036 | [ |
| 1037 | if test "x$withval" != "xno" ; then |
| 1038 | entropy_timeout=$withval |
| 1039 | fi |
| 1040 | ] |
| 1041 | ) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1042 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1043 | |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1044 | SSH_PRIVSEP_USER=sshd |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1045 | AC_ARG_WITH(privsep-user, |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 1046 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1047 | [ |
| 1048 | if test -n "$withval"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1049 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1050 | fi |
| 1051 | ] |
| 1052 | ) |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1053 | AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER") |
| 1054 | AC_SUBST(SSH_PRIVSEP_USER) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1055 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1056 | # We do this little dance with the search path to insure |
| 1057 | # that programs that we select for use by installed programs |
| 1058 | # (which may be run by the super-user) come from trusted |
| 1059 | # locations before they come from the user's private area. |
| 1060 | # This should help avoid accidentally configuring some |
| 1061 | # random version of a program in someone's personal bin. |
| 1062 | |
| 1063 | OPATH=$PATH |
| 1064 | PATH=/bin:/usr/bin |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1065 | test -h /bin 2> /dev/null && PATH=/usr/bin |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1066 | test -d /sbin && PATH=$PATH:/sbin |
| 1067 | test -d /usr/sbin && PATH=$PATH:/usr/sbin |
| 1068 | PATH=$PATH:/etc:$OPATH |
| 1069 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1070 | # These programs are used by the command hashing source to gather entropy |
| 1071 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 1072 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 1073 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 1074 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 1075 | OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat) |
| 1076 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 1077 | OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar) |
| 1078 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 1079 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 1080 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 1081 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 1082 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 1083 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 1084 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 1085 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 1086 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1087 | # restore PATH |
| 1088 | PATH=$OPATH |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1089 | |
| 1090 | # Where does ssh-rand-helper get its randomness from? |
| 1091 | INSTALL_SSH_PRNG_CMDS="" |
| 1092 | if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then |
| 1093 | if test ! -z "$PRNGD_PORT" ; then |
| 1094 | RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT" |
| 1095 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 1096 | RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\"" |
| 1097 | else |
| 1098 | RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)" |
| 1099 | RAND_HELPER_CMDHASH=yes |
| 1100 | INSTALL_SSH_PRNG_CMDS="yes" |
| 1101 | fi |
| 1102 | fi |
| 1103 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 1104 | |
| 1105 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 1106 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 1107 | if test ! -z "$SONY" ; then |
| 1108 | LIBS="$LIBS -liberty"; |
| 1109 | fi |
| 1110 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1111 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 1112 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 1113 | AC_CHECK_SIZEOF(short int, 2) |
| 1114 | AC_CHECK_SIZEOF(int, 4) |
| 1115 | AC_CHECK_SIZEOF(long int, 4) |
| 1116 | AC_CHECK_SIZEOF(long long int, 8) |
| 1117 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 1118 | # Sanity check long long for some platforms (AIX) |
| 1119 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 1120 | ac_cv_sizeof_long_long_int=0 |
| 1121 | fi |
| 1122 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1123 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 1124 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 1125 | AC_TRY_COMPILE( |
| 1126 | [ #include <sys/types.h> ], |
| 1127 | [ u_int a; a = 1;], |
| 1128 | [ ac_cv_have_u_int="yes" ], |
| 1129 | [ ac_cv_have_u_int="no" ] |
| 1130 | ) |
| 1131 | ]) |
| 1132 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 1133 | AC_DEFINE(HAVE_U_INT) |
| 1134 | have_u_int=1 |
| 1135 | fi |
| 1136 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1137 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 1138 | AC_TRY_COMPILE( |
| 1139 | [ #include <sys/types.h> ], |
| 1140 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 1141 | [ ac_cv_have_intxx_t="yes" ], |
| 1142 | [ ac_cv_have_intxx_t="no" ] |
| 1143 | ) |
| 1144 | ]) |
| 1145 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 1146 | AC_DEFINE(HAVE_INTXX_T) |
| 1147 | have_intxx_t=1 |
| 1148 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1149 | |
| 1150 | if (test -z "$have_intxx_t" && \ |
| 1151 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 1152 | then |
| 1153 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
| 1154 | AC_TRY_COMPILE( |
| 1155 | [ #include <stdint.h> ], |
| 1156 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 1157 | [ |
| 1158 | AC_DEFINE(HAVE_INTXX_T) |
| 1159 | AC_MSG_RESULT(yes) |
| 1160 | ], |
| 1161 | [ AC_MSG_RESULT(no) ] |
| 1162 | ) |
| 1163 | fi |
| 1164 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1165 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 1166 | AC_TRY_COMPILE( |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 1167 | [ |
| 1168 | #include <sys/types.h> |
| 1169 | #ifdef HAVE_STDINT_H |
| 1170 | # include <stdint.h> |
| 1171 | #endif |
| 1172 | #include <sys/socket.h> |
| 1173 | #ifdef HAVE_SYS_BITYPES_H |
| 1174 | # include <sys/bitypes.h> |
| 1175 | #endif |
| 1176 | ], |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1177 | [ int64_t a; a = 1;], |
| 1178 | [ ac_cv_have_int64_t="yes" ], |
| 1179 | [ ac_cv_have_int64_t="no" ] |
| 1180 | ) |
| 1181 | ]) |
| 1182 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 1183 | AC_DEFINE(HAVE_INT64_T) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1184 | fi |
| 1185 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1186 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 1187 | AC_TRY_COMPILE( |
| 1188 | [ #include <sys/types.h> ], |
| 1189 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 1190 | [ ac_cv_have_u_intxx_t="yes" ], |
| 1191 | [ ac_cv_have_u_intxx_t="no" ] |
| 1192 | ) |
| 1193 | ]) |
| 1194 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 1195 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1196 | have_u_intxx_t=1 |
| 1197 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 1198 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1199 | if test -z "$have_u_intxx_t" ; then |
| 1200 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
| 1201 | AC_TRY_COMPILE( |
| 1202 | [ #include <sys/socket.h> ], |
| 1203 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 1204 | [ |
| 1205 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1206 | AC_MSG_RESULT(yes) |
| 1207 | ], |
| 1208 | [ AC_MSG_RESULT(no) ] |
| 1209 | ) |
| 1210 | fi |
| 1211 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1212 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 1213 | AC_TRY_COMPILE( |
| 1214 | [ #include <sys/types.h> ], |
| 1215 | [ u_int64_t a; a = 1;], |
| 1216 | [ ac_cv_have_u_int64_t="yes" ], |
| 1217 | [ ac_cv_have_u_int64_t="no" ] |
| 1218 | ) |
| 1219 | ]) |
| 1220 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 1221 | AC_DEFINE(HAVE_U_INT64_T) |
| 1222 | have_u_int64_t=1 |
| 1223 | fi |
| 1224 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1225 | if test -z "$have_u_int64_t" ; then |
| 1226 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
| 1227 | AC_TRY_COMPILE( |
| 1228 | [ #include <sys/bitypes.h> ], |
| 1229 | [ u_int64_t a; a = 1], |
| 1230 | [ |
| 1231 | AC_DEFINE(HAVE_U_INT64_T) |
| 1232 | AC_MSG_RESULT(yes) |
| 1233 | ], |
| 1234 | [ AC_MSG_RESULT(no) ] |
| 1235 | ) |
| 1236 | fi |
| 1237 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1238 | if test -z "$have_u_intxx_t" ; then |
| 1239 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 1240 | AC_TRY_COMPILE( |
| 1241 | [ |
| 1242 | #include <sys/types.h> |
| 1243 | ], |
| 1244 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 1245 | [ ac_cv_have_uintxx_t="yes" ], |
| 1246 | [ ac_cv_have_uintxx_t="no" ] |
| 1247 | ) |
| 1248 | ]) |
| 1249 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 1250 | AC_DEFINE(HAVE_UINTXX_T) |
| 1251 | fi |
| 1252 | fi |
| 1253 | |
| 1254 | if test -z "$have_uintxx_t" ; then |
| 1255 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
| 1256 | AC_TRY_COMPILE( |
| 1257 | [ #include <stdint.h> ], |
| 1258 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
| 1259 | [ |
| 1260 | AC_DEFINE(HAVE_UINTXX_T) |
| 1261 | AC_MSG_RESULT(yes) |
| 1262 | ], |
| 1263 | [ AC_MSG_RESULT(no) ] |
| 1264 | ) |
| 1265 | fi |
| 1266 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1267 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 1268 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1269 | then |
| 1270 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 1271 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1272 | [ |
| 1273 | #include <sys/bitypes.h> |
| 1274 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1275 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 1276 | int8_t a; int16_t b; int32_t c; |
| 1277 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 1278 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 1279 | ], |
| 1280 | [ |
| 1281 | AC_DEFINE(HAVE_U_INTXX_T) |
| 1282 | AC_DEFINE(HAVE_INTXX_T) |
| 1283 | AC_MSG_RESULT(yes) |
| 1284 | ], |
| 1285 | [AC_MSG_RESULT(no)] |
| 1286 | ) |
| 1287 | fi |
| 1288 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 1289 | |
| 1290 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
| 1291 | AC_TRY_COMPILE( |
| 1292 | [ |
| 1293 | #include <sys/types.h> |
| 1294 | ], |
| 1295 | [ u_char foo; foo = 125; ], |
| 1296 | [ ac_cv_have_u_char="yes" ], |
| 1297 | [ ac_cv_have_u_char="no" ] |
| 1298 | ) |
| 1299 | ]) |
| 1300 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
| 1301 | AC_DEFINE(HAVE_U_CHAR) |
| 1302 | fi |
| 1303 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1304 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 1305 | |
Tim Rice | 200a5c0 | 2002-02-26 22:12:34 -0800 | [diff] [blame] | 1306 | AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1307 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1308 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 1309 | AC_TRY_COMPILE( |
| 1310 | [ |
| 1311 | #include <sys/types.h> |
| 1312 | ], |
| 1313 | [ size_t foo; foo = 1235; ], |
| 1314 | [ ac_cv_have_size_t="yes" ], |
| 1315 | [ ac_cv_have_size_t="no" ] |
| 1316 | ) |
| 1317 | ]) |
| 1318 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 1319 | AC_DEFINE(HAVE_SIZE_T) |
| 1320 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 1321 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 1322 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 1323 | AC_TRY_COMPILE( |
| 1324 | [ |
| 1325 | #include <sys/types.h> |
| 1326 | ], |
| 1327 | [ ssize_t foo; foo = 1235; ], |
| 1328 | [ ac_cv_have_ssize_t="yes" ], |
| 1329 | [ ac_cv_have_ssize_t="no" ] |
| 1330 | ) |
| 1331 | ]) |
| 1332 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 1333 | AC_DEFINE(HAVE_SSIZE_T) |
| 1334 | fi |
| 1335 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 1336 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 1337 | AC_TRY_COMPILE( |
| 1338 | [ |
| 1339 | #include <time.h> |
| 1340 | ], |
| 1341 | [ clock_t foo; foo = 1235; ], |
| 1342 | [ ac_cv_have_clock_t="yes" ], |
| 1343 | [ ac_cv_have_clock_t="no" ] |
| 1344 | ) |
| 1345 | ]) |
| 1346 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
| 1347 | AC_DEFINE(HAVE_CLOCK_T) |
| 1348 | fi |
| 1349 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1350 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 1351 | AC_TRY_COMPILE( |
| 1352 | [ |
| 1353 | #include <sys/types.h> |
| 1354 | #include <sys/socket.h> |
| 1355 | ], |
| 1356 | [ sa_family_t foo; foo = 1235; ], |
| 1357 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1358 | [ AC_TRY_COMPILE( |
| 1359 | [ |
| 1360 | #include <sys/types.h> |
| 1361 | #include <sys/socket.h> |
| 1362 | #include <netinet/in.h> |
| 1363 | ], |
| 1364 | [ sa_family_t foo; foo = 1235; ], |
| 1365 | [ ac_cv_have_sa_family_t="yes" ], |
| 1366 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1367 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1368 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 1369 | ) |
| 1370 | ]) |
| 1371 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 1372 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 1373 | fi |
| 1374 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 1375 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 1376 | AC_TRY_COMPILE( |
| 1377 | [ |
| 1378 | #include <sys/types.h> |
| 1379 | ], |
| 1380 | [ pid_t foo; foo = 1235; ], |
| 1381 | [ ac_cv_have_pid_t="yes" ], |
| 1382 | [ ac_cv_have_pid_t="no" ] |
| 1383 | ) |
| 1384 | ]) |
| 1385 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 1386 | AC_DEFINE(HAVE_PID_T) |
| 1387 | fi |
| 1388 | |
| 1389 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 1390 | AC_TRY_COMPILE( |
| 1391 | [ |
| 1392 | #include <sys/types.h> |
| 1393 | ], |
| 1394 | [ mode_t foo; foo = 1235; ], |
| 1395 | [ ac_cv_have_mode_t="yes" ], |
| 1396 | [ ac_cv_have_mode_t="no" ] |
| 1397 | ) |
| 1398 | ]) |
| 1399 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 1400 | AC_DEFINE(HAVE_MODE_T) |
| 1401 | fi |
| 1402 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1403 | |
| 1404 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 1405 | AC_TRY_COMPILE( |
| 1406 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1407 | #include <sys/types.h> |
| 1408 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1409 | ], |
| 1410 | [ struct sockaddr_storage s; ], |
| 1411 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 1412 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 1413 | ) |
| 1414 | ]) |
| 1415 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 1416 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 1417 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1418 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1419 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 1420 | AC_TRY_COMPILE( |
| 1421 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1422 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1423 | #include <netinet/in.h> |
| 1424 | ], |
| 1425 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 1426 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 1427 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 1428 | ) |
| 1429 | ]) |
| 1430 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 1431 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 1432 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1433 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1434 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 1435 | AC_TRY_COMPILE( |
| 1436 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1437 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1438 | #include <netinet/in.h> |
| 1439 | ], |
| 1440 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 1441 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 1442 | [ ac_cv_have_struct_in6_addr="no" ] |
| 1443 | ) |
| 1444 | ]) |
| 1445 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 1446 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 1447 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 1448 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1449 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 1450 | AC_TRY_COMPILE( |
| 1451 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1452 | #include <sys/types.h> |
| 1453 | #include <sys/socket.h> |
| 1454 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1455 | ], |
| 1456 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 1457 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 1458 | [ ac_cv_have_struct_addrinfo="no" ] |
| 1459 | ) |
| 1460 | ]) |
| 1461 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 1462 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 1463 | fi |
| 1464 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1465 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 1466 | AC_TRY_COMPILE( |
| 1467 | [ #include <sys/time.h> ], |
| 1468 | [ struct timeval tv; tv.tv_sec = 1;], |
| 1469 | [ ac_cv_have_struct_timeval="yes" ], |
| 1470 | [ ac_cv_have_struct_timeval="no" ] |
| 1471 | ) |
| 1472 | ]) |
| 1473 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
| 1474 | AC_DEFINE(HAVE_STRUCT_TIMEVAL) |
| 1475 | have_struct_timeval=1 |
| 1476 | fi |
| 1477 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1478 | # If we don't have int64_t then we can't compile sftp-server. So don't |
| 1479 | # even attempt to do it. |
| 1480 | if test "x$ac_cv_have_int64_t" = "xno" -a \ |
| 1481 | "x$ac_cv_sizeof_long_int" != "x8" -a \ |
| 1482 | "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
| 1483 | NO_SFTP='#' |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1484 | else |
| 1485 | dnl test snprintf (broken on SCO w/gcc) |
| 1486 | AC_TRY_RUN( |
| 1487 | [ |
| 1488 | #include <stdio.h> |
| 1489 | #include <string.h> |
| 1490 | #ifdef HAVE_SNPRINTF |
| 1491 | main() |
| 1492 | { |
| 1493 | char buf[50]; |
| 1494 | char expected_out[50]; |
| 1495 | int mazsize = 50 ; |
| 1496 | #if (SIZEOF_LONG_INT == 8) |
| 1497 | long int num = 0x7fffffffffffffff; |
| 1498 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 1499 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 1500 | #endif |
| 1501 | strcpy(expected_out, "9223372036854775807"); |
| 1502 | snprintf(buf, mazsize, "%lld", num); |
| 1503 | if(strcmp(buf, expected_out) != 0) |
| 1504 | exit(1); |
| 1505 | exit(0); |
| 1506 | } |
| 1507 | #else |
| 1508 | main() { exit(0); } |
| 1509 | #endif |
| 1510 | ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] |
| 1511 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1512 | fi |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 1513 | AC_SUBST(NO_SFTP) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1514 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1515 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1516 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 1517 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 1518 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 1519 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 1520 | 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] | 1521 | 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] | 1522 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 1523 | 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] | 1524 | 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] | 1525 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 1526 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 1527 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 1528 | 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] | 1529 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 1530 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 1531 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 1532 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1533 | |
| 1534 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1535 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1536 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 1537 | ac_cv_have_ss_family_in_struct_ss, [ |
| 1538 | AC_TRY_COMPILE( |
| 1539 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1540 | #include <sys/types.h> |
| 1541 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1542 | ], |
| 1543 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 1544 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 1545 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 1546 | ) |
| 1547 | ]) |
| 1548 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 1549 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 1550 | fi |
| 1551 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1552 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 1553 | ac_cv_have___ss_family_in_struct_ss, [ |
| 1554 | AC_TRY_COMPILE( |
| 1555 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1556 | #include <sys/types.h> |
| 1557 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1558 | ], |
| 1559 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 1560 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 1561 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 1562 | ) |
| 1563 | ]) |
| 1564 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 1565 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 1566 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 1567 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1568 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 1569 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 1570 | AC_TRY_COMPILE( |
| 1571 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1572 | #include <pwd.h> |
| 1573 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 1574 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1575 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 1576 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 1577 | ) |
| 1578 | ]) |
| 1579 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 1580 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 1581 | fi |
| 1582 | |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 1583 | AC_CACHE_CHECK([for pw_expire field in struct passwd], |
| 1584 | ac_cv_have_pw_expire_in_struct_passwd, [ |
| 1585 | AC_TRY_COMPILE( |
| 1586 | [ |
| 1587 | #include <pwd.h> |
| 1588 | ], |
| 1589 | [ struct passwd p; p.pw_expire = 0; ], |
| 1590 | [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], |
| 1591 | [ ac_cv_have_pw_expire_in_struct_passwd="no" ] |
| 1592 | ) |
| 1593 | ]) |
| 1594 | if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then |
| 1595 | AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD) |
| 1596 | fi |
| 1597 | |
| 1598 | AC_CACHE_CHECK([for pw_change field in struct passwd], |
| 1599 | ac_cv_have_pw_change_in_struct_passwd, [ |
| 1600 | AC_TRY_COMPILE( |
| 1601 | [ |
| 1602 | #include <pwd.h> |
| 1603 | ], |
| 1604 | [ struct passwd p; p.pw_change = 0; ], |
| 1605 | [ ac_cv_have_pw_change_in_struct_passwd="yes" ], |
| 1606 | [ ac_cv_have_pw_change_in_struct_passwd="no" ] |
| 1607 | ) |
| 1608 | ]) |
| 1609 | if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then |
| 1610 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) |
| 1611 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1612 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1613 | dnl make sure we're using the real structure members and not defines |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1614 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 1615 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1616 | AC_TRY_RUN( |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1617 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1618 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1619 | #include <sys/socket.h> |
| 1620 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1621 | int main() { |
| 1622 | #ifdef msg_accrights |
| 1623 | exit(1); |
| 1624 | #endif |
| 1625 | struct msghdr m; |
| 1626 | m.msg_accrights = 0; |
| 1627 | exit(0); |
| 1628 | } |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1629 | ], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 1630 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 1631 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 1632 | ) |
| 1633 | ]) |
| 1634 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
| 1635 | AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR) |
| 1636 | fi |
| 1637 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1638 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 1639 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1640 | AC_TRY_RUN( |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1641 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1642 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1643 | #include <sys/socket.h> |
| 1644 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 1645 | int main() { |
| 1646 | #ifdef msg_control |
| 1647 | exit(1); |
| 1648 | #endif |
| 1649 | struct msghdr m; |
| 1650 | m.msg_control = 0; |
| 1651 | exit(0); |
| 1652 | } |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1653 | ], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 1654 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 1655 | [ ac_cv_have_control_in_msghdr="no" ] |
| 1656 | ) |
| 1657 | ]) |
| 1658 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
| 1659 | AC_DEFINE(HAVE_CONTROL_IN_MSGHDR) |
| 1660 | fi |
| 1661 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1662 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 1663 | AC_TRY_LINK([], |
| 1664 | [ extern char *__progname; printf("%s", __progname); ], |
| 1665 | [ ac_cv_libc_defines___progname="yes" ], |
| 1666 | [ ac_cv_libc_defines___progname="no" ] |
| 1667 | ) |
| 1668 | ]) |
| 1669 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 1670 | AC_DEFINE(HAVE___PROGNAME) |
| 1671 | fi |
| 1672 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 1673 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
| 1674 | AC_TRY_LINK([ |
| 1675 | #include <stdio.h> |
| 1676 | ], |
| 1677 | [ printf("%s", __FUNCTION__); ], |
| 1678 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 1679 | [ ac_cv_cc_implements___FUNCTION__="no" ] |
| 1680 | ) |
| 1681 | ]) |
| 1682 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
| 1683 | AC_DEFINE(HAVE___FUNCTION__) |
| 1684 | fi |
| 1685 | |
| 1686 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
| 1687 | AC_TRY_LINK([ |
| 1688 | #include <stdio.h> |
| 1689 | ], |
| 1690 | [ printf("%s", __func__); ], |
| 1691 | [ ac_cv_cc_implements___func__="yes" ], |
| 1692 | [ ac_cv_cc_implements___func__="no" ] |
| 1693 | ) |
| 1694 | ]) |
| 1695 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
| 1696 | AC_DEFINE(HAVE___func__) |
| 1697 | fi |
| 1698 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 1699 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 1700 | ac_cv_have_getopt_optreset, [ |
| 1701 | AC_TRY_LINK( |
| 1702 | [ |
| 1703 | #include <getopt.h> |
| 1704 | ], |
| 1705 | [ extern int optreset; optreset = 0; ], |
| 1706 | [ ac_cv_have_getopt_optreset="yes" ], |
| 1707 | [ ac_cv_have_getopt_optreset="no" ] |
| 1708 | ) |
| 1709 | ]) |
| 1710 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
| 1711 | AC_DEFINE(HAVE_GETOPT_OPTRESET) |
| 1712 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1713 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 1714 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 1715 | AC_TRY_LINK([], |
| 1716 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 1717 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 1718 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 1719 | ) |
| 1720 | ]) |
| 1721 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 1722 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 1723 | fi |
| 1724 | |
| 1725 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 1726 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
| 1727 | AC_TRY_LINK([], |
| 1728 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
| 1729 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 1730 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 1731 | ) |
| 1732 | ]) |
| 1733 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 1734 | AC_DEFINE(HAVE_SYS_NERR) |
| 1735 | fi |
| 1736 | |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1737 | SCARD_MSG="no" |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 1738 | |
| 1739 | # Check whether user wants sectok support |
| 1740 | AC_ARG_WITH(sectok, |
| 1741 | [ --with-sectok Enable smartcard support using libsectok], |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1742 | [ |
| 1743 | if test "x$withval" != "xno" ; then |
| 1744 | if test "x$withval" != "xyes" ; then |
| 1745 | CPPFLAGS="$CPPFLAGS -I${withval}" |
| 1746 | LDFLAGS="$LDFLAGS -L${withval}" |
| 1747 | if test ! -z "$need_dash_r" ; then |
| 1748 | LDFLAGS="$LDFLAGS -R${withval}" |
| 1749 | fi |
| 1750 | if test ! -z "$blibpath" ; then |
| 1751 | blibpath="$blibpath:${withval}" |
| 1752 | fi |
| 1753 | fi |
| 1754 | AC_CHECK_HEADERS(sectok.h) |
| 1755 | if test "$ac_cv_header_sectok_h" != yes; then |
| 1756 | AC_MSG_ERROR(Can't find sectok.h) |
| 1757 | fi |
| 1758 | AC_CHECK_LIB(sectok, sectok_open) |
| 1759 | if test "$ac_cv_lib_sectok_sectok_open" != yes; then |
| 1760 | AC_MSG_ERROR(Can't find libsectok) |
| 1761 | fi |
| 1762 | AC_DEFINE(SMARTCARD) |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 1763 | AC_DEFINE(USE_SECTOK) |
| 1764 | SCARD_MSG="yes, using sectok" |
| 1765 | fi |
| 1766 | ] |
| 1767 | ) |
| 1768 | |
| 1769 | # Check whether user wants OpenSC support |
| 1770 | AC_ARG_WITH(opensc, |
Damien Miller | f6195f2 | 2002-04-23 22:48:46 +1000 | [diff] [blame] | 1771 | AC_HELP_STRING([--with-opensc=PFX], |
| 1772 | [Enable smartcard support using OpenSC]), |
| 1773 | opensc_config_prefix="$withval", opensc_config_prefix="") |
| 1774 | if test x$opensc_config_prefix != x ; then |
| 1775 | OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config |
| 1776 | AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) |
| 1777 | if test "$OPENSC_CONFIG" != "no"; then |
| 1778 | LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` |
| 1779 | LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` |
| 1780 | CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" |
| 1781 | LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" |
| 1782 | AC_DEFINE(SMARTCARD) |
| 1783 | AC_DEFINE(USE_OPENSC) |
| 1784 | SCARD_MSG="yes, using OpenSC" |
| 1785 | fi |
| 1786 | fi |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 1787 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 1788 | # Check whether user wants Kerberos 5 support |
| 1789 | KRB5_MSG="no" |
| 1790 | AC_ARG_WITH(kerberos5, |
| 1791 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
| 1792 | [ |
| 1793 | if test "x$withval" != "xno" ; then |
| 1794 | if test "x$withval" = "xyes" ; then |
| 1795 | KRB5ROOT="/usr/local" |
| 1796 | else |
| 1797 | KRB5ROOT=${withval} |
| 1798 | fi |
| 1799 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
| 1800 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
| 1801 | AC_DEFINE(KRB5) |
| 1802 | KRB5_MSG="yes" |
| 1803 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 1804 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 1805 | [ char *tmp = heimdal_version; ], |
| 1806 | [ AC_MSG_RESULT(yes) |
| 1807 | AC_DEFINE(HEIMDAL) |
| 1808 | K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken" |
| 1809 | ], |
| 1810 | [ AC_MSG_RESULT(no) |
| 1811 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
| 1812 | ] |
| 1813 | ) |
| 1814 | if test ! -z "$need_dash_r" ; then |
| 1815 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 1816 | fi |
| 1817 | if test ! -z "$blibpath" ; then |
| 1818 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 1819 | fi |
| 1820 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1821 | |
| 1822 | KRB5=yes |
| 1823 | fi |
| 1824 | ] |
| 1825 | ) |
| 1826 | # Check whether user wants Kerberos 4 support |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1827 | KRB4_MSG="no" |
| 1828 | AC_ARG_WITH(kerberos4, |
| 1829 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
| 1830 | [ |
| 1831 | if test "x$withval" != "xno" ; then |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1832 | if test "x$withval" != "xyes" ; then |
| 1833 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1834 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1835 | if test ! -z "$need_dash_r" ; then |
| 1836 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 1837 | fi |
| 1838 | if test ! -z "$blibpath" ; then |
| 1839 | blibpath="$blibpath:${withval}/lib" |
| 1840 | fi |
| 1841 | else |
| 1842 | if test -d /usr/include/kerberosIV ; then |
| 1843 | CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV" |
| 1844 | fi |
| 1845 | fi |
| 1846 | |
| 1847 | AC_CHECK_HEADERS(krb.h) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1848 | if test "$ac_cv_header_krb_h" != yes; then |
| 1849 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 1850 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1851 | AC_CHECK_LIB(krb, main) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1852 | if test "$ac_cv_lib_krb_main" != yes; then |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1853 | AC_CHECK_LIB(krb4, main) |
| 1854 | if test "$ac_cv_lib_krb4_main" != yes; then |
| 1855 | AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail]) |
| 1856 | else |
| 1857 | KLIBS="-lkrb4" |
| 1858 | fi |
| 1859 | else |
| 1860 | KLIBS="-lkrb" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1861 | fi |
Damien Miller | 9834474 | 2001-03-28 14:37:06 +1000 | [diff] [blame] | 1862 | AC_CHECK_LIB(des, des_cbc_encrypt) |
| 1863 | if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then |
| 1864 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
| 1865 | if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then |
| 1866 | AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail]) |
| 1867 | else |
| 1868 | KLIBS="-ldes425" |
| 1869 | fi |
| 1870 | else |
| 1871 | KLIBS="-ldes" |
| 1872 | fi |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1873 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1874 | KRB4=yes |
| 1875 | KRB4_MSG="yes" |
| 1876 | AC_DEFINE(KRB4) |
| 1877 | fi |
| 1878 | ] |
| 1879 | ) |
| 1880 | |
| 1881 | # Check whether user wants AFS support |
| 1882 | AFS_MSG="no" |
| 1883 | AC_ARG_WITH(afs, |
| 1884 | [ --with-afs=PATH Enable AFS support], |
| 1885 | [ |
| 1886 | if test "x$withval" != "xno" ; then |
| 1887 | |
| 1888 | if test "x$withval" != "xyes" ; then |
| 1889 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1890 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1891 | fi |
| 1892 | |
| 1893 | if test -z "$KRB4" ; then |
| 1894 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 1895 | fi |
| 1896 | |
| 1897 | LIBS="-lkafs $LIBS" |
| 1898 | if test ! -z "$AFS_LIBS" ; then |
| 1899 | LIBS="$LIBS $AFS_LIBS" |
| 1900 | fi |
| 1901 | AC_DEFINE(AFS) |
| 1902 | AFS_MSG="yes" |
| 1903 | fi |
| 1904 | ] |
| 1905 | ) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 1906 | LIBS="$LIBS $KLIBS $K5LIBS" |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 1907 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1908 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1909 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 1910 | PRIVSEP_PATH=/var/empty |
| 1911 | AC_ARG_WITH(privsep-path, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1912 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 1913 | [ |
| 1914 | if test "x$withval" != "$no" ; then |
| 1915 | PRIVSEP_PATH=$withval |
| 1916 | fi |
| 1917 | ] |
| 1918 | ) |
| 1919 | AC_SUBST(PRIVSEP_PATH) |
| 1920 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1921 | AC_ARG_WITH(xauth, |
| 1922 | [ --with-xauth=PATH Specify path to xauth program ], |
| 1923 | [ |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 1924 | if test "x$withval" != "xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1925 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1926 | fi |
| 1927 | ], |
| 1928 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 1929 | TestPath="$PATH" |
| 1930 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 1931 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 1932 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 1933 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
| 1934 | AC_PATH_PROG(xauth_path, xauth, , $TestPath) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1935 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1936 | xauth_path="/usr/openwin/bin/xauth" |
| 1937 | fi |
| 1938 | ] |
| 1939 | ) |
| 1940 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 1941 | STRIP_OPT=-s |
| 1942 | AC_ARG_ENABLE(strip, |
| 1943 | [ --disable-strip Disable calling strip(1) on install], |
| 1944 | [ |
| 1945 | if test "x$enableval" = "xno" ; then |
| 1946 | STRIP_OPT= |
| 1947 | fi |
| 1948 | ] |
| 1949 | ) |
| 1950 | AC_SUBST(STRIP_OPT) |
| 1951 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1952 | if test -z "$xauth_path" ; then |
| 1953 | XAUTH_PATH="undefined" |
| 1954 | AC_SUBST(XAUTH_PATH) |
| 1955 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1956 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 1957 | XAUTH_PATH=$xauth_path |
| 1958 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1959 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1960 | |
| 1961 | # Check for mail directory (last resort if we cannot get it from headers) |
| 1962 | if test ! -z "$MAIL" ; then |
| 1963 | maildir=`dirname $MAIL` |
| 1964 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 1965 | fi |
| 1966 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1967 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 1968 | if test "x$disable_ptmx_check" != "xyes" ; then |
| 1969 | AC_CHECK_FILE("/dev/ptmx", |
| 1970 | [ |
| 1971 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 1972 | have_dev_ptmx=1 |
| 1973 | ] |
| 1974 | ) |
| 1975 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1976 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 1977 | AC_CHECK_FILE("/dev/ptc", |
| 1978 | [ |
| 1979 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 1980 | have_dev_ptc=1 |
| 1981 | ] |
| 1982 | ) |
| 1983 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1984 | # Options from here on. Some of these are preset by platform above |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 1985 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1986 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1987 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 1988 | case "$withval" in |
| 1989 | man|cat|doc) |
| 1990 | MANTYPE=$withval |
| 1991 | ;; |
| 1992 | *) |
| 1993 | AC_MSG_ERROR(invalid man type: $withval) |
| 1994 | ;; |
| 1995 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1996 | ] |
| 1997 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 1998 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 1999 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
| 2000 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2001 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 2002 | MANTYPE=doc |
| 2003 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 2004 | MANTYPE=man |
| 2005 | else |
| 2006 | MANTYPE=cat |
| 2007 | fi |
| 2008 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 2009 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2010 | if test "$MANTYPE" = "doc"; then |
| 2011 | mansubdir=man; |
| 2012 | else |
| 2013 | mansubdir=$MANTYPE; |
| 2014 | fi |
| 2015 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2016 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2017 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2018 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 2019 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 2020 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2021 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 2022 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2023 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2024 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2025 | fi |
| 2026 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 2027 | ) |
| 2028 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2029 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2030 | AC_ARG_WITH(shadow, |
| 2031 | [ --without-shadow Disable shadow password support], |
| 2032 | [ |
| 2033 | if test "x$withval" = "xno" ; then |
| 2034 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 2035 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2036 | fi |
| 2037 | ] |
| 2038 | ) |
| 2039 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 2040 | if test -z "$disable_shadow" ; then |
| 2041 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 2042 | AC_TRY_COMPILE( |
| 2043 | [ |
| 2044 | #include <sys/types.h> |
| 2045 | #include <shadow.h> |
| 2046 | struct spwd sp; |
| 2047 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 2048 | [ sp_expire_available=yes ], [] |
| 2049 | ) |
| 2050 | |
| 2051 | if test "x$sp_expire_available" = "xyes" ; then |
| 2052 | AC_MSG_RESULT(yes) |
| 2053 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 2054 | else |
| 2055 | AC_MSG_RESULT(no) |
| 2056 | fi |
| 2057 | fi |
| 2058 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2059 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 2060 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 2061 | DISPLAY_HACK_MSG="yes" |
| 2062 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 2063 | else |
| 2064 | DISPLAY_HACK_MSG="no" |
| 2065 | AC_ARG_WITH(ipaddr-display, |
| 2066 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 2067 | [ |
| 2068 | if test "x$withval" != "xno" ; then |
| 2069 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 2070 | DISPLAY_HACK_MSG="yes" |
| 2071 | fi |
| 2072 | ] |
| 2073 | ) |
| 2074 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2075 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2076 | dnl BSD systems use /etc/login.conf so --with-default-path= has no effect |
| 2077 | if test $ac_cv_func_login_getcapbool = "yes" -a \ |
| 2078 | $ac_cv_header_login_cap_h = "yes" ; then |
| 2079 | USES_LOGIN_CONF=yes |
| 2080 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2081 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2082 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 2083 | AC_ARG_WITH(default-path, |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 2084 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2085 | [ |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2086 | if test "$USES_LOGIN_CONF" = "yes" ; then |
| 2087 | AC_MSG_WARN([ |
| 2088 | --with-default-path=PATH has no effect on this system. |
| 2089 | Edit /etc/login.conf instead.]) |
| 2090 | elif test "x$withval" != "xno" ; then |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2091 | user_path="$withval" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2092 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2093 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2094 | ], |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2095 | [ if test "$USES_LOGIN_CONF" = "yes" ; then |
| 2096 | AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) |
| 2097 | else |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2098 | AC_TRY_RUN( |
| 2099 | [ |
| 2100 | /* find out what STDPATH is */ |
| 2101 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2102 | #ifdef HAVE_PATHS_H |
| 2103 | # include <paths.h> |
| 2104 | #endif |
| 2105 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 2106 | # ifdef _PATH_USERPATH /* Irix */ |
| 2107 | # define _PATH_STDPATH _PATH_USERPATH |
| 2108 | # else |
| 2109 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 2110 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2111 | #endif |
| 2112 | #include <sys/types.h> |
| 2113 | #include <sys/stat.h> |
| 2114 | #include <fcntl.h> |
| 2115 | #define DATA "conftest.stdpath" |
| 2116 | |
| 2117 | main() |
| 2118 | { |
| 2119 | FILE *fd; |
| 2120 | int rc; |
| 2121 | |
| 2122 | fd = fopen(DATA,"w"); |
| 2123 | if(fd == NULL) |
| 2124 | exit(1); |
| 2125 | |
| 2126 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 2127 | exit(1); |
| 2128 | |
| 2129 | exit(0); |
| 2130 | } |
| 2131 | ], [ user_path=`cat conftest.stdpath` ], |
| 2132 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 2133 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 2134 | ) |
| 2135 | # make sure $bindir is in USER_PATH so scp will work |
| 2136 | t_bindir=`eval echo ${bindir}` |
| 2137 | case $t_bindir in |
| 2138 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 2139 | esac |
| 2140 | case $t_bindir in |
| 2141 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 2142 | esac |
| 2143 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 2144 | if test $? -ne 0 ; then |
| 2145 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 2146 | if test $? -ne 0 ; then |
| 2147 | user_path=$user_path:$t_bindir |
| 2148 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 2149 | fi |
| 2150 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2151 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2152 | ) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2153 | if test "$USES_LOGIN_CONF" != "yes" ; then |
| 2154 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") |
| 2155 | AC_SUBST(user_path) |
| 2156 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2157 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2158 | # Set superuser path separately to user path |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2159 | AC_ARG_WITH(superuser-path, |
| 2160 | [ --with-superuser-path= Specify different path for super-user], |
| 2161 | [ |
| 2162 | if test "x$withval" != "xno" ; then |
| 2163 | AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval") |
| 2164 | superuser_path=$withval |
| 2165 | fi |
| 2166 | ] |
| 2167 | ) |
| 2168 | |
| 2169 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2170 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2171 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 2172 | AC_ARG_WITH(ipv4-default, |
| 2173 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 2174 | [ |
| 2175 | if test "x$withval" != "xno" ; then |
| 2176 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2177 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 2178 | fi |
| 2179 | ] |
| 2180 | ) |
| 2181 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2182 | 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] | 2183 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2184 | AC_ARG_WITH(4in6, |
| 2185 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 2186 | [ |
| 2187 | if test "x$withval" != "xno" ; then |
| 2188 | AC_MSG_RESULT(yes) |
| 2189 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2190 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2191 | else |
| 2192 | AC_MSG_RESULT(no) |
| 2193 | fi |
| 2194 | ],[ |
| 2195 | if test "x$inet6_default_4in6" = "xyes"; then |
| 2196 | AC_MSG_RESULT([yes (default)]) |
| 2197 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2198 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 2199 | else |
| 2200 | AC_MSG_RESULT([no (default)]) |
| 2201 | fi |
| 2202 | ] |
| 2203 | ) |
| 2204 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2205 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2206 | BSD_AUTH_MSG=no |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2207 | AC_ARG_WITH(bsd-auth, |
| 2208 | [ --with-bsd-auth Enable BSD auth support], |
| 2209 | [ |
| 2210 | if test "x$withval" != "xno" ; then |
| 2211 | AC_DEFINE(BSD_AUTH) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2212 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2213 | fi |
| 2214 | ] |
| 2215 | ) |
| 2216 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2217 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 2218 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2219 | # make sure the directory exists |
| 2220 | if test ! -d $piddir ; then |
| 2221 | piddir=`eval echo ${sysconfdir}` |
| 2222 | case $piddir in |
| 2223 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 2224 | esac |
| 2225 | fi |
| 2226 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 2227 | AC_ARG_WITH(pid-dir, |
| 2228 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 2229 | [ |
| 2230 | if test "x$withval" != "xno" ; then |
| 2231 | piddir=$withval |
| 2232 | if test ! -d $piddir ; then |
| 2233 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 2234 | fi |
| 2235 | fi |
| 2236 | ] |
| 2237 | ) |
| 2238 | |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 2239 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 2240 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 2241 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2242 | dnl allow user to disable some login recording features |
| 2243 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2244 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2245 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 2246 | ) |
| 2247 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2248 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2249 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 2250 | ) |
| 2251 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2252 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2253 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 2254 | ) |
| 2255 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2256 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2257 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 2258 | ) |
| 2259 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2260 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2261 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 2262 | ) |
| 2263 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2264 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2265 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 2266 | ) |
| 2267 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2268 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2269 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 2270 | ) |
| 2271 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2272 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2273 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 2274 | ) |
| 2275 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 2276 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 2277 | [ |
| 2278 | if test "x$withval" = "xno" ; then |
| 2279 | AC_DEFINE(DISABLE_LASTLOG) |
| 2280 | else |
| 2281 | conf_lastlog_location=$withval |
| 2282 | fi |
| 2283 | ] |
| 2284 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2285 | |
| 2286 | dnl lastlog, [uw]tmpx? detection |
| 2287 | dnl NOTE: set the paths in the platform section to avoid the |
| 2288 | dnl need for command-line parameters |
| 2289 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 2290 | |
| 2291 | dnl lastlog detection |
| 2292 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 2293 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 2294 | AC_TRY_COMPILE([ |
| 2295 | #include <sys/types.h> |
| 2296 | #include <utmp.h> |
| 2297 | #ifdef HAVE_LASTLOG_H |
| 2298 | # include <lastlog.h> |
| 2299 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2300 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2301 | # include <paths.h> |
| 2302 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2303 | #ifdef HAVE_LOGIN_H |
| 2304 | # include <login.h> |
| 2305 | #endif |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2306 | ], |
| 2307 | [ char *lastlog = LASTLOG_FILE; ], |
| 2308 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2309 | [ |
| 2310 | AC_MSG_RESULT(no) |
| 2311 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 2312 | AC_TRY_COMPILE([ |
| 2313 | #include <sys/types.h> |
| 2314 | #include <utmp.h> |
| 2315 | #ifdef HAVE_LASTLOG_H |
| 2316 | # include <lastlog.h> |
| 2317 | #endif |
| 2318 | #ifdef HAVE_PATHS_H |
| 2319 | # include <paths.h> |
| 2320 | #endif |
| 2321 | ], |
| 2322 | [ char *lastlog = _PATH_LASTLOG; ], |
| 2323 | [ AC_MSG_RESULT(yes) ], |
| 2324 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 2325 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2326 | system_lastlog_path=no |
| 2327 | ]) |
| 2328 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2329 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2330 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2331 | if test -z "$conf_lastlog_location"; then |
| 2332 | if test x"$system_lastlog_path" = x"no" ; then |
| 2333 | 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] | 2334 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2335 | conf_lastlog_location=$f |
| 2336 | fi |
| 2337 | done |
| 2338 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 2339 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 2340 | 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] | 2341 | fi |
| 2342 | fi |
| 2343 | fi |
| 2344 | |
| 2345 | if test -n "$conf_lastlog_location"; then |
| 2346 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 2347 | fi |
| 2348 | |
| 2349 | dnl utmp detection |
| 2350 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 2351 | AC_TRY_COMPILE([ |
| 2352 | #include <sys/types.h> |
| 2353 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2354 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2355 | # include <paths.h> |
| 2356 | #endif |
| 2357 | ], |
| 2358 | [ char *utmp = UTMP_FILE; ], |
| 2359 | [ AC_MSG_RESULT(yes) ], |
| 2360 | [ AC_MSG_RESULT(no) |
| 2361 | system_utmp_path=no ] |
| 2362 | ) |
| 2363 | if test -z "$conf_utmp_location"; then |
| 2364 | if test x"$system_utmp_path" = x"no" ; then |
| 2365 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 2366 | if test -f $f ; then |
| 2367 | conf_utmp_location=$f |
| 2368 | fi |
| 2369 | done |
| 2370 | if test -z "$conf_utmp_location"; then |
| 2371 | AC_DEFINE(DISABLE_UTMP) |
| 2372 | fi |
| 2373 | fi |
| 2374 | fi |
| 2375 | if test -n "$conf_utmp_location"; then |
| 2376 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 2377 | fi |
| 2378 | |
| 2379 | dnl wtmp detection |
| 2380 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 2381 | AC_TRY_COMPILE([ |
| 2382 | #include <sys/types.h> |
| 2383 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2384 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2385 | # include <paths.h> |
| 2386 | #endif |
| 2387 | ], |
| 2388 | [ char *wtmp = WTMP_FILE; ], |
| 2389 | [ AC_MSG_RESULT(yes) ], |
| 2390 | [ AC_MSG_RESULT(no) |
| 2391 | system_wtmp_path=no ] |
| 2392 | ) |
| 2393 | if test -z "$conf_wtmp_location"; then |
| 2394 | if test x"$system_wtmp_path" = x"no" ; then |
| 2395 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 2396 | if test -f $f ; then |
| 2397 | conf_wtmp_location=$f |
| 2398 | fi |
| 2399 | done |
| 2400 | if test -z "$conf_wtmp_location"; then |
| 2401 | AC_DEFINE(DISABLE_WTMP) |
| 2402 | fi |
| 2403 | fi |
| 2404 | fi |
| 2405 | if test -n "$conf_wtmp_location"; then |
| 2406 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 2407 | fi |
| 2408 | |
| 2409 | |
| 2410 | dnl utmpx detection - I don't know any system so perverse as to require |
| 2411 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 2412 | dnl there, though. |
| 2413 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 2414 | AC_TRY_COMPILE([ |
| 2415 | #include <sys/types.h> |
| 2416 | #include <utmp.h> |
| 2417 | #ifdef HAVE_UTMPX_H |
| 2418 | #include <utmpx.h> |
| 2419 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2420 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2421 | # include <paths.h> |
| 2422 | #endif |
| 2423 | ], |
| 2424 | [ char *utmpx = UTMPX_FILE; ], |
| 2425 | [ AC_MSG_RESULT(yes) ], |
| 2426 | [ AC_MSG_RESULT(no) |
| 2427 | system_utmpx_path=no ] |
| 2428 | ) |
| 2429 | if test -z "$conf_utmpx_location"; then |
| 2430 | if test x"$system_utmpx_path" = x"no" ; then |
| 2431 | AC_DEFINE(DISABLE_UTMPX) |
| 2432 | fi |
| 2433 | else |
| 2434 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 2435 | fi |
| 2436 | |
| 2437 | dnl wtmpx detection |
| 2438 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 2439 | AC_TRY_COMPILE([ |
| 2440 | #include <sys/types.h> |
| 2441 | #include <utmp.h> |
| 2442 | #ifdef HAVE_UTMPX_H |
| 2443 | #include <utmpx.h> |
| 2444 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 2445 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2446 | # include <paths.h> |
| 2447 | #endif |
| 2448 | ], |
| 2449 | [ char *wtmpx = WTMPX_FILE; ], |
| 2450 | [ AC_MSG_RESULT(yes) ], |
| 2451 | [ AC_MSG_RESULT(no) |
| 2452 | system_wtmpx_path=no ] |
| 2453 | ) |
| 2454 | if test -z "$conf_wtmpx_location"; then |
| 2455 | if test x"$system_wtmpx_path" = x"no" ; then |
| 2456 | AC_DEFINE(DISABLE_WTMPX) |
| 2457 | fi |
| 2458 | else |
| 2459 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 2460 | fi |
| 2461 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 2462 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 2463 | if test ! -z "$blibpath" ; then |
| 2464 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 2465 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 2466 | fi |
| 2467 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2468 | dnl remove pam and dl because they are in $LIBPAM |
| 2469 | if test "$PAM_MSG" = yes ; then |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 2470 | LIBS=`echo $LIBS | sed 's/-lpam //'` |
| 2471 | fi |
| 2472 | if test "$ac_cv_lib_pam_pam_set_item" = yes ; then |
| 2473 | LIBS=`echo $LIBS | sed 's/-ldl //'` |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2474 | fi |
| 2475 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 2476 | AC_EXEEXT |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 2477 | AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds]) |
| 2478 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 2479 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2480 | # Print summary of options |
| 2481 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2482 | # Someone please show me a better way :) |
| 2483 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 2484 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 2485 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 2486 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 2487 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2488 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2489 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2490 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 2491 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 2492 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2493 | |
| 2494 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 2495 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2496 | echo " User binaries: $B" |
| 2497 | echo " System binaries: $C" |
| 2498 | echo " Configuration files: $D" |
| 2499 | echo " Askpass program: $E" |
| 2500 | echo " Manual pages: $F" |
| 2501 | echo " PID file: $G" |
| 2502 | echo " Privilege separation chroot path: $H" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2503 | if test "$USES_LOGIN_CONF" = "yes" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2504 | echo " At runtime, sshd will use the path defined in /etc/login.conf" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2505 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2506 | echo " sshd default user PATH: $I" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2507 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2508 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2509 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 2510 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2511 | echo " Manpage format: $MANTYPE" |
| 2512 | echo " PAM support: ${PAM_MSG}" |
| 2513 | echo " KerberosIV support: $KRB4_MSG" |
| 2514 | echo " KerberosV support: $KRB5_MSG" |
| 2515 | echo " Smartcard support: $SCARD_MSG" |
| 2516 | echo " AFS support: $AFS_MSG" |
| 2517 | echo " S/KEY support: $SKEY_MSG" |
| 2518 | echo " TCP Wrappers support: $TCPW_MSG" |
| 2519 | echo " MD5 password support: $MD5_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 2520 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2521 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 2522 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 2523 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 2524 | echo " Random number source: $RAND_MSG" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2525 | if test ! -z "$USE_RAND_HELPER" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2526 | echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2527 | fi |
| 2528 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2529 | echo "" |
| 2530 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 2531 | echo " Host: ${host}" |
| 2532 | echo " Compiler: ${CC}" |
| 2533 | echo " Compiler flags: ${CFLAGS}" |
| 2534 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 2535 | echo " Linker flags: ${LDFLAGS}" |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2536 | echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2537 | |
| 2538 | echo "" |
| 2539 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 2540 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2541 | echo "PAM is enabled. You may need to install a PAM control file " |
| 2542 | echo "for sshd, otherwise password authentication may fail. " |
| 2543 | echo "Example PAM control files can be found in the contrib/ " |
| 2544 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 2545 | echo "" |
| 2546 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2547 | |
| 2548 | if test ! -z "$NO_SFTP"; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2549 | echo "sftp-server will be disabled. Your compiler does not " |
| 2550 | echo "support 64bit integers." |
| 2551 | echo "" |
| 2552 | fi |
| 2553 | |
| 2554 | if test ! -z "$RAND_HELPER_CMDHASH" ; then |
| 2555 | echo "WARNING: you are using the builtin random number collection " |
| 2556 | echo "service. Please read WARNING.RNG and request that your OS " |
| 2557 | echo "vendor includes kernel-based random number collection in " |
| 2558 | echo "future versions of your OS." |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2559 | echo "" |
| 2560 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 2561 | |