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