blob: b85f1884e9825b99d73dd3dfe308267f908bfe92 [file] [log] [blame]
Tim Rice89fe3f32003-01-19 20:20:24 -08001# $Id: configure.ac,v 1.102 2003/01/20 04:20:25 tim Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100060 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Millerfa2bb692002-04-23 23:22:25 +100061 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
64 AC_TRY_LINK([],
65 [],
66 [
67 AC_MSG_RESULT(yes)
68 blibpath="/usr/lib:/lib:/usr/local/lib"
69 ],
70 [ AC_MSG_RESULT(no) ]
71 )
72 LDFLAGS="$saved_LDFLAGS"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Tim Ricee958ed32002-07-05 07:12:33 -070074 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
75 [AC_CHECK_LIB(s,authenticate,
76 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
77 LIBS="$LIBS -ls"
78 ])
79 ])
Damien Millereca71f82000-01-20 22:38:27 +110080 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100081 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000082 dnl AIX handles lastlog as part of its login message
83 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000084 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerec201962003-01-13 10:04:58 +110085 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
86 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller75b1d102000-01-07 14:01:41 +110087 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110088*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080089 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110090 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000091 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110092 AC_DEFINE(DISABLE_SHADOW)
93 AC_DEFINE(IPV4_DEFAULT)
94 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000095 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000096 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -070097 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +000098 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110099 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000100*-*-dgux*)
101 AC_DEFINE(IP_TOS_IS_BROKEN)
102 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000103*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000104 AC_MSG_CHECKING(if we have working getaddrinfo)
105 AC_TRY_RUN([#include <mach-o/dyld.h>
106main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
107 exit(0);
108 else
109 exit(1);
110}], [AC_MSG_RESULT(working)],
111 [AC_MSG_RESULT(buggy)
112 AC_DEFINE(BROKEN_GETADDRINFO)],
113 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000114 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000115*-*-hpux10.26)
116 if test -z "$GCC"; then
117 CFLAGS="$CFLAGS -Ae"
118 fi
119 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
120 IPADDR_IN_DISPLAY=yes
121 AC_DEFINE(HAVE_SECUREWARE)
122 AC_DEFINE(USE_PIPES)
123 AC_DEFINE(LOGIN_NO_ENDOPT)
124 AC_DEFINE(LOGIN_NEEDS_UTMPX)
125 AC_DEFINE(DISABLE_SHADOW)
126 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100127 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700128 LIBS="$LIBS -lsec -lsecpw"
129 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000130 disable_ptmx_check=yes
131 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100132*-*-hpux10*)
133 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000134 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100135 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000136 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100137 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000138 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000139 AC_DEFINE(LOGIN_NO_ENDOPT)
140 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100141 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100142 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100143 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700144 LIBS="$LIBS -lsec"
145 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100146 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000147*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000148 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100149 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100150 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100151 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000152 AC_DEFINE(LOGIN_NO_ENDOPT)
153 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100154 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100155 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100156 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700157 LIBS="$LIBS -lsec"
158 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000159 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100160*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000161 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000162 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100163 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000164 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000165 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100166 ;;
167*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000168 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000169 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100170 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000171 AC_DEFINE(WITH_IRIX_ARRAY)
172 AC_DEFINE(WITH_IRIX_PROJECT)
173 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000174 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000175 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000176 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100177 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100178*-*-linux*)
179 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100180 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100181 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000182 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100183 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
184 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100185 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100186 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000187mips-sony-bsd|mips-sony-newsos4)
188 AC_DEFINE(HAVE_NEWS4)
189 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000190 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100191*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000192 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100193 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100194 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100195*-*-freebsd*)
196 check_for_libcrypt_later=1
197 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000198*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000199 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100200 conf_utmp_location=/etc/utmp
201 conf_wtmp_location=/usr/adm/wtmp
202 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000203 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000204 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000205 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100206 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000208 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000209 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100210*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000212 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100213 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100214 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000215 AC_DEFINE(LOGIN_NEEDS_UTMPX)
216 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000217 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000218 # hardwire lastlog location (can't detect it on some versions)
219 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000220 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
221 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
222 if test "$sol2ver" -ge 8; then
223 AC_MSG_RESULT(yes)
224 AC_DEFINE(DISABLE_UTMP)
225 AC_DEFINE(DISABLE_WTMP)
226 else
227 AC_MSG_RESULT(no)
228 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100229 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000230*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000231 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000232 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100233 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000234 conf_utmp_location=/etc/utmp
235 conf_wtmp_location=/var/adm/wtmp
236 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000237 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000238 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000239*-ncr-sysv*)
240 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
241 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700242 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000243 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000244 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000245*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000246 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700247 # /usr/ucblib MUST NOT be searched on ReliantUNIX
248 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100249 IPADDR_IN_DISPLAY=yes
250 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000251 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700252 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
253 # Attention: always take care to bind libsocket and libnsl before libc,
254 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000255 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100256*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000257 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100258 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100259 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100260 ;;
261*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100264 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100265 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100266*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000267 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100268 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100269 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100270*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000271 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100272 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700273 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100274 RANLIB=true
275 no_dev_ptmx=1
276 AC_DEFINE(BROKEN_SYS_TERMIO_H)
277 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000278 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000279 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100280 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100281 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700282 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700283 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100284 ;;
285*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800286 if test -z "$GCC"; then
287 CFLAGS="$CFLAGS -belf"
288 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000289 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000290 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100291 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000292 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100293 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000294 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000295 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700296 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100297 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700298 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000299 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000300*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000301 AC_DEFINE(USE_PIPES)
302 AC_DEFINE(DISABLE_FD_PASSING)
303 LDFLAGS="$LDFLAGS"
304 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
305 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000306 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000307*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000308 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700309 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700310 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000311 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
312 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
313 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700314 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000315*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000316 AC_MSG_CHECKING(for Digital Unix SIA)
317 no_osfsia=""
318 AC_ARG_WITH(osfsia,
319 [ --with-osfsia Enable Digital Unix SIA],
320 [
321 if test "x$withval" = "xno" ; then
322 AC_MSG_RESULT(disabled)
323 no_osfsia=1
324 fi
325 ],
326 )
327 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000328 if test -f /etc/sia/matrix.conf; then
329 AC_MSG_RESULT(yes)
330 AC_DEFINE(HAVE_OSF_SIA)
331 AC_DEFINE(DISABLE_LOGIN)
332 LIBS="$LIBS -lsecurity -ldb -lm -laud"
333 else
334 AC_MSG_RESULT(no)
335 fi
336 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000337 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000338 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000339
340*-*-nto-qnx)
341 AC_DEFINE(USE_PIPES)
342 AC_DEFINE(NO_X11_UNIX_SOCKETS)
343 AC_DEFINE(MISSING_NFDBITS)
344 AC_DEFINE(MISSING_HOWMANY)
345 AC_DEFINE(MISSING_FD_MASK)
346 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100347esac
348
Damien Millere37bfc12000-06-05 09:37:43 +1000349# Allow user to specify flags
350AC_ARG_WITH(cflags,
351 [ --with-cflags Specify additional flags to pass to compiler],
352 [
353 if test "x$withval" != "xno" ; then
354 CFLAGS="$CFLAGS $withval"
355 fi
356 ]
357)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000358AC_ARG_WITH(cppflags,
359 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
360 [
361 if test "x$withval" != "xno"; then
362 CPPFLAGS="$CPPFLAGS $withval"
363 fi
364 ]
365)
Damien Millere37bfc12000-06-05 09:37:43 +1000366AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000367 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000368 [
369 if test "x$withval" != "xno" ; then
370 LDFLAGS="$LDFLAGS $withval"
371 fi
372 ]
373)
374AC_ARG_WITH(libs,
375 [ --with-libs Specify additional libraries to link with],
376 [
377 if test "x$withval" != "xno" ; then
378 LIBS="$LIBS $withval"
379 fi
380 ]
381)
382
Tim Rice4cec93f2002-02-26 08:40:48 -0800383# Checks for header files.
384AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700385 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800386 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000387 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000388 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800389 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100390 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800391 sys/stropts.h sys/sysmacros.h sys/time.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700392 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800393 util.h utime.h utmp.h utmpx.h)
394
Damien Millera22ba012000-03-02 23:09:20 +1100395# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700396AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
397AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000398
Damien Millerdf288022001-02-18 13:07:07 +1100399dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700400if test "x$with_tcp_wrappers" != "xno" ; then
401 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
402 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
403 fi
404fi
Damien Millerdf288022001-02-18 13:07:07 +1100405
Tim Rice13aae5e2001-10-21 17:53:58 -0700406AC_CHECK_FUNC(getspnam, ,
407 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700408
Damien Miller150c8b52002-02-13 23:06:56 +1100409AC_ARG_WITH(rpath,
410 [ --without-rpath Disable auto-added -R linker paths],
411 [
412 if test "x$withval" = "xno" ; then
413 need_dash_r=""
414 fi
415 if test "x$withval" = "xyes" ; then
416 need_dash_r=1
417 fi
418 ]
419)
420
Tim Rice13aae5e2001-10-21 17:53:58 -0700421dnl zlib is required
422AC_ARG_WITH(zlib,
423 [ --with-zlib=PATH Use zlib in PATH],
424 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000425 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100426 AC_MSG_ERROR([*** zlib is required ***])
427 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700428 if test -d "$withval/lib"; then
429 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700430 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700431 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700432 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700433 fi
434 else
435 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700436 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700437 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700438 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700439 fi
440 fi
441 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700442 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700443 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700444 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700445 fi
446 ]
447)
448
Tim Rice17b93e52001-10-23 22:36:54 -0700449AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100450
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000451dnl UnixWare 2.x
452AC_CHECK_FUNC(strcasecmp,
453 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
454)
455AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700456 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
457 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000458)
Damien Millerab18c411999-11-11 10:40:23 +1100459
Tim Ricee589a292001-11-03 11:09:32 -0800460dnl Checks for libutil functions
461AC_CHECK_HEADERS(libutil.h)
462AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
463AC_CHECK_FUNCS(logout updwtmp logwtmp)
464
Ben Lindstrom8697e082001-02-24 21:41:10 +0000465AC_FUNC_STRFTIME
466
Damien Miller3c027682001-03-14 11:39:45 +1100467# Check for ALTDIRFUNC glob() extension
468AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
469AC_EGREP_CPP(FOUNDIT,
470 [
471 #include <glob.h>
472 #ifdef GLOB_ALTDIRFUNC
473 FOUNDIT
474 #endif
475 ],
476 [
477 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
478 AC_MSG_RESULT(yes)
479 ],
480 [
481 AC_MSG_RESULT(no)
482 ]
483)
Damien Millerab18c411999-11-11 10:40:23 +1100484
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000485# Check for g.gl_matchc glob() extension
486AC_MSG_CHECKING(for gl_matchc field in glob_t)
487AC_EGREP_CPP(FOUNDIT,
488 [
489 #include <glob.h>
490 int main(void){glob_t g; g.gl_matchc = 1;}
491 ],
492 [
493 AC_DEFINE(GLOB_HAS_GL_MATCHC)
494 AC_MSG_RESULT(yes)
495 ],
496 [
497 AC_MSG_RESULT(no)
498 ]
499)
500
Damien Miller18bb4732001-03-28 14:35:30 +1000501AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
502AC_TRY_RUN(
503 [
504#include <sys/types.h>
505#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700506int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000507 ],
508 [AC_MSG_RESULT(yes)],
509 [
510 AC_MSG_RESULT(no)
511 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
512 ]
513)
514
Damien Millerc547bf12001-02-16 10:18:12 +1100515# Check whether user wants S/Key support
516SKEY_MSG="no"
517AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700518 [ --with-skey[[=PATH]] Enable S/Key support
519 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100520 [
521 if test "x$withval" != "xno" ; then
522
523 if test "x$withval" != "xyes" ; then
524 CPPFLAGS="$CPPFLAGS -I${withval}/include"
525 LDFLAGS="$LDFLAGS -L${withval}/lib"
526 fi
527
528 AC_DEFINE(SKEY)
529 LIBS="-lskey $LIBS"
530 SKEY_MSG="yes"
531
Tim Rice4cec93f2002-02-26 08:40:48 -0800532 AC_MSG_CHECKING([for s/key support])
533 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100534 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800535#include <stdio.h>
536#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700537int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800538 ],
539 [AC_MSG_RESULT(yes)],
540 [
541 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100542 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
543 ])
544 fi
545 ]
546)
547
548# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700549TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100550AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700551 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
552 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100553 [
554 if test "x$withval" != "xno" ; then
555 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 saved_LDFLAGS="$LDFLAGS"
557 saved_CPPFLAGS="$CPPFLAGS"
558 if test -n "${withval}" -a "${withval}" != "yes"; then
559 if test -d "${withval}/lib"; then
560 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700561 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700562 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700563 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700564 fi
565 else
566 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700567 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700569 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700570 fi
571 fi
572 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700573 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700574 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700575 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700576 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800578 LIBWRAP="-lwrap"
579 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100580 AC_MSG_CHECKING(for libwrap)
581 AC_TRY_LINK(
582 [
583#include <tcpd.h>
584 int deny_severity = 0, allow_severity = 0;
585 ],
586 [hosts_access(0);],
587 [
588 AC_MSG_RESULT(yes)
589 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800590 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700591 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100592 ],
593 [
594 AC_MSG_ERROR([*** libwrap missing])
595 ]
596 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800597 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100598 fi
599 ]
600)
601
Damien Millerad833b32000-08-23 10:46:23 +1000602dnl Checks for library functions.
Ben Lindstromfdee8ef2002-04-06 23:52:02 +0000603AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
Tim Rice13aae5e2001-10-21 17:53:58 -0700604 clock fchmod fchown freeaddrinfo futimes gai_strerror \
Damien Miller771721f2002-09-12 10:32:59 +1000605 getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
Tim Rice13aae5e2001-10-21 17:53:58 -0700606 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
607 inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Millera8ed44b2003-01-10 09:53:12 +1100608 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo pstat readpassphrase \
Damien Miller594a71b2002-04-23 20:22:59 +1000609 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
Ben Lindstrom837461b2002-06-12 16:57:14 +0000610 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
Ben Lindstromf0bfa832002-06-21 00:01:18 +0000611 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
Damien Miller9715bb12003-01-17 10:31:38 +1100612 socketpair strerror strlcat strlcpy strmode strnvis sysconf \
Damien Millerbc9b7c42003-01-08 00:06:48 +1100613 tcgetpgrp truncate utimes vhangup vsnprintf waitpid __b64_ntop \
614 _getpty)
Tim Rice13aae5e2001-10-21 17:53:58 -0700615
Ben Lindstrom3e006472002-10-16 00:24:03 +0000616dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
617AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
618
Tim Rice13aae5e2001-10-21 17:53:58 -0700619dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700620AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700621 AC_CHECK_LIB(gen, dirname,[
622 AC_CACHE_CHECK([for broken dirname],
623 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700624 save_LIBS="$LIBS"
625 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 AC_TRY_RUN(
627 [
628#include <libgen.h>
629#include <string.h>
630
631int main(int argc, char **argv) {
632 char *s, buf[32];
633
634 strncpy(buf,"/etc", 32);
635 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700636 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700637 exit(1);
638 } else {
639 exit(0);
640 }
641}
642 ],
643 [ ac_cv_have_broken_dirname="no" ],
644 [ ac_cv_have_broken_dirname="yes" ]
645 )
Tim Rice17b93e52001-10-23 22:36:54 -0700646 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700647 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700648 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700649 LIBS="$LIBS -lgen"
650 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700651 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700652 fi
653 ])
654])
655
Damien Millerad833b32000-08-23 10:46:23 +1000656dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000657AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000658dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000659AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000660AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000661dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000662AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000663AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100664
Damien Miller04f80141999-11-19 15:32:34 +1100665AC_CHECK_FUNC(daemon,
666 [AC_DEFINE(HAVE_DAEMON)],
667 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
668)
669
Damien Miller9fb07e42000-03-05 16:22:59 +1100670AC_CHECK_FUNC(getpagesize,
671 [AC_DEFINE(HAVE_GETPAGESIZE)],
672 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
673)
674
Damien Millercb170cb2000-07-01 16:52:55 +1000675# Check for broken snprintf
676if test "x$ac_cv_func_snprintf" = "xyes" ; then
677 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
678 AC_TRY_RUN(
679 [
680#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700681int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000682 ],
683 [AC_MSG_RESULT(yes)],
684 [
685 AC_MSG_RESULT(no)
686 AC_DEFINE(BROKEN_SNPRINTF)
687 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
688 ]
689 )
690fi
691
Damien Millere8328192003-01-07 15:18:32 +1100692dnl see whether mkstemp() requires XXXXXX
693if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
694AC_MSG_CHECKING([for (overly) strict mkstemp])
695AC_TRY_RUN(
696 [
697#include <stdlib.h>
698main() { char template[]="conftest.mkstemp-test";
699if (mkstemp(template) == -1)
700 exit(1);
701unlink(template); exit(0);
702}
703 ],
704 [
705 AC_MSG_RESULT(no)
706 ],
707 [
708 AC_MSG_RESULT(yes)
709 AC_DEFINE(HAVE_STRICT_MKSTEMP)
710 ],
711 [
712 AC_MSG_RESULT(yes)
713 AC_DEFINE(HAVE_STRICT_MKSTEMP)
714 ]
715)
716fi
717
Damien Miller606f8802000-09-16 15:39:56 +1100718AC_FUNC_GETPGRP
719
Damien Millera64b57a2001-01-17 10:44:13 +1100720# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000721PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100722AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100723 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100724 [
Damien Millera64b57a2001-01-17 10:44:13 +1100725 if test "x$withval" != "xno" ; then
726 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
727 AC_MSG_ERROR([PAM headers not found])
728 fi
729
730 AC_CHECK_LIB(dl, dlopen, , )
731 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
732 AC_CHECK_FUNCS(pam_getenvlist)
733
734 disable_shadow=yes
735 PAM_MSG="yes"
736
737 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800738 if test $ac_cv_lib_dl_dlopen = yes; then
739 LIBPAM="-lpam -ldl"
740 else
741 LIBPAM="-lpam"
742 fi
743 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100744 fi
745 ]
746)
Damien Millera22ba012000-03-02 23:09:20 +1100747
Damien Millera64b57a2001-01-17 10:44:13 +1100748# Check for older PAM
749if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100750 # Check PAM strerror arguments (old PAM)
751 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
752 AC_TRY_COMPILE(
753 [
Damien Miller81171112000-04-23 11:14:01 +1000754#include <stdlib.h>
755#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100756 ],
757 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
758 [AC_MSG_RESULT(no)],
759 [
760 AC_DEFINE(HAVE_OLD_PAM)
761 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000762 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100763 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100764 )
Damien Millera22ba012000-03-02 23:09:20 +1100765fi
766
Damien Millerfc93d4b2002-09-04 23:26:29 +1000767# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
768# because the system crypt() is more featureful.
769if test "x$check_for_libcrypt_before" = "x1"; then
770 AC_CHECK_LIB(crypt, crypt)
771fi
772
Tim Riceaef73712002-05-11 13:17:42 -0700773# Search for OpenSSL
774saved_CPPFLAGS="$CPPFLAGS"
775saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100776AC_ARG_WITH(ssl-dir,
777 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
778 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000779 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700780 if test -d "$withval/lib"; then
781 if test -n "${need_dash_r}"; then
782 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
783 else
784 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
785 fi
786 else
787 if test -n "${need_dash_r}"; then
788 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
789 else
790 LDFLAGS="-L${withval} ${LDFLAGS}"
791 fi
792 fi
793 if test -d "$withval/include"; then
794 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
795 else
796 CPPFLAGS="-I${withval} ${CPPFLAGS}"
797 fi
Damien Millera22ba012000-03-02 23:09:20 +1100798 fi
799 ]
800)
Tim Riceaef73712002-05-11 13:17:42 -0700801LIBS="$LIBS -lcrypto"
802AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000803 [
Tim Riceaef73712002-05-11 13:17:42 -0700804 dnl Check default openssl install dir
805 if test -n "${need_dash_r}"; then
806 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000807 else
Tim Riceaef73712002-05-11 13:17:42 -0700808 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000809 fi
Tim Riceaef73712002-05-11 13:17:42 -0700810 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
811 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
812 [
813 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
814 ]
815 )
816 ]
817)
818
Tim Riced730b782002-08-13 18:52:10 -0700819# Determine OpenSSL header version
820AC_MSG_CHECKING([OpenSSL header version])
821AC_TRY_RUN(
822 [
823#include <stdio.h>
824#include <string.h>
825#include <openssl/opensslv.h>
826#define DATA "conftest.sslincver"
827int main(void) {
828 FILE *fd;
829 int rc;
830
831 fd = fopen(DATA,"w");
832 if(fd == NULL)
833 exit(1);
834
835 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
836 exit(1);
837
838 exit(0);
839}
840 ],
841 [
842 ssl_header_ver=`cat conftest.sslincver`
843 AC_MSG_RESULT($ssl_header_ver)
844 ],
845 [
846 AC_MSG_RESULT(not found)
847 AC_MSG_ERROR(OpenSSL version header not found.)
848 ]
849)
850
851# Determine OpenSSL library version
852AC_MSG_CHECKING([OpenSSL library version])
853AC_TRY_RUN(
854 [
855#include <stdio.h>
856#include <string.h>
857#include <openssl/opensslv.h>
858#include <openssl/crypto.h>
859#define DATA "conftest.ssllibver"
860int main(void) {
861 FILE *fd;
862 int rc;
863
864 fd = fopen(DATA,"w");
865 if(fd == NULL)
866 exit(1);
867
868 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
869 exit(1);
870
871 exit(0);
872}
873 ],
874 [
875 ssl_library_ver=`cat conftest.ssllibver`
876 AC_MSG_RESULT($ssl_library_ver)
877 ],
878 [
879 AC_MSG_RESULT(not found)
880 AC_MSG_ERROR(OpenSSL library not found.)
881 ]
882)
Damien Millera22ba012000-03-02 23:09:20 +1100883
Damien Millerec932372002-01-22 22:16:03 +1100884# Sanity check OpenSSL headers
885AC_MSG_CHECKING([whether OpenSSL's headers match the library])
886AC_TRY_RUN(
887 [
888#include <string.h>
889#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700890int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100891 ],
892 [
893 AC_MSG_RESULT(yes)
894 ],
895 [
896 AC_MSG_RESULT(no)
897 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
898 ]
899)
900
Damien Millera64b57a2001-01-17 10:44:13 +1100901# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
902# version in OpenSSL. Skip this for PAM
903if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100904 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100905fi
906
Damien Miller6c21c512002-01-22 21:57:53 +1100907
908### Configure cryptographic random number support
909
910# Check wheter OpenSSL seeds itself
911AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
912AC_TRY_RUN(
913 [
914#include <string.h>
915#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700916int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100917 ],
918 [
919 OPENSSL_SEEDS_ITSELF=yes
920 AC_MSG_RESULT(yes)
921 ],
922 [
923 AC_MSG_RESULT(no)
924 # Default to use of the rand helper if OpenSSL doesn't
925 # seed itself
926 USE_RAND_HELPER=yes
927 ]
928)
929
930
931# Do we want to force the use of the rand helper?
932AC_ARG_WITH(rand-helper,
933 [ --with-rand-helper Use subprocess to gather strong randomness ],
934 [
935 if test "x$withval" = "xno" ; then
936 # Force use of OpenSSL's internal RNG, even if
937 # the previous test showed it to be unseeded.
938 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
939 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
940 OPENSSL_SEEDS_ITSELF=yes
941 USE_RAND_HELPER=""
942 fi
943 else
944 USE_RAND_HELPER=yes
945 fi
946 ],
947)
948
949# Which randomness source do we use?
950if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
951 # OpenSSL only
952 AC_DEFINE(OPENSSL_PRNG_ONLY)
953 RAND_MSG="OpenSSL internal ONLY"
954 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800955elif test ! -z "$USE_RAND_HELPER" ; then
956 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100957 RAND_MSG="ssh-rand-helper"
958 INSTALL_SSH_RAND_HELPER="yes"
959fi
960AC_SUBST(INSTALL_SSH_RAND_HELPER)
961
962### Configuration of ssh-rand-helper
963
964# PRNGD TCP socket
965AC_ARG_WITH(prngd-port,
966 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
967 [
Damien Millere996d722002-01-23 11:20:59 +1100968 case "$withval" in
969 no)
970 withval=""
971 ;;
972 [[0-9]]*)
973 ;;
974 *)
975 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
976 ;;
977 esac
978 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100979 PRNGD_PORT="$withval"
980 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
981 fi
982 ]
983)
984
985# PRNGD Unix domain socket
986AC_ARG_WITH(prngd-socket,
987 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
988 [
Damien Millere996d722002-01-23 11:20:59 +1100989 case "$withval" in
990 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100991 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100992 ;;
993 no)
994 withval=""
995 ;;
996 /*)
997 ;;
998 *)
999 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1000 ;;
1001 esac
1002
1003 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001004 if test ! -z "$PRNGD_PORT" ; then
1005 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1006 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001007 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001008 AC_MSG_WARN(Entropy socket is not readable)
1009 fi
1010 PRNGD_SOCKET="$withval"
1011 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1012 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001013 ],
1014 [
1015 # Check for existing socket only if we don't have a random device already
1016 if test "$USE_RAND_HELPER" = yes ; then
1017 AC_MSG_CHECKING(for PRNGD/EGD socket)
1018 # Insert other locations here
1019 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1020 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1021 PRNGD_SOCKET="$sock"
1022 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1023 break;
1024 fi
1025 done
1026 if test ! -z "$PRNGD_SOCKET" ; then
1027 AC_MSG_RESULT($PRNGD_SOCKET)
1028 else
1029 AC_MSG_RESULT(not found)
1030 fi
1031 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001032 ]
1033)
1034
1035# Change default command timeout for hashing entropy source
1036entropy_timeout=200
1037AC_ARG_WITH(entropy-timeout,
1038 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1039 [
1040 if test "x$withval" != "xno" ; then
1041 entropy_timeout=$withval
1042 fi
1043 ]
1044)
Damien Miller6c21c512002-01-22 21:57:53 +11001045AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1046
Damien Millerd3f6ad22002-06-25 10:24:47 +10001047SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001048AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001049 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001050 [
1051 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001052 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001053 fi
1054 ]
1055)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001056AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1057AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001058
Tim Rice88f2ab52002-03-17 12:17:34 -08001059# We do this little dance with the search path to insure
1060# that programs that we select for use by installed programs
1061# (which may be run by the super-user) come from trusted
1062# locations before they come from the user's private area.
1063# This should help avoid accidentally configuring some
1064# random version of a program in someone's personal bin.
1065
1066OPATH=$PATH
1067PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001068test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001069test -d /sbin && PATH=$PATH:/sbin
1070test -d /usr/sbin && PATH=$PATH:/usr/sbin
1071PATH=$PATH:/etc:$OPATH
1072
Damien Miller6c21c512002-01-22 21:57:53 +11001073# These programs are used by the command hashing source to gather entropy
1074OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1075OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1076OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1077OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1078OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1079OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1080OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1081OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1082OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1083OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1084OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1085OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1086OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1087OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1088OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1089OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001090# restore PATH
1091PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001092
1093# Where does ssh-rand-helper get its randomness from?
1094INSTALL_SSH_PRNG_CMDS=""
1095if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1096 if test ! -z "$PRNGD_PORT" ; then
1097 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1098 elif test ! -z "$PRNGD_SOCKET" ; then
1099 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1100 else
1101 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1102 RAND_HELPER_CMDHASH=yes
1103 INSTALL_SSH_PRNG_CMDS="yes"
1104 fi
1105fi
1106AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1107
1108
Ben Lindstromb5628642000-10-18 00:02:25 +00001109# Cheap hack to ensure NEWS-OS libraries are arranged right.
1110if test ! -z "$SONY" ; then
1111 LIBS="$LIBS -liberty";
1112fi
1113
Damien Millera22ba012000-03-02 23:09:20 +11001114# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001115AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001116AC_CHECK_SIZEOF(short int, 2)
1117AC_CHECK_SIZEOF(int, 4)
1118AC_CHECK_SIZEOF(long int, 4)
1119AC_CHECK_SIZEOF(long long int, 8)
1120
Damien Millerfa2bb692002-04-23 23:22:25 +10001121# Sanity check long long for some platforms (AIX)
1122if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1123 ac_cv_sizeof_long_long_int=0
1124fi
1125
Damien Millera22ba012000-03-02 23:09:20 +11001126# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001127AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1128 AC_TRY_COMPILE(
1129 [ #include <sys/types.h> ],
1130 [ u_int a; a = 1;],
1131 [ ac_cv_have_u_int="yes" ],
1132 [ ac_cv_have_u_int="no" ]
1133 )
1134])
1135if test "x$ac_cv_have_u_int" = "xyes" ; then
1136 AC_DEFINE(HAVE_U_INT)
1137 have_u_int=1
1138fi
1139
Damien Miller61e50f12000-05-08 20:49:37 +10001140AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1141 AC_TRY_COMPILE(
1142 [ #include <sys/types.h> ],
1143 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1144 [ ac_cv_have_intxx_t="yes" ],
1145 [ ac_cv_have_intxx_t="no" ]
1146 )
1147])
1148if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1149 AC_DEFINE(HAVE_INTXX_T)
1150 have_intxx_t=1
1151fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001152
1153if (test -z "$have_intxx_t" && \
1154 test "x$ac_cv_header_stdint_h" = "xyes")
1155then
1156 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1157 AC_TRY_COMPILE(
1158 [ #include <stdint.h> ],
1159 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1160 [
1161 AC_DEFINE(HAVE_INTXX_T)
1162 AC_MSG_RESULT(yes)
1163 ],
1164 [ AC_MSG_RESULT(no) ]
1165 )
1166fi
1167
Damien Miller578783e2000-09-23 14:12:24 +11001168AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1169 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001170 [
1171#include <sys/types.h>
1172#ifdef HAVE_STDINT_H
1173# include <stdint.h>
1174#endif
1175#include <sys/socket.h>
1176#ifdef HAVE_SYS_BITYPES_H
1177# include <sys/bitypes.h>
1178#endif
1179 ],
Damien Miller578783e2000-09-23 14:12:24 +11001180 [ int64_t a; a = 1;],
1181 [ ac_cv_have_int64_t="yes" ],
1182 [ ac_cv_have_int64_t="no" ]
1183 )
1184])
1185if test "x$ac_cv_have_int64_t" = "xyes" ; then
1186 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001187fi
1188
Damien Miller61e50f12000-05-08 20:49:37 +10001189AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1190 AC_TRY_COMPILE(
1191 [ #include <sys/types.h> ],
1192 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1193 [ ac_cv_have_u_intxx_t="yes" ],
1194 [ ac_cv_have_u_intxx_t="no" ]
1195 )
1196])
1197if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1198 AC_DEFINE(HAVE_U_INTXX_T)
1199 have_u_intxx_t=1
1200fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001201
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001202if test -z "$have_u_intxx_t" ; then
1203 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1204 AC_TRY_COMPILE(
1205 [ #include <sys/socket.h> ],
1206 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1207 [
1208 AC_DEFINE(HAVE_U_INTXX_T)
1209 AC_MSG_RESULT(yes)
1210 ],
1211 [ AC_MSG_RESULT(no) ]
1212 )
1213fi
1214
Damien Miller578783e2000-09-23 14:12:24 +11001215AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1216 AC_TRY_COMPILE(
1217 [ #include <sys/types.h> ],
1218 [ u_int64_t a; a = 1;],
1219 [ ac_cv_have_u_int64_t="yes" ],
1220 [ ac_cv_have_u_int64_t="no" ]
1221 )
1222])
1223if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1224 AC_DEFINE(HAVE_U_INT64_T)
1225 have_u_int64_t=1
1226fi
1227
Tim Rice4cec93f2002-02-26 08:40:48 -08001228if test -z "$have_u_int64_t" ; then
1229 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1230 AC_TRY_COMPILE(
1231 [ #include <sys/bitypes.h> ],
1232 [ u_int64_t a; a = 1],
1233 [
1234 AC_DEFINE(HAVE_U_INT64_T)
1235 AC_MSG_RESULT(yes)
1236 ],
1237 [ AC_MSG_RESULT(no) ]
1238 )
1239fi
1240
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001241if test -z "$have_u_intxx_t" ; then
1242 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1243 AC_TRY_COMPILE(
1244 [
1245#include <sys/types.h>
1246 ],
1247 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1248 [ ac_cv_have_uintxx_t="yes" ],
1249 [ ac_cv_have_uintxx_t="no" ]
1250 )
1251 ])
1252 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1253 AC_DEFINE(HAVE_UINTXX_T)
1254 fi
1255fi
1256
1257if test -z "$have_uintxx_t" ; then
1258 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1259 AC_TRY_COMPILE(
1260 [ #include <stdint.h> ],
1261 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1262 [
1263 AC_DEFINE(HAVE_UINTXX_T)
1264 AC_MSG_RESULT(yes)
1265 ],
1266 [ AC_MSG_RESULT(no) ]
1267 )
1268fi
1269
Damien Milleredb82922000-06-20 13:25:52 +10001270if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1271 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001272then
1273 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1274 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001275 [
1276#include <sys/bitypes.h>
1277 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001278 [
Damien Miller70494d12000-04-03 15:57:06 +10001279 int8_t a; int16_t b; int32_t c;
1280 u_int8_t e; u_int16_t f; u_int32_t g;
1281 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001282 ],
1283 [
1284 AC_DEFINE(HAVE_U_INTXX_T)
1285 AC_DEFINE(HAVE_INTXX_T)
1286 AC_MSG_RESULT(yes)
1287 ],
1288 [AC_MSG_RESULT(no)]
1289 )
1290fi
1291
Damien Miller58be7382001-09-15 21:31:54 +10001292
1293AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1294 AC_TRY_COMPILE(
1295 [
1296#include <sys/types.h>
1297 ],
1298 [ u_char foo; foo = 125; ],
1299 [ ac_cv_have_u_char="yes" ],
1300 [ ac_cv_have_u_char="no" ]
1301 )
1302])
1303if test "x$ac_cv_have_u_char" = "xyes" ; then
1304 AC_DEFINE(HAVE_U_CHAR)
1305fi
1306
Tim Rice13aae5e2001-10-21 17:53:58 -07001307TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001308
Tim Rice200a5c02002-02-26 22:12:34 -08001309AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001310
Damien Miller61e50f12000-05-08 20:49:37 +10001311AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1312 AC_TRY_COMPILE(
1313 [
1314#include <sys/types.h>
1315 ],
1316 [ size_t foo; foo = 1235; ],
1317 [ ac_cv_have_size_t="yes" ],
1318 [ ac_cv_have_size_t="no" ]
1319 )
1320])
1321if test "x$ac_cv_have_size_t" = "xyes" ; then
1322 AC_DEFINE(HAVE_SIZE_T)
1323fi
Damien Miller95058511999-12-29 10:36:45 +11001324
Damien Miller615f9392000-05-17 22:53:33 +10001325AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1326 AC_TRY_COMPILE(
1327 [
1328#include <sys/types.h>
1329 ],
1330 [ ssize_t foo; foo = 1235; ],
1331 [ ac_cv_have_ssize_t="yes" ],
1332 [ ac_cv_have_ssize_t="no" ]
1333 )
1334])
1335if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1336 AC_DEFINE(HAVE_SSIZE_T)
1337fi
1338
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001339AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1340 AC_TRY_COMPILE(
1341 [
1342#include <time.h>
1343 ],
1344 [ clock_t foo; foo = 1235; ],
1345 [ ac_cv_have_clock_t="yes" ],
1346 [ ac_cv_have_clock_t="no" ]
1347 )
1348])
1349if test "x$ac_cv_have_clock_t" = "xyes" ; then
1350 AC_DEFINE(HAVE_CLOCK_T)
1351fi
1352
Damien Millerb54b40e2000-06-23 08:23:34 +10001353AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1354 AC_TRY_COMPILE(
1355 [
1356#include <sys/types.h>
1357#include <sys/socket.h>
1358 ],
1359 [ sa_family_t foo; foo = 1235; ],
1360 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001361 [ AC_TRY_COMPILE(
1362 [
1363#include <sys/types.h>
1364#include <sys/socket.h>
1365#include <netinet/in.h>
1366 ],
1367 [ sa_family_t foo; foo = 1235; ],
1368 [ ac_cv_have_sa_family_t="yes" ],
1369
Damien Millerb54b40e2000-06-23 08:23:34 +10001370 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001371 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001372 )
1373])
1374if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1375 AC_DEFINE(HAVE_SA_FAMILY_T)
1376fi
1377
Damien Miller0f91b4e2000-06-18 15:43:25 +10001378AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1379 AC_TRY_COMPILE(
1380 [
1381#include <sys/types.h>
1382 ],
1383 [ pid_t foo; foo = 1235; ],
1384 [ ac_cv_have_pid_t="yes" ],
1385 [ ac_cv_have_pid_t="no" ]
1386 )
1387])
1388if test "x$ac_cv_have_pid_t" = "xyes" ; then
1389 AC_DEFINE(HAVE_PID_T)
1390fi
1391
1392AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1393 AC_TRY_COMPILE(
1394 [
1395#include <sys/types.h>
1396 ],
1397 [ mode_t foo; foo = 1235; ],
1398 [ ac_cv_have_mode_t="yes" ],
1399 [ ac_cv_have_mode_t="no" ]
1400 )
1401])
1402if test "x$ac_cv_have_mode_t" = "xyes" ; then
1403 AC_DEFINE(HAVE_MODE_T)
1404fi
1405
Damien Miller61e50f12000-05-08 20:49:37 +10001406
1407AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1408 AC_TRY_COMPILE(
1409 [
Damien Miller81171112000-04-23 11:14:01 +10001410#include <sys/types.h>
1411#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001412 ],
1413 [ struct sockaddr_storage s; ],
1414 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1415 [ ac_cv_have_struct_sockaddr_storage="no" ]
1416 )
1417])
1418if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1419 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1420fi
Damien Miller34132e52000-01-14 15:45:46 +11001421
Damien Miller61e50f12000-05-08 20:49:37 +10001422AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1423 AC_TRY_COMPILE(
1424 [
Damien Miller7b22d652000-06-18 14:07:04 +10001425#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001426#include <netinet/in.h>
1427 ],
1428 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1429 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1430 [ ac_cv_have_struct_sockaddr_in6="no" ]
1431 )
1432])
1433if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1434 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1435fi
Damien Miller34132e52000-01-14 15:45:46 +11001436
Damien Miller61e50f12000-05-08 20:49:37 +10001437AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1438 AC_TRY_COMPILE(
1439 [
Damien Miller7b22d652000-06-18 14:07:04 +10001440#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001441#include <netinet/in.h>
1442 ],
1443 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1444 [ ac_cv_have_struct_in6_addr="yes" ],
1445 [ ac_cv_have_struct_in6_addr="no" ]
1446 )
1447])
1448if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1449 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1450fi
Damien Miller34132e52000-01-14 15:45:46 +11001451
Damien Miller61e50f12000-05-08 20:49:37 +10001452AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1453 AC_TRY_COMPILE(
1454 [
Damien Miller81171112000-04-23 11:14:01 +10001455#include <sys/types.h>
1456#include <sys/socket.h>
1457#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001458 ],
1459 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1460 [ ac_cv_have_struct_addrinfo="yes" ],
1461 [ ac_cv_have_struct_addrinfo="no" ]
1462 )
1463])
1464if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1465 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1466fi
1467
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001468AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1469 AC_TRY_COMPILE(
1470 [ #include <sys/time.h> ],
1471 [ struct timeval tv; tv.tv_sec = 1;],
1472 [ ac_cv_have_struct_timeval="yes" ],
1473 [ ac_cv_have_struct_timeval="no" ]
1474 )
1475])
1476if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1477 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1478 have_struct_timeval=1
1479fi
1480
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001481# If we don't have int64_t then we can't compile sftp-server. So don't
1482# even attempt to do it.
1483if test "x$ac_cv_have_int64_t" = "xno" -a \
1484 "x$ac_cv_sizeof_long_int" != "x8" -a \
1485 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1486 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001487else
1488dnl test snprintf (broken on SCO w/gcc)
1489 AC_TRY_RUN(
1490 [
1491#include <stdio.h>
1492#include <string.h>
1493#ifdef HAVE_SNPRINTF
1494main()
1495{
1496 char buf[50];
1497 char expected_out[50];
1498 int mazsize = 50 ;
1499#if (SIZEOF_LONG_INT == 8)
1500 long int num = 0x7fffffffffffffff;
1501#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001502 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001503#endif
1504 strcpy(expected_out, "9223372036854775807");
1505 snprintf(buf, mazsize, "%lld", num);
1506 if(strcmp(buf, expected_out) != 0)
1507 exit(1);
1508 exit(0);
1509}
1510#else
1511main() { exit(0); }
1512#endif
1513 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1514 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001515fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001516AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001517
Damien Miller78315eb2000-09-29 23:01:36 +11001518dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001519OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1520OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1521OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1522OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1523OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001524OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001525OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1526OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001527OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001528OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1529OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1530OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1531OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001532OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1533OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1535OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001536
1537AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001538
Damien Miller61e50f12000-05-08 20:49:37 +10001539AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1540 ac_cv_have_ss_family_in_struct_ss, [
1541 AC_TRY_COMPILE(
1542 [
Damien Miller81171112000-04-23 11:14:01 +10001543#include <sys/types.h>
1544#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001545 ],
1546 [ struct sockaddr_storage s; s.ss_family = 1; ],
1547 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1548 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1549 )
1550])
1551if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1552 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1553fi
1554
Damien Miller61e50f12000-05-08 20:49:37 +10001555AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1556 ac_cv_have___ss_family_in_struct_ss, [
1557 AC_TRY_COMPILE(
1558 [
Damien Miller81171112000-04-23 11:14:01 +10001559#include <sys/types.h>
1560#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001561 ],
1562 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1563 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1564 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1565 )
1566])
1567if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1568 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1569fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001570
Damien Millerad833b32000-08-23 10:46:23 +10001571AC_CACHE_CHECK([for pw_class field in struct passwd],
1572 ac_cv_have_pw_class_in_struct_passwd, [
1573 AC_TRY_COMPILE(
1574 [
Damien Millerad833b32000-08-23 10:46:23 +10001575#include <pwd.h>
1576 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001577 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001578 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1579 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1580 )
1581])
1582if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1583 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1584fi
1585
Kevin Steves82456952001-06-22 21:14:18 +00001586AC_CACHE_CHECK([for pw_expire field in struct passwd],
1587 ac_cv_have_pw_expire_in_struct_passwd, [
1588 AC_TRY_COMPILE(
1589 [
1590#include <pwd.h>
1591 ],
1592 [ struct passwd p; p.pw_expire = 0; ],
1593 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1594 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1595 )
1596])
1597if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1598 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1599fi
1600
1601AC_CACHE_CHECK([for pw_change field in struct passwd],
1602 ac_cv_have_pw_change_in_struct_passwd, [
1603 AC_TRY_COMPILE(
1604 [
1605#include <pwd.h>
1606 ],
1607 [ struct passwd p; p.pw_change = 0; ],
1608 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1609 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1610 )
1611])
1612if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1613 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1614fi
Damien Miller61e50f12000-05-08 20:49:37 +10001615
Tim Rice28bbb0c2002-05-27 17:37:32 -07001616dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001617AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1618 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001619 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001620 [
Tim Riceae49fe62002-04-12 10:26:21 -07001621#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001622#include <sys/socket.h>
1623#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001624int main() {
1625#ifdef msg_accrights
1626exit(1);
1627#endif
1628struct msghdr m;
1629m.msg_accrights = 0;
1630exit(0);
1631}
Kevin Steves939c9db2002-03-22 17:23:25 +00001632 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001633 [ ac_cv_have_accrights_in_msghdr="yes" ],
1634 [ ac_cv_have_accrights_in_msghdr="no" ]
1635 )
1636])
1637if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1638 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1639fi
1640
Kevin Stevesa44e0352002-04-07 16:18:03 +00001641AC_CACHE_CHECK([for msg_control field in struct msghdr],
1642 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001643 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001644 [
Tim Riceae49fe62002-04-12 10:26:21 -07001645#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001646#include <sys/socket.h>
1647#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001648int main() {
1649#ifdef msg_control
1650exit(1);
1651#endif
1652struct msghdr m;
1653m.msg_control = 0;
1654exit(0);
1655}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001656 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001657 [ ac_cv_have_control_in_msghdr="yes" ],
1658 [ ac_cv_have_control_in_msghdr="no" ]
1659 )
1660])
1661if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1662 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1663fi
1664
Damien Miller61e50f12000-05-08 20:49:37 +10001665AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1666 AC_TRY_LINK([],
1667 [ extern char *__progname; printf("%s", __progname); ],
1668 [ ac_cv_libc_defines___progname="yes" ],
1669 [ ac_cv_libc_defines___progname="no" ]
1670 )
1671])
1672if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1673 AC_DEFINE(HAVE___PROGNAME)
1674fi
1675
Kevin Steves4846f4a2002-03-22 18:19:53 +00001676AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1677 AC_TRY_LINK([
1678#include <stdio.h>
1679],
1680 [ printf("%s", __FUNCTION__); ],
1681 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1682 [ ac_cv_cc_implements___FUNCTION__="no" ]
1683 )
1684])
1685if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1686 AC_DEFINE(HAVE___FUNCTION__)
1687fi
1688
1689AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1690 AC_TRY_LINK([
1691#include <stdio.h>
1692],
1693 [ printf("%s", __func__); ],
1694 [ ac_cv_cc_implements___func__="yes" ],
1695 [ ac_cv_cc_implements___func__="no" ]
1696 )
1697])
1698if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1699 AC_DEFINE(HAVE___func__)
1700fi
1701
Damien Miller4f8e6692001-07-14 13:22:53 +10001702AC_CACHE_CHECK([whether getopt has optreset support],
1703 ac_cv_have_getopt_optreset, [
1704 AC_TRY_LINK(
1705 [
1706#include <getopt.h>
1707 ],
1708 [ extern int optreset; optreset = 0; ],
1709 [ ac_cv_have_getopt_optreset="yes" ],
1710 [ ac_cv_have_getopt_optreset="no" ]
1711 )
1712])
1713if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1714 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1715fi
Damien Millera22ba012000-03-02 23:09:20 +11001716
Damien Millerecbb26d2000-07-15 14:59:14 +10001717AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1718 AC_TRY_LINK([],
1719 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1720 [ ac_cv_libc_defines_sys_errlist="yes" ],
1721 [ ac_cv_libc_defines_sys_errlist="no" ]
1722 )
1723])
1724if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1725 AC_DEFINE(HAVE_SYS_ERRLIST)
1726fi
1727
1728
Damien Miller11fa2cc2000-08-16 10:35:58 +10001729AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1730 AC_TRY_LINK([],
1731 [ extern int sys_nerr; printf("%i", sys_nerr);],
1732 [ ac_cv_libc_defines_sys_nerr="yes" ],
1733 [ ac_cv_libc_defines_sys_nerr="no" ]
1734 )
1735])
1736if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1737 AC_DEFINE(HAVE_SYS_NERR)
1738fi
1739
Damien Miller85de5802001-09-18 14:01:11 +10001740SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001741
1742# Check whether user wants sectok support
1743AC_ARG_WITH(sectok,
1744 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001745 [
1746 if test "x$withval" != "xno" ; then
1747 if test "x$withval" != "xyes" ; then
1748 CPPFLAGS="$CPPFLAGS -I${withval}"
1749 LDFLAGS="$LDFLAGS -L${withval}"
1750 if test ! -z "$need_dash_r" ; then
1751 LDFLAGS="$LDFLAGS -R${withval}"
1752 fi
1753 if test ! -z "$blibpath" ; then
1754 blibpath="$blibpath:${withval}"
1755 fi
1756 fi
1757 AC_CHECK_HEADERS(sectok.h)
1758 if test "$ac_cv_header_sectok_h" != yes; then
1759 AC_MSG_ERROR(Can't find sectok.h)
1760 fi
1761 AC_CHECK_LIB(sectok, sectok_open)
1762 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1763 AC_MSG_ERROR(Can't find libsectok)
1764 fi
1765 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001766 AC_DEFINE(USE_SECTOK)
1767 SCARD_MSG="yes, using sectok"
1768 fi
1769 ]
1770)
1771
1772# Check whether user wants OpenSC support
1773AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001774 AC_HELP_STRING([--with-opensc=PFX],
1775 [Enable smartcard support using OpenSC]),
1776 opensc_config_prefix="$withval", opensc_config_prefix="")
1777if test x$opensc_config_prefix != x ; then
1778 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1779 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1780 if test "$OPENSC_CONFIG" != "no"; then
1781 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1782 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1783 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1784 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1785 AC_DEFINE(SMARTCARD)
1786 AC_DEFINE(USE_OPENSC)
1787 SCARD_MSG="yes, using OpenSC"
1788 fi
1789fi
Damien Miller85de5802001-09-18 14:01:11 +10001790
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001791# Check whether user wants Kerberos 5 support
1792KRB5_MSG="no"
1793AC_ARG_WITH(kerberos5,
1794 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1795 [
1796 if test "x$withval" != "xno" ; then
1797 if test "x$withval" = "xyes" ; then
1798 KRB5ROOT="/usr/local"
1799 else
1800 KRB5ROOT=${withval}
1801 fi
1802 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1803 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1804 AC_DEFINE(KRB5)
1805 KRB5_MSG="yes"
1806 AC_MSG_CHECKING(whether we are using Heimdal)
1807 AC_TRY_COMPILE([ #include <krb5.h> ],
1808 [ char *tmp = heimdal_version; ],
1809 [ AC_MSG_RESULT(yes)
1810 AC_DEFINE(HEIMDAL)
1811 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1812 ],
1813 [ AC_MSG_RESULT(no)
1814 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1815 ]
1816 )
1817 if test ! -z "$need_dash_r" ; then
1818 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1819 fi
1820 if test ! -z "$blibpath" ; then
1821 blibpath="$blibpath:${KRB5ROOT}/lib"
1822 fi
1823 AC_CHECK_LIB(resolv, dn_expand, , )
1824
1825 KRB5=yes
1826 fi
1827 ]
1828)
1829# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001830KRB4_MSG="no"
1831AC_ARG_WITH(kerberos4,
1832 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1833 [
1834 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001835 if test "x$withval" != "xyes" ; then
1836 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1837 LDFLAGS="$LDFLAGS -L${withval}/lib"
1838 if test ! -z "$need_dash_r" ; then
1839 LDFLAGS="$LDFLAGS -R${withval}/lib"
1840 fi
1841 if test ! -z "$blibpath" ; then
1842 blibpath="$blibpath:${withval}/lib"
1843 fi
1844 else
1845 if test -d /usr/include/kerberosIV ; then
1846 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1847 fi
1848 fi
1849
1850 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001851 if test "$ac_cv_header_krb_h" != yes; then
1852 AC_MSG_WARN([Cannot find krb.h, build may fail])
1853 fi
Damien Miller98344742001-03-28 14:37:06 +10001854 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001855 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001856 AC_CHECK_LIB(krb4, main)
1857 if test "$ac_cv_lib_krb4_main" != yes; then
1858 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1859 else
1860 KLIBS="-lkrb4"
1861 fi
1862 else
1863 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001864 fi
Damien Miller98344742001-03-28 14:37:06 +10001865 AC_CHECK_LIB(des, des_cbc_encrypt)
1866 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1867 AC_CHECK_LIB(des425, des_cbc_encrypt)
1868 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1869 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1870 else
1871 KLIBS="-ldes425"
1872 fi
1873 else
1874 KLIBS="-ldes"
1875 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001876 AC_CHECK_LIB(resolv, dn_expand, , )
1877 KRB4=yes
1878 KRB4_MSG="yes"
1879 AC_DEFINE(KRB4)
1880 fi
1881 ]
1882)
1883
1884# Check whether user wants AFS support
1885AFS_MSG="no"
1886AC_ARG_WITH(afs,
1887 [ --with-afs=PATH Enable AFS support],
1888 [
1889 if test "x$withval" != "xno" ; then
1890
1891 if test "x$withval" != "xyes" ; then
1892 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1893 LDFLAGS="$LDFLAGS -L${withval}/lib"
1894 fi
1895
1896 if test -z "$KRB4" ; then
1897 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1898 fi
1899
1900 LIBS="-lkafs $LIBS"
1901 if test ! -z "$AFS_LIBS" ; then
1902 LIBS="$LIBS $AFS_LIBS"
1903 fi
1904 AC_DEFINE(AFS)
1905 AFS_MSG="yes"
1906 fi
1907 ]
1908)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001909LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001910
Damien Millera22ba012000-03-02 23:09:20 +11001911# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001912
Damien Millerf58c6722002-05-13 13:15:42 +10001913PRIVSEP_PATH=/var/empty
1914AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001915 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001916 [
1917 if test "x$withval" != "$no" ; then
1918 PRIVSEP_PATH=$withval
1919 fi
1920 ]
1921)
1922AC_SUBST(PRIVSEP_PATH)
1923
Damien Millera22ba012000-03-02 23:09:20 +11001924AC_ARG_WITH(xauth,
1925 [ --with-xauth=PATH Specify path to xauth program ],
1926 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001927 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001928 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001929 fi
1930 ],
1931 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001932 TestPath="$PATH"
1933 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1934 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1935 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1936 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1937 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001938 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001939 xauth_path="/usr/openwin/bin/xauth"
1940 fi
1941 ]
1942)
1943
Damien Miller7d901272003-01-13 16:55:22 +11001944STRIP_OPT=-s
1945AC_ARG_ENABLE(strip,
1946 [ --disable-strip Disable calling strip(1) on install],
1947 [
1948 if test "x$enableval" = "xno" ; then
1949 STRIP_OPT=
1950 fi
1951 ]
1952)
1953AC_SUBST(STRIP_OPT)
1954
Damien Millera19cf472000-11-29 13:28:50 +11001955if test -z "$xauth_path" ; then
1956 XAUTH_PATH="undefined"
1957 AC_SUBST(XAUTH_PATH)
1958else
Damien Millera22ba012000-03-02 23:09:20 +11001959 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001960 XAUTH_PATH=$xauth_path
1961 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001962fi
Damien Millera22ba012000-03-02 23:09:20 +11001963
1964# Check for mail directory (last resort if we cannot get it from headers)
1965if test ! -z "$MAIL" ; then
1966 maildir=`dirname $MAIL`
1967 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1968fi
1969
Damien Millera22ba012000-03-02 23:09:20 +11001970if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001971 if test "x$disable_ptmx_check" != "xyes" ; then
1972 AC_CHECK_FILE("/dev/ptmx",
1973 [
1974 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1975 have_dev_ptmx=1
1976 ]
1977 )
1978 fi
Damien Millera22ba012000-03-02 23:09:20 +11001979fi
Damien Miller204ad072000-03-02 23:56:12 +11001980AC_CHECK_FILE("/dev/ptc",
1981 [
1982 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1983 have_dev_ptc=1
1984 ]
1985)
1986
Damien Millera22ba012000-03-02 23:09:20 +11001987# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001988AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001989 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001990 [
Damien Miller897741e2001-04-16 10:41:46 +10001991 case "$withval" in
1992 man|cat|doc)
1993 MANTYPE=$withval
1994 ;;
1995 *)
1996 AC_MSG_ERROR(invalid man type: $withval)
1997 ;;
1998 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001999 ]
2000)
Ben Lindstrombc709922001-04-18 18:04:21 +00002001if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002002 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2003 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002004 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2005 MANTYPE=doc
2006 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2007 MANTYPE=man
2008 else
2009 MANTYPE=cat
2010 fi
2011fi
Damien Miller670a4b82000-01-22 13:53:11 +11002012AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002013if test "$MANTYPE" = "doc"; then
2014 mansubdir=man;
2015else
2016 mansubdir=$MANTYPE;
2017fi
2018AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002019
Damien Millera22ba012000-03-02 23:09:20 +11002020# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002021MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002022AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002023 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002024 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002025 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002026 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002027 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002028 fi
2029 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002030)
2031
Damien Millera22ba012000-03-02 23:09:20 +11002032# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002033AC_ARG_WITH(shadow,
2034 [ --without-shadow Disable shadow password support],
2035 [
2036 if test "x$withval" = "xno" ; then
2037 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002038 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002039 fi
2040 ]
2041)
2042
Damien Miller1f335fb2000-06-26 11:31:33 +10002043if test -z "$disable_shadow" ; then
2044 AC_MSG_CHECKING([if the systems has expire shadow information])
2045 AC_TRY_COMPILE(
2046 [
2047#include <sys/types.h>
2048#include <shadow.h>
2049 struct spwd sp;
2050 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2051 [ sp_expire_available=yes ], []
2052 )
2053
2054 if test "x$sp_expire_available" = "xyes" ; then
2055 AC_MSG_RESULT(yes)
2056 AC_DEFINE(HAS_SHADOW_EXPIRE)
2057 else
2058 AC_MSG_RESULT(no)
2059 fi
2060fi
2061
Damien Millera22ba012000-03-02 23:09:20 +11002062# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002063if test ! -z "$IPADDR_IN_DISPLAY" ; then
2064 DISPLAY_HACK_MSG="yes"
2065 AC_DEFINE(IPADDR_IN_DISPLAY)
2066else
2067 DISPLAY_HACK_MSG="no"
2068 AC_ARG_WITH(ipaddr-display,
2069 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2070 [
2071 if test "x$withval" != "xno" ; then
2072 AC_DEFINE(IPADDR_IN_DISPLAY)
2073 DISPLAY_HACK_MSG="yes"
2074 fi
2075 ]
2076 )
2077fi
Damien Miller76112de1999-12-21 11:18:08 +11002078
Tim Rice43a1c132002-04-17 21:19:14 -07002079dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2080if test $ac_cv_func_login_getcapbool = "yes" -a \
2081 $ac_cv_header_login_cap_h = "yes" ; then
2082 USES_LOGIN_CONF=yes
2083fi
Damien Millera22ba012000-03-02 23:09:20 +11002084# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002085SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002086AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002087 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002088 [
Tim Rice43a1c132002-04-17 21:19:14 -07002089 if test "$USES_LOGIN_CONF" = "yes" ; then
2090 AC_MSG_WARN([
2091--with-default-path=PATH has no effect on this system.
2092Edit /etc/login.conf instead.])
2093 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002094 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002095 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002096 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002097 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002098 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2099 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2100 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002101 AC_TRY_RUN(
2102 [
2103/* find out what STDPATH is */
2104#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002105#ifdef HAVE_PATHS_H
2106# include <paths.h>
2107#endif
2108#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002109# ifdef _PATH_USERPATH /* Irix */
2110# define _PATH_STDPATH _PATH_USERPATH
2111# else
2112# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2113# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002114#endif
2115#include <sys/types.h>
2116#include <sys/stat.h>
2117#include <fcntl.h>
2118#define DATA "conftest.stdpath"
2119
2120main()
2121{
2122 FILE *fd;
2123 int rc;
2124
2125 fd = fopen(DATA,"w");
2126 if(fd == NULL)
2127 exit(1);
2128
2129 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2130 exit(1);
2131
2132 exit(0);
2133}
2134 ], [ user_path=`cat conftest.stdpath` ],
2135 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2136 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2137 )
2138# make sure $bindir is in USER_PATH so scp will work
2139 t_bindir=`eval echo ${bindir}`
2140 case $t_bindir in
2141 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2142 esac
2143 case $t_bindir in
2144 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2145 esac
2146 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2147 if test $? -ne 0 ; then
2148 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2149 if test $? -ne 0 ; then
2150 user_path=$user_path:$t_bindir
2151 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2152 fi
2153 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002154 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002155)
Tim Rice43a1c132002-04-17 21:19:14 -07002156if test "$USES_LOGIN_CONF" != "yes" ; then
2157 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2158 AC_SUBST(user_path)
2159fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002160
Damien Millera18bbd32002-05-13 10:48:57 +10002161# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002162AC_ARG_WITH(superuser-path,
2163 [ --with-superuser-path= Specify different path for super-user],
2164 [
2165 if test "x$withval" != "xno" ; then
2166 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2167 superuser_path=$withval
2168 fi
2169 ]
2170)
2171
2172
Damien Millera22ba012000-03-02 23:09:20 +11002173# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002174IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002175AC_ARG_WITH(ipv4-default,
2176 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2177 [
2178 if test "x$withval" != "xno" ; then
2179 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002180 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002181 fi
2182 ]
2183)
2184
Damien Miller61e50f12000-05-08 20:49:37 +10002185AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002186IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002187AC_ARG_WITH(4in6,
2188 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2189 [
2190 if test "x$withval" != "xno" ; then
2191 AC_MSG_RESULT(yes)
2192 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002193 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002194 else
2195 AC_MSG_RESULT(no)
2196 fi
2197 ],[
2198 if test "x$inet6_default_4in6" = "xyes"; then
2199 AC_MSG_RESULT([yes (default)])
2200 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002201 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002202 else
2203 AC_MSG_RESULT([no (default)])
2204 fi
2205 ]
2206)
2207
Damien Miller60396b02001-02-18 17:01:00 +11002208# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002209BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002210AC_ARG_WITH(bsd-auth,
2211 [ --with-bsd-auth Enable BSD auth support],
2212 [
2213 if test "x$withval" != "xno" ; then
2214 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002215 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002216 fi
2217 ]
2218)
2219
Damien Millera22ba012000-03-02 23:09:20 +11002220# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002221piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002222# make sure the directory exists
2223if test ! -d $piddir ; then
2224 piddir=`eval echo ${sysconfdir}`
2225 case $piddir in
2226 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2227 esac
2228fi
2229
Tim Rice88f2ab52002-03-17 12:17:34 -08002230AC_ARG_WITH(pid-dir,
2231 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2232 [
2233 if test "x$withval" != "xno" ; then
2234 piddir=$withval
2235 if test ! -d $piddir ; then
2236 AC_MSG_WARN([** no $piddir directory on this system **])
2237 fi
2238 fi
2239 ]
2240)
2241
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002242AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002243AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002244
andre2ff7b5d2000-06-03 14:57:40 +00002245dnl allow user to disable some login recording features
2246AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002247 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002248 [ AC_DEFINE(DISABLE_LASTLOG) ]
2249)
2250AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002251 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002252 [ AC_DEFINE(DISABLE_UTMP) ]
2253)
2254AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002255 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002256 [ AC_DEFINE(DISABLE_UTMPX) ]
2257)
2258AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002259 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002260 [ AC_DEFINE(DISABLE_WTMP) ]
2261)
2262AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002263 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002264 [ AC_DEFINE(DISABLE_WTMPX) ]
2265)
2266AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002267 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002268 [ AC_DEFINE(DISABLE_LOGIN) ]
2269)
2270AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002271 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002272 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2273)
2274AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002275 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002276 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2277)
2278AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002279 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002280 [
2281 if test "x$withval" = "xno" ; then
2282 AC_DEFINE(DISABLE_LASTLOG)
2283 else
2284 conf_lastlog_location=$withval
2285 fi
2286 ]
2287)
andre2ff7b5d2000-06-03 14:57:40 +00002288
2289dnl lastlog, [uw]tmpx? detection
2290dnl NOTE: set the paths in the platform section to avoid the
2291dnl need for command-line parameters
2292dnl lastlog and [uw]tmp are subject to a file search if all else fails
2293
2294dnl lastlog detection
2295dnl NOTE: the code itself will detect if lastlog is a directory
2296AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2297AC_TRY_COMPILE([
2298#include <sys/types.h>
2299#include <utmp.h>
2300#ifdef HAVE_LASTLOG_H
2301# include <lastlog.h>
2302#endif
Damien Miller2994e082000-06-04 15:51:47 +10002303#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002304# include <paths.h>
2305#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002306#ifdef HAVE_LOGIN_H
2307# include <login.h>
2308#endif
andre2ff7b5d2000-06-03 14:57:40 +00002309 ],
2310 [ char *lastlog = LASTLOG_FILE; ],
2311 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002312 [
2313 AC_MSG_RESULT(no)
2314 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2315 AC_TRY_COMPILE([
2316#include <sys/types.h>
2317#include <utmp.h>
2318#ifdef HAVE_LASTLOG_H
2319# include <lastlog.h>
2320#endif
2321#ifdef HAVE_PATHS_H
2322# include <paths.h>
2323#endif
2324 ],
2325 [ char *lastlog = _PATH_LASTLOG; ],
2326 [ AC_MSG_RESULT(yes) ],
2327 [
andree441aa32000-06-12 22:34:38 +00002328 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002329 system_lastlog_path=no
2330 ])
2331 ]
andre2ff7b5d2000-06-03 14:57:40 +00002332)
Damien Miller2994e082000-06-04 15:51:47 +10002333
andre2ff7b5d2000-06-03 14:57:40 +00002334if test -z "$conf_lastlog_location"; then
2335 if test x"$system_lastlog_path" = x"no" ; then
2336 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002337 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002338 conf_lastlog_location=$f
2339 fi
2340 done
2341 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002342 AC_MSG_WARN([** Cannot find lastlog **])
2343 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002344 fi
2345 fi
2346fi
2347
2348if test -n "$conf_lastlog_location"; then
2349 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2350fi
2351
2352dnl utmp detection
2353AC_MSG_CHECKING([if your system defines UTMP_FILE])
2354AC_TRY_COMPILE([
2355#include <sys/types.h>
2356#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002357#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002358# include <paths.h>
2359#endif
2360 ],
2361 [ char *utmp = UTMP_FILE; ],
2362 [ AC_MSG_RESULT(yes) ],
2363 [ AC_MSG_RESULT(no)
2364 system_utmp_path=no ]
2365)
2366if test -z "$conf_utmp_location"; then
2367 if test x"$system_utmp_path" = x"no" ; then
2368 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2369 if test -f $f ; then
2370 conf_utmp_location=$f
2371 fi
2372 done
2373 if test -z "$conf_utmp_location"; then
2374 AC_DEFINE(DISABLE_UTMP)
2375 fi
2376 fi
2377fi
2378if test -n "$conf_utmp_location"; then
2379 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2380fi
2381
2382dnl wtmp detection
2383AC_MSG_CHECKING([if your system defines WTMP_FILE])
2384AC_TRY_COMPILE([
2385#include <sys/types.h>
2386#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002387#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002388# include <paths.h>
2389#endif
2390 ],
2391 [ char *wtmp = WTMP_FILE; ],
2392 [ AC_MSG_RESULT(yes) ],
2393 [ AC_MSG_RESULT(no)
2394 system_wtmp_path=no ]
2395)
2396if test -z "$conf_wtmp_location"; then
2397 if test x"$system_wtmp_path" = x"no" ; then
2398 for f in /usr/adm/wtmp /var/log/wtmp; do
2399 if test -f $f ; then
2400 conf_wtmp_location=$f
2401 fi
2402 done
2403 if test -z "$conf_wtmp_location"; then
2404 AC_DEFINE(DISABLE_WTMP)
2405 fi
2406 fi
2407fi
2408if test -n "$conf_wtmp_location"; then
2409 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2410fi
2411
2412
2413dnl utmpx detection - I don't know any system so perverse as to require
2414dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2415dnl there, though.
2416AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2417AC_TRY_COMPILE([
2418#include <sys/types.h>
2419#include <utmp.h>
2420#ifdef HAVE_UTMPX_H
2421#include <utmpx.h>
2422#endif
Damien Miller2994e082000-06-04 15:51:47 +10002423#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002424# include <paths.h>
2425#endif
2426 ],
2427 [ char *utmpx = UTMPX_FILE; ],
2428 [ AC_MSG_RESULT(yes) ],
2429 [ AC_MSG_RESULT(no)
2430 system_utmpx_path=no ]
2431)
2432if test -z "$conf_utmpx_location"; then
2433 if test x"$system_utmpx_path" = x"no" ; then
2434 AC_DEFINE(DISABLE_UTMPX)
2435 fi
2436else
2437 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2438fi
2439
2440dnl wtmpx detection
2441AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2442AC_TRY_COMPILE([
2443#include <sys/types.h>
2444#include <utmp.h>
2445#ifdef HAVE_UTMPX_H
2446#include <utmpx.h>
2447#endif
Damien Miller2994e082000-06-04 15:51:47 +10002448#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002449# include <paths.h>
2450#endif
2451 ],
2452 [ char *wtmpx = WTMPX_FILE; ],
2453 [ AC_MSG_RESULT(yes) ],
2454 [ AC_MSG_RESULT(no)
2455 system_wtmpx_path=no ]
2456)
2457if test -z "$conf_wtmpx_location"; then
2458 if test x"$system_wtmpx_path" = x"no" ; then
2459 AC_DEFINE(DISABLE_WTMPX)
2460 fi
2461else
2462 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2463fi
2464
Damien Miller4018c192000-04-30 09:30:44 +10002465
Damien Miller29ea30d2000-03-17 10:54:15 +11002466if test ! -z "$blibpath" ; then
2467 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2468 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2469fi
2470
Tim Rice4cec93f2002-02-26 08:40:48 -08002471dnl remove pam and dl because they are in $LIBPAM
2472if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002473 LIBS=`echo $LIBS | sed 's/-lpam //'`
2474fi
2475if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2476 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002477fi
2478
Damien Millerbac2d8a2000-09-05 16:13:06 +11002479AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002480AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2481AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002482
Damien Miller7b22d652000-06-18 14:07:04 +10002483# Print summary of options
2484
Damien Miller7b22d652000-06-18 14:07:04 +10002485# Someone please show me a better way :)
2486A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2487B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2488C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2489D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002490E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002491F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002492G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002493H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2494I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2495J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002496
2497echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002498echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002499echo " User binaries: $B"
2500echo " System binaries: $C"
2501echo " Configuration files: $D"
2502echo " Askpass program: $E"
2503echo " Manual pages: $F"
2504echo " PID file: $G"
2505echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002506if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002507echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002508else
Damien Millerf58c6722002-05-13 13:15:42 +10002509echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002510fi
Damien Millera18bbd32002-05-13 10:48:57 +10002511if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002512echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002513fi
Damien Millerf58c6722002-05-13 13:15:42 +10002514echo " Manpage format: $MANTYPE"
2515echo " PAM support: ${PAM_MSG}"
2516echo " KerberosIV support: $KRB4_MSG"
2517echo " KerberosV support: $KRB5_MSG"
2518echo " Smartcard support: $SCARD_MSG"
2519echo " AFS support: $AFS_MSG"
2520echo " S/KEY support: $SKEY_MSG"
2521echo " TCP Wrappers support: $TCPW_MSG"
2522echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002523echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002524echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2525echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2526echo " BSD Auth support: $BSD_AUTH_MSG"
2527echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002528if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002529echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002530fi
2531
Damien Miller7b22d652000-06-18 14:07:04 +10002532echo ""
2533
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002534echo " Host: ${host}"
2535echo " Compiler: ${CC}"
2536echo " Compiler flags: ${CFLAGS}"
2537echo "Preprocessor flags: ${CPPFLAGS}"
2538echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002539echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002540
2541echo ""
2542
Damien Miller82cf0ce2000-12-20 13:34:48 +11002543if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002544 echo "PAM is enabled. You may need to install a PAM control file "
2545 echo "for sshd, otherwise password authentication may fail. "
2546 echo "Example PAM control files can be found in the contrib/ "
2547 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002548 echo ""
2549fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002550
2551if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002552 echo "sftp-server will be disabled. Your compiler does not "
2553 echo "support 64bit integers."
2554 echo ""
2555fi
2556
2557if test ! -z "$RAND_HELPER_CMDHASH" ; then
2558 echo "WARNING: you are using the builtin random number collection "
2559 echo "service. Please read WARNING.RNG and request that your OS "
2560 echo "vendor includes kernel-based random number collection in "
2561 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002562 echo ""
2563fi
Damien Miller60396b02001-02-18 17:01:00 +11002564