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