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