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