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