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