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