blob: 870def2ae1e12df8cbc48eb9107aad14ed05c7f0 [file] [log] [blame]
Ben Lindstrom6dc562a2003-01-27 21:15:10 +00001# $Id: configure.ac,v 1.103 2003/01/27 21:15:10 mouring 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 \
Ben Lindstrom6dc562a2003-01-27 21:15:10 +0000613 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
Tim Rice13aae5e2001-10-21 17:53:58 -0700614
Ben Lindstrom3e006472002-10-16 00:24:03 +0000615dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
616AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
617
Tim Rice13aae5e2001-10-21 17:53:58 -0700618dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700619AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700620 AC_CHECK_LIB(gen, dirname,[
621 AC_CACHE_CHECK([for broken dirname],
622 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700623 save_LIBS="$LIBS"
624 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700625 AC_TRY_RUN(
626 [
627#include <libgen.h>
628#include <string.h>
629
630int main(int argc, char **argv) {
631 char *s, buf[32];
632
633 strncpy(buf,"/etc", 32);
634 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700635 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700636 exit(1);
637 } else {
638 exit(0);
639 }
640}
641 ],
642 [ ac_cv_have_broken_dirname="no" ],
643 [ ac_cv_have_broken_dirname="yes" ]
644 )
Tim Rice17b93e52001-10-23 22:36:54 -0700645 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700646 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700647 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700648 LIBS="$LIBS -lgen"
649 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700650 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700651 fi
652 ])
653])
654
Damien Millerad833b32000-08-23 10:46:23 +1000655dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000656AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000657dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000658AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000659AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000660dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000661AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000662AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100663
Damien Miller04f80141999-11-19 15:32:34 +1100664AC_CHECK_FUNC(daemon,
665 [AC_DEFINE(HAVE_DAEMON)],
666 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
667)
668
Damien Miller9fb07e42000-03-05 16:22:59 +1100669AC_CHECK_FUNC(getpagesize,
670 [AC_DEFINE(HAVE_GETPAGESIZE)],
671 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
672)
673
Damien Millercb170cb2000-07-01 16:52:55 +1000674# Check for broken snprintf
675if test "x$ac_cv_func_snprintf" = "xyes" ; then
676 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
677 AC_TRY_RUN(
678 [
679#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700680int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000681 ],
682 [AC_MSG_RESULT(yes)],
683 [
684 AC_MSG_RESULT(no)
685 AC_DEFINE(BROKEN_SNPRINTF)
686 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
687 ]
688 )
689fi
690
Damien Millere8328192003-01-07 15:18:32 +1100691dnl see whether mkstemp() requires XXXXXX
692if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
693AC_MSG_CHECKING([for (overly) strict mkstemp])
694AC_TRY_RUN(
695 [
696#include <stdlib.h>
697main() { char template[]="conftest.mkstemp-test";
698if (mkstemp(template) == -1)
699 exit(1);
700unlink(template); exit(0);
701}
702 ],
703 [
704 AC_MSG_RESULT(no)
705 ],
706 [
707 AC_MSG_RESULT(yes)
708 AC_DEFINE(HAVE_STRICT_MKSTEMP)
709 ],
710 [
711 AC_MSG_RESULT(yes)
712 AC_DEFINE(HAVE_STRICT_MKSTEMP)
713 ]
714)
715fi
716
Damien Miller606f8802000-09-16 15:39:56 +1100717AC_FUNC_GETPGRP
718
Damien Millera64b57a2001-01-17 10:44:13 +1100719# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000720PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100721AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100722 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100723 [
Damien Millera64b57a2001-01-17 10:44:13 +1100724 if test "x$withval" != "xno" ; then
725 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
726 AC_MSG_ERROR([PAM headers not found])
727 fi
728
729 AC_CHECK_LIB(dl, dlopen, , )
730 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
731 AC_CHECK_FUNCS(pam_getenvlist)
732
733 disable_shadow=yes
734 PAM_MSG="yes"
735
736 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800737 if test $ac_cv_lib_dl_dlopen = yes; then
738 LIBPAM="-lpam -ldl"
739 else
740 LIBPAM="-lpam"
741 fi
742 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100743 fi
744 ]
745)
Damien Millera22ba012000-03-02 23:09:20 +1100746
Damien Millera64b57a2001-01-17 10:44:13 +1100747# Check for older PAM
748if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100749 # Check PAM strerror arguments (old PAM)
750 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
751 AC_TRY_COMPILE(
752 [
Damien Miller81171112000-04-23 11:14:01 +1000753#include <stdlib.h>
754#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100755 ],
756 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
757 [AC_MSG_RESULT(no)],
758 [
759 AC_DEFINE(HAVE_OLD_PAM)
760 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000761 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100762 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100763 )
Damien Millera22ba012000-03-02 23:09:20 +1100764fi
765
Damien Millerfc93d4b2002-09-04 23:26:29 +1000766# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
767# because the system crypt() is more featureful.
768if test "x$check_for_libcrypt_before" = "x1"; then
769 AC_CHECK_LIB(crypt, crypt)
770fi
771
Tim Riceaef73712002-05-11 13:17:42 -0700772# Search for OpenSSL
773saved_CPPFLAGS="$CPPFLAGS"
774saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100775AC_ARG_WITH(ssl-dir,
776 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
777 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000778 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700779 if test -d "$withval/lib"; then
780 if test -n "${need_dash_r}"; then
781 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
782 else
783 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
784 fi
785 else
786 if test -n "${need_dash_r}"; then
787 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
788 else
789 LDFLAGS="-L${withval} ${LDFLAGS}"
790 fi
791 fi
792 if test -d "$withval/include"; then
793 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
794 else
795 CPPFLAGS="-I${withval} ${CPPFLAGS}"
796 fi
Damien Millera22ba012000-03-02 23:09:20 +1100797 fi
798 ]
799)
Tim Riceaef73712002-05-11 13:17:42 -0700800LIBS="$LIBS -lcrypto"
801AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000802 [
Tim Riceaef73712002-05-11 13:17:42 -0700803 dnl Check default openssl install dir
804 if test -n "${need_dash_r}"; then
805 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000806 else
Tim Riceaef73712002-05-11 13:17:42 -0700807 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000808 fi
Tim Riceaef73712002-05-11 13:17:42 -0700809 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
810 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
811 [
812 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
813 ]
814 )
815 ]
816)
817
Tim Riced730b782002-08-13 18:52:10 -0700818# Determine OpenSSL header version
819AC_MSG_CHECKING([OpenSSL header version])
820AC_TRY_RUN(
821 [
822#include <stdio.h>
823#include <string.h>
824#include <openssl/opensslv.h>
825#define DATA "conftest.sslincver"
826int main(void) {
827 FILE *fd;
828 int rc;
829
830 fd = fopen(DATA,"w");
831 if(fd == NULL)
832 exit(1);
833
834 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
835 exit(1);
836
837 exit(0);
838}
839 ],
840 [
841 ssl_header_ver=`cat conftest.sslincver`
842 AC_MSG_RESULT($ssl_header_ver)
843 ],
844 [
845 AC_MSG_RESULT(not found)
846 AC_MSG_ERROR(OpenSSL version header not found.)
847 ]
848)
849
850# Determine OpenSSL library version
851AC_MSG_CHECKING([OpenSSL library version])
852AC_TRY_RUN(
853 [
854#include <stdio.h>
855#include <string.h>
856#include <openssl/opensslv.h>
857#include <openssl/crypto.h>
858#define DATA "conftest.ssllibver"
859int main(void) {
860 FILE *fd;
861 int rc;
862
863 fd = fopen(DATA,"w");
864 if(fd == NULL)
865 exit(1);
866
867 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
868 exit(1);
869
870 exit(0);
871}
872 ],
873 [
874 ssl_library_ver=`cat conftest.ssllibver`
875 AC_MSG_RESULT($ssl_library_ver)
876 ],
877 [
878 AC_MSG_RESULT(not found)
879 AC_MSG_ERROR(OpenSSL library not found.)
880 ]
881)
Damien Millera22ba012000-03-02 23:09:20 +1100882
Damien Millerec932372002-01-22 22:16:03 +1100883# Sanity check OpenSSL headers
884AC_MSG_CHECKING([whether OpenSSL's headers match the library])
885AC_TRY_RUN(
886 [
887#include <string.h>
888#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700889int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100890 ],
891 [
892 AC_MSG_RESULT(yes)
893 ],
894 [
895 AC_MSG_RESULT(no)
896 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
897 ]
898)
899
Damien Millera64b57a2001-01-17 10:44:13 +1100900# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
901# version in OpenSSL. Skip this for PAM
902if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100903 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100904fi
905
Damien Miller6c21c512002-01-22 21:57:53 +1100906
907### Configure cryptographic random number support
908
909# Check wheter OpenSSL seeds itself
910AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
911AC_TRY_RUN(
912 [
913#include <string.h>
914#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700915int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100916 ],
917 [
918 OPENSSL_SEEDS_ITSELF=yes
919 AC_MSG_RESULT(yes)
920 ],
921 [
922 AC_MSG_RESULT(no)
923 # Default to use of the rand helper if OpenSSL doesn't
924 # seed itself
925 USE_RAND_HELPER=yes
926 ]
927)
928
929
930# Do we want to force the use of the rand helper?
931AC_ARG_WITH(rand-helper,
932 [ --with-rand-helper Use subprocess to gather strong randomness ],
933 [
934 if test "x$withval" = "xno" ; then
935 # Force use of OpenSSL's internal RNG, even if
936 # the previous test showed it to be unseeded.
937 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
938 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
939 OPENSSL_SEEDS_ITSELF=yes
940 USE_RAND_HELPER=""
941 fi
942 else
943 USE_RAND_HELPER=yes
944 fi
945 ],
946)
947
948# Which randomness source do we use?
949if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
950 # OpenSSL only
951 AC_DEFINE(OPENSSL_PRNG_ONLY)
952 RAND_MSG="OpenSSL internal ONLY"
953 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800954elif test ! -z "$USE_RAND_HELPER" ; then
955 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100956 RAND_MSG="ssh-rand-helper"
957 INSTALL_SSH_RAND_HELPER="yes"
958fi
959AC_SUBST(INSTALL_SSH_RAND_HELPER)
960
961### Configuration of ssh-rand-helper
962
963# PRNGD TCP socket
964AC_ARG_WITH(prngd-port,
965 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
966 [
Damien Millere996d722002-01-23 11:20:59 +1100967 case "$withval" in
968 no)
969 withval=""
970 ;;
971 [[0-9]]*)
972 ;;
973 *)
974 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
975 ;;
976 esac
977 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100978 PRNGD_PORT="$withval"
979 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
980 fi
981 ]
982)
983
984# PRNGD Unix domain socket
985AC_ARG_WITH(prngd-socket,
986 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
987 [
Damien Millere996d722002-01-23 11:20:59 +1100988 case "$withval" in
989 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100990 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100991 ;;
992 no)
993 withval=""
994 ;;
995 /*)
996 ;;
997 *)
998 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
999 ;;
1000 esac
1001
1002 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001003 if test ! -z "$PRNGD_PORT" ; then
1004 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1005 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001006 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001007 AC_MSG_WARN(Entropy socket is not readable)
1008 fi
1009 PRNGD_SOCKET="$withval"
1010 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1011 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001012 ],
1013 [
1014 # Check for existing socket only if we don't have a random device already
1015 if test "$USE_RAND_HELPER" = yes ; then
1016 AC_MSG_CHECKING(for PRNGD/EGD socket)
1017 # Insert other locations here
1018 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1019 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1020 PRNGD_SOCKET="$sock"
1021 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1022 break;
1023 fi
1024 done
1025 if test ! -z "$PRNGD_SOCKET" ; then
1026 AC_MSG_RESULT($PRNGD_SOCKET)
1027 else
1028 AC_MSG_RESULT(not found)
1029 fi
1030 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001031 ]
1032)
1033
1034# Change default command timeout for hashing entropy source
1035entropy_timeout=200
1036AC_ARG_WITH(entropy-timeout,
1037 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1038 [
1039 if test "x$withval" != "xno" ; then
1040 entropy_timeout=$withval
1041 fi
1042 ]
1043)
Damien Miller6c21c512002-01-22 21:57:53 +11001044AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1045
Damien Millerd3f6ad22002-06-25 10:24:47 +10001046SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001047AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001048 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001049 [
1050 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001051 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001052 fi
1053 ]
1054)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001055AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1056AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001057
Tim Rice88f2ab52002-03-17 12:17:34 -08001058# We do this little dance with the search path to insure
1059# that programs that we select for use by installed programs
1060# (which may be run by the super-user) come from trusted
1061# locations before they come from the user's private area.
1062# This should help avoid accidentally configuring some
1063# random version of a program in someone's personal bin.
1064
1065OPATH=$PATH
1066PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001067test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001068test -d /sbin && PATH=$PATH:/sbin
1069test -d /usr/sbin && PATH=$PATH:/usr/sbin
1070PATH=$PATH:/etc:$OPATH
1071
Damien Miller6c21c512002-01-22 21:57:53 +11001072# These programs are used by the command hashing source to gather entropy
1073OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1074OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1075OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1076OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1077OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1078OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1079OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1080OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1081OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1082OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1083OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1084OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1085OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1086OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1087OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1088OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001089# restore PATH
1090PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001091
1092# Where does ssh-rand-helper get its randomness from?
1093INSTALL_SSH_PRNG_CMDS=""
1094if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1095 if test ! -z "$PRNGD_PORT" ; then
1096 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1097 elif test ! -z "$PRNGD_SOCKET" ; then
1098 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1099 else
1100 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1101 RAND_HELPER_CMDHASH=yes
1102 INSTALL_SSH_PRNG_CMDS="yes"
1103 fi
1104fi
1105AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1106
1107
Ben Lindstromb5628642000-10-18 00:02:25 +00001108# Cheap hack to ensure NEWS-OS libraries are arranged right.
1109if test ! -z "$SONY" ; then
1110 LIBS="$LIBS -liberty";
1111fi
1112
Damien Millera22ba012000-03-02 23:09:20 +11001113# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001114AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001115AC_CHECK_SIZEOF(short int, 2)
1116AC_CHECK_SIZEOF(int, 4)
1117AC_CHECK_SIZEOF(long int, 4)
1118AC_CHECK_SIZEOF(long long int, 8)
1119
Damien Millerfa2bb692002-04-23 23:22:25 +10001120# Sanity check long long for some platforms (AIX)
1121if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1122 ac_cv_sizeof_long_long_int=0
1123fi
1124
Damien Millera22ba012000-03-02 23:09:20 +11001125# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001126AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1127 AC_TRY_COMPILE(
1128 [ #include <sys/types.h> ],
1129 [ u_int a; a = 1;],
1130 [ ac_cv_have_u_int="yes" ],
1131 [ ac_cv_have_u_int="no" ]
1132 )
1133])
1134if test "x$ac_cv_have_u_int" = "xyes" ; then
1135 AC_DEFINE(HAVE_U_INT)
1136 have_u_int=1
1137fi
1138
Damien Miller61e50f12000-05-08 20:49:37 +10001139AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1140 AC_TRY_COMPILE(
1141 [ #include <sys/types.h> ],
1142 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1143 [ ac_cv_have_intxx_t="yes" ],
1144 [ ac_cv_have_intxx_t="no" ]
1145 )
1146])
1147if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1148 AC_DEFINE(HAVE_INTXX_T)
1149 have_intxx_t=1
1150fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001151
1152if (test -z "$have_intxx_t" && \
1153 test "x$ac_cv_header_stdint_h" = "xyes")
1154then
1155 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1156 AC_TRY_COMPILE(
1157 [ #include <stdint.h> ],
1158 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1159 [
1160 AC_DEFINE(HAVE_INTXX_T)
1161 AC_MSG_RESULT(yes)
1162 ],
1163 [ AC_MSG_RESULT(no) ]
1164 )
1165fi
1166
Damien Miller578783e2000-09-23 14:12:24 +11001167AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1168 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001169 [
1170#include <sys/types.h>
1171#ifdef HAVE_STDINT_H
1172# include <stdint.h>
1173#endif
1174#include <sys/socket.h>
1175#ifdef HAVE_SYS_BITYPES_H
1176# include <sys/bitypes.h>
1177#endif
1178 ],
Damien Miller578783e2000-09-23 14:12:24 +11001179 [ int64_t a; a = 1;],
1180 [ ac_cv_have_int64_t="yes" ],
1181 [ ac_cv_have_int64_t="no" ]
1182 )
1183])
1184if test "x$ac_cv_have_int64_t" = "xyes" ; then
1185 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001186fi
1187
Damien Miller61e50f12000-05-08 20:49:37 +10001188AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1189 AC_TRY_COMPILE(
1190 [ #include <sys/types.h> ],
1191 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1192 [ ac_cv_have_u_intxx_t="yes" ],
1193 [ ac_cv_have_u_intxx_t="no" ]
1194 )
1195])
1196if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1197 AC_DEFINE(HAVE_U_INTXX_T)
1198 have_u_intxx_t=1
1199fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001200
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001201if test -z "$have_u_intxx_t" ; then
1202 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1203 AC_TRY_COMPILE(
1204 [ #include <sys/socket.h> ],
1205 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1206 [
1207 AC_DEFINE(HAVE_U_INTXX_T)
1208 AC_MSG_RESULT(yes)
1209 ],
1210 [ AC_MSG_RESULT(no) ]
1211 )
1212fi
1213
Damien Miller578783e2000-09-23 14:12:24 +11001214AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1215 AC_TRY_COMPILE(
1216 [ #include <sys/types.h> ],
1217 [ u_int64_t a; a = 1;],
1218 [ ac_cv_have_u_int64_t="yes" ],
1219 [ ac_cv_have_u_int64_t="no" ]
1220 )
1221])
1222if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1223 AC_DEFINE(HAVE_U_INT64_T)
1224 have_u_int64_t=1
1225fi
1226
Tim Rice4cec93f2002-02-26 08:40:48 -08001227if test -z "$have_u_int64_t" ; then
1228 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1229 AC_TRY_COMPILE(
1230 [ #include <sys/bitypes.h> ],
1231 [ u_int64_t a; a = 1],
1232 [
1233 AC_DEFINE(HAVE_U_INT64_T)
1234 AC_MSG_RESULT(yes)
1235 ],
1236 [ AC_MSG_RESULT(no) ]
1237 )
1238fi
1239
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001240if test -z "$have_u_intxx_t" ; then
1241 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1242 AC_TRY_COMPILE(
1243 [
1244#include <sys/types.h>
1245 ],
1246 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1247 [ ac_cv_have_uintxx_t="yes" ],
1248 [ ac_cv_have_uintxx_t="no" ]
1249 )
1250 ])
1251 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1252 AC_DEFINE(HAVE_UINTXX_T)
1253 fi
1254fi
1255
1256if test -z "$have_uintxx_t" ; then
1257 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1258 AC_TRY_COMPILE(
1259 [ #include <stdint.h> ],
1260 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1261 [
1262 AC_DEFINE(HAVE_UINTXX_T)
1263 AC_MSG_RESULT(yes)
1264 ],
1265 [ AC_MSG_RESULT(no) ]
1266 )
1267fi
1268
Damien Milleredb82922000-06-20 13:25:52 +10001269if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1270 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001271then
1272 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1273 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001274 [
1275#include <sys/bitypes.h>
1276 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001277 [
Damien Miller70494d12000-04-03 15:57:06 +10001278 int8_t a; int16_t b; int32_t c;
1279 u_int8_t e; u_int16_t f; u_int32_t g;
1280 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001281 ],
1282 [
1283 AC_DEFINE(HAVE_U_INTXX_T)
1284 AC_DEFINE(HAVE_INTXX_T)
1285 AC_MSG_RESULT(yes)
1286 ],
1287 [AC_MSG_RESULT(no)]
1288 )
1289fi
1290
Damien Miller58be7382001-09-15 21:31:54 +10001291
1292AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1293 AC_TRY_COMPILE(
1294 [
1295#include <sys/types.h>
1296 ],
1297 [ u_char foo; foo = 125; ],
1298 [ ac_cv_have_u_char="yes" ],
1299 [ ac_cv_have_u_char="no" ]
1300 )
1301])
1302if test "x$ac_cv_have_u_char" = "xyes" ; then
1303 AC_DEFINE(HAVE_U_CHAR)
1304fi
1305
Tim Rice13aae5e2001-10-21 17:53:58 -07001306TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001307
Tim Rice200a5c02002-02-26 22:12:34 -08001308AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001309
Damien Miller61e50f12000-05-08 20:49:37 +10001310AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1311 AC_TRY_COMPILE(
1312 [
1313#include <sys/types.h>
1314 ],
1315 [ size_t foo; foo = 1235; ],
1316 [ ac_cv_have_size_t="yes" ],
1317 [ ac_cv_have_size_t="no" ]
1318 )
1319])
1320if test "x$ac_cv_have_size_t" = "xyes" ; then
1321 AC_DEFINE(HAVE_SIZE_T)
1322fi
Damien Miller95058511999-12-29 10:36:45 +11001323
Damien Miller615f9392000-05-17 22:53:33 +10001324AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1325 AC_TRY_COMPILE(
1326 [
1327#include <sys/types.h>
1328 ],
1329 [ ssize_t foo; foo = 1235; ],
1330 [ ac_cv_have_ssize_t="yes" ],
1331 [ ac_cv_have_ssize_t="no" ]
1332 )
1333])
1334if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1335 AC_DEFINE(HAVE_SSIZE_T)
1336fi
1337
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001338AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1339 AC_TRY_COMPILE(
1340 [
1341#include <time.h>
1342 ],
1343 [ clock_t foo; foo = 1235; ],
1344 [ ac_cv_have_clock_t="yes" ],
1345 [ ac_cv_have_clock_t="no" ]
1346 )
1347])
1348if test "x$ac_cv_have_clock_t" = "xyes" ; then
1349 AC_DEFINE(HAVE_CLOCK_T)
1350fi
1351
Damien Millerb54b40e2000-06-23 08:23:34 +10001352AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1353 AC_TRY_COMPILE(
1354 [
1355#include <sys/types.h>
1356#include <sys/socket.h>
1357 ],
1358 [ sa_family_t foo; foo = 1235; ],
1359 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001360 [ AC_TRY_COMPILE(
1361 [
1362#include <sys/types.h>
1363#include <sys/socket.h>
1364#include <netinet/in.h>
1365 ],
1366 [ sa_family_t foo; foo = 1235; ],
1367 [ ac_cv_have_sa_family_t="yes" ],
1368
Damien Millerb54b40e2000-06-23 08:23:34 +10001369 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001370 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001371 )
1372])
1373if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1374 AC_DEFINE(HAVE_SA_FAMILY_T)
1375fi
1376
Damien Miller0f91b4e2000-06-18 15:43:25 +10001377AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1378 AC_TRY_COMPILE(
1379 [
1380#include <sys/types.h>
1381 ],
1382 [ pid_t foo; foo = 1235; ],
1383 [ ac_cv_have_pid_t="yes" ],
1384 [ ac_cv_have_pid_t="no" ]
1385 )
1386])
1387if test "x$ac_cv_have_pid_t" = "xyes" ; then
1388 AC_DEFINE(HAVE_PID_T)
1389fi
1390
1391AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1392 AC_TRY_COMPILE(
1393 [
1394#include <sys/types.h>
1395 ],
1396 [ mode_t foo; foo = 1235; ],
1397 [ ac_cv_have_mode_t="yes" ],
1398 [ ac_cv_have_mode_t="no" ]
1399 )
1400])
1401if test "x$ac_cv_have_mode_t" = "xyes" ; then
1402 AC_DEFINE(HAVE_MODE_T)
1403fi
1404
Damien Miller61e50f12000-05-08 20:49:37 +10001405
1406AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1407 AC_TRY_COMPILE(
1408 [
Damien Miller81171112000-04-23 11:14:01 +10001409#include <sys/types.h>
1410#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001411 ],
1412 [ struct sockaddr_storage s; ],
1413 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1414 [ ac_cv_have_struct_sockaddr_storage="no" ]
1415 )
1416])
1417if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1418 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1419fi
Damien Miller34132e52000-01-14 15:45:46 +11001420
Damien Miller61e50f12000-05-08 20:49:37 +10001421AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1422 AC_TRY_COMPILE(
1423 [
Damien Miller7b22d652000-06-18 14:07:04 +10001424#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001425#include <netinet/in.h>
1426 ],
1427 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1428 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1429 [ ac_cv_have_struct_sockaddr_in6="no" ]
1430 )
1431])
1432if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1433 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1434fi
Damien Miller34132e52000-01-14 15:45:46 +11001435
Damien Miller61e50f12000-05-08 20:49:37 +10001436AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1437 AC_TRY_COMPILE(
1438 [
Damien Miller7b22d652000-06-18 14:07:04 +10001439#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001440#include <netinet/in.h>
1441 ],
1442 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1443 [ ac_cv_have_struct_in6_addr="yes" ],
1444 [ ac_cv_have_struct_in6_addr="no" ]
1445 )
1446])
1447if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1448 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1449fi
Damien Miller34132e52000-01-14 15:45:46 +11001450
Damien Miller61e50f12000-05-08 20:49:37 +10001451AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1452 AC_TRY_COMPILE(
1453 [
Damien Miller81171112000-04-23 11:14:01 +10001454#include <sys/types.h>
1455#include <sys/socket.h>
1456#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001457 ],
1458 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1459 [ ac_cv_have_struct_addrinfo="yes" ],
1460 [ ac_cv_have_struct_addrinfo="no" ]
1461 )
1462])
1463if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1464 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1465fi
1466
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001467AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1468 AC_TRY_COMPILE(
1469 [ #include <sys/time.h> ],
1470 [ struct timeval tv; tv.tv_sec = 1;],
1471 [ ac_cv_have_struct_timeval="yes" ],
1472 [ ac_cv_have_struct_timeval="no" ]
1473 )
1474])
1475if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1476 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1477 have_struct_timeval=1
1478fi
1479
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001480# If we don't have int64_t then we can't compile sftp-server. So don't
1481# even attempt to do it.
1482if test "x$ac_cv_have_int64_t" = "xno" -a \
1483 "x$ac_cv_sizeof_long_int" != "x8" -a \
1484 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1485 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001486else
1487dnl test snprintf (broken on SCO w/gcc)
1488 AC_TRY_RUN(
1489 [
1490#include <stdio.h>
1491#include <string.h>
1492#ifdef HAVE_SNPRINTF
1493main()
1494{
1495 char buf[50];
1496 char expected_out[50];
1497 int mazsize = 50 ;
1498#if (SIZEOF_LONG_INT == 8)
1499 long int num = 0x7fffffffffffffff;
1500#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001501 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001502#endif
1503 strcpy(expected_out, "9223372036854775807");
1504 snprintf(buf, mazsize, "%lld", num);
1505 if(strcmp(buf, expected_out) != 0)
1506 exit(1);
1507 exit(0);
1508}
1509#else
1510main() { exit(0); }
1511#endif
1512 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1513 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001514fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001515AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001516
Damien Miller78315eb2000-09-29 23:01:36 +11001517dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001518OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1519OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1520OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1521OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1522OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001523OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001524OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1525OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001526OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001527OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1528OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1529OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1530OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001531OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1532OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1533OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001535
1536AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001537
Damien Miller61e50f12000-05-08 20:49:37 +10001538AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1539 ac_cv_have_ss_family_in_struct_ss, [
1540 AC_TRY_COMPILE(
1541 [
Damien Miller81171112000-04-23 11:14:01 +10001542#include <sys/types.h>
1543#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001544 ],
1545 [ struct sockaddr_storage s; s.ss_family = 1; ],
1546 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1547 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1548 )
1549])
1550if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1551 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1552fi
1553
Damien Miller61e50f12000-05-08 20:49:37 +10001554AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1555 ac_cv_have___ss_family_in_struct_ss, [
1556 AC_TRY_COMPILE(
1557 [
Damien Miller81171112000-04-23 11:14:01 +10001558#include <sys/types.h>
1559#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001560 ],
1561 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1562 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1563 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1564 )
1565])
1566if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1567 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1568fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001569
Damien Millerad833b32000-08-23 10:46:23 +10001570AC_CACHE_CHECK([for pw_class field in struct passwd],
1571 ac_cv_have_pw_class_in_struct_passwd, [
1572 AC_TRY_COMPILE(
1573 [
Damien Millerad833b32000-08-23 10:46:23 +10001574#include <pwd.h>
1575 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001576 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001577 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1578 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1579 )
1580])
1581if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1582 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1583fi
1584
Kevin Steves82456952001-06-22 21:14:18 +00001585AC_CACHE_CHECK([for pw_expire field in struct passwd],
1586 ac_cv_have_pw_expire_in_struct_passwd, [
1587 AC_TRY_COMPILE(
1588 [
1589#include <pwd.h>
1590 ],
1591 [ struct passwd p; p.pw_expire = 0; ],
1592 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1593 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1594 )
1595])
1596if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1597 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1598fi
1599
1600AC_CACHE_CHECK([for pw_change field in struct passwd],
1601 ac_cv_have_pw_change_in_struct_passwd, [
1602 AC_TRY_COMPILE(
1603 [
1604#include <pwd.h>
1605 ],
1606 [ struct passwd p; p.pw_change = 0; ],
1607 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1608 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1609 )
1610])
1611if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1612 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1613fi
Damien Miller61e50f12000-05-08 20:49:37 +10001614
Tim Rice28bbb0c2002-05-27 17:37:32 -07001615dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001616AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1617 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001618 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001619 [
Tim Riceae49fe62002-04-12 10:26:21 -07001620#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001621#include <sys/socket.h>
1622#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001623int main() {
1624#ifdef msg_accrights
1625exit(1);
1626#endif
1627struct msghdr m;
1628m.msg_accrights = 0;
1629exit(0);
1630}
Kevin Steves939c9db2002-03-22 17:23:25 +00001631 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001632 [ ac_cv_have_accrights_in_msghdr="yes" ],
1633 [ ac_cv_have_accrights_in_msghdr="no" ]
1634 )
1635])
1636if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1637 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1638fi
1639
Kevin Stevesa44e0352002-04-07 16:18:03 +00001640AC_CACHE_CHECK([for msg_control field in struct msghdr],
1641 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001642 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001643 [
Tim Riceae49fe62002-04-12 10:26:21 -07001644#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001645#include <sys/socket.h>
1646#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001647int main() {
1648#ifdef msg_control
1649exit(1);
1650#endif
1651struct msghdr m;
1652m.msg_control = 0;
1653exit(0);
1654}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001655 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001656 [ ac_cv_have_control_in_msghdr="yes" ],
1657 [ ac_cv_have_control_in_msghdr="no" ]
1658 )
1659])
1660if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1661 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1662fi
1663
Damien Miller61e50f12000-05-08 20:49:37 +10001664AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1665 AC_TRY_LINK([],
1666 [ extern char *__progname; printf("%s", __progname); ],
1667 [ ac_cv_libc_defines___progname="yes" ],
1668 [ ac_cv_libc_defines___progname="no" ]
1669 )
1670])
1671if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1672 AC_DEFINE(HAVE___PROGNAME)
1673fi
1674
Kevin Steves4846f4a2002-03-22 18:19:53 +00001675AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1676 AC_TRY_LINK([
1677#include <stdio.h>
1678],
1679 [ printf("%s", __FUNCTION__); ],
1680 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1681 [ ac_cv_cc_implements___FUNCTION__="no" ]
1682 )
1683])
1684if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1685 AC_DEFINE(HAVE___FUNCTION__)
1686fi
1687
1688AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1689 AC_TRY_LINK([
1690#include <stdio.h>
1691],
1692 [ printf("%s", __func__); ],
1693 [ ac_cv_cc_implements___func__="yes" ],
1694 [ ac_cv_cc_implements___func__="no" ]
1695 )
1696])
1697if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1698 AC_DEFINE(HAVE___func__)
1699fi
1700
Damien Miller4f8e6692001-07-14 13:22:53 +10001701AC_CACHE_CHECK([whether getopt has optreset support],
1702 ac_cv_have_getopt_optreset, [
1703 AC_TRY_LINK(
1704 [
1705#include <getopt.h>
1706 ],
1707 [ extern int optreset; optreset = 0; ],
1708 [ ac_cv_have_getopt_optreset="yes" ],
1709 [ ac_cv_have_getopt_optreset="no" ]
1710 )
1711])
1712if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1713 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1714fi
Damien Millera22ba012000-03-02 23:09:20 +11001715
Damien Millerecbb26d2000-07-15 14:59:14 +10001716AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1717 AC_TRY_LINK([],
1718 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1719 [ ac_cv_libc_defines_sys_errlist="yes" ],
1720 [ ac_cv_libc_defines_sys_errlist="no" ]
1721 )
1722])
1723if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1724 AC_DEFINE(HAVE_SYS_ERRLIST)
1725fi
1726
1727
Damien Miller11fa2cc2000-08-16 10:35:58 +10001728AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1729 AC_TRY_LINK([],
1730 [ extern int sys_nerr; printf("%i", sys_nerr);],
1731 [ ac_cv_libc_defines_sys_nerr="yes" ],
1732 [ ac_cv_libc_defines_sys_nerr="no" ]
1733 )
1734])
1735if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1736 AC_DEFINE(HAVE_SYS_NERR)
1737fi
1738
Damien Miller85de5802001-09-18 14:01:11 +10001739SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001740
1741# Check whether user wants sectok support
1742AC_ARG_WITH(sectok,
1743 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001744 [
1745 if test "x$withval" != "xno" ; then
1746 if test "x$withval" != "xyes" ; then
1747 CPPFLAGS="$CPPFLAGS -I${withval}"
1748 LDFLAGS="$LDFLAGS -L${withval}"
1749 if test ! -z "$need_dash_r" ; then
1750 LDFLAGS="$LDFLAGS -R${withval}"
1751 fi
1752 if test ! -z "$blibpath" ; then
1753 blibpath="$blibpath:${withval}"
1754 fi
1755 fi
1756 AC_CHECK_HEADERS(sectok.h)
1757 if test "$ac_cv_header_sectok_h" != yes; then
1758 AC_MSG_ERROR(Can't find sectok.h)
1759 fi
1760 AC_CHECK_LIB(sectok, sectok_open)
1761 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1762 AC_MSG_ERROR(Can't find libsectok)
1763 fi
1764 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001765 AC_DEFINE(USE_SECTOK)
1766 SCARD_MSG="yes, using sectok"
1767 fi
1768 ]
1769)
1770
1771# Check whether user wants OpenSC support
1772AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001773 AC_HELP_STRING([--with-opensc=PFX],
1774 [Enable smartcard support using OpenSC]),
1775 opensc_config_prefix="$withval", opensc_config_prefix="")
1776if test x$opensc_config_prefix != x ; then
1777 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1778 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1779 if test "$OPENSC_CONFIG" != "no"; then
1780 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1781 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1782 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1783 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1784 AC_DEFINE(SMARTCARD)
1785 AC_DEFINE(USE_OPENSC)
1786 SCARD_MSG="yes, using OpenSC"
1787 fi
1788fi
Damien Miller85de5802001-09-18 14:01:11 +10001789
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001790# Check whether user wants Kerberos 5 support
1791KRB5_MSG="no"
1792AC_ARG_WITH(kerberos5,
1793 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1794 [
1795 if test "x$withval" != "xno" ; then
1796 if test "x$withval" = "xyes" ; then
1797 KRB5ROOT="/usr/local"
1798 else
1799 KRB5ROOT=${withval}
1800 fi
1801 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1802 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1803 AC_DEFINE(KRB5)
1804 KRB5_MSG="yes"
1805 AC_MSG_CHECKING(whether we are using Heimdal)
1806 AC_TRY_COMPILE([ #include <krb5.h> ],
1807 [ char *tmp = heimdal_version; ],
1808 [ AC_MSG_RESULT(yes)
1809 AC_DEFINE(HEIMDAL)
1810 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1811 ],
1812 [ AC_MSG_RESULT(no)
1813 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1814 ]
1815 )
1816 if test ! -z "$need_dash_r" ; then
1817 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1818 fi
1819 if test ! -z "$blibpath" ; then
1820 blibpath="$blibpath:${KRB5ROOT}/lib"
1821 fi
1822 AC_CHECK_LIB(resolv, dn_expand, , )
1823
1824 KRB5=yes
1825 fi
1826 ]
1827)
1828# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001829KRB4_MSG="no"
1830AC_ARG_WITH(kerberos4,
1831 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1832 [
1833 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001834 if test "x$withval" != "xyes" ; then
1835 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1836 LDFLAGS="$LDFLAGS -L${withval}/lib"
1837 if test ! -z "$need_dash_r" ; then
1838 LDFLAGS="$LDFLAGS -R${withval}/lib"
1839 fi
1840 if test ! -z "$blibpath" ; then
1841 blibpath="$blibpath:${withval}/lib"
1842 fi
1843 else
1844 if test -d /usr/include/kerberosIV ; then
1845 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1846 fi
1847 fi
1848
1849 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001850 if test "$ac_cv_header_krb_h" != yes; then
1851 AC_MSG_WARN([Cannot find krb.h, build may fail])
1852 fi
Damien Miller98344742001-03-28 14:37:06 +10001853 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001854 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001855 AC_CHECK_LIB(krb4, main)
1856 if test "$ac_cv_lib_krb4_main" != yes; then
1857 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1858 else
1859 KLIBS="-lkrb4"
1860 fi
1861 else
1862 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001863 fi
Damien Miller98344742001-03-28 14:37:06 +10001864 AC_CHECK_LIB(des, des_cbc_encrypt)
1865 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1866 AC_CHECK_LIB(des425, des_cbc_encrypt)
1867 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1868 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1869 else
1870 KLIBS="-ldes425"
1871 fi
1872 else
1873 KLIBS="-ldes"
1874 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001875 AC_CHECK_LIB(resolv, dn_expand, , )
1876 KRB4=yes
1877 KRB4_MSG="yes"
1878 AC_DEFINE(KRB4)
1879 fi
1880 ]
1881)
1882
1883# Check whether user wants AFS support
1884AFS_MSG="no"
1885AC_ARG_WITH(afs,
1886 [ --with-afs=PATH Enable AFS support],
1887 [
1888 if test "x$withval" != "xno" ; then
1889
1890 if test "x$withval" != "xyes" ; then
1891 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1892 LDFLAGS="$LDFLAGS -L${withval}/lib"
1893 fi
1894
1895 if test -z "$KRB4" ; then
1896 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1897 fi
1898
1899 LIBS="-lkafs $LIBS"
1900 if test ! -z "$AFS_LIBS" ; then
1901 LIBS="$LIBS $AFS_LIBS"
1902 fi
1903 AC_DEFINE(AFS)
1904 AFS_MSG="yes"
1905 fi
1906 ]
1907)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001908LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001909
Damien Millera22ba012000-03-02 23:09:20 +11001910# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001911
Damien Millerf58c6722002-05-13 13:15:42 +10001912PRIVSEP_PATH=/var/empty
1913AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001914 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001915 [
1916 if test "x$withval" != "$no" ; then
1917 PRIVSEP_PATH=$withval
1918 fi
1919 ]
1920)
1921AC_SUBST(PRIVSEP_PATH)
1922
Damien Millera22ba012000-03-02 23:09:20 +11001923AC_ARG_WITH(xauth,
1924 [ --with-xauth=PATH Specify path to xauth program ],
1925 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001926 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001927 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001928 fi
1929 ],
1930 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001931 TestPath="$PATH"
1932 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1933 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1934 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1935 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1936 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001937 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001938 xauth_path="/usr/openwin/bin/xauth"
1939 fi
1940 ]
1941)
1942
Damien Miller7d901272003-01-13 16:55:22 +11001943STRIP_OPT=-s
1944AC_ARG_ENABLE(strip,
1945 [ --disable-strip Disable calling strip(1) on install],
1946 [
1947 if test "x$enableval" = "xno" ; then
1948 STRIP_OPT=
1949 fi
1950 ]
1951)
1952AC_SUBST(STRIP_OPT)
1953
Damien Millera19cf472000-11-29 13:28:50 +11001954if test -z "$xauth_path" ; then
1955 XAUTH_PATH="undefined"
1956 AC_SUBST(XAUTH_PATH)
1957else
Damien Millera22ba012000-03-02 23:09:20 +11001958 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001959 XAUTH_PATH=$xauth_path
1960 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001961fi
Damien Millera22ba012000-03-02 23:09:20 +11001962
1963# Check for mail directory (last resort if we cannot get it from headers)
1964if test ! -z "$MAIL" ; then
1965 maildir=`dirname $MAIL`
1966 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1967fi
1968
Damien Millera22ba012000-03-02 23:09:20 +11001969if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001970 if test "x$disable_ptmx_check" != "xyes" ; then
1971 AC_CHECK_FILE("/dev/ptmx",
1972 [
1973 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1974 have_dev_ptmx=1
1975 ]
1976 )
1977 fi
Damien Millera22ba012000-03-02 23:09:20 +11001978fi
Damien Miller204ad072000-03-02 23:56:12 +11001979AC_CHECK_FILE("/dev/ptc",
1980 [
1981 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1982 have_dev_ptc=1
1983 ]
1984)
1985
Damien Millera22ba012000-03-02 23:09:20 +11001986# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001987AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001988 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001989 [
Damien Miller897741e2001-04-16 10:41:46 +10001990 case "$withval" in
1991 man|cat|doc)
1992 MANTYPE=$withval
1993 ;;
1994 *)
1995 AC_MSG_ERROR(invalid man type: $withval)
1996 ;;
1997 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001998 ]
1999)
Ben Lindstrombc709922001-04-18 18:04:21 +00002000if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002001 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2002 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002003 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2004 MANTYPE=doc
2005 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2006 MANTYPE=man
2007 else
2008 MANTYPE=cat
2009 fi
2010fi
Damien Miller670a4b82000-01-22 13:53:11 +11002011AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002012if test "$MANTYPE" = "doc"; then
2013 mansubdir=man;
2014else
2015 mansubdir=$MANTYPE;
2016fi
2017AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002018
Damien Millera22ba012000-03-02 23:09:20 +11002019# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002020MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002021AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002022 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002023 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002024 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002025 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002026 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002027 fi
2028 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002029)
2030
Damien Millera22ba012000-03-02 23:09:20 +11002031# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002032AC_ARG_WITH(shadow,
2033 [ --without-shadow Disable shadow password support],
2034 [
2035 if test "x$withval" = "xno" ; then
2036 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002037 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002038 fi
2039 ]
2040)
2041
Damien Miller1f335fb2000-06-26 11:31:33 +10002042if test -z "$disable_shadow" ; then
2043 AC_MSG_CHECKING([if the systems has expire shadow information])
2044 AC_TRY_COMPILE(
2045 [
2046#include <sys/types.h>
2047#include <shadow.h>
2048 struct spwd sp;
2049 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2050 [ sp_expire_available=yes ], []
2051 )
2052
2053 if test "x$sp_expire_available" = "xyes" ; then
2054 AC_MSG_RESULT(yes)
2055 AC_DEFINE(HAS_SHADOW_EXPIRE)
2056 else
2057 AC_MSG_RESULT(no)
2058 fi
2059fi
2060
Damien Millera22ba012000-03-02 23:09:20 +11002061# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002062if test ! -z "$IPADDR_IN_DISPLAY" ; then
2063 DISPLAY_HACK_MSG="yes"
2064 AC_DEFINE(IPADDR_IN_DISPLAY)
2065else
2066 DISPLAY_HACK_MSG="no"
2067 AC_ARG_WITH(ipaddr-display,
2068 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2069 [
2070 if test "x$withval" != "xno" ; then
2071 AC_DEFINE(IPADDR_IN_DISPLAY)
2072 DISPLAY_HACK_MSG="yes"
2073 fi
2074 ]
2075 )
2076fi
Damien Miller76112de1999-12-21 11:18:08 +11002077
Tim Rice43a1c132002-04-17 21:19:14 -07002078dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2079if test $ac_cv_func_login_getcapbool = "yes" -a \
2080 $ac_cv_header_login_cap_h = "yes" ; then
2081 USES_LOGIN_CONF=yes
2082fi
Damien Millera22ba012000-03-02 23:09:20 +11002083# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002084SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002085AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002086 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002087 [
Tim Rice43a1c132002-04-17 21:19:14 -07002088 if test "$USES_LOGIN_CONF" = "yes" ; then
2089 AC_MSG_WARN([
2090--with-default-path=PATH has no effect on this system.
2091Edit /etc/login.conf instead.])
2092 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002093 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002094 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002095 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002096 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002097 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2098 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2099 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002100 AC_TRY_RUN(
2101 [
2102/* find out what STDPATH is */
2103#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002104#ifdef HAVE_PATHS_H
2105# include <paths.h>
2106#endif
2107#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002108# ifdef _PATH_USERPATH /* Irix */
2109# define _PATH_STDPATH _PATH_USERPATH
2110# else
2111# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2112# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002113#endif
2114#include <sys/types.h>
2115#include <sys/stat.h>
2116#include <fcntl.h>
2117#define DATA "conftest.stdpath"
2118
2119main()
2120{
2121 FILE *fd;
2122 int rc;
2123
2124 fd = fopen(DATA,"w");
2125 if(fd == NULL)
2126 exit(1);
2127
2128 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2129 exit(1);
2130
2131 exit(0);
2132}
2133 ], [ user_path=`cat conftest.stdpath` ],
2134 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2135 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2136 )
2137# make sure $bindir is in USER_PATH so scp will work
2138 t_bindir=`eval echo ${bindir}`
2139 case $t_bindir in
2140 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2141 esac
2142 case $t_bindir in
2143 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2144 esac
2145 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2146 if test $? -ne 0 ; then
2147 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2148 if test $? -ne 0 ; then
2149 user_path=$user_path:$t_bindir
2150 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2151 fi
2152 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002153 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002154)
Tim Rice43a1c132002-04-17 21:19:14 -07002155if test "$USES_LOGIN_CONF" != "yes" ; then
2156 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2157 AC_SUBST(user_path)
2158fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002159
Damien Millera18bbd32002-05-13 10:48:57 +10002160# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002161AC_ARG_WITH(superuser-path,
2162 [ --with-superuser-path= Specify different path for super-user],
2163 [
2164 if test "x$withval" != "xno" ; then
2165 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2166 superuser_path=$withval
2167 fi
2168 ]
2169)
2170
2171
Damien Millera22ba012000-03-02 23:09:20 +11002172# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002173IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002174AC_ARG_WITH(ipv4-default,
2175 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2176 [
2177 if test "x$withval" != "xno" ; then
2178 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002179 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002180 fi
2181 ]
2182)
2183
Damien Miller61e50f12000-05-08 20:49:37 +10002184AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002185IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002186AC_ARG_WITH(4in6,
2187 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2188 [
2189 if test "x$withval" != "xno" ; then
2190 AC_MSG_RESULT(yes)
2191 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002192 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002193 else
2194 AC_MSG_RESULT(no)
2195 fi
2196 ],[
2197 if test "x$inet6_default_4in6" = "xyes"; then
2198 AC_MSG_RESULT([yes (default)])
2199 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002200 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002201 else
2202 AC_MSG_RESULT([no (default)])
2203 fi
2204 ]
2205)
2206
Damien Miller60396b02001-02-18 17:01:00 +11002207# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002208BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002209AC_ARG_WITH(bsd-auth,
2210 [ --with-bsd-auth Enable BSD auth support],
2211 [
2212 if test "x$withval" != "xno" ; then
2213 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002214 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002215 fi
2216 ]
2217)
2218
Damien Millera22ba012000-03-02 23:09:20 +11002219# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002220piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002221# make sure the directory exists
2222if test ! -d $piddir ; then
2223 piddir=`eval echo ${sysconfdir}`
2224 case $piddir in
2225 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2226 esac
2227fi
2228
Tim Rice88f2ab52002-03-17 12:17:34 -08002229AC_ARG_WITH(pid-dir,
2230 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2231 [
2232 if test "x$withval" != "xno" ; then
2233 piddir=$withval
2234 if test ! -d $piddir ; then
2235 AC_MSG_WARN([** no $piddir directory on this system **])
2236 fi
2237 fi
2238 ]
2239)
2240
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002241AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002242AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002243
andre2ff7b5d2000-06-03 14:57:40 +00002244dnl allow user to disable some login recording features
2245AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002246 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002247 [ AC_DEFINE(DISABLE_LASTLOG) ]
2248)
2249AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002250 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002251 [ AC_DEFINE(DISABLE_UTMP) ]
2252)
2253AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002254 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002255 [ AC_DEFINE(DISABLE_UTMPX) ]
2256)
2257AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002258 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002259 [ AC_DEFINE(DISABLE_WTMP) ]
2260)
2261AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002262 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002263 [ AC_DEFINE(DISABLE_WTMPX) ]
2264)
2265AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002266 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002267 [ AC_DEFINE(DISABLE_LOGIN) ]
2268)
2269AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002270 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002271 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2272)
2273AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002274 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002275 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2276)
2277AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002278 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002279 [
2280 if test "x$withval" = "xno" ; then
2281 AC_DEFINE(DISABLE_LASTLOG)
2282 else
2283 conf_lastlog_location=$withval
2284 fi
2285 ]
2286)
andre2ff7b5d2000-06-03 14:57:40 +00002287
2288dnl lastlog, [uw]tmpx? detection
2289dnl NOTE: set the paths in the platform section to avoid the
2290dnl need for command-line parameters
2291dnl lastlog and [uw]tmp are subject to a file search if all else fails
2292
2293dnl lastlog detection
2294dnl NOTE: the code itself will detect if lastlog is a directory
2295AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2296AC_TRY_COMPILE([
2297#include <sys/types.h>
2298#include <utmp.h>
2299#ifdef HAVE_LASTLOG_H
2300# include <lastlog.h>
2301#endif
Damien Miller2994e082000-06-04 15:51:47 +10002302#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002303# include <paths.h>
2304#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002305#ifdef HAVE_LOGIN_H
2306# include <login.h>
2307#endif
andre2ff7b5d2000-06-03 14:57:40 +00002308 ],
2309 [ char *lastlog = LASTLOG_FILE; ],
2310 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002311 [
2312 AC_MSG_RESULT(no)
2313 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2314 AC_TRY_COMPILE([
2315#include <sys/types.h>
2316#include <utmp.h>
2317#ifdef HAVE_LASTLOG_H
2318# include <lastlog.h>
2319#endif
2320#ifdef HAVE_PATHS_H
2321# include <paths.h>
2322#endif
2323 ],
2324 [ char *lastlog = _PATH_LASTLOG; ],
2325 [ AC_MSG_RESULT(yes) ],
2326 [
andree441aa32000-06-12 22:34:38 +00002327 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002328 system_lastlog_path=no
2329 ])
2330 ]
andre2ff7b5d2000-06-03 14:57:40 +00002331)
Damien Miller2994e082000-06-04 15:51:47 +10002332
andre2ff7b5d2000-06-03 14:57:40 +00002333if test -z "$conf_lastlog_location"; then
2334 if test x"$system_lastlog_path" = x"no" ; then
2335 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002336 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002337 conf_lastlog_location=$f
2338 fi
2339 done
2340 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002341 AC_MSG_WARN([** Cannot find lastlog **])
2342 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002343 fi
2344 fi
2345fi
2346
2347if test -n "$conf_lastlog_location"; then
2348 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2349fi
2350
2351dnl utmp detection
2352AC_MSG_CHECKING([if your system defines UTMP_FILE])
2353AC_TRY_COMPILE([
2354#include <sys/types.h>
2355#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002356#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002357# include <paths.h>
2358#endif
2359 ],
2360 [ char *utmp = UTMP_FILE; ],
2361 [ AC_MSG_RESULT(yes) ],
2362 [ AC_MSG_RESULT(no)
2363 system_utmp_path=no ]
2364)
2365if test -z "$conf_utmp_location"; then
2366 if test x"$system_utmp_path" = x"no" ; then
2367 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2368 if test -f $f ; then
2369 conf_utmp_location=$f
2370 fi
2371 done
2372 if test -z "$conf_utmp_location"; then
2373 AC_DEFINE(DISABLE_UTMP)
2374 fi
2375 fi
2376fi
2377if test -n "$conf_utmp_location"; then
2378 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2379fi
2380
2381dnl wtmp detection
2382AC_MSG_CHECKING([if your system defines WTMP_FILE])
2383AC_TRY_COMPILE([
2384#include <sys/types.h>
2385#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002386#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002387# include <paths.h>
2388#endif
2389 ],
2390 [ char *wtmp = WTMP_FILE; ],
2391 [ AC_MSG_RESULT(yes) ],
2392 [ AC_MSG_RESULT(no)
2393 system_wtmp_path=no ]
2394)
2395if test -z "$conf_wtmp_location"; then
2396 if test x"$system_wtmp_path" = x"no" ; then
2397 for f in /usr/adm/wtmp /var/log/wtmp; do
2398 if test -f $f ; then
2399 conf_wtmp_location=$f
2400 fi
2401 done
2402 if test -z "$conf_wtmp_location"; then
2403 AC_DEFINE(DISABLE_WTMP)
2404 fi
2405 fi
2406fi
2407if test -n "$conf_wtmp_location"; then
2408 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2409fi
2410
2411
2412dnl utmpx detection - I don't know any system so perverse as to require
2413dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2414dnl there, though.
2415AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2416AC_TRY_COMPILE([
2417#include <sys/types.h>
2418#include <utmp.h>
2419#ifdef HAVE_UTMPX_H
2420#include <utmpx.h>
2421#endif
Damien Miller2994e082000-06-04 15:51:47 +10002422#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002423# include <paths.h>
2424#endif
2425 ],
2426 [ char *utmpx = UTMPX_FILE; ],
2427 [ AC_MSG_RESULT(yes) ],
2428 [ AC_MSG_RESULT(no)
2429 system_utmpx_path=no ]
2430)
2431if test -z "$conf_utmpx_location"; then
2432 if test x"$system_utmpx_path" = x"no" ; then
2433 AC_DEFINE(DISABLE_UTMPX)
2434 fi
2435else
2436 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2437fi
2438
2439dnl wtmpx detection
2440AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2441AC_TRY_COMPILE([
2442#include <sys/types.h>
2443#include <utmp.h>
2444#ifdef HAVE_UTMPX_H
2445#include <utmpx.h>
2446#endif
Damien Miller2994e082000-06-04 15:51:47 +10002447#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002448# include <paths.h>
2449#endif
2450 ],
2451 [ char *wtmpx = WTMPX_FILE; ],
2452 [ AC_MSG_RESULT(yes) ],
2453 [ AC_MSG_RESULT(no)
2454 system_wtmpx_path=no ]
2455)
2456if test -z "$conf_wtmpx_location"; then
2457 if test x"$system_wtmpx_path" = x"no" ; then
2458 AC_DEFINE(DISABLE_WTMPX)
2459 fi
2460else
2461 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2462fi
2463
Damien Miller4018c192000-04-30 09:30:44 +10002464
Damien Miller29ea30d2000-03-17 10:54:15 +11002465if test ! -z "$blibpath" ; then
2466 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2467 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2468fi
2469
Tim Rice4cec93f2002-02-26 08:40:48 -08002470dnl remove pam and dl because they are in $LIBPAM
2471if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002472 LIBS=`echo $LIBS | sed 's/-lpam //'`
2473fi
2474if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2475 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002476fi
2477
Damien Millerbac2d8a2000-09-05 16:13:06 +11002478AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002479AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2480AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002481
Damien Miller7b22d652000-06-18 14:07:04 +10002482# Print summary of options
2483
Damien Miller7b22d652000-06-18 14:07:04 +10002484# Someone please show me a better way :)
2485A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2486B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2487C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2488D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002489E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002490F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002491G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002492H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2493I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2494J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002495
2496echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002497echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002498echo " User binaries: $B"
2499echo " System binaries: $C"
2500echo " Configuration files: $D"
2501echo " Askpass program: $E"
2502echo " Manual pages: $F"
2503echo " PID file: $G"
2504echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002505if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002506echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002507else
Damien Millerf58c6722002-05-13 13:15:42 +10002508echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002509fi
Damien Millera18bbd32002-05-13 10:48:57 +10002510if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002511echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002512fi
Damien Millerf58c6722002-05-13 13:15:42 +10002513echo " Manpage format: $MANTYPE"
2514echo " PAM support: ${PAM_MSG}"
2515echo " KerberosIV support: $KRB4_MSG"
2516echo " KerberosV support: $KRB5_MSG"
2517echo " Smartcard support: $SCARD_MSG"
2518echo " AFS support: $AFS_MSG"
2519echo " S/KEY support: $SKEY_MSG"
2520echo " TCP Wrappers support: $TCPW_MSG"
2521echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002522echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002523echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2524echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2525echo " BSD Auth support: $BSD_AUTH_MSG"
2526echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002527if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002528echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002529fi
2530
Damien Miller7b22d652000-06-18 14:07:04 +10002531echo ""
2532
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002533echo " Host: ${host}"
2534echo " Compiler: ${CC}"
2535echo " Compiler flags: ${CFLAGS}"
2536echo "Preprocessor flags: ${CPPFLAGS}"
2537echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002538echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002539
2540echo ""
2541
Damien Miller82cf0ce2000-12-20 13:34:48 +11002542if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002543 echo "PAM is enabled. You may need to install a PAM control file "
2544 echo "for sshd, otherwise password authentication may fail. "
2545 echo "Example PAM control files can be found in the contrib/ "
2546 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002547 echo ""
2548fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002549
2550if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002551 echo "sftp-server will be disabled. Your compiler does not "
2552 echo "support 64bit integers."
2553 echo ""
2554fi
2555
2556if test ! -z "$RAND_HELPER_CMDHASH" ; then
2557 echo "WARNING: you are using the builtin random number collection "
2558 echo "service. Please read WARNING.RNG and request that your OS "
2559 echo "vendor includes kernel-based random number collection in "
2560 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002561 echo ""
2562fi
Damien Miller60396b02001-02-18 17:01:00 +11002563