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