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