Tim Rice | 66fd217 | 2005-08-31 09:59:49 -0700 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.292 2005/08/31 16:59:49 tim Exp $ |
Damien Miller | 4fefe24 | 2004-03-11 14:20:10 +1100 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) 1999-2004 Damien Miller |
| 4 | # |
| 5 | # Permission to use, copy, modify, and distribute this software for any |
| 6 | # purpose with or without fee is hereby granted, provided that the above |
| 7 | # copyright notice and this permission notice appear in all copies. |
| 8 | # |
| 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 16 | |
Darren Tucker | 6a45f3d | 2005-06-03 19:33:10 +1000 | [diff] [blame] | 17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 18 | AC_CONFIG_SRCDIR([ssh.c]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 19 | |
| 20 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 21 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 22 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 23 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 24 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 25 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 26 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 27 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 28 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 29 | AC_PROG_INSTALL |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 30 | AC_PATH_PROG(AR, ar) |
Tim Rice | 5af9db9 | 2004-06-19 19:31:06 -0700 | [diff] [blame] | 31 | AC_PATH_PROG(CAT, cat) |
| 32 | AC_PATH_PROG(KILL, kill) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 33 | AC_PATH_PROGS(PERL, perl5 perl) |
Tim Rice | d0d7a8b | 2003-01-08 17:22:59 -0800 | [diff] [blame] | 34 | AC_PATH_PROG(SED, sed) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 35 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 36 | AC_PATH_PROG(ENT, ent) |
| 37 | AC_SUBST(ENT) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 38 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 39 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 40 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Tim Rice | 0502a47 | 2002-05-08 16:04:14 -0700 | [diff] [blame] | 41 | AC_PATH_PROG(SH, sh) |
Tim Rice | f7ba8f6 | 2004-06-20 10:37:32 -0700 | [diff] [blame] | 42 | AC_SUBST(TEST_SHELL,sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 43 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 44 | dnl for buildpkg.sh |
| 45 | AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd, |
| 46 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
| 47 | AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd, |
| 48 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
| 49 | AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no) |
| 50 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 51 | # System features |
| 52 | AC_SYS_LARGEFILE |
| 53 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 54 | if test -z "$AR" ; then |
| 55 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 56 | fi |
| 57 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 58 | # Use LOGIN_PROGRAM from environment if possible |
| 59 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 60 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 61 | else |
| 62 | # Search for login |
| 63 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 64 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 65 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 66 | fi |
| 67 | fi |
| 68 | |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 69 | AC_PATH_PROG(PATH_PASSWD_PROG, passwd) |
| 70 | if test ! -z "$PATH_PASSWD_PROG" ; then |
| 71 | AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG") |
| 72 | fi |
| 73 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 74 | if test -z "$LD" ; then |
| 75 | LD=$CC |
| 76 | fi |
| 77 | AC_SUBST(LD) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 78 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 79 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 80 | |
| 81 | AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>]) |
| 82 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 83 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | dd352b6 | 2005-08-02 17:21:29 +1000 | [diff] [blame] | 84 | CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 85 | GCC_VER=`$CC --version` |
| 86 | case $GCC_VER in |
| 87 | 1.*) ;; |
| 88 | 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;; |
| 89 | 2.*) ;; |
| 90 | *) CFLAGS="$CFLAGS -Wsign-compare" ;; |
| 91 | esac |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 92 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 93 | if test -z "$have_llong_max"; then |
| 94 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 95 | unset ac_cv_have_decl_LLONG_MAX |
| 96 | saved_CFLAGS="$CFLAGS" |
| 97 | CFLAGS="$CFLAGS -std=gnu99" |
| 98 | AC_CHECK_DECL(LLONG_MAX, |
| 99 | [have_llong_max=1], |
| 100 | [CFLAGS="$saved_CFLAGS"], |
| 101 | [#include <limits.h>] |
| 102 | ) |
| 103 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 104 | fi |
| 105 | |
Darren Tucker | 431f022 | 2005-06-07 17:53:40 +1000 | [diff] [blame] | 106 | if test -z "$have_llong_max"; then |
| 107 | AC_MSG_CHECKING([for max value of long long]) |
| 108 | AC_RUN_IFELSE( |
| 109 | [AC_LANG_SOURCE([[ |
| 110 | #include <stdio.h> |
| 111 | /* Why is this so damn hard? */ |
| 112 | #ifdef __GNUC__ |
| 113 | # undef __GNUC__ |
| 114 | #endif |
| 115 | #define __USE_ISOC99 |
| 116 | #include <limits.h> |
| 117 | #define DATA "conftest.llminmax" |
| 118 | int main(void) { |
| 119 | FILE *f; |
| 120 | long long i, llmin, llmax = 0; |
| 121 | |
| 122 | if((f = fopen(DATA,"w")) == NULL) |
| 123 | exit(1); |
| 124 | |
| 125 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 126 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 127 | llmin = LLONG_MIN; |
| 128 | llmax = LLONG_MAX; |
| 129 | #else |
| 130 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 131 | /* This will work on one's complement and two's complement */ |
| 132 | for (i = 1; i > llmax; i <<= 1, i++) |
| 133 | llmax = i; |
| 134 | llmin = llmax + 1LL; /* wrap */ |
| 135 | #endif |
| 136 | |
| 137 | /* Sanity check */ |
| 138 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
| 139 | || llmax - 1 > llmax) { |
| 140 | fprintf(f, "unknown unknown\n"); |
| 141 | exit(2); |
| 142 | } |
| 143 | |
| 144 | if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) |
| 145 | exit(3); |
| 146 | |
| 147 | exit(0); |
| 148 | } |
| 149 | ]])], |
| 150 | [ |
| 151 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 152 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 153 | AC_MSG_RESULT($llong_max) |
| 154 | AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], |
| 155 | [max value of long long calculated by configure]) |
| 156 | AC_MSG_CHECKING([for min value of long long]) |
| 157 | AC_MSG_RESULT($llong_min) |
| 158 | AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL], |
| 159 | [min value of long long calculated by configure]) |
| 160 | ], |
| 161 | [ |
| 162 | AC_MSG_RESULT(not found) |
| 163 | ], |
| 164 | [ |
| 165 | AC_MSG_WARN([cross compiling: not checking]) |
| 166 | ] |
| 167 | ) |
| 168 | fi |
| 169 | |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 170 | AC_ARG_WITH(rpath, |
| 171 | [ --without-rpath Disable auto-added -R linker paths], |
| 172 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 173 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 174 | need_dash_r="" |
| 175 | fi |
| 176 | if test "x$withval" = "xyes" ; then |
| 177 | need_dash_r=1 |
| 178 | fi |
| 179 | ] |
| 180 | ) |
| 181 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 182 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 183 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 184 | *-*-aix*) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 185 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 186 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 187 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 188 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 189 | saved_LDFLAGS="$LDFLAGS" |
| 190 | for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do |
| 191 | if (test -z "$blibflags"); then |
| 192 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
| 193 | AC_TRY_LINK([], [], [blibflags=$tryflags]) |
| 194 | fi |
| 195 | done |
| 196 | if (test -z "$blibflags"); then |
| 197 | AC_MSG_RESULT(not found) |
| 198 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 199 | else |
| 200 | AC_MSG_RESULT($blibflags) |
| 201 | fi |
| 202 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 203 | dnl Check for authenticate. Might be in libs.a on older AIXes |
| 204 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 205 | [AC_CHECK_LIB(s,authenticate, |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 206 | [ AC_DEFINE(WITH_AIXAUTHENTICATE) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 207 | LIBS="$LIBS -ls" |
| 208 | ]) |
| 209 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 210 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 211 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 212 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 213 | dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 214 | AC_CHECK_DECLS(loginfailed, |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 215 | [AC_MSG_CHECKING(if loginfailed takes 4 arguments) |
| 216 | AC_TRY_COMPILE( |
Darren Tucker | a0c0b63 | 2003-07-08 20:52:12 +1000 | [diff] [blame] | 217 | [#include <usersec.h>], |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 218 | [(void)loginfailed("user","host","tty",0);], |
| 219 | [AC_MSG_RESULT(yes) |
| 220 | AC_DEFINE(AIX_LOGINFAILED_4ARG)], |
Darren Tucker | a0c0b63 | 2003-07-08 20:52:12 +1000 | [diff] [blame] | 221 | [AC_MSG_RESULT(no)] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 222 | )], |
| 223 | [], |
| 224 | [#include <usersec.h>] |
| 225 | ) |
Darren Tucker | fc3454e | 2003-07-14 16:41:55 +1000 | [diff] [blame] | 226 | AC_CHECK_FUNCS(setauthdb) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 227 | check_for_aix_broken_getaddrinfo=1 |
Damien Miller | f5fea44 | 2002-04-23 22:52:45 +1000 | [diff] [blame] | 228 | AC_DEFINE(BROKEN_REALPATH) |
Darren Tucker | 9f18be6 | 2003-09-06 16:44:39 +1000 | [diff] [blame] | 229 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 230 | AC_DEFINE(BROKEN_SETREUID) |
| 231 | AC_DEFINE(BROKEN_SETREGID) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 232 | dnl AIX handles lastlog as part of its login message |
| 233 | AC_DEFINE(DISABLE_LASTLOG) |
Kevin Steves | 90d5de7 | 2002-06-22 18:51:48 +0000 | [diff] [blame] | 234 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Damien Miller | 3527625 | 2003-06-03 10:14:28 +1000 | [diff] [blame] | 235 | AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 236 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 237 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 238 | check_for_libcrypt_later=1 |
Tim Rice | fe1d100 | 2001-11-26 17:19:43 -0800 | [diff] [blame] | 239 | LIBS="$LIBS /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 240 | AC_DEFINE(HAVE_CYGWIN) |
Ben Lindstrom | ca60a9b | 2001-05-17 03:32:50 +0000 | [diff] [blame] | 241 | AC_DEFINE(USE_PIPES) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 242 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 243 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Ben Lindstrom | 38e6093 | 2001-02-24 00:55:04 +0000 | [diff] [blame] | 244 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Ben Lindstrom | 99a4e14 | 2002-07-09 14:06:40 +0000 | [diff] [blame] | 245 | AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 246 | AC_DEFINE(DISABLE_FD_PASSING) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 247 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 248 | *-*-dgux*) |
| 249 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Darren Tucker | 454da0b | 2003-12-18 12:52:19 +1100 | [diff] [blame] | 250 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 251 | AC_DEFINE(BROKEN_SETREUID) |
| 252 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 253 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 254 | *-*-darwin*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 255 | AC_MSG_CHECKING(if we have working getaddrinfo) |
| 256 | AC_TRY_RUN([#include <mach-o/dyld.h> |
| 257 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 258 | exit(0); |
| 259 | else |
| 260 | exit(1); |
| 261 | }], [AC_MSG_RESULT(working)], |
| 262 | [AC_MSG_RESULT(buggy) |
| 263 | AC_DEFINE(BROKEN_GETADDRINFO)], |
Tim Rice | 480ef8d | 2003-09-21 21:38:11 -0700 | [diff] [blame] | 264 | [AC_MSG_RESULT(assume it is working)]) |
Darren Tucker | 20379a3 | 2003-09-22 11:07:40 +1000 | [diff] [blame] | 265 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 266 | AC_DEFINE(BROKEN_SETREUID) |
| 267 | AC_DEFINE(BROKEN_SETREGID) |
Damien Miller | 7a2ea78 | 2004-01-02 17:52:10 +1100 | [diff] [blame] | 268 | AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 269 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 270 | *-*-hpux*) |
| 271 | # first we define all of the options common to all HP-UX releases |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 272 | 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] | 273 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 274 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 275 | AC_DEFINE(LOGIN_NO_ENDOPT) |
| 276 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 277 | AC_DEFINE(LOCKED_PASSWD_STRING, "*") |
Damien Miller | 3527625 | 2003-06-03 10:14:28 +1000 | [diff] [blame] | 278 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 279 | LIBS="$LIBS -lsec" |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 280 | AC_CHECK_LIB(xnet, t_error, , |
| 281 | AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) |
| 282 | |
| 283 | # next, we define all of the options specific to major releases |
| 284 | case "$host" in |
| 285 | *-*-hpux10*) |
| 286 | if test -z "$GCC"; then |
| 287 | CFLAGS="$CFLAGS -Ae" |
| 288 | fi |
| 289 | ;; |
| 290 | *-*-hpux11*) |
| 291 | AC_DEFINE(PAM_SUN_CODEBASE) |
| 292 | AC_DEFINE(DISABLE_UTMP) |
| 293 | AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) |
| 294 | check_for_hpux_broken_getaddrinfo=1 |
| 295 | check_for_conflicting_getspnam=1 |
| 296 | ;; |
| 297 | esac |
| 298 | |
| 299 | # lastly, we define options specific to minor releases |
| 300 | case "$host" in |
| 301 | *-*-hpux10.26) |
| 302 | AC_DEFINE(HAVE_SECUREWARE) |
| 303 | disable_ptmx_check=yes |
| 304 | LIBS="$LIBS -lsecpw" |
| 305 | ;; |
| 306 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 307 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 308 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 309 | PATH="$PATH:/usr/etc" |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 310 | AC_DEFINE(BROKEN_INET_NTOA) |
Darren Tucker | beaf679 | 2003-09-24 20:03:48 +1000 | [diff] [blame] | 311 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 312 | AC_DEFINE(BROKEN_SETREUID) |
| 313 | AC_DEFINE(BROKEN_SETREGID) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 314 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 315 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 316 | ;; |
| 317 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 318 | PATH="$PATH:/usr/etc" |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 319 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 320 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 321 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 8ff2a8d | 2002-04-06 18:58:31 +0000 | [diff] [blame] | 322 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 323 | AC_DEFINE(BROKEN_INET_NTOA) |
Darren Tucker | be79af1 | 2003-09-22 11:58:21 +1000 | [diff] [blame] | 324 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 325 | AC_DEFINE(BROKEN_SETREUID) |
| 326 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 8db9a0f | 2004-04-06 21:31:12 +1000 | [diff] [blame] | 327 | AC_DEFINE(BROKEN_UPDWTMPX) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 328 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 329 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 330 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 331 | *-*-linux*) |
| 332 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 333 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 334 | check_for_openpty_ctty_bug=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 335 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 336 | AC_DEFINE(PAM_TTY_KLUDGE) |
Darren Tucker | 809031f | 2004-03-30 14:03:45 +1000 | [diff] [blame] | 337 | AC_DEFINE(LOCKED_PASSWD_PREFIX, "!") |
Damien Miller | 3527625 | 2003-06-03 10:14:28 +1000 | [diff] [blame] | 338 | AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) |
Darren Tucker | e59b508 | 2004-06-28 16:01:19 +1000 | [diff] [blame] | 339 | AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM) |
Darren Tucker | 2fba993 | 2005-02-02 23:30:24 +1100 | [diff] [blame] | 340 | AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts]) |
| 341 | AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 342 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 343 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 344 | 1.*|2.0.*) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 345 | AC_DEFINE(BROKEN_CMSG_TYPE) |
| 346 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 347 | esac |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 348 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 349 | mips-sony-bsd|mips-sony-newsos4) |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 350 | AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 351 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 352 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 353 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 354 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 355 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 356 | need_dash_r=1 |
| 357 | fi |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 358 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 359 | *-*-freebsd*) |
| 360 | check_for_libcrypt_later=1 |
| 361 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 362 | *-*-bsdi*) |
| 363 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 364 | AC_DEFINE(BROKEN_SETREUID) |
| 365 | AC_DEFINE(BROKEN_SETREGID) |
| 366 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 367 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 368 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 369 | conf_utmp_location=/etc/utmp |
| 370 | conf_wtmp_location=/usr/adm/wtmp |
| 371 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 372 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 373 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 374 | AC_DEFINE(USE_PIPES) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 375 | AC_DEFINE(BROKEN_SAVED_UIDS) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 376 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 377 | *-*-openbsd*) |
| 378 | AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) |
| 379 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 380 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 381 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 382 | need_dash_r=1 |
| 383 | fi |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 384 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 385 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
| 386 | AC_DEFINE(LOGIN_NEEDS_TERM) |
Ben Lindstrom | 9527671 | 2001-10-23 17:14:00 +0000 | [diff] [blame] | 387 | AC_DEFINE(PAM_TTY_KLUDGE) |
Darren Tucker | 21dd089 | 2004-08-16 23:12:05 +1000 | [diff] [blame] | 388 | AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 389 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 390 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
| 391 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 392 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 393 | # hardwire lastlog location (can't detect it on some versions) |
| 394 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 395 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 396 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 397 | if test "$sol2ver" -ge 8; then |
| 398 | AC_MSG_RESULT(yes) |
| 399 | AC_DEFINE(DISABLE_UTMP) |
| 400 | AC_DEFINE(DISABLE_WTMP) |
| 401 | else |
| 402 | AC_MSG_RESULT(no) |
| 403 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 404 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 405 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 406 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 407 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 408 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 409 | conf_utmp_location=/etc/utmp |
| 410 | conf_wtmp_location=/var/adm/wtmp |
| 411 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 412 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 413 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 414 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 415 | LIBS="$LIBS -lc89" |
Kevin Steves | 0bd4b34 | 2002-01-05 23:24:27 +0000 | [diff] [blame] | 416 | AC_DEFINE(USE_PIPES) |
Darren Tucker | 2972d6c | 2003-05-30 17:43:42 +1000 | [diff] [blame] | 417 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | 0013011 | 2003-09-22 11:40:24 +1000 | [diff] [blame] | 418 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 419 | AC_DEFINE(BROKEN_SETREUID) |
| 420 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 421 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 422 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 423 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Darren Tucker | 89df7a3 | 2003-10-07 20:35:57 +1000 | [diff] [blame] | 424 | AC_CHECK_LIB(dl, dlsym, ,) |
Darren Tucker | ca6e7a7 | 2005-02-16 16:19:17 +1100 | [diff] [blame] | 425 | # -lresolv needs to be at then end of LIBS or DNS lookups break |
| 426 | AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 427 | IPADDR_IN_DISPLAY=yes |
| 428 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 429 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Darren Tucker | 3b2a06c | 2003-10-07 18:37:11 +1000 | [diff] [blame] | 430 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 431 | AC_DEFINE(BROKEN_SETREUID) |
| 432 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 2972d6c | 2003-05-30 17:43:42 +1000 | [diff] [blame] | 433 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 434 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 435 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 436 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 437 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 438 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 439 | # UnixWare 1.x, UnixWare 2.x, and others based on code from Univel. |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 440 | *-*-sysv4.2*) |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 441 | AC_DEFINE(USE_PIPES) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 442 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 443 | AC_DEFINE(BROKEN_SETREUID) |
| 444 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 2f97b8b | 2005-04-11 19:00:18 -0700 | [diff] [blame] | 445 | AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 446 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 447 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 448 | *-*-sysv5*) |
Tim Rice | eb45654 | 2005-08-30 07:12:02 -0700 | [diff] [blame] | 449 | check_for_libcrypt_later=1 |
| 450 | AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 451 | AC_DEFINE(USE_PIPES) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 452 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 453 | AC_DEFINE(BROKEN_SETREUID) |
| 454 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 2f97b8b | 2005-04-11 19:00:18 -0700 | [diff] [blame] | 455 | AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 456 | case "$host" in |
| 457 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
| 458 | TEST_SHELL=/u95/bin/sh |
Tim Rice | 66fd217 | 2005-08-31 09:59:49 -0700 | [diff] [blame] | 459 | AC_DEFINE(BROKEN_LIBIAF, 1, [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 460 | ;; |
| 461 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 462 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 463 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 464 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 465 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 466 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 467 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 468 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 469 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 470 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 471 | if test -z "$GCC"; then |
| 472 | CFLAGS="$CFLAGS -belf" |
| 473 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 474 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 475 | no_dev_ptmx=1 |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 476 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 477 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 478 | AC_DEFINE(DISABLE_SHADOW) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 479 | AC_DEFINE(DISABLE_FD_PASSING) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 480 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 481 | AC_DEFINE(BROKEN_SETREUID) |
| 482 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | ae477e9 | 2003-09-12 18:15:15 -0700 | [diff] [blame] | 483 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Tim Rice | 816bd0d | 2004-07-19 10:19:26 -0700 | [diff] [blame] | 484 | AC_DEFINE(BROKEN_UPDWTMPX) |
Darren Tucker | 33370e0 | 2005-02-09 22:17:28 +1100 | [diff] [blame] | 485 | AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 486 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 487 | MANTYPE=man |
Tim Rice | f7ba8f6 | 2004-06-20 10:37:32 -0700 | [diff] [blame] | 488 | TEST_SHELL=ksh |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 489 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 490 | *-*-unicosmk*) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 491 | AC_DEFINE(NO_SSH_LASTLOG) |
| 492 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 493 | AC_DEFINE(BROKEN_SETREUID) |
| 494 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 495 | AC_DEFINE(USE_PIPES) |
| 496 | AC_DEFINE(DISABLE_FD_PASSING) |
| 497 | LDFLAGS="$LDFLAGS" |
| 498 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 499 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 500 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 501 | *-*-unicosmp*) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 502 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 503 | AC_DEFINE(BROKEN_SETREUID) |
| 504 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 505 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
| 506 | AC_DEFINE(USE_PIPES) |
| 507 | AC_DEFINE(DISABLE_FD_PASSING) |
| 508 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 509 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 510 | MANTYPE=cat |
| 511 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 512 | *-*-unicos*) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 513 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 514 | AC_DEFINE(BROKEN_SETREUID) |
| 515 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 516 | AC_DEFINE(USE_PIPES) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 517 | AC_DEFINE(DISABLE_FD_PASSING) |
Tim Rice | 81ed518 | 2002-09-25 17:38:46 -0700 | [diff] [blame] | 518 | AC_DEFINE(NO_SSH_LASTLOG) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 519 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 520 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 521 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 522 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 523 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 524 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 525 | no_osfsia="" |
| 526 | AC_ARG_WITH(osfsia, |
| 527 | [ --with-osfsia Enable Digital Unix SIA], |
| 528 | [ |
| 529 | if test "x$withval" = "xno" ; then |
| 530 | AC_MSG_RESULT(disabled) |
| 531 | no_osfsia=1 |
| 532 | fi |
| 533 | ], |
| 534 | ) |
| 535 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 536 | if test -f /etc/sia/matrix.conf; then |
| 537 | AC_MSG_RESULT(yes) |
| 538 | AC_DEFINE(HAVE_OSF_SIA) |
| 539 | AC_DEFINE(DISABLE_LOGIN) |
Ben Lindstrom | c8c548d | 2003-03-21 01:18:09 +0000 | [diff] [blame] | 540 | AC_DEFINE(DISABLE_FD_PASSING) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 541 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 542 | else |
| 543 | AC_MSG_RESULT(no) |
Darren Tucker | 4e06a1d | 2003-11-22 14:25:15 +1100 | [diff] [blame] | 544 | AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin") |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 545 | fi |
| 546 | fi |
Darren Tucker | 3c8e1e1 | 2003-08-25 13:27:40 +1000 | [diff] [blame] | 547 | AC_DEFINE(BROKEN_GETADDRINFO) |
Tim Rice | 7a74c6b | 2003-09-21 21:00:59 -0700 | [diff] [blame] | 548 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
Darren Tucker | ed92b21 | 2003-09-22 11:26:16 +1000 | [diff] [blame] | 549 | AC_DEFINE(BROKEN_SETREUID) |
| 550 | AC_DEFINE(BROKEN_SETREGID) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 551 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 552 | |
| 553 | *-*-nto-qnx) |
| 554 | AC_DEFINE(USE_PIPES) |
| 555 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
| 556 | AC_DEFINE(MISSING_NFDBITS) |
| 557 | AC_DEFINE(MISSING_HOWMANY) |
| 558 | AC_DEFINE(MISSING_FD_MASK) |
| 559 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 560 | |
| 561 | *-*-ultrix*) |
| 562 | AC_DEFINE(BROKEN_GETGROUPS, [], [getgroups(0,NULL) will return -1]) |
| 563 | AC_DEFINE(BROKEN_MMAP, [], [Ultrix mmap can't map files]) |
| 564 | AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 565 | AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix]) |
| 566 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 567 | |
| 568 | *-*-lynxos) |
| 569 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 570 | AC_DEFINE(MISSING_HOWMANY) |
| 571 | AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation]) |
| 572 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 573 | esac |
| 574 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 575 | # Allow user to specify flags |
| 576 | AC_ARG_WITH(cflags, |
| 577 | [ --with-cflags Specify additional flags to pass to compiler], |
| 578 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 579 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 580 | test "x${withval}" != "xyes"; then |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 581 | CFLAGS="$CFLAGS $withval" |
| 582 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 583 | ] |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 584 | ) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 585 | AC_ARG_WITH(cppflags, |
| 586 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 587 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 588 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 589 | test "x${withval}" != "xyes"; then |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 590 | CPPFLAGS="$CPPFLAGS $withval" |
| 591 | fi |
| 592 | ] |
| 593 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 594 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 595 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 596 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 597 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 598 | test "x${withval}" != "xyes"; then |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 599 | LDFLAGS="$LDFLAGS $withval" |
| 600 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 601 | ] |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 602 | ) |
| 603 | AC_ARG_WITH(libs, |
| 604 | [ --with-libs Specify additional libraries to link with], |
| 605 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 606 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 607 | test "x${withval}" != "xyes"; then |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 608 | LIBS="$LIBS $withval" |
| 609 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 610 | ] |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 611 | ) |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 612 | AC_ARG_WITH(Werror, |
| 613 | [ --with-Werror Build main code with -Werror], |
| 614 | [ |
| 615 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 616 | werror_flags="-Werror" |
| 617 | if "x${withval}" != "xyes"; then |
| 618 | werror_flags="$withval" |
| 619 | fi |
| 620 | fi |
| 621 | ] |
| 622 | ) |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 623 | |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 624 | AC_MSG_CHECKING(compiler and flags for sanity) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 625 | AC_RUN_IFELSE( |
| 626 | [AC_LANG_SOURCE([ |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 627 | #include <stdio.h> |
| 628 | int main(){exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 629 | ])], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 630 | [ AC_MSG_RESULT(yes) ], |
| 631 | [ |
| 632 | AC_MSG_RESULT(no) |
| 633 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 634 | ], |
| 635 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 636 | ) |
| 637 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 638 | dnl Checks for header files. |
| 639 | AC_CHECK_HEADERS( \ |
| 640 | bstring.h \ |
| 641 | crypt.h \ |
| 642 | dirent.h \ |
| 643 | endian.h \ |
| 644 | features.h \ |
| 645 | floatingpoint.h \ |
| 646 | getopt.h \ |
| 647 | glob.h \ |
| 648 | ia.h \ |
Tim Rice | 2291c00 | 2005-08-26 13:15:19 -0700 | [diff] [blame] | 649 | iaf.h \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 650 | lastlog.h \ |
| 651 | limits.h \ |
| 652 | login.h \ |
| 653 | login_cap.h \ |
| 654 | maillock.h \ |
| 655 | ndir.h \ |
| 656 | netdb.h \ |
| 657 | netgroup.h \ |
| 658 | netinet/in_systm.h \ |
| 659 | pam/pam_appl.h \ |
| 660 | paths.h \ |
| 661 | pty.h \ |
| 662 | readpassphrase.h \ |
| 663 | rpc/types.h \ |
| 664 | security/pam_appl.h \ |
| 665 | shadow.h \ |
| 666 | stddef.h \ |
| 667 | stdint.h \ |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 668 | string.h \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 669 | strings.h \ |
| 670 | sys/audit.h \ |
| 671 | sys/bitypes.h \ |
| 672 | sys/bsdtty.h \ |
| 673 | sys/cdefs.h \ |
| 674 | sys/dir.h \ |
| 675 | sys/mman.h \ |
| 676 | sys/ndir.h \ |
| 677 | sys/prctl.h \ |
| 678 | sys/pstat.h \ |
| 679 | sys/select.h \ |
| 680 | sys/stat.h \ |
| 681 | sys/stream.h \ |
| 682 | sys/stropts.h \ |
| 683 | sys/strtio.h \ |
| 684 | sys/sysmacros.h \ |
| 685 | sys/time.h \ |
| 686 | sys/timers.h \ |
| 687 | sys/un.h \ |
| 688 | time.h \ |
| 689 | tmpdir.h \ |
| 690 | ttyent.h \ |
Darren Tucker | 7d2171b | 2005-05-28 16:57:00 +1000 | [diff] [blame] | 691 | unistd.h \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 692 | usersec.h \ |
| 693 | util.h \ |
| 694 | utime.h \ |
| 695 | utmp.h \ |
| 696 | utmpx.h \ |
Darren Tucker | e910be1 | 2005-05-28 16:01:18 +1000 | [diff] [blame] | 697 | vis.h \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 698 | ) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 699 | |
Darren Tucker | 48d99d3 | 2004-08-29 17:04:50 +1000 | [diff] [blame] | 700 | # sys/ptms.h requires sys/stream.h to be included first on Solaris |
| 701 | AC_CHECK_HEADERS(sys/ptms.h, [], [], [ |
| 702 | #ifdef HAVE_SYS_STREAM_H |
| 703 | # include <sys/stream.h> |
| 704 | #endif |
| 705 | ]) |
| 706 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 707 | # Checks for libraries. |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 708 | AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) |
| 709 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 710 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 711 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
| 712 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ |
| 713 | AC_CHECK_LIB(gen, dirname,[ |
| 714 | AC_CACHE_CHECK([for broken dirname], |
| 715 | ac_cv_have_broken_dirname, [ |
| 716 | save_LIBS="$LIBS" |
| 717 | LIBS="$LIBS -lgen" |
| 718 | AC_TRY_RUN( |
| 719 | [ |
| 720 | #include <libgen.h> |
| 721 | #include <string.h> |
| 722 | |
| 723 | int main(int argc, char **argv) { |
| 724 | char *s, buf[32]; |
| 725 | |
| 726 | strncpy(buf,"/etc", 32); |
| 727 | s = dirname(buf); |
| 728 | if (!s || strncmp(s, "/", 32) != 0) { |
| 729 | exit(1); |
| 730 | } else { |
| 731 | exit(0); |
| 732 | } |
| 733 | } |
| 734 | ], |
| 735 | [ ac_cv_have_broken_dirname="no" ], |
| 736 | [ ac_cv_have_broken_dirname="yes" ] |
| 737 | ) |
| 738 | LIBS="$save_LIBS" |
| 739 | ]) |
| 740 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 741 | LIBS="$LIBS -lgen" |
| 742 | AC_DEFINE(HAVE_DIRNAME) |
| 743 | AC_CHECK_HEADERS(libgen.h) |
| 744 | fi |
| 745 | ]) |
| 746 | ]) |
| 747 | |
| 748 | AC_CHECK_FUNC(getspnam, , |
| 749 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) |
| 750 | AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME)) |
| 751 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 752 | dnl zlib is required |
| 753 | AC_ARG_WITH(zlib, |
| 754 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 755 | [ if test "x$withval" = "xno" ; then |
| 756 | AC_MSG_ERROR([*** zlib is required ***]) |
| 757 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 758 | if test -d "$withval/lib"; then |
| 759 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 760 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 761 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 762 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 763 | fi |
| 764 | else |
| 765 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 766 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 767 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 768 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 769 | fi |
| 770 | fi |
| 771 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 772 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 773 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 774 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 775 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 776 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 777 | ) |
| 778 | |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 779 | AC_CHECK_LIB(z, deflate, , |
| 780 | [ |
| 781 | saved_CPPFLAGS="$CPPFLAGS" |
| 782 | saved_LDFLAGS="$LDFLAGS" |
| 783 | save_LIBS="$LIBS" |
| 784 | dnl Check default zlib install dir |
| 785 | if test -n "${need_dash_r}"; then |
| 786 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 787 | else |
| 788 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 789 | fi |
| 790 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 791 | LIBS="$LIBS -lz" |
| 792 | AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ), |
| 793 | [ |
| 794 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 795 | ] |
| 796 | ) |
| 797 | ] |
| 798 | ) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 799 | AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 800 | |
| 801 | AC_ARG_WITH(zlib-version-check, |
| 802 | [ --without-zlib-version-check Disable zlib version check], |
| 803 | [ if test "x$withval" = "xno" ; then |
| 804 | zlib_check_nonfatal=1 |
| 805 | fi |
| 806 | ] |
| 807 | ) |
| 808 | |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 809 | AC_MSG_CHECKING(for possibly buggy zlib) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 810 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 811 | #include <stdio.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 812 | #include <zlib.h> |
| 813 | int main() |
| 814 | { |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 815 | int a=0, b=0, c=0, d=0, n, v; |
| 816 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 817 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 818 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 819 | v = a*1000000 + b*10000 + c*100 + d; |
| 820 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 821 | |
| 822 | /* 1.1.4 is OK */ |
| 823 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 824 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 825 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 826 | /* 1.2.3 and up are OK */ |
| 827 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 828 | exit(0); |
| 829 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 830 | exit(2); |
| 831 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 832 | ]])], |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 833 | AC_MSG_RESULT(no), |
| 834 | [ AC_MSG_RESULT(yes) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 835 | if test -z "$zlib_check_nonfatal" ; then |
| 836 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 837 | Your reported zlib version has known security problems. It's possible your |
| 838 | vendor has fixed these problems without changing the version number. If you |
| 839 | are sure this is the case, you can disable the check by running |
| 840 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 841 | If you are in doubt, upgrade zlib to version 1.2.3 or greater. |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 842 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 843 | else |
| 844 | AC_MSG_WARN([zlib version may have security problems]) |
| 845 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 846 | ], |
| 847 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 848 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 849 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 850 | dnl UnixWare 2.x |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 851 | AC_CHECK_FUNC(strcasecmp, |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 852 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 853 | ) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 854 | AC_CHECK_FUNC(utimes, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 855 | [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES) |
| 856 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 857 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 858 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 859 | dnl Checks for libutil functions |
| 860 | AC_CHECK_HEADERS(libutil.h) |
| 861 | AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)]) |
| 862 | AC_CHECK_FUNCS(logout updwtmp logwtmp) |
| 863 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 864 | AC_FUNC_STRFTIME |
| 865 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 866 | # Check for ALTDIRFUNC glob() extension |
| 867 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 868 | AC_EGREP_CPP(FOUNDIT, |
| 869 | [ |
| 870 | #include <glob.h> |
| 871 | #ifdef GLOB_ALTDIRFUNC |
| 872 | FOUNDIT |
| 873 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 874 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 875 | [ |
| 876 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC) |
| 877 | AC_MSG_RESULT(yes) |
| 878 | ], |
| 879 | [ |
| 880 | AC_MSG_RESULT(no) |
| 881 | ] |
| 882 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 883 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 884 | # Check for g.gl_matchc glob() extension |
| 885 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
| 886 | AC_EGREP_CPP(FOUNDIT, |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 887 | [ |
| 888 | #include <glob.h> |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 889 | int main(void){glob_t g; g.gl_matchc = 1;} |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 890 | ], |
| 891 | [ |
| 892 | AC_DEFINE(GLOB_HAS_GL_MATCHC) |
| 893 | AC_MSG_RESULT(yes) |
| 894 | ], |
| 895 | [ |
| 896 | AC_MSG_RESULT(no) |
| 897 | ] |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 898 | ) |
| 899 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 900 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 901 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 902 | [AC_LANG_SOURCE([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 903 | #include <sys/types.h> |
| 904 | #include <dirent.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 905 | int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 906 | ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 907 | [AC_MSG_RESULT(yes)], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 908 | [ |
| 909 | AC_MSG_RESULT(no) |
| 910 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 911 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 912 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 913 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
| 914 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 915 | ] |
| 916 | ) |
| 917 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 918 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 919 | if test -d "/proc/$$/fd" ; then |
| 920 | AC_DEFINE(HAVE_PROC_PID) |
| 921 | AC_MSG_RESULT(yes) |
| 922 | else |
| 923 | AC_MSG_RESULT(no) |
| 924 | fi |
| 925 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 926 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 927 | SKEY_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 928 | AC_ARG_WITH(skey, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 929 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 930 | [ |
| 931 | if test "x$withval" != "xno" ; then |
| 932 | |
| 933 | if test "x$withval" != "xyes" ; then |
| 934 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 935 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 936 | fi |
| 937 | |
| 938 | AC_DEFINE(SKEY) |
| 939 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 940 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 941 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 942 | AC_MSG_CHECKING([for s/key support]) |
| 943 | AC_TRY_RUN( |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 944 | [ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 945 | #include <stdio.h> |
| 946 | #include <skey.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 947 | int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); } |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 948 | ], |
| 949 | [AC_MSG_RESULT(yes)], |
| 950 | [ |
| 951 | AC_MSG_RESULT(no) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 952 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 953 | ]) |
Darren Tucker | 3b908f6 | 2004-04-14 15:26:39 +1000 | [diff] [blame] | 954 | AC_MSG_CHECKING(if skeychallenge takes 4 arguments) |
| 955 | AC_TRY_COMPILE( |
| 956 | [#include <stdio.h> |
| 957 | #include <skey.h>], |
| 958 | [(void)skeychallenge(NULL,"name","",0);], |
| 959 | [AC_MSG_RESULT(yes) |
| 960 | AC_DEFINE(SKEYCHALLENGE_4ARG)], |
| 961 | [AC_MSG_RESULT(no)] |
| 962 | ) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 963 | fi |
| 964 | ] |
| 965 | ) |
| 966 | |
| 967 | # Check whether user wants TCP wrappers support |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 968 | TCPW_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 969 | AC_ARG_WITH(tcp-wrappers, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 970 | [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 971 | [ |
| 972 | if test "x$withval" != "xno" ; then |
| 973 | saved_LIBS="$LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 974 | saved_LDFLAGS="$LDFLAGS" |
| 975 | saved_CPPFLAGS="$CPPFLAGS" |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 976 | if test -n "${withval}" && \ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 977 | test "x${withval}" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 978 | if test -d "${withval}/lib"; then |
| 979 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 980 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 981 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 982 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 983 | fi |
| 984 | else |
| 985 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 986 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 987 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 988 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 989 | fi |
| 990 | fi |
| 991 | if test -d "${withval}/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 992 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 993 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 994 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 995 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 996 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 997 | LIBWRAP="-lwrap" |
| 998 | LIBS="$LIBWRAP $LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 999 | AC_MSG_CHECKING(for libwrap) |
| 1000 | AC_TRY_LINK( |
| 1001 | [ |
Damien Miller | 0ac4500 | 2004-04-14 20:14:26 +1000 | [diff] [blame] | 1002 | #include <sys/types.h> |
| 1003 | #include <sys/socket.h> |
| 1004 | #include <netinet/in.h> |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1005 | #include <tcpd.h> |
| 1006 | int deny_severity = 0, allow_severity = 0; |
| 1007 | ], |
| 1008 | [hosts_access(0);], |
| 1009 | [ |
| 1010 | AC_MSG_RESULT(yes) |
| 1011 | AC_DEFINE(LIBWRAP) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1012 | AC_SUBST(LIBWRAP) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1013 | TCPW_MSG="yes" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1014 | ], |
| 1015 | [ |
| 1016 | AC_MSG_ERROR([*** libwrap missing]) |
| 1017 | ] |
| 1018 | ) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1019 | LIBS="$saved_LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1020 | fi |
| 1021 | ] |
| 1022 | ) |
| 1023 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1024 | # Check whether user wants libedit support |
| 1025 | LIBEDIT_MSG="no" |
| 1026 | AC_ARG_WITH(libedit, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1027 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1028 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1029 | if test "x$withval" != "xyes"; then |
| 1030 | CPPFLAGS="$CPPFLAGS -I$withval/include" |
| 1031 | LDFLAGS="$LDFLAGS -L$withval/lib" |
| 1032 | fi |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1033 | AC_CHECK_LIB(edit, el_init, |
| 1034 | [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp]) |
| 1035 | LIBEDIT="-ledit -lcurses" |
| 1036 | LIBEDIT_MSG="yes" |
| 1037 | AC_SUBST(LIBEDIT) |
| 1038 | ], |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1039 | [ AC_MSG_ERROR(libedit not found) ], |
| 1040 | [ -lcurses ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1041 | ) |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1042 | AC_MSG_CHECKING(if libedit version is compatible) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1043 | AC_COMPILE_IFELSE( |
| 1044 | [AC_LANG_SOURCE([[ |
| 1045 | #include <histedit.h> |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1046 | int main(void) |
| 1047 | { |
| 1048 | int i = H_SETSIZE; |
| 1049 | el_init("", NULL, NULL, NULL); |
| 1050 | exit(0); |
| 1051 | } |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1052 | ]])], |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1053 | [ AC_MSG_RESULT(yes) ], |
| 1054 | [ AC_MSG_RESULT(no) |
| 1055 | AC_MSG_ERROR(libedit version is not compatible) ] |
| 1056 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1057 | fi ] |
| 1058 | ) |
| 1059 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1060 | AUDIT_MODULE=none |
| 1061 | AC_ARG_WITH(audit, |
| 1062 | [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)], |
| 1063 | [ |
| 1064 | AC_MSG_CHECKING(for supported audit module) |
| 1065 | case "$withval" in |
| 1066 | bsm) |
| 1067 | AC_MSG_RESULT(bsm) |
| 1068 | AUDIT_MODULE=bsm |
| 1069 | dnl Checks for headers, libs and functions |
| 1070 | AC_CHECK_HEADERS(bsm/audit.h, [], |
| 1071 | [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)]) |
| 1072 | AC_CHECK_LIB(bsm, getaudit, [], |
| 1073 | [AC_MSG_ERROR(BSM enabled and required library not found)]) |
| 1074 | AC_CHECK_FUNCS(getaudit, [], |
| 1075 | [AC_MSG_ERROR(BSM enabled and required function not found)]) |
| 1076 | # These are optional |
Darren Tucker | 0d09669 | 2005-03-07 17:34:45 +1100 | [diff] [blame] | 1077 | AC_CHECK_FUNCS(getaudit_addr) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1078 | AC_DEFINE(USE_BSM_AUDIT, [], [Use BSM audit module]) |
| 1079 | ;; |
| 1080 | debug) |
| 1081 | AUDIT_MODULE=debug |
| 1082 | AC_MSG_RESULT(debug) |
| 1083 | AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module) |
| 1084 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1085 | no) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1086 | AC_MSG_RESULT(no) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1087 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1088 | *) |
| 1089 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1090 | ;; |
| 1091 | esac ] |
| 1092 | ) |
| 1093 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1094 | dnl Checks for library functions. Please keep in alphabetical order |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1095 | AC_CHECK_FUNCS( \ |
| 1096 | arc4random \ |
| 1097 | b64_ntop \ |
| 1098 | __b64_ntop \ |
| 1099 | b64_pton \ |
| 1100 | __b64_pton \ |
| 1101 | bcopy \ |
| 1102 | bindresvport_sa \ |
| 1103 | clock \ |
| 1104 | closefrom \ |
| 1105 | dirfd \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1106 | fchmod \ |
| 1107 | fchown \ |
| 1108 | freeaddrinfo \ |
| 1109 | futimes \ |
| 1110 | getaddrinfo \ |
| 1111 | getcwd \ |
| 1112 | getgrouplist \ |
| 1113 | getnameinfo \ |
| 1114 | getopt \ |
| 1115 | getpeereid \ |
| 1116 | _getpty \ |
| 1117 | getrlimit \ |
| 1118 | getttyent \ |
| 1119 | glob \ |
| 1120 | inet_aton \ |
| 1121 | inet_ntoa \ |
| 1122 | inet_ntop \ |
| 1123 | innetgr \ |
| 1124 | login_getcapbool \ |
| 1125 | md5_crypt \ |
| 1126 | memmove \ |
| 1127 | mkdtemp \ |
| 1128 | mmap \ |
| 1129 | ngetaddrinfo \ |
| 1130 | nsleep \ |
| 1131 | ogetaddrinfo \ |
| 1132 | openlog_r \ |
| 1133 | openpty \ |
| 1134 | prctl \ |
| 1135 | pstat \ |
| 1136 | readpassphrase \ |
| 1137 | realpath \ |
| 1138 | recvmsg \ |
| 1139 | rresvport_af \ |
| 1140 | sendmsg \ |
| 1141 | setdtablesize \ |
| 1142 | setegid \ |
| 1143 | setenv \ |
| 1144 | seteuid \ |
| 1145 | setgroups \ |
| 1146 | setlogin \ |
| 1147 | setpcred \ |
| 1148 | setproctitle \ |
| 1149 | setregid \ |
| 1150 | setreuid \ |
| 1151 | setrlimit \ |
| 1152 | setsid \ |
| 1153 | setvbuf \ |
| 1154 | sigaction \ |
| 1155 | sigvec \ |
| 1156 | snprintf \ |
| 1157 | socketpair \ |
| 1158 | strdup \ |
| 1159 | strerror \ |
| 1160 | strlcat \ |
| 1161 | strlcpy \ |
| 1162 | strmode \ |
| 1163 | strnvis \ |
| 1164 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1165 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1166 | strtoul \ |
| 1167 | sysconf \ |
| 1168 | tcgetpgrp \ |
| 1169 | truncate \ |
| 1170 | unsetenv \ |
| 1171 | updwtmpx \ |
| 1172 | utimes \ |
| 1173 | vhangup \ |
| 1174 | vsnprintf \ |
| 1175 | waitpid \ |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1176 | ) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1177 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1178 | # IRIX has a const char return value for gai_strerror() |
| 1179 | AC_CHECK_FUNCS(gai_strerror,[ |
| 1180 | AC_DEFINE(HAVE_GAI_STRERROR) |
| 1181 | AC_TRY_COMPILE([ |
| 1182 | #include <sys/types.h> |
| 1183 | #include <sys/socket.h> |
| 1184 | #include <netdb.h> |
| 1185 | |
| 1186 | const char *gai_strerror(int);],[ |
| 1187 | char *str; |
| 1188 | |
| 1189 | str = gai_strerror(0);],[ |
| 1190 | AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1, |
| 1191 | [Define if gai_strerror() returns const char *])])]) |
| 1192 | |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1193 | AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP)) |
| 1194 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1195 | dnl Make sure prototypes are defined for these before using them. |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1196 | AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)]) |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1197 | AC_CHECK_DECL(strsep, |
| 1198 | [AC_CHECK_FUNCS(strsep)], |
| 1199 | [], |
| 1200 | [ |
| 1201 | #ifdef HAVE_STRING_H |
| 1202 | # include <string.h> |
| 1203 | #endif |
| 1204 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1205 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1206 | dnl tcsendbreak might be a macro |
| 1207 | AC_CHECK_DECL(tcsendbreak, |
| 1208 | [AC_DEFINE(HAVE_TCSENDBREAK)], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1209 | [AC_CHECK_FUNCS(tcsendbreak)], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1210 | [#include <termios.h>] |
| 1211 | ) |
| 1212 | |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1213 | AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>]) |
| 1214 | |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1215 | AC_CHECK_FUNCS(setresuid, [ |
| 1216 | dnl Some platorms have setresuid that isn't implemented, test for this |
| 1217 | AC_MSG_CHECKING(if setresuid seems to work) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1218 | AC_RUN_IFELSE( |
| 1219 | [AC_LANG_SOURCE([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1220 | #include <stdlib.h> |
| 1221 | #include <errno.h> |
| 1222 | int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1223 | ]])], |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1224 | [AC_MSG_RESULT(yes)], |
Darren Tucker | fd0894a | 2004-01-09 00:19:25 +1100 | [diff] [blame] | 1225 | [AC_DEFINE(BROKEN_SETRESUID) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1226 | AC_MSG_RESULT(not implemented)], |
| 1227 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1228 | ) |
| 1229 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1230 | |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1231 | AC_CHECK_FUNCS(setresgid, [ |
| 1232 | dnl Some platorms have setresgid that isn't implemented, test for this |
| 1233 | AC_MSG_CHECKING(if setresgid seems to work) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1234 | AC_RUN_IFELSE( |
| 1235 | [AC_LANG_SOURCE([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1236 | #include <stdlib.h> |
| 1237 | #include <errno.h> |
| 1238 | int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1239 | ]])], |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1240 | [AC_MSG_RESULT(yes)], |
| 1241 | [AC_DEFINE(BROKEN_SETRESGID) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1242 | AC_MSG_RESULT(not implemented)], |
| 1243 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1244 | ) |
| 1245 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1246 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1247 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1248 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1249 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 1250 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1251 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1252 | dnl Checks for utmpx functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 1253 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1254 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 1255 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1256 | AC_CHECK_FUNC(daemon, |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 1257 | [AC_DEFINE(HAVE_DAEMON)], |
| 1258 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 1259 | ) |
| 1260 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1261 | AC_CHECK_FUNC(getpagesize, |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 1262 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 1263 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 1264 | ) |
| 1265 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1266 | # Check for broken snprintf |
| 1267 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 1268 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1269 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1270 | [AC_LANG_SOURCE([[ |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1271 | #include <stdio.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1272 | int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1273 | ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1274 | [AC_MSG_RESULT(yes)], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1275 | [ |
| 1276 | AC_MSG_RESULT(no) |
| 1277 | AC_DEFINE(BROKEN_SNPRINTF) |
| 1278 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1279 | ], |
| 1280 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1281 | ) |
| 1282 | fi |
| 1283 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1284 | # Check for missing getpeereid (or equiv) support |
| 1285 | NO_PEERCHECK="" |
| 1286 | if test "x$ac_cv_func_getpeereid" != "xyes" ; then |
| 1287 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
| 1288 | AC_TRY_COMPILE( |
| 1289 | [#include <sys/types.h> |
| 1290 | #include <sys/socket.h>], |
| 1291 | [int i = SO_PEERCRED;], |
Darren Tucker | 9d2562c | 2005-04-05 19:22:45 +1000 | [diff] [blame] | 1292 | [ AC_MSG_RESULT(yes) |
| 1293 | AC_DEFINE(HAVE_SO_PEERCRED, [], [Have PEERCRED socket option]) |
| 1294 | ], |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1295 | [AC_MSG_RESULT(no) |
| 1296 | NO_PEERCHECK=1] |
| 1297 | ) |
| 1298 | fi |
| 1299 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1300 | dnl see whether mkstemp() requires XXXXXX |
| 1301 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 1302 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
| 1303 | AC_TRY_RUN( |
| 1304 | [ |
| 1305 | #include <stdlib.h> |
| 1306 | main() { char template[]="conftest.mkstemp-test"; |
| 1307 | if (mkstemp(template) == -1) |
| 1308 | exit(1); |
| 1309 | unlink(template); exit(0); |
| 1310 | } |
| 1311 | ], |
| 1312 | [ |
| 1313 | AC_MSG_RESULT(no) |
| 1314 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1315 | [ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1316 | AC_MSG_RESULT(yes) |
| 1317 | AC_DEFINE(HAVE_STRICT_MKSTEMP) |
| 1318 | ], |
| 1319 | [ |
| 1320 | AC_MSG_RESULT(yes) |
| 1321 | AC_DEFINE(HAVE_STRICT_MKSTEMP) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1322 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1323 | ) |
| 1324 | fi |
| 1325 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1326 | dnl make sure that openpty does not reacquire controlling terminal |
| 1327 | if test ! -z "$check_for_openpty_ctty_bug"; then |
| 1328 | AC_MSG_CHECKING(if openpty correctly handles controlling tty) |
| 1329 | AC_TRY_RUN( |
| 1330 | [ |
| 1331 | #include <stdio.h> |
| 1332 | #include <sys/fcntl.h> |
| 1333 | #include <sys/types.h> |
| 1334 | #include <sys/wait.h> |
| 1335 | |
| 1336 | int |
| 1337 | main() |
| 1338 | { |
| 1339 | pid_t pid; |
| 1340 | int fd, ptyfd, ttyfd, status; |
| 1341 | |
| 1342 | pid = fork(); |
| 1343 | if (pid < 0) { /* failed */ |
| 1344 | exit(1); |
| 1345 | } else if (pid > 0) { /* parent */ |
| 1346 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1347 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1348 | exit(WEXITSTATUS(status)); |
| 1349 | else |
| 1350 | exit(2); |
| 1351 | } else { /* child */ |
| 1352 | close(0); close(1); close(2); |
| 1353 | setsid(); |
| 1354 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 1355 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 1356 | if (fd >= 0) |
| 1357 | exit(3); /* Acquired ctty: broken */ |
| 1358 | else |
| 1359 | exit(0); /* Did not acquire ctty: OK */ |
| 1360 | } |
| 1361 | } |
| 1362 | ], |
| 1363 | [ |
| 1364 | AC_MSG_RESULT(yes) |
| 1365 | ], |
| 1366 | [ |
| 1367 | AC_MSG_RESULT(no) |
| 1368 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
| 1369 | ] |
| 1370 | ) |
| 1371 | fi |
| 1372 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1373 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1374 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1375 | AC_MSG_CHECKING(if getaddrinfo seems to work) |
| 1376 | AC_TRY_RUN( |
| 1377 | [ |
| 1378 | #include <stdio.h> |
| 1379 | #include <sys/socket.h> |
| 1380 | #include <netdb.h> |
| 1381 | #include <errno.h> |
| 1382 | #include <netinet/in.h> |
| 1383 | |
| 1384 | #define TEST_PORT "2222" |
| 1385 | |
| 1386 | int |
| 1387 | main(void) |
| 1388 | { |
| 1389 | int err, sock; |
| 1390 | struct addrinfo *gai_ai, *ai, hints; |
| 1391 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 1392 | |
| 1393 | memset(&hints, 0, sizeof(hints)); |
| 1394 | hints.ai_family = PF_UNSPEC; |
| 1395 | hints.ai_socktype = SOCK_STREAM; |
| 1396 | hints.ai_flags = AI_PASSIVE; |
| 1397 | |
| 1398 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 1399 | if (err != 0) { |
| 1400 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 1401 | exit(1); |
| 1402 | } |
| 1403 | |
| 1404 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 1405 | if (ai->ai_family != AF_INET6) |
| 1406 | continue; |
| 1407 | |
| 1408 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 1409 | sizeof(ntop), strport, sizeof(strport), |
| 1410 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 1411 | |
| 1412 | if (err != 0) { |
| 1413 | if (err == EAI_SYSTEM) |
| 1414 | perror("getnameinfo EAI_SYSTEM"); |
| 1415 | else |
| 1416 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 1417 | gai_strerror(err)); |
| 1418 | exit(2); |
| 1419 | } |
| 1420 | |
| 1421 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 1422 | if (sock < 0) |
| 1423 | perror("socket"); |
| 1424 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 1425 | if (errno == EBADF) |
| 1426 | exit(3); |
| 1427 | } |
| 1428 | } |
| 1429 | exit(0); |
| 1430 | } |
| 1431 | ], |
| 1432 | [ |
| 1433 | AC_MSG_RESULT(yes) |
| 1434 | ], |
| 1435 | [ |
| 1436 | AC_MSG_RESULT(no) |
| 1437 | AC_DEFINE(BROKEN_GETADDRINFO) |
| 1438 | ] |
| 1439 | ) |
| 1440 | fi |
| 1441 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1442 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1443 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1444 | AC_MSG_CHECKING(if getaddrinfo seems to work) |
| 1445 | AC_TRY_RUN( |
| 1446 | [ |
| 1447 | #include <stdio.h> |
| 1448 | #include <sys/socket.h> |
| 1449 | #include <netdb.h> |
| 1450 | #include <errno.h> |
| 1451 | #include <netinet/in.h> |
| 1452 | |
| 1453 | #define TEST_PORT "2222" |
| 1454 | |
| 1455 | int |
| 1456 | main(void) |
| 1457 | { |
| 1458 | int err, sock; |
| 1459 | struct addrinfo *gai_ai, *ai, hints; |
| 1460 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 1461 | |
| 1462 | memset(&hints, 0, sizeof(hints)); |
| 1463 | hints.ai_family = PF_UNSPEC; |
| 1464 | hints.ai_socktype = SOCK_STREAM; |
| 1465 | hints.ai_flags = AI_PASSIVE; |
| 1466 | |
| 1467 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 1468 | if (err != 0) { |
| 1469 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 1470 | exit(1); |
| 1471 | } |
| 1472 | |
| 1473 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 1474 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 1475 | continue; |
| 1476 | |
| 1477 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 1478 | sizeof(ntop), strport, sizeof(strport), |
| 1479 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 1480 | |
| 1481 | if (ai->ai_family == AF_INET && err != 0) { |
| 1482 | perror("getnameinfo"); |
| 1483 | exit(2); |
| 1484 | } |
| 1485 | } |
| 1486 | exit(0); |
| 1487 | } |
| 1488 | ], |
| 1489 | [ |
| 1490 | AC_MSG_RESULT(yes) |
| 1491 | AC_DEFINE(AIX_GETNAMEINFO_HACK, [], |
| 1492 | [Define if you have a getaddrinfo that fails for the all-zeros IPv6 address]) |
| 1493 | ], |
| 1494 | [ |
| 1495 | AC_MSG_RESULT(no) |
| 1496 | AC_DEFINE(BROKEN_GETADDRINFO) |
| 1497 | ] |
| 1498 | ) |
| 1499 | fi |
| 1500 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 1501 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
| 1502 | AC_MSG_CHECKING(for conflicting getspnam in shadow.h) |
| 1503 | AC_COMPILE_IFELSE( |
| 1504 | [ |
| 1505 | #include <shadow.h> |
| 1506 | int main(void) {exit(0);} |
| 1507 | ], |
| 1508 | [ |
| 1509 | AC_MSG_RESULT(no) |
| 1510 | ], |
| 1511 | [ |
| 1512 | AC_MSG_RESULT(yes) |
| 1513 | AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1, |
| 1514 | [Conflicting defs for getspnam]) |
| 1515 | ] |
| 1516 | ) |
| 1517 | fi |
| 1518 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 1519 | AC_FUNC_GETPGRP |
| 1520 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1521 | # Check for PAM libs |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1522 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1523 | AC_ARG_WITH(pam, |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1524 | [ --with-pam Enable PAM support ], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1525 | [ |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1526 | if test "x$withval" != "xno" ; then |
Damien Miller | 0f47c53 | 2004-01-02 18:01:30 +1100 | [diff] [blame] | 1527 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 1528 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1529 | AC_MSG_ERROR([PAM headers not found]) |
| 1530 | fi |
| 1531 | |
| 1532 | AC_CHECK_LIB(dl, dlopen, , ) |
| 1533 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 1534 | AC_CHECK_FUNCS(pam_getenvlist) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 1535 | AC_CHECK_FUNCS(pam_putenv) |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1536 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1537 | PAM_MSG="yes" |
| 1538 | |
| 1539 | AC_DEFINE(USE_PAM) |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 1540 | if test $ac_cv_lib_dl_dlopen = yes; then |
| 1541 | LIBPAM="-lpam -ldl" |
| 1542 | else |
| 1543 | LIBPAM="-lpam" |
| 1544 | fi |
| 1545 | AC_SUBST(LIBPAM) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1546 | fi |
| 1547 | ] |
| 1548 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1549 | |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1550 | # Check for older PAM |
| 1551 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1552 | # Check PAM strerror arguments (old PAM) |
| 1553 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 1554 | AC_TRY_COMPILE( |
| 1555 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1556 | #include <stdlib.h> |
Damien Miller | 0f47c53 | 2004-01-02 18:01:30 +1100 | [diff] [blame] | 1557 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1558 | #include <security/pam_appl.h> |
Damien Miller | 0f47c53 | 2004-01-02 18:01:30 +1100 | [diff] [blame] | 1559 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 1560 | #include <pam/pam_appl.h> |
| 1561 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1562 | ], |
| 1563 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1564 | [AC_MSG_RESULT(no)], |
| 1565 | [ |
| 1566 | AC_DEFINE(HAVE_OLD_PAM) |
| 1567 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1568 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1569 | ] |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1570 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1571 | fi |
| 1572 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1573 | # Search for OpenSSL |
| 1574 | saved_CPPFLAGS="$CPPFLAGS" |
| 1575 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1576 | AC_ARG_WITH(ssl-dir, |
| 1577 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 1578 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 1579 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 1580 | case "$withval" in |
| 1581 | # Relative paths |
| 1582 | ./*|../*) withval="`pwd`/$withval" |
| 1583 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1584 | if test -d "$withval/lib"; then |
| 1585 | if test -n "${need_dash_r}"; then |
| 1586 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1587 | else |
| 1588 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1589 | fi |
| 1590 | else |
| 1591 | if test -n "${need_dash_r}"; then |
| 1592 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 1593 | else |
| 1594 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 1595 | fi |
| 1596 | fi |
| 1597 | if test -d "$withval/include"; then |
| 1598 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 1599 | else |
| 1600 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 1601 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1602 | fi |
| 1603 | ] |
| 1604 | ) |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 1605 | LIBS="-lcrypto $LIBS" |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1606 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 1607 | [ |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1608 | dnl Check default openssl install dir |
| 1609 | if test -n "${need_dash_r}"; then |
| 1610 | 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] | 1611 | else |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1612 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 1613 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1614 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 1615 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
| 1616 | [ |
| 1617 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 1618 | ] |
| 1619 | ) |
| 1620 | ] |
| 1621 | ) |
| 1622 | |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1623 | # Determine OpenSSL header version |
| 1624 | AC_MSG_CHECKING([OpenSSL header version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1625 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1626 | [AC_LANG_SOURCE([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1627 | #include <stdio.h> |
| 1628 | #include <string.h> |
| 1629 | #include <openssl/opensslv.h> |
| 1630 | #define DATA "conftest.sslincver" |
| 1631 | int main(void) { |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1632 | FILE *fd; |
| 1633 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1634 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1635 | fd = fopen(DATA,"w"); |
| 1636 | if(fd == NULL) |
| 1637 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1638 | |
| 1639 | if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) |
| 1640 | exit(1); |
| 1641 | |
| 1642 | exit(0); |
| 1643 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1644 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1645 | [ |
| 1646 | ssl_header_ver=`cat conftest.sslincver` |
| 1647 | AC_MSG_RESULT($ssl_header_ver) |
| 1648 | ], |
| 1649 | [ |
| 1650 | AC_MSG_RESULT(not found) |
| 1651 | AC_MSG_ERROR(OpenSSL version header not found.) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1652 | ], |
| 1653 | [ |
| 1654 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1655 | ] |
| 1656 | ) |
| 1657 | |
| 1658 | # Determine OpenSSL library version |
| 1659 | AC_MSG_CHECKING([OpenSSL library version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1660 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1661 | [AC_LANG_SOURCE([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1662 | #include <stdio.h> |
| 1663 | #include <string.h> |
| 1664 | #include <openssl/opensslv.h> |
| 1665 | #include <openssl/crypto.h> |
| 1666 | #define DATA "conftest.ssllibver" |
| 1667 | int main(void) { |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1668 | FILE *fd; |
| 1669 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1670 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1671 | fd = fopen(DATA,"w"); |
| 1672 | if(fd == NULL) |
| 1673 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1674 | |
| 1675 | if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0) |
| 1676 | exit(1); |
| 1677 | |
| 1678 | exit(0); |
| 1679 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1680 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1681 | [ |
| 1682 | ssl_library_ver=`cat conftest.ssllibver` |
| 1683 | AC_MSG_RESULT($ssl_library_ver) |
| 1684 | ], |
| 1685 | [ |
| 1686 | AC_MSG_RESULT(not found) |
| 1687 | AC_MSG_ERROR(OpenSSL library not found.) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1688 | ], |
| 1689 | [ |
| 1690 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1691 | ] |
| 1692 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1693 | |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 1694 | # Sanity check OpenSSL headers |
| 1695 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1696 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1697 | [AC_LANG_SOURCE([[ |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 1698 | #include <string.h> |
| 1699 | #include <openssl/opensslv.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1700 | int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1701 | ]])], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 1702 | [ |
| 1703 | AC_MSG_RESULT(yes) |
| 1704 | ], |
| 1705 | [ |
| 1706 | AC_MSG_RESULT(no) |
Darren Tucker | a0472e0 | 2003-06-24 20:22:09 +1000 | [diff] [blame] | 1707 | AC_MSG_ERROR([Your OpenSSL headers do not match your library. |
| 1708 | Check config.log for details. |
| 1709 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1710 | ], |
| 1711 | [ |
| 1712 | AC_MSG_WARN([cross compiling: not checking]) |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 1713 | ] |
| 1714 | ) |
| 1715 | |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 1716 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 1717 | # because the system crypt() is more featureful. |
| 1718 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 1719 | AC_CHECK_LIB(crypt, crypt) |
| 1720 | fi |
| 1721 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1722 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
Tim Rice | 43fa557 | 2004-02-11 14:46:40 -0800 | [diff] [blame] | 1723 | # version in OpenSSL. |
Damien Miller | 4f9f42a | 2003-05-10 19:28:02 +1000 | [diff] [blame] | 1724 | if test "x$check_for_libcrypt_later" = "x1"; then |
Damien Miller | 95aa2d6 | 2001-03-01 09:16:11 +1100 | [diff] [blame] | 1725 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 1726 | fi |
| 1727 | |
Tim Rice | 2291c00 | 2005-08-26 13:15:19 -0700 | [diff] [blame] | 1728 | AC_CHECK_LIB(iaf, ia_openinfo) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1729 | |
| 1730 | ### Configure cryptographic random number support |
| 1731 | |
| 1732 | # Check wheter OpenSSL seeds itself |
| 1733 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1734 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1735 | [AC_LANG_SOURCE([[ |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1736 | #include <string.h> |
| 1737 | #include <openssl/rand.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1738 | int main(void) { exit(RAND_status() == 1 ? 0 : 1); } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1739 | ]])], |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1740 | [ |
| 1741 | OPENSSL_SEEDS_ITSELF=yes |
| 1742 | AC_MSG_RESULT(yes) |
| 1743 | ], |
| 1744 | [ |
| 1745 | AC_MSG_RESULT(no) |
| 1746 | # Default to use of the rand helper if OpenSSL doesn't |
| 1747 | # seed itself |
| 1748 | USE_RAND_HELPER=yes |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1749 | ], |
| 1750 | [ |
| 1751 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1752 | # This is safe, since all recent OpenSSL versions will |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1753 | # complain at runtime if not seeded correctly. |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1754 | OPENSSL_SEEDS_ITSELF=yes |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1755 | ] |
| 1756 | ) |
| 1757 | |
| 1758 | |
| 1759 | # Do we want to force the use of the rand helper? |
| 1760 | AC_ARG_WITH(rand-helper, |
| 1761 | [ --with-rand-helper Use subprocess to gather strong randomness ], |
| 1762 | [ |
| 1763 | if test "x$withval" = "xno" ; then |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1764 | # Force use of OpenSSL's internal RNG, even if |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1765 | # the previous test showed it to be unseeded. |
| 1766 | if test -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 1767 | AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG]) |
| 1768 | OPENSSL_SEEDS_ITSELF=yes |
| 1769 | USE_RAND_HELPER="" |
| 1770 | fi |
| 1771 | else |
| 1772 | USE_RAND_HELPER=yes |
| 1773 | fi |
| 1774 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1775 | ) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1776 | |
| 1777 | # Which randomness source do we use? |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1778 | if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1779 | # OpenSSL only |
| 1780 | AC_DEFINE(OPENSSL_PRNG_ONLY) |
| 1781 | RAND_MSG="OpenSSL internal ONLY" |
| 1782 | INSTALL_SSH_RAND_HELPER="" |
Tim Rice | 1e2c600 | 2002-01-30 22:14:03 -0800 | [diff] [blame] | 1783 | elif test ! -z "$USE_RAND_HELPER" ; then |
| 1784 | # install rand helper |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1785 | RAND_MSG="ssh-rand-helper" |
| 1786 | INSTALL_SSH_RAND_HELPER="yes" |
| 1787 | fi |
| 1788 | AC_SUBST(INSTALL_SSH_RAND_HELPER) |
| 1789 | |
| 1790 | ### Configuration of ssh-rand-helper |
| 1791 | |
| 1792 | # PRNGD TCP socket |
| 1793 | AC_ARG_WITH(prngd-port, |
| 1794 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 1795 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 1796 | case "$withval" in |
| 1797 | no) |
| 1798 | withval="" |
| 1799 | ;; |
| 1800 | [[0-9]]*) |
| 1801 | ;; |
| 1802 | *) |
| 1803 | AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port) |
| 1804 | ;; |
| 1805 | esac |
| 1806 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1807 | PRNGD_PORT="$withval" |
| 1808 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT) |
| 1809 | fi |
| 1810 | ] |
| 1811 | ) |
| 1812 | |
| 1813 | # PRNGD Unix domain socket |
| 1814 | AC_ARG_WITH(prngd-socket, |
| 1815 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 1816 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 1817 | case "$withval" in |
| 1818 | yes) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1819 | withval="/var/run/egd-pool" |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 1820 | ;; |
| 1821 | no) |
| 1822 | withval="" |
| 1823 | ;; |
| 1824 | /*) |
| 1825 | ;; |
| 1826 | *) |
| 1827 | AC_MSG_ERROR(You must specify an absolute path to the entropy socket) |
| 1828 | ;; |
| 1829 | esac |
| 1830 | |
| 1831 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1832 | if test ! -z "$PRNGD_PORT" ; then |
| 1833 | AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket) |
| 1834 | fi |
Damien Miller | 6385ba0 | 2002-01-23 08:12:36 +1100 | [diff] [blame] | 1835 | if test ! -r "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1836 | AC_MSG_WARN(Entropy socket is not readable) |
| 1837 | fi |
| 1838 | PRNGD_SOCKET="$withval" |
| 1839 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 1840 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1841 | ], |
| 1842 | [ |
| 1843 | # Check for existing socket only if we don't have a random device already |
| 1844 | if test "$USE_RAND_HELPER" = yes ; then |
| 1845 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 1846 | # Insert other locations here |
| 1847 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 1848 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 1849 | PRNGD_SOCKET="$sock" |
| 1850 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 1851 | break; |
| 1852 | fi |
| 1853 | done |
| 1854 | if test ! -z "$PRNGD_SOCKET" ; then |
| 1855 | AC_MSG_RESULT($PRNGD_SOCKET) |
| 1856 | else |
| 1857 | AC_MSG_RESULT(not found) |
| 1858 | fi |
| 1859 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1860 | ] |
| 1861 | ) |
| 1862 | |
| 1863 | # Change default command timeout for hashing entropy source |
| 1864 | entropy_timeout=200 |
| 1865 | AC_ARG_WITH(entropy-timeout, |
| 1866 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1867 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 1868 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 1869 | test "x${withval}" != "xyes"; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1870 | entropy_timeout=$withval |
| 1871 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1872 | ] |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1873 | ) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1874 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1875 | |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1876 | SSH_PRIVSEP_USER=sshd |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1877 | AC_ARG_WITH(privsep-user, |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 1878 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1879 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 1880 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 1881 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1882 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1883 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1884 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1885 | ) |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 1886 | AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER") |
| 1887 | AC_SUBST(SSH_PRIVSEP_USER) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 1888 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1889 | # We do this little dance with the search path to insure |
| 1890 | # that programs that we select for use by installed programs |
| 1891 | # (which may be run by the super-user) come from trusted |
| 1892 | # locations before they come from the user's private area. |
| 1893 | # This should help avoid accidentally configuring some |
| 1894 | # random version of a program in someone's personal bin. |
| 1895 | |
| 1896 | OPATH=$PATH |
| 1897 | PATH=/bin:/usr/bin |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 1898 | test -h /bin 2> /dev/null && PATH=/usr/bin |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1899 | test -d /sbin && PATH=$PATH:/sbin |
| 1900 | test -d /usr/sbin && PATH=$PATH:/usr/sbin |
| 1901 | PATH=$PATH:/etc:$OPATH |
| 1902 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1903 | # These programs are used by the command hashing source to gather entropy |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1904 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 1905 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 1906 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 1907 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 1908 | OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat) |
| 1909 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 1910 | OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar) |
| 1911 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 1912 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 1913 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 1914 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 1915 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 1916 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 1917 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 1918 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 1919 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 1920 | # restore PATH |
| 1921 | PATH=$OPATH |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 1922 | |
| 1923 | # Where does ssh-rand-helper get its randomness from? |
| 1924 | INSTALL_SSH_PRNG_CMDS="" |
| 1925 | if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then |
| 1926 | if test ! -z "$PRNGD_PORT" ; then |
| 1927 | RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT" |
| 1928 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 1929 | RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\"" |
| 1930 | else |
| 1931 | RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)" |
| 1932 | RAND_HELPER_CMDHASH=yes |
| 1933 | INSTALL_SSH_PRNG_CMDS="yes" |
| 1934 | fi |
| 1935 | fi |
| 1936 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 1937 | |
| 1938 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 1939 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 1940 | if test ! -z "$SONY" ; then |
| 1941 | LIBS="$LIBS -liberty"; |
| 1942 | fi |
| 1943 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1944 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 1945 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 1946 | AC_CHECK_SIZEOF(short int, 2) |
| 1947 | AC_CHECK_SIZEOF(int, 4) |
| 1948 | AC_CHECK_SIZEOF(long int, 4) |
| 1949 | AC_CHECK_SIZEOF(long long int, 8) |
| 1950 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 1951 | # Sanity check long long for some platforms (AIX) |
| 1952 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 1953 | ac_cv_sizeof_long_long_int=0 |
| 1954 | fi |
| 1955 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1956 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 1957 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 1958 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1959 | [ #include <sys/types.h> ], |
| 1960 | [ u_int a; a = 1;], |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 1961 | [ ac_cv_have_u_int="yes" ], |
| 1962 | [ ac_cv_have_u_int="no" ] |
| 1963 | ) |
| 1964 | ]) |
| 1965 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 1966 | AC_DEFINE(HAVE_U_INT) |
| 1967 | have_u_int=1 |
| 1968 | fi |
| 1969 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1970 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 1971 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1972 | [ #include <sys/types.h> ], |
| 1973 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1974 | [ ac_cv_have_intxx_t="yes" ], |
| 1975 | [ ac_cv_have_intxx_t="no" ] |
| 1976 | ) |
| 1977 | ]) |
| 1978 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 1979 | AC_DEFINE(HAVE_INTXX_T) |
| 1980 | have_intxx_t=1 |
| 1981 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1982 | |
| 1983 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1984 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1985 | then |
| 1986 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
| 1987 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1988 | [ #include <stdint.h> ], |
| 1989 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1990 | [ |
| 1991 | AC_DEFINE(HAVE_INTXX_T) |
| 1992 | AC_MSG_RESULT(yes) |
| 1993 | ], |
| 1994 | [ AC_MSG_RESULT(no) ] |
| 1995 | ) |
| 1996 | fi |
| 1997 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 1998 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 1999 | AC_TRY_COMPILE( |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 2000 | [ |
| 2001 | #include <sys/types.h> |
| 2002 | #ifdef HAVE_STDINT_H |
| 2003 | # include <stdint.h> |
| 2004 | #endif |
| 2005 | #include <sys/socket.h> |
| 2006 | #ifdef HAVE_SYS_BITYPES_H |
| 2007 | # include <sys/bitypes.h> |
| 2008 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2009 | ], |
| 2010 | [ int64_t a; a = 1;], |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2011 | [ ac_cv_have_int64_t="yes" ], |
| 2012 | [ ac_cv_have_int64_t="no" ] |
| 2013 | ) |
| 2014 | ]) |
| 2015 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 2016 | AC_DEFINE(HAVE_INT64_T) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2017 | fi |
| 2018 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2019 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 2020 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2021 | [ #include <sys/types.h> ], |
| 2022 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2023 | [ ac_cv_have_u_intxx_t="yes" ], |
| 2024 | [ ac_cv_have_u_intxx_t="no" ] |
| 2025 | ) |
| 2026 | ]) |
| 2027 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 2028 | AC_DEFINE(HAVE_U_INTXX_T) |
| 2029 | have_u_intxx_t=1 |
| 2030 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 2031 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2032 | if test -z "$have_u_intxx_t" ; then |
| 2033 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
| 2034 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2035 | [ #include <sys/socket.h> ], |
| 2036 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2037 | [ |
| 2038 | AC_DEFINE(HAVE_U_INTXX_T) |
| 2039 | AC_MSG_RESULT(yes) |
| 2040 | ], |
| 2041 | [ AC_MSG_RESULT(no) ] |
| 2042 | ) |
| 2043 | fi |
| 2044 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2045 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 2046 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2047 | [ #include <sys/types.h> ], |
| 2048 | [ u_int64_t a; a = 1;], |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2049 | [ ac_cv_have_u_int64_t="yes" ], |
| 2050 | [ ac_cv_have_u_int64_t="no" ] |
| 2051 | ) |
| 2052 | ]) |
| 2053 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 2054 | AC_DEFINE(HAVE_U_INT64_T) |
| 2055 | have_u_int64_t=1 |
| 2056 | fi |
| 2057 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2058 | if test -z "$have_u_int64_t" ; then |
| 2059 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
| 2060 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2061 | [ #include <sys/bitypes.h> ], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2062 | [ u_int64_t a; a = 1], |
| 2063 | [ |
| 2064 | AC_DEFINE(HAVE_U_INT64_T) |
| 2065 | AC_MSG_RESULT(yes) |
| 2066 | ], |
| 2067 | [ AC_MSG_RESULT(no) ] |
| 2068 | ) |
| 2069 | fi |
| 2070 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2071 | if test -z "$have_u_intxx_t" ; then |
| 2072 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 2073 | AC_TRY_COMPILE( |
| 2074 | [ |
| 2075 | #include <sys/types.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2076 | ], |
| 2077 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2078 | [ ac_cv_have_uintxx_t="yes" ], |
| 2079 | [ ac_cv_have_uintxx_t="no" ] |
| 2080 | ) |
| 2081 | ]) |
| 2082 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 2083 | AC_DEFINE(HAVE_UINTXX_T) |
| 2084 | fi |
| 2085 | fi |
| 2086 | |
| 2087 | if test -z "$have_uintxx_t" ; then |
| 2088 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
| 2089 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2090 | [ #include <stdint.h> ], |
| 2091 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2092 | [ |
| 2093 | AC_DEFINE(HAVE_UINTXX_T) |
| 2094 | AC_MSG_RESULT(yes) |
| 2095 | ], |
| 2096 | [ AC_MSG_RESULT(no) ] |
| 2097 | ) |
| 2098 | fi |
| 2099 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 2100 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2101 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2102 | then |
| 2103 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 2104 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2105 | [ |
| 2106 | #include <sys/bitypes.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2107 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2108 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 2109 | int8_t a; int16_t b; int32_t c; |
| 2110 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 2111 | a = b = c = e = f = g = 1; |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2112 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2113 | [ |
| 2114 | AC_DEFINE(HAVE_U_INTXX_T) |
| 2115 | AC_DEFINE(HAVE_INTXX_T) |
| 2116 | AC_MSG_RESULT(yes) |
| 2117 | ], |
| 2118 | [AC_MSG_RESULT(no)] |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2119 | ) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2120 | fi |
| 2121 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 2122 | |
| 2123 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
| 2124 | AC_TRY_COMPILE( |
| 2125 | [ |
| 2126 | #include <sys/types.h> |
| 2127 | ], |
| 2128 | [ u_char foo; foo = 125; ], |
| 2129 | [ ac_cv_have_u_char="yes" ], |
| 2130 | [ ac_cv_have_u_char="no" ] |
| 2131 | ) |
| 2132 | ]) |
| 2133 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
| 2134 | AC_DEFINE(HAVE_U_CHAR) |
| 2135 | fi |
| 2136 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 2137 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 2138 | |
Tim Rice | 200a5c0 | 2002-02-26 22:12:34 -0800 | [diff] [blame] | 2139 | AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2140 | |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 2141 | AC_CHECK_TYPES(in_addr_t,,, |
| 2142 | [#include <sys/types.h> |
| 2143 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 2144 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2145 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 2146 | AC_TRY_COMPILE( |
| 2147 | [ |
| 2148 | #include <sys/types.h> |
| 2149 | ], |
| 2150 | [ size_t foo; foo = 1235; ], |
| 2151 | [ ac_cv_have_size_t="yes" ], |
| 2152 | [ ac_cv_have_size_t="no" ] |
| 2153 | ) |
| 2154 | ]) |
| 2155 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 2156 | AC_DEFINE(HAVE_SIZE_T) |
| 2157 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 2158 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 2159 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 2160 | AC_TRY_COMPILE( |
| 2161 | [ |
| 2162 | #include <sys/types.h> |
| 2163 | ], |
| 2164 | [ ssize_t foo; foo = 1235; ], |
| 2165 | [ ac_cv_have_ssize_t="yes" ], |
| 2166 | [ ac_cv_have_ssize_t="no" ] |
| 2167 | ) |
| 2168 | ]) |
| 2169 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 2170 | AC_DEFINE(HAVE_SSIZE_T) |
| 2171 | fi |
| 2172 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 2173 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 2174 | AC_TRY_COMPILE( |
| 2175 | [ |
| 2176 | #include <time.h> |
| 2177 | ], |
| 2178 | [ clock_t foo; foo = 1235; ], |
| 2179 | [ ac_cv_have_clock_t="yes" ], |
| 2180 | [ ac_cv_have_clock_t="no" ] |
| 2181 | ) |
| 2182 | ]) |
| 2183 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
| 2184 | AC_DEFINE(HAVE_CLOCK_T) |
| 2185 | fi |
| 2186 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2187 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 2188 | AC_TRY_COMPILE( |
| 2189 | [ |
| 2190 | #include <sys/types.h> |
| 2191 | #include <sys/socket.h> |
| 2192 | ], |
| 2193 | [ sa_family_t foo; foo = 1235; ], |
| 2194 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2195 | [ AC_TRY_COMPILE( |
| 2196 | [ |
| 2197 | #include <sys/types.h> |
| 2198 | #include <sys/socket.h> |
| 2199 | #include <netinet/in.h> |
| 2200 | ], |
| 2201 | [ sa_family_t foo; foo = 1235; ], |
| 2202 | [ ac_cv_have_sa_family_t="yes" ], |
| 2203 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2204 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2205 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2206 | ) |
| 2207 | ]) |
| 2208 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 2209 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 2210 | fi |
| 2211 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 2212 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 2213 | AC_TRY_COMPILE( |
| 2214 | [ |
| 2215 | #include <sys/types.h> |
| 2216 | ], |
| 2217 | [ pid_t foo; foo = 1235; ], |
| 2218 | [ ac_cv_have_pid_t="yes" ], |
| 2219 | [ ac_cv_have_pid_t="no" ] |
| 2220 | ) |
| 2221 | ]) |
| 2222 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 2223 | AC_DEFINE(HAVE_PID_T) |
| 2224 | fi |
| 2225 | |
| 2226 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 2227 | AC_TRY_COMPILE( |
| 2228 | [ |
| 2229 | #include <sys/types.h> |
| 2230 | ], |
| 2231 | [ mode_t foo; foo = 1235; ], |
| 2232 | [ ac_cv_have_mode_t="yes" ], |
| 2233 | [ ac_cv_have_mode_t="no" ] |
| 2234 | ) |
| 2235 | ]) |
| 2236 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 2237 | AC_DEFINE(HAVE_MODE_T) |
| 2238 | fi |
| 2239 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2240 | |
| 2241 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 2242 | AC_TRY_COMPILE( |
| 2243 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2244 | #include <sys/types.h> |
| 2245 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2246 | ], |
| 2247 | [ struct sockaddr_storage s; ], |
| 2248 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 2249 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 2250 | ) |
| 2251 | ]) |
| 2252 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 2253 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 2254 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2255 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2256 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 2257 | AC_TRY_COMPILE( |
| 2258 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2259 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2260 | #include <netinet/in.h> |
| 2261 | ], |
| 2262 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 2263 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 2264 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 2265 | ) |
| 2266 | ]) |
| 2267 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 2268 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 2269 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2270 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2271 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 2272 | AC_TRY_COMPILE( |
| 2273 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2274 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2275 | #include <netinet/in.h> |
| 2276 | ], |
| 2277 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 2278 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 2279 | [ ac_cv_have_struct_in6_addr="no" ] |
| 2280 | ) |
| 2281 | ]) |
| 2282 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 2283 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 2284 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2285 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2286 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 2287 | AC_TRY_COMPILE( |
| 2288 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2289 | #include <sys/types.h> |
| 2290 | #include <sys/socket.h> |
| 2291 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2292 | ], |
| 2293 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 2294 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 2295 | [ ac_cv_have_struct_addrinfo="no" ] |
| 2296 | ) |
| 2297 | ]) |
| 2298 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 2299 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 2300 | fi |
| 2301 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 2302 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 2303 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2304 | [ #include <sys/time.h> ], |
| 2305 | [ struct timeval tv; tv.tv_sec = 1;], |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 2306 | [ ac_cv_have_struct_timeval="yes" ], |
| 2307 | [ ac_cv_have_struct_timeval="no" ] |
| 2308 | ) |
| 2309 | ]) |
| 2310 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
| 2311 | AC_DEFINE(HAVE_STRUCT_TIMEVAL) |
| 2312 | have_struct_timeval=1 |
| 2313 | fi |
| 2314 | |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 2315 | AC_CHECK_TYPES(struct timespec) |
| 2316 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 2317 | # We need int64_t or else certian parts of the compile will fail. |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2318 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 2319 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 2320 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 2321 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 2322 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 2323 | echo "" |
| 2324 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2325 | else |
| 2326 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2327 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2328 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2329 | #include <stdio.h> |
| 2330 | #include <string.h> |
| 2331 | #ifdef HAVE_SNPRINTF |
| 2332 | main() |
| 2333 | { |
| 2334 | char buf[50]; |
| 2335 | char expected_out[50]; |
| 2336 | int mazsize = 50 ; |
| 2337 | #if (SIZEOF_LONG_INT == 8) |
| 2338 | long int num = 0x7fffffffffffffff; |
| 2339 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 2340 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2341 | #endif |
| 2342 | strcpy(expected_out, "9223372036854775807"); |
| 2343 | snprintf(buf, mazsize, "%lld", num); |
| 2344 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2345 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2346 | exit(0); |
| 2347 | } |
| 2348 | #else |
| 2349 | main() { exit(0); } |
| 2350 | #endif |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2351 | ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2352 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2353 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2354 | fi |
| 2355 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2356 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2357 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 2358 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 2359 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 2360 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 2361 | 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] | 2362 | 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] | 2363 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 2364 | 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] | 2365 | 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] | 2366 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 2367 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 2368 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 2369 | 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] | 2370 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 2371 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 2372 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 2373 | 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] | 2374 | |
| 2375 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 2376 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2377 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 2378 | ac_cv_have_ss_family_in_struct_ss, [ |
| 2379 | AC_TRY_COMPILE( |
| 2380 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2381 | #include <sys/types.h> |
| 2382 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2383 | ], |
| 2384 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 2385 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 2386 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 2387 | ) |
| 2388 | ]) |
| 2389 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 2390 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 2391 | fi |
| 2392 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2393 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 2394 | ac_cv_have___ss_family_in_struct_ss, [ |
| 2395 | AC_TRY_COMPILE( |
| 2396 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2397 | #include <sys/types.h> |
| 2398 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2399 | ], |
| 2400 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 2401 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 2402 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 2403 | ) |
| 2404 | ]) |
| 2405 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 2406 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 2407 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 2408 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2409 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 2410 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 2411 | AC_TRY_COMPILE( |
| 2412 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2413 | #include <pwd.h> |
| 2414 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 2415 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2416 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 2417 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 2418 | ) |
| 2419 | ]) |
| 2420 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 2421 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 2422 | fi |
| 2423 | |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 2424 | AC_CACHE_CHECK([for pw_expire field in struct passwd], |
| 2425 | ac_cv_have_pw_expire_in_struct_passwd, [ |
| 2426 | AC_TRY_COMPILE( |
| 2427 | [ |
| 2428 | #include <pwd.h> |
| 2429 | ], |
| 2430 | [ struct passwd p; p.pw_expire = 0; ], |
| 2431 | [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], |
| 2432 | [ ac_cv_have_pw_expire_in_struct_passwd="no" ] |
| 2433 | ) |
| 2434 | ]) |
| 2435 | if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then |
| 2436 | AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD) |
| 2437 | fi |
| 2438 | |
| 2439 | AC_CACHE_CHECK([for pw_change field in struct passwd], |
| 2440 | ac_cv_have_pw_change_in_struct_passwd, [ |
| 2441 | AC_TRY_COMPILE( |
| 2442 | [ |
| 2443 | #include <pwd.h> |
| 2444 | ], |
| 2445 | [ struct passwd p; p.pw_change = 0; ], |
| 2446 | [ ac_cv_have_pw_change_in_struct_passwd="yes" ], |
| 2447 | [ ac_cv_have_pw_change_in_struct_passwd="no" ] |
| 2448 | ) |
| 2449 | ]) |
| 2450 | if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then |
| 2451 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) |
| 2452 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2453 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 2454 | 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] | 2455 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 2456 | ac_cv_have_accrights_in_msghdr, [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2457 | AC_COMPILE_IFELSE( |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 2458 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 2459 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 2460 | #include <sys/socket.h> |
| 2461 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 2462 | int main() { |
| 2463 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2464 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 2465 | exit(1); |
| 2466 | #endif |
| 2467 | struct msghdr m; |
| 2468 | m.msg_accrights = 0; |
| 2469 | exit(0); |
| 2470 | } |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 2471 | ], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 2472 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 2473 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 2474 | ) |
| 2475 | ]) |
| 2476 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
| 2477 | AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR) |
| 2478 | fi |
| 2479 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 2480 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 2481 | ac_cv_have_control_in_msghdr, [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2482 | AC_COMPILE_IFELSE( |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 2483 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 2484 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 2485 | #include <sys/socket.h> |
| 2486 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 2487 | int main() { |
| 2488 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2489 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 2490 | exit(1); |
| 2491 | #endif |
| 2492 | struct msghdr m; |
| 2493 | m.msg_control = 0; |
| 2494 | exit(0); |
| 2495 | } |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 2496 | ], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 2497 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 2498 | [ ac_cv_have_control_in_msghdr="no" ] |
| 2499 | ) |
| 2500 | ]) |
| 2501 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
| 2502 | AC_DEFINE(HAVE_CONTROL_IN_MSGHDR) |
| 2503 | fi |
| 2504 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2505 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2506 | AC_TRY_LINK([], |
| 2507 | [ extern char *__progname; printf("%s", __progname); ], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2508 | [ ac_cv_libc_defines___progname="yes" ], |
| 2509 | [ ac_cv_libc_defines___progname="no" ] |
| 2510 | ) |
| 2511 | ]) |
| 2512 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 2513 | AC_DEFINE(HAVE___PROGNAME) |
| 2514 | fi |
| 2515 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 2516 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
| 2517 | AC_TRY_LINK([ |
| 2518 | #include <stdio.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2519 | ], |
| 2520 | [ printf("%s", __FUNCTION__); ], |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 2521 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 2522 | [ ac_cv_cc_implements___FUNCTION__="no" ] |
| 2523 | ) |
| 2524 | ]) |
| 2525 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
| 2526 | AC_DEFINE(HAVE___FUNCTION__) |
| 2527 | fi |
| 2528 | |
| 2529 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
| 2530 | AC_TRY_LINK([ |
| 2531 | #include <stdio.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2532 | ], |
| 2533 | [ printf("%s", __func__); ], |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 2534 | [ ac_cv_cc_implements___func__="yes" ], |
| 2535 | [ ac_cv_cc_implements___func__="no" ] |
| 2536 | ) |
| 2537 | ]) |
| 2538 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
| 2539 | AC_DEFINE(HAVE___func__) |
| 2540 | fi |
| 2541 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 2542 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 2543 | ac_cv_have_getopt_optreset, [ |
| 2544 | AC_TRY_LINK( |
| 2545 | [ |
| 2546 | #include <getopt.h> |
| 2547 | ], |
| 2548 | [ extern int optreset; optreset = 0; ], |
| 2549 | [ ac_cv_have_getopt_optreset="yes" ], |
| 2550 | [ ac_cv_have_getopt_optreset="no" ] |
| 2551 | ) |
| 2552 | ]) |
| 2553 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
| 2554 | AC_DEFINE(HAVE_GETOPT_OPTRESET) |
| 2555 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2556 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 2557 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2558 | AC_TRY_LINK([], |
| 2559 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 2560 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 2561 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 2562 | ) |
| 2563 | ]) |
| 2564 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 2565 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 2566 | fi |
| 2567 | |
| 2568 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 2569 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2570 | AC_TRY_LINK([], |
| 2571 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 2572 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 2573 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 2574 | ) |
| 2575 | ]) |
| 2576 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 2577 | AC_DEFINE(HAVE_SYS_NERR) |
| 2578 | fi |
| 2579 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2580 | SCARD_MSG="no" |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 2581 | # Check whether user wants sectok support |
| 2582 | AC_ARG_WITH(sectok, |
| 2583 | [ --with-sectok Enable smartcard support using libsectok], |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 2584 | [ |
| 2585 | if test "x$withval" != "xno" ; then |
| 2586 | if test "x$withval" != "xyes" ; then |
| 2587 | CPPFLAGS="$CPPFLAGS -I${withval}" |
| 2588 | LDFLAGS="$LDFLAGS -L${withval}" |
| 2589 | if test ! -z "$need_dash_r" ; then |
| 2590 | LDFLAGS="$LDFLAGS -R${withval}" |
| 2591 | fi |
| 2592 | if test ! -z "$blibpath" ; then |
| 2593 | blibpath="$blibpath:${withval}" |
| 2594 | fi |
| 2595 | fi |
| 2596 | AC_CHECK_HEADERS(sectok.h) |
| 2597 | if test "$ac_cv_header_sectok_h" != yes; then |
| 2598 | AC_MSG_ERROR(Can't find sectok.h) |
| 2599 | fi |
| 2600 | AC_CHECK_LIB(sectok, sectok_open) |
| 2601 | if test "$ac_cv_lib_sectok_sectok_open" != yes; then |
| 2602 | AC_MSG_ERROR(Can't find libsectok) |
| 2603 | fi |
| 2604 | AC_DEFINE(SMARTCARD) |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 2605 | AC_DEFINE(USE_SECTOK) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2606 | SCARD_MSG="yes, using sectok" |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 2607 | fi |
| 2608 | ] |
| 2609 | ) |
| 2610 | |
| 2611 | # Check whether user wants OpenSC support |
Tim Rice | 12ee8e2 | 2005-03-17 13:37:04 -0800 | [diff] [blame] | 2612 | OPENSC_CONFIG="no" |
Ben Lindstrom | a42694f | 2002-04-05 16:11:45 +0000 | [diff] [blame] | 2613 | AC_ARG_WITH(opensc, |
Tim Rice | 12ee8e2 | 2005-03-17 13:37:04 -0800 | [diff] [blame] | 2614 | [--with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)], |
| 2615 | [ |
| 2616 | if test "x$withval" != "xno" ; then |
| 2617 | if test "x$withval" != "xyes" ; then |
| 2618 | OPENSC_CONFIG=$withval/bin/opensc-config |
| 2619 | else |
| 2620 | AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) |
| 2621 | fi |
| 2622 | if test "$OPENSC_CONFIG" != "no"; then |
| 2623 | LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` |
| 2624 | LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` |
| 2625 | CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" |
| 2626 | LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" |
| 2627 | AC_DEFINE(SMARTCARD) |
| 2628 | AC_DEFINE(USE_OPENSC) |
| 2629 | SCARD_MSG="yes, using OpenSC" |
| 2630 | fi |
| 2631 | fi |
| 2632 | ] |
| 2633 | ) |
Damien Miller | 85de580 | 2001-09-18 14:01:11 +1000 | [diff] [blame] | 2634 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 2635 | # Check libraries needed by DNS fingerprint support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2636 | AC_SEARCH_LIBS(getrrsetbyname, resolv, |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 2637 | [AC_DEFINE(HAVE_GETRRSETBYNAME)], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 2638 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 2639 | # Needed by our getrrsetbyname() |
| 2640 | AC_SEARCH_LIBS(res_query, resolv) |
| 2641 | AC_SEARCH_LIBS(dn_expand, resolv) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 2642 | AC_MSG_CHECKING(if res_query will link) |
| 2643 | AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes), |
| 2644 | [AC_MSG_RESULT(no) |
| 2645 | saved_LIBS="$LIBS" |
| 2646 | LIBS="$LIBS -lresolv" |
| 2647 | AC_MSG_CHECKING(for res_query in -lresolv) |
| 2648 | AC_LINK_IFELSE([ |
| 2649 | #include <resolv.h> |
| 2650 | int main() |
| 2651 | { |
| 2652 | res_query (0, 0, 0, 0, 0); |
| 2653 | return 0; |
| 2654 | } |
| 2655 | ], |
| 2656 | [LIBS="$LIBS -lresolv" |
| 2657 | AC_MSG_RESULT(yes)], |
| 2658 | [LIBS="$saved_LIBS" |
| 2659 | AC_MSG_RESULT(no)]) |
| 2660 | ]) |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 2661 | AC_CHECK_FUNCS(_getshort _getlong) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 2662 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 2663 | [#include <sys/types.h> |
| 2664 | #include <arpa/nameser.h>]) |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 2665 | AC_CHECK_MEMBER(HEADER.ad, |
| 2666 | [AC_DEFINE(HAVE_HEADER_AD)],, |
| 2667 | [#include <arpa/nameser.h>]) |
| 2668 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 2669 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 2670 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2671 | KRB5_MSG="no" |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 2672 | AC_ARG_WITH(kerberos5, |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2673 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 2674 | [ if test "x$withval" != "xno" ; then |
| 2675 | if test "x$withval" = "xyes" ; then |
| 2676 | KRB5ROOT="/usr/local" |
| 2677 | else |
| 2678 | KRB5ROOT=${withval} |
| 2679 | fi |
| 2680 | |
| 2681 | AC_DEFINE(KRB5) |
| 2682 | KRB5_MSG="yes" |
| 2683 | |
| 2684 | AC_MSG_CHECKING(for krb5-config) |
| 2685 | if test -x $KRB5ROOT/bin/krb5-config ; then |
| 2686 | KRB5CONF=$KRB5ROOT/bin/krb5-config |
| 2687 | AC_MSG_RESULT($KRB5CONF) |
| 2688 | |
| 2689 | AC_MSG_CHECKING(for gssapi support) |
| 2690 | if $KRB5CONF | grep gssapi >/dev/null ; then |
| 2691 | AC_MSG_RESULT(yes) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 2692 | AC_DEFINE(GSSAPI) |
| 2693 | k5confopts=gssapi |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2694 | else |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 2695 | AC_MSG_RESULT(no) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 2696 | k5confopts="" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2697 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 2698 | K5CFLAGS="`$KRB5CONF --cflags $k5confopts`" |
| 2699 | K5LIBS="`$KRB5CONF --libs $k5confopts`" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 2700 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 2701 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 2702 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 2703 | [ char *tmp = heimdal_version; ], |
| 2704 | [ AC_MSG_RESULT(yes) |
| 2705 | AC_DEFINE(HEIMDAL) ], |
| 2706 | AC_MSG_RESULT(no) |
| 2707 | ) |
| 2708 | else |
| 2709 | AC_MSG_RESULT(no) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 2710 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2711 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2712 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 2713 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 2714 | [ char *tmp = heimdal_version; ], |
| 2715 | [ AC_MSG_RESULT(yes) |
| 2716 | AC_DEFINE(HEIMDAL) |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 2717 | K5LIBS="-lkrb5 -ldes" |
| 2718 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2719 | AC_CHECK_LIB(roken, net_write, |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 2720 | [K5LIBS="$K5LIBS -lroken"]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2721 | ], |
| 2722 | [ AC_MSG_RESULT(no) |
| 2723 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
| 2724 | ] |
| 2725 | ) |
Damien Miller | 200d0a7 | 2003-06-30 19:21:36 +1000 | [diff] [blame] | 2726 | AC_SEARCH_LIBS(dn_expand, resolv) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 2727 | |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 2728 | AC_CHECK_LIB(gssapi,gss_init_sec_context, |
| 2729 | [ AC_DEFINE(GSSAPI) |
| 2730 | K5LIBS="-lgssapi $K5LIBS" ], |
| 2731 | [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context, |
| 2732 | [ AC_DEFINE(GSSAPI) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2733 | K5LIBS="-lgssapi_krb5 $K5LIBS" ], |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 2734 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]), |
| 2735 | $K5LIBS) |
| 2736 | ], |
| 2737 | $K5LIBS) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2738 | |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 2739 | AC_CHECK_HEADER(gssapi.h, , |
| 2740 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2741 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 2742 | AC_CHECK_HEADERS(gssapi.h, , |
| 2743 | AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2744 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 2745 | ] |
| 2746 | ) |
| 2747 | |
| 2748 | oldCPP="$CPPFLAGS" |
| 2749 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
| 2750 | AC_CHECK_HEADER(gssapi_krb5.h, , |
| 2751 | [ CPPFLAGS="$oldCPP" ]) |
| 2752 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2753 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 2754 | if test ! -z "$need_dash_r" ; then |
| 2755 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 2756 | fi |
| 2757 | if test ! -z "$blibpath" ; then |
| 2758 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 2759 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 2760 | fi |
| 2761 | |
| 2762 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h) |
| 2763 | AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h) |
| 2764 | AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h) |
| 2765 | |
| 2766 | LIBS="$LIBS $K5LIBS" |
| 2767 | AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS)) |
| 2768 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 2769 | ) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 2770 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2771 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2772 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2773 | PRIVSEP_PATH=/var/empty |
| 2774 | AC_ARG_WITH(privsep-path, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 2775 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2776 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2777 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2778 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 2779 | PRIVSEP_PATH=$withval |
| 2780 | fi |
| 2781 | ] |
| 2782 | ) |
| 2783 | AC_SUBST(PRIVSEP_PATH) |
| 2784 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2785 | AC_ARG_WITH(xauth, |
| 2786 | [ --with-xauth=PATH Specify path to xauth program ], |
| 2787 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2788 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2789 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2790 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2791 | fi |
| 2792 | ], |
| 2793 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 2794 | TestPath="$PATH" |
| 2795 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 2796 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 2797 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 2798 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
| 2799 | AC_PATH_PROG(xauth_path, xauth, , $TestPath) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 2800 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2801 | xauth_path="/usr/openwin/bin/xauth" |
| 2802 | fi |
| 2803 | ] |
| 2804 | ) |
| 2805 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 2806 | STRIP_OPT=-s |
| 2807 | AC_ARG_ENABLE(strip, |
| 2808 | [ --disable-strip Disable calling strip(1) on install], |
| 2809 | [ |
| 2810 | if test "x$enableval" = "xno" ; then |
| 2811 | STRIP_OPT= |
| 2812 | fi |
| 2813 | ] |
| 2814 | ) |
| 2815 | AC_SUBST(STRIP_OPT) |
| 2816 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 2817 | if test -z "$xauth_path" ; then |
| 2818 | XAUTH_PATH="undefined" |
| 2819 | AC_SUBST(XAUTH_PATH) |
| 2820 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2821 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 2822 | XAUTH_PATH=$xauth_path |
| 2823 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2824 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2825 | |
| 2826 | # Check for mail directory (last resort if we cannot get it from headers) |
| 2827 | if test ! -z "$MAIL" ; then |
| 2828 | maildir=`dirname $MAIL` |
| 2829 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 2830 | fi |
| 2831 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2832 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2833 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 2834 | disable_ptmx_check=yes |
| 2835 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2836 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 2837 | if test "x$disable_ptmx_check" != "xyes" ; then |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2838 | AC_CHECK_FILE("/dev/ptmx", |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 2839 | [ |
| 2840 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 2841 | have_dev_ptmx=1 |
| 2842 | ] |
| 2843 | ) |
| 2844 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2845 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2846 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2847 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2848 | AC_CHECK_FILE("/dev/ptc", |
| 2849 | [ |
| 2850 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 2851 | have_dev_ptc=1 |
| 2852 | ] |
| 2853 | ) |
| 2854 | else |
| 2855 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 2856 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 2857 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2858 | # Options from here on. Some of these are preset by platform above |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 2859 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 2860 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 2861 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 2862 | case "$withval" in |
| 2863 | man|cat|doc) |
| 2864 | MANTYPE=$withval |
| 2865 | ;; |
| 2866 | *) |
| 2867 | AC_MSG_ERROR(invalid man type: $withval) |
| 2868 | ;; |
| 2869 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 2870 | ] |
| 2871 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2872 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 2873 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
| 2874 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2875 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 2876 | MANTYPE=doc |
| 2877 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 2878 | MANTYPE=man |
| 2879 | else |
| 2880 | MANTYPE=cat |
| 2881 | fi |
| 2882 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 2883 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 2884 | if test "$MANTYPE" = "doc"; then |
| 2885 | mansubdir=man; |
| 2886 | else |
| 2887 | mansubdir=$MANTYPE; |
| 2888 | fi |
| 2889 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2890 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2891 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2892 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 2893 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 2894 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2895 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 2896 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2897 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2898 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 2899 | fi |
| 2900 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 2901 | ) |
| 2902 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2903 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2904 | AC_ARG_WITH(shadow, |
| 2905 | [ --without-shadow Disable shadow password support], |
| 2906 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2907 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2908 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 2909 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2910 | fi |
| 2911 | ] |
| 2912 | ) |
| 2913 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 2914 | if test -z "$disable_shadow" ; then |
| 2915 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 2916 | AC_TRY_COMPILE( |
| 2917 | [ |
| 2918 | #include <sys/types.h> |
| 2919 | #include <shadow.h> |
| 2920 | struct spwd sp; |
| 2921 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 2922 | [ sp_expire_available=yes ], [] |
| 2923 | ) |
| 2924 | |
| 2925 | if test "x$sp_expire_available" = "xyes" ; then |
| 2926 | AC_MSG_RESULT(yes) |
| 2927 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 2928 | else |
| 2929 | AC_MSG_RESULT(no) |
| 2930 | fi |
| 2931 | fi |
| 2932 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2933 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 2934 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 2935 | DISPLAY_HACK_MSG="yes" |
| 2936 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 2937 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2938 | DISPLAY_HACK_MSG="no" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 2939 | AC_ARG_WITH(ipaddr-display, |
| 2940 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 2941 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2942 | if test "x$withval" != "xno" ; then |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 2943 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2944 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 2945 | fi |
| 2946 | ] |
| 2947 | ) |
| 2948 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 2949 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2950 | # check for /etc/default/login and use it if present. |
Tim Rice | 7ff4e6d | 2003-09-22 19:50:14 -0700 | [diff] [blame] | 2951 | AC_ARG_ENABLE(etc-default-login, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 2952 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 2953 | [ if test "x$enableval" = "xno"; then |
| 2954 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 2955 | etc_default_login=no |
| 2956 | else |
| 2957 | etc_default_login=yes |
| 2958 | fi ], |
| 2959 | [ etc_default_login=yes ] |
| 2960 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2961 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 2962 | if test "x$etc_default_login" != "xno"; then |
| 2963 | AC_CHECK_FILE("/etc/default/login", |
| 2964 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2965 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 2966 | then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2967 | AC_MSG_WARN([cross compiling: Disabling /etc/default/login test]) |
| 2968 | elif test "x$external_path_file" = "x/etc/default/login"; then |
| 2969 | AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN) |
| 2970 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 2971 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2972 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2973 | dnl BSD systems use /etc/login.conf so --with-default-path= has no effect |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2974 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 2975 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2976 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2977 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2978 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2979 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2980 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 2981 | AC_ARG_WITH(default-path, |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 2982 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2983 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2984 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 2985 | AC_MSG_WARN([ |
| 2986 | --with-default-path=PATH has no effect on this system. |
| 2987 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2988 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 2989 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2990 | AC_MSG_WARN([ |
| 2991 | --with-default-path=PATH will only be used if PATH is not defined in |
| 2992 | $external_path_file .]) |
| 2993 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2994 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2995 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 2996 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 2997 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 2998 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 2999 | AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3000 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 3001 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3002 | AC_MSG_WARN([ |
| 3003 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 3004 | otherwise scp will not work.]) |
| 3005 | fi |
| 3006 | AC_TRY_RUN( |
| 3007 | [ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3008 | /* find out what STDPATH is */ |
| 3009 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3010 | #ifdef HAVE_PATHS_H |
| 3011 | # include <paths.h> |
| 3012 | #endif |
| 3013 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 3014 | # ifdef _PATH_USERPATH /* Irix */ |
| 3015 | # define _PATH_STDPATH _PATH_USERPATH |
| 3016 | # else |
| 3017 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 3018 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3019 | #endif |
| 3020 | #include <sys/types.h> |
| 3021 | #include <sys/stat.h> |
| 3022 | #include <fcntl.h> |
| 3023 | #define DATA "conftest.stdpath" |
| 3024 | |
| 3025 | main() |
| 3026 | { |
| 3027 | FILE *fd; |
| 3028 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3029 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3030 | fd = fopen(DATA,"w"); |
| 3031 | if(fd == NULL) |
| 3032 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3033 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3034 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 3035 | exit(1); |
| 3036 | |
| 3037 | exit(0); |
| 3038 | } |
| 3039 | ], [ user_path=`cat conftest.stdpath` ], |
| 3040 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 3041 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 3042 | ) |
| 3043 | # make sure $bindir is in USER_PATH so scp will work |
| 3044 | t_bindir=`eval echo ${bindir}` |
| 3045 | case $t_bindir in |
| 3046 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 3047 | esac |
| 3048 | case $t_bindir in |
| 3049 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 3050 | esac |
| 3051 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 3052 | if test $? -ne 0 ; then |
| 3053 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 3054 | if test $? -ne 0 ; then |
| 3055 | user_path=$user_path:$t_bindir |
| 3056 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 3057 | fi |
| 3058 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3059 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3060 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3061 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3062 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") |
| 3063 | AC_SUBST(user_path) |
| 3064 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3065 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3066 | # Set superuser path separately to user path |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3067 | AC_ARG_WITH(superuser-path, |
| 3068 | [ --with-superuser-path= Specify different path for super-user], |
| 3069 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3070 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3071 | test "x${withval}" != "xyes"; then |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3072 | AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval") |
| 3073 | superuser_path=$withval |
| 3074 | fi |
| 3075 | ] |
| 3076 | ) |
| 3077 | |
| 3078 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3079 | AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3080 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3081 | AC_ARG_WITH(4in6, |
| 3082 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 3083 | [ |
| 3084 | if test "x$withval" != "xno" ; then |
| 3085 | AC_MSG_RESULT(yes) |
| 3086 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3087 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3088 | else |
| 3089 | AC_MSG_RESULT(no) |
| 3090 | fi |
| 3091 | ],[ |
| 3092 | if test "x$inet6_default_4in6" = "xyes"; then |
| 3093 | AC_MSG_RESULT([yes (default)]) |
| 3094 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3095 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3096 | else |
| 3097 | AC_MSG_RESULT([no (default)]) |
| 3098 | fi |
| 3099 | ] |
| 3100 | ) |
| 3101 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3102 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3103 | BSD_AUTH_MSG=no |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3104 | AC_ARG_WITH(bsd-auth, |
| 3105 | [ --with-bsd-auth Enable BSD auth support], |
| 3106 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3107 | if test "x$withval" != "xno" ; then |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3108 | AC_DEFINE(BSD_AUTH) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3109 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3110 | fi |
| 3111 | ] |
| 3112 | ) |
| 3113 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3114 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 3115 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3116 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3117 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3118 | piddir=`eval echo ${sysconfdir}` |
| 3119 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3120 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3121 | esac |
| 3122 | fi |
| 3123 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3124 | AC_ARG_WITH(pid-dir, |
| 3125 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 3126 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3127 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3128 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3129 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3130 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3131 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 3132 | fi |
| 3133 | fi |
| 3134 | ] |
| 3135 | ) |
| 3136 | |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 3137 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 3138 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 3139 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3140 | dnl allow user to disable some login recording features |
| 3141 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3142 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3143 | [ |
| 3144 | if test "x$enableval" = "xno" ; then |
| 3145 | AC_DEFINE(DISABLE_LASTLOG) |
| 3146 | fi |
| 3147 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3148 | ) |
| 3149 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3150 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3151 | [ |
| 3152 | if test "x$enableval" = "xno" ; then |
| 3153 | AC_DEFINE(DISABLE_UTMP) |
| 3154 | fi |
| 3155 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3156 | ) |
| 3157 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3158 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3159 | [ |
| 3160 | if test "x$enableval" = "xno" ; then |
| 3161 | AC_DEFINE(DISABLE_UTMPX) |
| 3162 | fi |
| 3163 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3164 | ) |
| 3165 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3166 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3167 | [ |
| 3168 | if test "x$enableval" = "xno" ; then |
| 3169 | AC_DEFINE(DISABLE_WTMP) |
| 3170 | fi |
| 3171 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3172 | ) |
| 3173 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3174 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3175 | [ |
| 3176 | if test "x$enableval" = "xno" ; then |
| 3177 | AC_DEFINE(DISABLE_WTMPX) |
| 3178 | fi |
| 3179 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3180 | ) |
| 3181 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3182 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3183 | [ |
| 3184 | if test "x$enableval" = "xno" ; then |
| 3185 | AC_DEFINE(DISABLE_LOGIN) |
| 3186 | fi |
| 3187 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3188 | ) |
| 3189 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3190 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3191 | [ |
| 3192 | if test "x$enableval" = "xno" ; then |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3193 | AC_DEFINE(DISABLE_PUTUTLINE) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3194 | fi |
| 3195 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3196 | ) |
| 3197 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3198 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3199 | [ |
| 3200 | if test "x$enableval" = "xno" ; then |
| 3201 | AC_DEFINE(DISABLE_PUTUTXLINE) |
| 3202 | fi |
| 3203 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3204 | ) |
| 3205 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3206 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3207 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3208 | if test "x$withval" = "xno" ; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3209 | AC_DEFINE(DISABLE_LASTLOG) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3210 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3211 | conf_lastlog_location=$withval |
| 3212 | fi |
| 3213 | ] |
| 3214 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3215 | |
| 3216 | dnl lastlog, [uw]tmpx? detection |
| 3217 | dnl NOTE: set the paths in the platform section to avoid the |
| 3218 | dnl need for command-line parameters |
| 3219 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 3220 | |
| 3221 | dnl lastlog detection |
| 3222 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 3223 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 3224 | AC_TRY_COMPILE([ |
| 3225 | #include <sys/types.h> |
| 3226 | #include <utmp.h> |
| 3227 | #ifdef HAVE_LASTLOG_H |
| 3228 | # include <lastlog.h> |
| 3229 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3230 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3231 | # include <paths.h> |
| 3232 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3233 | #ifdef HAVE_LOGIN_H |
| 3234 | # include <login.h> |
| 3235 | #endif |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3236 | ], |
| 3237 | [ char *lastlog = LASTLOG_FILE; ], |
| 3238 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3239 | [ |
| 3240 | AC_MSG_RESULT(no) |
| 3241 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 3242 | AC_TRY_COMPILE([ |
| 3243 | #include <sys/types.h> |
| 3244 | #include <utmp.h> |
| 3245 | #ifdef HAVE_LASTLOG_H |
| 3246 | # include <lastlog.h> |
| 3247 | #endif |
| 3248 | #ifdef HAVE_PATHS_H |
| 3249 | # include <paths.h> |
| 3250 | #endif |
| 3251 | ], |
| 3252 | [ char *lastlog = _PATH_LASTLOG; ], |
| 3253 | [ AC_MSG_RESULT(yes) ], |
| 3254 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 3255 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3256 | system_lastlog_path=no |
| 3257 | ]) |
| 3258 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3259 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3260 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3261 | if test -z "$conf_lastlog_location"; then |
| 3262 | if test x"$system_lastlog_path" = x"no" ; then |
| 3263 | 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] | 3264 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3265 | conf_lastlog_location=$f |
| 3266 | fi |
| 3267 | done |
| 3268 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 3269 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 3270 | 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] | 3271 | fi |
| 3272 | fi |
| 3273 | fi |
| 3274 | |
| 3275 | if test -n "$conf_lastlog_location"; then |
| 3276 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3277 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3278 | |
| 3279 | dnl utmp detection |
| 3280 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 3281 | AC_TRY_COMPILE([ |
| 3282 | #include <sys/types.h> |
| 3283 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3284 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3285 | # include <paths.h> |
| 3286 | #endif |
| 3287 | ], |
| 3288 | [ char *utmp = UTMP_FILE; ], |
| 3289 | [ AC_MSG_RESULT(yes) ], |
| 3290 | [ AC_MSG_RESULT(no) |
| 3291 | system_utmp_path=no ] |
| 3292 | ) |
| 3293 | if test -z "$conf_utmp_location"; then |
| 3294 | if test x"$system_utmp_path" = x"no" ; then |
| 3295 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 3296 | if test -f $f ; then |
| 3297 | conf_utmp_location=$f |
| 3298 | fi |
| 3299 | done |
| 3300 | if test -z "$conf_utmp_location"; then |
| 3301 | AC_DEFINE(DISABLE_UTMP) |
| 3302 | fi |
| 3303 | fi |
| 3304 | fi |
| 3305 | if test -n "$conf_utmp_location"; then |
| 3306 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3307 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3308 | |
| 3309 | dnl wtmp detection |
| 3310 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 3311 | AC_TRY_COMPILE([ |
| 3312 | #include <sys/types.h> |
| 3313 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3314 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3315 | # include <paths.h> |
| 3316 | #endif |
| 3317 | ], |
| 3318 | [ char *wtmp = WTMP_FILE; ], |
| 3319 | [ AC_MSG_RESULT(yes) ], |
| 3320 | [ AC_MSG_RESULT(no) |
| 3321 | system_wtmp_path=no ] |
| 3322 | ) |
| 3323 | if test -z "$conf_wtmp_location"; then |
| 3324 | if test x"$system_wtmp_path" = x"no" ; then |
| 3325 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 3326 | if test -f $f ; then |
| 3327 | conf_wtmp_location=$f |
| 3328 | fi |
| 3329 | done |
| 3330 | if test -z "$conf_wtmp_location"; then |
| 3331 | AC_DEFINE(DISABLE_WTMP) |
| 3332 | fi |
| 3333 | fi |
| 3334 | fi |
| 3335 | if test -n "$conf_wtmp_location"; then |
| 3336 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3337 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3338 | |
| 3339 | |
| 3340 | dnl utmpx detection - I don't know any system so perverse as to require |
| 3341 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 3342 | dnl there, though. |
| 3343 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 3344 | AC_TRY_COMPILE([ |
| 3345 | #include <sys/types.h> |
| 3346 | #include <utmp.h> |
| 3347 | #ifdef HAVE_UTMPX_H |
| 3348 | #include <utmpx.h> |
| 3349 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3350 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3351 | # include <paths.h> |
| 3352 | #endif |
| 3353 | ], |
| 3354 | [ char *utmpx = UTMPX_FILE; ], |
| 3355 | [ AC_MSG_RESULT(yes) ], |
| 3356 | [ AC_MSG_RESULT(no) |
| 3357 | system_utmpx_path=no ] |
| 3358 | ) |
| 3359 | if test -z "$conf_utmpx_location"; then |
| 3360 | if test x"$system_utmpx_path" = x"no" ; then |
| 3361 | AC_DEFINE(DISABLE_UTMPX) |
| 3362 | fi |
| 3363 | else |
| 3364 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3365 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3366 | |
| 3367 | dnl wtmpx detection |
| 3368 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 3369 | AC_TRY_COMPILE([ |
| 3370 | #include <sys/types.h> |
| 3371 | #include <utmp.h> |
| 3372 | #ifdef HAVE_UTMPX_H |
| 3373 | #include <utmpx.h> |
| 3374 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3375 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3376 | # include <paths.h> |
| 3377 | #endif |
| 3378 | ], |
| 3379 | [ char *wtmpx = WTMPX_FILE; ], |
| 3380 | [ AC_MSG_RESULT(yes) ], |
| 3381 | [ AC_MSG_RESULT(no) |
| 3382 | system_wtmpx_path=no ] |
| 3383 | ) |
| 3384 | if test -z "$conf_wtmpx_location"; then |
| 3385 | if test x"$system_wtmpx_path" = x"no" ; then |
| 3386 | AC_DEFINE(DISABLE_WTMPX) |
| 3387 | fi |
| 3388 | else |
| 3389 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3390 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3391 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 3392 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 3393 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 3394 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 3395 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 3396 | fi |
| 3397 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3398 | dnl remove pam and dl because they are in $LIBPAM |
| 3399 | if test "$PAM_MSG" = yes ; then |
Tim Rice | 7d2d1f1 | 2002-02-26 22:05:11 -0800 | [diff] [blame] | 3400 | LIBS=`echo $LIBS | sed 's/-lpam //'` |
| 3401 | fi |
| 3402 | if test "$ac_cv_lib_pam_pam_set_item" = yes ; then |
| 3403 | LIBS=`echo $LIBS | sed 's/-ldl //'` |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3404 | fi |
| 3405 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 3406 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 3407 | dnl Add now. |
| 3408 | CFLAGS="$CFLAGS $werror_flags" |
| 3409 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 3410 | AC_EXEEXT |
Darren Tucker | 72c025d | 2005-01-18 12:05:18 +1100 | [diff] [blame] | 3411 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \ |
| 3412 | scard/Makefile ssh_prng_cmds survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3413 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 3414 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3415 | # Print summary of options |
| 3416 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3417 | # Someone please show me a better way :) |
| 3418 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 3419 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 3420 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 3421 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 3422 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3423 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3424 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3425 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 3426 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 3427 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3428 | |
| 3429 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 3430 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3431 | echo " User binaries: $B" |
| 3432 | echo " System binaries: $C" |
| 3433 | echo " Configuration files: $D" |
| 3434 | echo " Askpass program: $E" |
| 3435 | echo " Manual pages: $F" |
| 3436 | echo " PID file: $G" |
| 3437 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3438 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 3439 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 3440 | echo " Make sure the path to scp is present, otherwise scp will not work" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3441 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3442 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 3443 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3444 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 3445 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 3446 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3447 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3448 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3449 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3450 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3451 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3452 | echo " PAM support: $PAM_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3453 | echo " KerberosV support: $KRB5_MSG" |
| 3454 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3455 | echo " S/KEY support: $SKEY_MSG" |
| 3456 | echo " TCP Wrappers support: $TCPW_MSG" |
| 3457 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 3458 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 3459 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3460 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 3461 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 3462 | echo " Random number source: $RAND_MSG" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3463 | if test ! -z "$USE_RAND_HELPER" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3464 | echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3465 | fi |
| 3466 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3467 | echo "" |
| 3468 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 3469 | echo " Host: ${host}" |
| 3470 | echo " Compiler: ${CC}" |
| 3471 | echo " Compiler flags: ${CFLAGS}" |
| 3472 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 3473 | echo " Linker flags: ${LDFLAGS}" |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3474 | echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3475 | |
| 3476 | echo "" |
| 3477 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 3478 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 3479 | echo "SVR4 style packages are supported with \"make package\"" |
| 3480 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 3481 | fi |
| 3482 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 3483 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3484 | echo "PAM is enabled. You may need to install a PAM control file " |
| 3485 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3486 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3487 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 3488 | echo "" |
| 3489 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3490 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3491 | if test ! -z "$RAND_HELPER_CMDHASH" ; then |
| 3492 | echo "WARNING: you are using the builtin random number collection " |
| 3493 | echo "service. Please read WARNING.RNG and request that your OS " |
| 3494 | echo "vendor includes kernel-based random number collection in " |
| 3495 | echo "future versions of your OS." |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3496 | echo "" |
| 3497 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3498 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 3499 | if test ! -z "$NO_PEERCHECK" ; then |
| 3500 | echo "WARNING: the operating system that you are using does not " |
| 3501 | echo "appear to support either the getpeereid() API nor the " |
| 3502 | echo "SO_PEERCRED getsockopt() option. These facilities are used to " |
| 3503 | echo "enforce security checks to prevent unauthorised connections to " |
| 3504 | echo "ssh-agent. Their absence increases the risk that a malicious " |
| 3505 | echo "user can connect to your agent. " |
| 3506 | echo "" |
| 3507 | fi |
| 3508 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3509 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 3510 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 3511 | echo "See the Solaris section in README.platform for details." |
| 3512 | fi |