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