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