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