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