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