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