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