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