blob: f66104e78627914ef65e65cd22d1da6ba30bd772 [file] [log] [blame]
Damien Millercd6853c2003-01-28 11:33:42 +11001# $Id: configure.ac,v 1.104 2003/01/28 00:33:44 djm 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
Damien Millercd6853c2003-01-28 11:33:42 +1100615AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
616
Ben Lindstrom3e006472002-10-16 00:24:03 +0000617dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
618AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
619
Tim Rice13aae5e2001-10-21 17:53:58 -0700620dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700621AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 AC_CHECK_LIB(gen, dirname,[
623 AC_CACHE_CHECK([for broken dirname],
624 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700625 save_LIBS="$LIBS"
626 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700627 AC_TRY_RUN(
628 [
629#include <libgen.h>
630#include <string.h>
631
632int main(int argc, char **argv) {
633 char *s, buf[32];
634
635 strncpy(buf,"/etc", 32);
636 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700637 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700638 exit(1);
639 } else {
640 exit(0);
641 }
642}
643 ],
644 [ ac_cv_have_broken_dirname="no" ],
645 [ ac_cv_have_broken_dirname="yes" ]
646 )
Tim Rice17b93e52001-10-23 22:36:54 -0700647 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700648 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700649 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700650 LIBS="$LIBS -lgen"
651 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700652 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700653 fi
654 ])
655])
656
Damien Millerad833b32000-08-23 10:46:23 +1000657dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000658AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000659dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000660AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000661AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000662dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000663AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000664AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100665
Damien Miller04f80141999-11-19 15:32:34 +1100666AC_CHECK_FUNC(daemon,
667 [AC_DEFINE(HAVE_DAEMON)],
668 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
669)
670
Damien Miller9fb07e42000-03-05 16:22:59 +1100671AC_CHECK_FUNC(getpagesize,
672 [AC_DEFINE(HAVE_GETPAGESIZE)],
673 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
674)
675
Damien Millercb170cb2000-07-01 16:52:55 +1000676# Check for broken snprintf
677if test "x$ac_cv_func_snprintf" = "xyes" ; then
678 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
679 AC_TRY_RUN(
680 [
681#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700682int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000683 ],
684 [AC_MSG_RESULT(yes)],
685 [
686 AC_MSG_RESULT(no)
687 AC_DEFINE(BROKEN_SNPRINTF)
688 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
689 ]
690 )
691fi
692
Damien Millere8328192003-01-07 15:18:32 +1100693dnl see whether mkstemp() requires XXXXXX
694if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
695AC_MSG_CHECKING([for (overly) strict mkstemp])
696AC_TRY_RUN(
697 [
698#include <stdlib.h>
699main() { char template[]="conftest.mkstemp-test";
700if (mkstemp(template) == -1)
701 exit(1);
702unlink(template); exit(0);
703}
704 ],
705 [
706 AC_MSG_RESULT(no)
707 ],
708 [
709 AC_MSG_RESULT(yes)
710 AC_DEFINE(HAVE_STRICT_MKSTEMP)
711 ],
712 [
713 AC_MSG_RESULT(yes)
714 AC_DEFINE(HAVE_STRICT_MKSTEMP)
715 ]
716)
717fi
718
Damien Miller606f8802000-09-16 15:39:56 +1100719AC_FUNC_GETPGRP
720
Damien Millera64b57a2001-01-17 10:44:13 +1100721# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000722PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100723AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100724 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100725 [
Damien Millera64b57a2001-01-17 10:44:13 +1100726 if test "x$withval" != "xno" ; then
727 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
728 AC_MSG_ERROR([PAM headers not found])
729 fi
730
731 AC_CHECK_LIB(dl, dlopen, , )
732 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
733 AC_CHECK_FUNCS(pam_getenvlist)
734
735 disable_shadow=yes
736 PAM_MSG="yes"
737
738 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800739 if test $ac_cv_lib_dl_dlopen = yes; then
740 LIBPAM="-lpam -ldl"
741 else
742 LIBPAM="-lpam"
743 fi
744 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100745 fi
746 ]
747)
Damien Millera22ba012000-03-02 23:09:20 +1100748
Damien Millera64b57a2001-01-17 10:44:13 +1100749# Check for older PAM
750if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100751 # Check PAM strerror arguments (old PAM)
752 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
753 AC_TRY_COMPILE(
754 [
Damien Miller81171112000-04-23 11:14:01 +1000755#include <stdlib.h>
756#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100757 ],
758 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
759 [AC_MSG_RESULT(no)],
760 [
761 AC_DEFINE(HAVE_OLD_PAM)
762 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000763 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100764 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100765 )
Damien Millera22ba012000-03-02 23:09:20 +1100766fi
767
Damien Millerfc93d4b2002-09-04 23:26:29 +1000768# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
769# because the system crypt() is more featureful.
770if test "x$check_for_libcrypt_before" = "x1"; then
771 AC_CHECK_LIB(crypt, crypt)
772fi
773
Tim Riceaef73712002-05-11 13:17:42 -0700774# Search for OpenSSL
775saved_CPPFLAGS="$CPPFLAGS"
776saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100777AC_ARG_WITH(ssl-dir,
778 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
779 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000780 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700781 if test -d "$withval/lib"; then
782 if test -n "${need_dash_r}"; then
783 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
784 else
785 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
786 fi
787 else
788 if test -n "${need_dash_r}"; then
789 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
790 else
791 LDFLAGS="-L${withval} ${LDFLAGS}"
792 fi
793 fi
794 if test -d "$withval/include"; then
795 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
796 else
797 CPPFLAGS="-I${withval} ${CPPFLAGS}"
798 fi
Damien Millera22ba012000-03-02 23:09:20 +1100799 fi
800 ]
801)
Tim Riceaef73712002-05-11 13:17:42 -0700802LIBS="$LIBS -lcrypto"
803AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000804 [
Tim Riceaef73712002-05-11 13:17:42 -0700805 dnl Check default openssl install dir
806 if test -n "${need_dash_r}"; then
807 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000808 else
Tim Riceaef73712002-05-11 13:17:42 -0700809 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000810 fi
Tim Riceaef73712002-05-11 13:17:42 -0700811 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
812 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
813 [
814 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
815 ]
816 )
817 ]
818)
819
Tim Riced730b782002-08-13 18:52:10 -0700820# Determine OpenSSL header version
821AC_MSG_CHECKING([OpenSSL header version])
822AC_TRY_RUN(
823 [
824#include <stdio.h>
825#include <string.h>
826#include <openssl/opensslv.h>
827#define DATA "conftest.sslincver"
828int main(void) {
829 FILE *fd;
830 int rc;
831
832 fd = fopen(DATA,"w");
833 if(fd == NULL)
834 exit(1);
835
836 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
837 exit(1);
838
839 exit(0);
840}
841 ],
842 [
843 ssl_header_ver=`cat conftest.sslincver`
844 AC_MSG_RESULT($ssl_header_ver)
845 ],
846 [
847 AC_MSG_RESULT(not found)
848 AC_MSG_ERROR(OpenSSL version header not found.)
849 ]
850)
851
852# Determine OpenSSL library version
853AC_MSG_CHECKING([OpenSSL library version])
854AC_TRY_RUN(
855 [
856#include <stdio.h>
857#include <string.h>
858#include <openssl/opensslv.h>
859#include <openssl/crypto.h>
860#define DATA "conftest.ssllibver"
861int main(void) {
862 FILE *fd;
863 int rc;
864
865 fd = fopen(DATA,"w");
866 if(fd == NULL)
867 exit(1);
868
869 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
870 exit(1);
871
872 exit(0);
873}
874 ],
875 [
876 ssl_library_ver=`cat conftest.ssllibver`
877 AC_MSG_RESULT($ssl_library_ver)
878 ],
879 [
880 AC_MSG_RESULT(not found)
881 AC_MSG_ERROR(OpenSSL library not found.)
882 ]
883)
Damien Millera22ba012000-03-02 23:09:20 +1100884
Damien Millerec932372002-01-22 22:16:03 +1100885# Sanity check OpenSSL headers
886AC_MSG_CHECKING([whether OpenSSL's headers match the library])
887AC_TRY_RUN(
888 [
889#include <string.h>
890#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700891int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100892 ],
893 [
894 AC_MSG_RESULT(yes)
895 ],
896 [
897 AC_MSG_RESULT(no)
898 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
899 ]
900)
901
Damien Millera64b57a2001-01-17 10:44:13 +1100902# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
903# version in OpenSSL. Skip this for PAM
904if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100905 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100906fi
907
Damien Miller6c21c512002-01-22 21:57:53 +1100908
909### Configure cryptographic random number support
910
911# Check wheter OpenSSL seeds itself
912AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
913AC_TRY_RUN(
914 [
915#include <string.h>
916#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700917int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100918 ],
919 [
920 OPENSSL_SEEDS_ITSELF=yes
921 AC_MSG_RESULT(yes)
922 ],
923 [
924 AC_MSG_RESULT(no)
925 # Default to use of the rand helper if OpenSSL doesn't
926 # seed itself
927 USE_RAND_HELPER=yes
928 ]
929)
930
931
932# Do we want to force the use of the rand helper?
933AC_ARG_WITH(rand-helper,
934 [ --with-rand-helper Use subprocess to gather strong randomness ],
935 [
936 if test "x$withval" = "xno" ; then
937 # Force use of OpenSSL's internal RNG, even if
938 # the previous test showed it to be unseeded.
939 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
940 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
941 OPENSSL_SEEDS_ITSELF=yes
942 USE_RAND_HELPER=""
943 fi
944 else
945 USE_RAND_HELPER=yes
946 fi
947 ],
948)
949
950# Which randomness source do we use?
951if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
952 # OpenSSL only
953 AC_DEFINE(OPENSSL_PRNG_ONLY)
954 RAND_MSG="OpenSSL internal ONLY"
955 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800956elif test ! -z "$USE_RAND_HELPER" ; then
957 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100958 RAND_MSG="ssh-rand-helper"
959 INSTALL_SSH_RAND_HELPER="yes"
960fi
961AC_SUBST(INSTALL_SSH_RAND_HELPER)
962
963### Configuration of ssh-rand-helper
964
965# PRNGD TCP socket
966AC_ARG_WITH(prngd-port,
967 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
968 [
Damien Millere996d722002-01-23 11:20:59 +1100969 case "$withval" in
970 no)
971 withval=""
972 ;;
973 [[0-9]]*)
974 ;;
975 *)
976 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
977 ;;
978 esac
979 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100980 PRNGD_PORT="$withval"
981 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
982 fi
983 ]
984)
985
986# PRNGD Unix domain socket
987AC_ARG_WITH(prngd-socket,
988 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
989 [
Damien Millere996d722002-01-23 11:20:59 +1100990 case "$withval" in
991 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100992 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100993 ;;
994 no)
995 withval=""
996 ;;
997 /*)
998 ;;
999 *)
1000 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1001 ;;
1002 esac
1003
1004 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001005 if test ! -z "$PRNGD_PORT" ; then
1006 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1007 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001008 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001009 AC_MSG_WARN(Entropy socket is not readable)
1010 fi
1011 PRNGD_SOCKET="$withval"
1012 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1013 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001014 ],
1015 [
1016 # Check for existing socket only if we don't have a random device already
1017 if test "$USE_RAND_HELPER" = yes ; then
1018 AC_MSG_CHECKING(for PRNGD/EGD socket)
1019 # Insert other locations here
1020 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1021 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1022 PRNGD_SOCKET="$sock"
1023 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1024 break;
1025 fi
1026 done
1027 if test ! -z "$PRNGD_SOCKET" ; then
1028 AC_MSG_RESULT($PRNGD_SOCKET)
1029 else
1030 AC_MSG_RESULT(not found)
1031 fi
1032 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001033 ]
1034)
1035
1036# Change default command timeout for hashing entropy source
1037entropy_timeout=200
1038AC_ARG_WITH(entropy-timeout,
1039 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1040 [
1041 if test "x$withval" != "xno" ; then
1042 entropy_timeout=$withval
1043 fi
1044 ]
1045)
Damien Miller6c21c512002-01-22 21:57:53 +11001046AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1047
Damien Millerd3f6ad22002-06-25 10:24:47 +10001048SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001049AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001050 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001051 [
1052 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001053 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001054 fi
1055 ]
1056)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001057AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1058AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001059
Tim Rice88f2ab52002-03-17 12:17:34 -08001060# We do this little dance with the search path to insure
1061# that programs that we select for use by installed programs
1062# (which may be run by the super-user) come from trusted
1063# locations before they come from the user's private area.
1064# This should help avoid accidentally configuring some
1065# random version of a program in someone's personal bin.
1066
1067OPATH=$PATH
1068PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001069test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001070test -d /sbin && PATH=$PATH:/sbin
1071test -d /usr/sbin && PATH=$PATH:/usr/sbin
1072PATH=$PATH:/etc:$OPATH
1073
Damien Miller6c21c512002-01-22 21:57:53 +11001074# These programs are used by the command hashing source to gather entropy
1075OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1076OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1077OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1078OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1079OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1080OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1081OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1082OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1083OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1084OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1085OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1086OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1087OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1088OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1089OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1090OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001091# restore PATH
1092PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001093
1094# Where does ssh-rand-helper get its randomness from?
1095INSTALL_SSH_PRNG_CMDS=""
1096if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1097 if test ! -z "$PRNGD_PORT" ; then
1098 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1099 elif test ! -z "$PRNGD_SOCKET" ; then
1100 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1101 else
1102 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1103 RAND_HELPER_CMDHASH=yes
1104 INSTALL_SSH_PRNG_CMDS="yes"
1105 fi
1106fi
1107AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1108
1109
Ben Lindstromb5628642000-10-18 00:02:25 +00001110# Cheap hack to ensure NEWS-OS libraries are arranged right.
1111if test ! -z "$SONY" ; then
1112 LIBS="$LIBS -liberty";
1113fi
1114
Damien Millera22ba012000-03-02 23:09:20 +11001115# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001116AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001117AC_CHECK_SIZEOF(short int, 2)
1118AC_CHECK_SIZEOF(int, 4)
1119AC_CHECK_SIZEOF(long int, 4)
1120AC_CHECK_SIZEOF(long long int, 8)
1121
Damien Millerfa2bb692002-04-23 23:22:25 +10001122# Sanity check long long for some platforms (AIX)
1123if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1124 ac_cv_sizeof_long_long_int=0
1125fi
1126
Damien Millera22ba012000-03-02 23:09:20 +11001127# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001128AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1129 AC_TRY_COMPILE(
1130 [ #include <sys/types.h> ],
1131 [ u_int a; a = 1;],
1132 [ ac_cv_have_u_int="yes" ],
1133 [ ac_cv_have_u_int="no" ]
1134 )
1135])
1136if test "x$ac_cv_have_u_int" = "xyes" ; then
1137 AC_DEFINE(HAVE_U_INT)
1138 have_u_int=1
1139fi
1140
Damien Miller61e50f12000-05-08 20:49:37 +10001141AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1142 AC_TRY_COMPILE(
1143 [ #include <sys/types.h> ],
1144 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1145 [ ac_cv_have_intxx_t="yes" ],
1146 [ ac_cv_have_intxx_t="no" ]
1147 )
1148])
1149if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1150 AC_DEFINE(HAVE_INTXX_T)
1151 have_intxx_t=1
1152fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001153
1154if (test -z "$have_intxx_t" && \
1155 test "x$ac_cv_header_stdint_h" = "xyes")
1156then
1157 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1158 AC_TRY_COMPILE(
1159 [ #include <stdint.h> ],
1160 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1161 [
1162 AC_DEFINE(HAVE_INTXX_T)
1163 AC_MSG_RESULT(yes)
1164 ],
1165 [ AC_MSG_RESULT(no) ]
1166 )
1167fi
1168
Damien Miller578783e2000-09-23 14:12:24 +11001169AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1170 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001171 [
1172#include <sys/types.h>
1173#ifdef HAVE_STDINT_H
1174# include <stdint.h>
1175#endif
1176#include <sys/socket.h>
1177#ifdef HAVE_SYS_BITYPES_H
1178# include <sys/bitypes.h>
1179#endif
1180 ],
Damien Miller578783e2000-09-23 14:12:24 +11001181 [ int64_t a; a = 1;],
1182 [ ac_cv_have_int64_t="yes" ],
1183 [ ac_cv_have_int64_t="no" ]
1184 )
1185])
1186if test "x$ac_cv_have_int64_t" = "xyes" ; then
1187 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001188fi
1189
Damien Miller61e50f12000-05-08 20:49:37 +10001190AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1191 AC_TRY_COMPILE(
1192 [ #include <sys/types.h> ],
1193 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1194 [ ac_cv_have_u_intxx_t="yes" ],
1195 [ ac_cv_have_u_intxx_t="no" ]
1196 )
1197])
1198if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1199 AC_DEFINE(HAVE_U_INTXX_T)
1200 have_u_intxx_t=1
1201fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001202
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001203if test -z "$have_u_intxx_t" ; then
1204 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1205 AC_TRY_COMPILE(
1206 [ #include <sys/socket.h> ],
1207 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1208 [
1209 AC_DEFINE(HAVE_U_INTXX_T)
1210 AC_MSG_RESULT(yes)
1211 ],
1212 [ AC_MSG_RESULT(no) ]
1213 )
1214fi
1215
Damien Miller578783e2000-09-23 14:12:24 +11001216AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1217 AC_TRY_COMPILE(
1218 [ #include <sys/types.h> ],
1219 [ u_int64_t a; a = 1;],
1220 [ ac_cv_have_u_int64_t="yes" ],
1221 [ ac_cv_have_u_int64_t="no" ]
1222 )
1223])
1224if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1225 AC_DEFINE(HAVE_U_INT64_T)
1226 have_u_int64_t=1
1227fi
1228
Tim Rice4cec93f2002-02-26 08:40:48 -08001229if test -z "$have_u_int64_t" ; then
1230 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1231 AC_TRY_COMPILE(
1232 [ #include <sys/bitypes.h> ],
1233 [ u_int64_t a; a = 1],
1234 [
1235 AC_DEFINE(HAVE_U_INT64_T)
1236 AC_MSG_RESULT(yes)
1237 ],
1238 [ AC_MSG_RESULT(no) ]
1239 )
1240fi
1241
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001242if test -z "$have_u_intxx_t" ; then
1243 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1244 AC_TRY_COMPILE(
1245 [
1246#include <sys/types.h>
1247 ],
1248 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1249 [ ac_cv_have_uintxx_t="yes" ],
1250 [ ac_cv_have_uintxx_t="no" ]
1251 )
1252 ])
1253 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1254 AC_DEFINE(HAVE_UINTXX_T)
1255 fi
1256fi
1257
1258if test -z "$have_uintxx_t" ; then
1259 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1260 AC_TRY_COMPILE(
1261 [ #include <stdint.h> ],
1262 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1263 [
1264 AC_DEFINE(HAVE_UINTXX_T)
1265 AC_MSG_RESULT(yes)
1266 ],
1267 [ AC_MSG_RESULT(no) ]
1268 )
1269fi
1270
Damien Milleredb82922000-06-20 13:25:52 +10001271if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1272 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001273then
1274 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1275 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001276 [
1277#include <sys/bitypes.h>
1278 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001279 [
Damien Miller70494d12000-04-03 15:57:06 +10001280 int8_t a; int16_t b; int32_t c;
1281 u_int8_t e; u_int16_t f; u_int32_t g;
1282 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001283 ],
1284 [
1285 AC_DEFINE(HAVE_U_INTXX_T)
1286 AC_DEFINE(HAVE_INTXX_T)
1287 AC_MSG_RESULT(yes)
1288 ],
1289 [AC_MSG_RESULT(no)]
1290 )
1291fi
1292
Damien Miller58be7382001-09-15 21:31:54 +10001293
1294AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1295 AC_TRY_COMPILE(
1296 [
1297#include <sys/types.h>
1298 ],
1299 [ u_char foo; foo = 125; ],
1300 [ ac_cv_have_u_char="yes" ],
1301 [ ac_cv_have_u_char="no" ]
1302 )
1303])
1304if test "x$ac_cv_have_u_char" = "xyes" ; then
1305 AC_DEFINE(HAVE_U_CHAR)
1306fi
1307
Tim Rice13aae5e2001-10-21 17:53:58 -07001308TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001309
Tim Rice200a5c02002-02-26 22:12:34 -08001310AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001311
Damien Miller61e50f12000-05-08 20:49:37 +10001312AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1313 AC_TRY_COMPILE(
1314 [
1315#include <sys/types.h>
1316 ],
1317 [ size_t foo; foo = 1235; ],
1318 [ ac_cv_have_size_t="yes" ],
1319 [ ac_cv_have_size_t="no" ]
1320 )
1321])
1322if test "x$ac_cv_have_size_t" = "xyes" ; then
1323 AC_DEFINE(HAVE_SIZE_T)
1324fi
Damien Miller95058511999-12-29 10:36:45 +11001325
Damien Miller615f9392000-05-17 22:53:33 +10001326AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1327 AC_TRY_COMPILE(
1328 [
1329#include <sys/types.h>
1330 ],
1331 [ ssize_t foo; foo = 1235; ],
1332 [ ac_cv_have_ssize_t="yes" ],
1333 [ ac_cv_have_ssize_t="no" ]
1334 )
1335])
1336if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1337 AC_DEFINE(HAVE_SSIZE_T)
1338fi
1339
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001340AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1341 AC_TRY_COMPILE(
1342 [
1343#include <time.h>
1344 ],
1345 [ clock_t foo; foo = 1235; ],
1346 [ ac_cv_have_clock_t="yes" ],
1347 [ ac_cv_have_clock_t="no" ]
1348 )
1349])
1350if test "x$ac_cv_have_clock_t" = "xyes" ; then
1351 AC_DEFINE(HAVE_CLOCK_T)
1352fi
1353
Damien Millerb54b40e2000-06-23 08:23:34 +10001354AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1355 AC_TRY_COMPILE(
1356 [
1357#include <sys/types.h>
1358#include <sys/socket.h>
1359 ],
1360 [ sa_family_t foo; foo = 1235; ],
1361 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001362 [ AC_TRY_COMPILE(
1363 [
1364#include <sys/types.h>
1365#include <sys/socket.h>
1366#include <netinet/in.h>
1367 ],
1368 [ sa_family_t foo; foo = 1235; ],
1369 [ ac_cv_have_sa_family_t="yes" ],
1370
Damien Millerb54b40e2000-06-23 08:23:34 +10001371 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001372 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001373 )
1374])
1375if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1376 AC_DEFINE(HAVE_SA_FAMILY_T)
1377fi
1378
Damien Miller0f91b4e2000-06-18 15:43:25 +10001379AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1380 AC_TRY_COMPILE(
1381 [
1382#include <sys/types.h>
1383 ],
1384 [ pid_t foo; foo = 1235; ],
1385 [ ac_cv_have_pid_t="yes" ],
1386 [ ac_cv_have_pid_t="no" ]
1387 )
1388])
1389if test "x$ac_cv_have_pid_t" = "xyes" ; then
1390 AC_DEFINE(HAVE_PID_T)
1391fi
1392
1393AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1394 AC_TRY_COMPILE(
1395 [
1396#include <sys/types.h>
1397 ],
1398 [ mode_t foo; foo = 1235; ],
1399 [ ac_cv_have_mode_t="yes" ],
1400 [ ac_cv_have_mode_t="no" ]
1401 )
1402])
1403if test "x$ac_cv_have_mode_t" = "xyes" ; then
1404 AC_DEFINE(HAVE_MODE_T)
1405fi
1406
Damien Miller61e50f12000-05-08 20:49:37 +10001407
1408AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1409 AC_TRY_COMPILE(
1410 [
Damien Miller81171112000-04-23 11:14:01 +10001411#include <sys/types.h>
1412#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001413 ],
1414 [ struct sockaddr_storage s; ],
1415 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1416 [ ac_cv_have_struct_sockaddr_storage="no" ]
1417 )
1418])
1419if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1420 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1421fi
Damien Miller34132e52000-01-14 15:45:46 +11001422
Damien Miller61e50f12000-05-08 20:49:37 +10001423AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1424 AC_TRY_COMPILE(
1425 [
Damien Miller7b22d652000-06-18 14:07:04 +10001426#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001427#include <netinet/in.h>
1428 ],
1429 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1430 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1431 [ ac_cv_have_struct_sockaddr_in6="no" ]
1432 )
1433])
1434if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1435 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1436fi
Damien Miller34132e52000-01-14 15:45:46 +11001437
Damien Miller61e50f12000-05-08 20:49:37 +10001438AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1439 AC_TRY_COMPILE(
1440 [
Damien Miller7b22d652000-06-18 14:07:04 +10001441#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001442#include <netinet/in.h>
1443 ],
1444 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1445 [ ac_cv_have_struct_in6_addr="yes" ],
1446 [ ac_cv_have_struct_in6_addr="no" ]
1447 )
1448])
1449if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1450 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1451fi
Damien Miller34132e52000-01-14 15:45:46 +11001452
Damien Miller61e50f12000-05-08 20:49:37 +10001453AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1454 AC_TRY_COMPILE(
1455 [
Damien Miller81171112000-04-23 11:14:01 +10001456#include <sys/types.h>
1457#include <sys/socket.h>
1458#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001459 ],
1460 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1461 [ ac_cv_have_struct_addrinfo="yes" ],
1462 [ ac_cv_have_struct_addrinfo="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1466 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1467fi
1468
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001469AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1470 AC_TRY_COMPILE(
1471 [ #include <sys/time.h> ],
1472 [ struct timeval tv; tv.tv_sec = 1;],
1473 [ ac_cv_have_struct_timeval="yes" ],
1474 [ ac_cv_have_struct_timeval="no" ]
1475 )
1476])
1477if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1478 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1479 have_struct_timeval=1
1480fi
1481
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001482# If we don't have int64_t then we can't compile sftp-server. So don't
1483# even attempt to do it.
1484if test "x$ac_cv_have_int64_t" = "xno" -a \
1485 "x$ac_cv_sizeof_long_int" != "x8" -a \
1486 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1487 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001488else
1489dnl test snprintf (broken on SCO w/gcc)
1490 AC_TRY_RUN(
1491 [
1492#include <stdio.h>
1493#include <string.h>
1494#ifdef HAVE_SNPRINTF
1495main()
1496{
1497 char buf[50];
1498 char expected_out[50];
1499 int mazsize = 50 ;
1500#if (SIZEOF_LONG_INT == 8)
1501 long int num = 0x7fffffffffffffff;
1502#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001503 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001504#endif
1505 strcpy(expected_out, "9223372036854775807");
1506 snprintf(buf, mazsize, "%lld", num);
1507 if(strcmp(buf, expected_out) != 0)
1508 exit(1);
1509 exit(0);
1510}
1511#else
1512main() { exit(0); }
1513#endif
1514 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1515 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001516fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001517AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001518
Damien Miller78315eb2000-09-29 23:01:36 +11001519dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001520OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1521OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1522OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1523OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1524OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001525OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001526OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1527OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001528OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001529OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1530OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1531OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1532OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001533OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1535OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1536OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001537
1538AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001539
Damien Miller61e50f12000-05-08 20:49:37 +10001540AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1541 ac_cv_have_ss_family_in_struct_ss, [
1542 AC_TRY_COMPILE(
1543 [
Damien Miller81171112000-04-23 11:14:01 +10001544#include <sys/types.h>
1545#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001546 ],
1547 [ struct sockaddr_storage s; s.ss_family = 1; ],
1548 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1549 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1550 )
1551])
1552if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1553 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1554fi
1555
Damien Miller61e50f12000-05-08 20:49:37 +10001556AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1557 ac_cv_have___ss_family_in_struct_ss, [
1558 AC_TRY_COMPILE(
1559 [
Damien Miller81171112000-04-23 11:14:01 +10001560#include <sys/types.h>
1561#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001562 ],
1563 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1564 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1565 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1566 )
1567])
1568if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1569 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1570fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001571
Damien Millerad833b32000-08-23 10:46:23 +10001572AC_CACHE_CHECK([for pw_class field in struct passwd],
1573 ac_cv_have_pw_class_in_struct_passwd, [
1574 AC_TRY_COMPILE(
1575 [
Damien Millerad833b32000-08-23 10:46:23 +10001576#include <pwd.h>
1577 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001578 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001579 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1580 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1581 )
1582])
1583if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1584 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1585fi
1586
Kevin Steves82456952001-06-22 21:14:18 +00001587AC_CACHE_CHECK([for pw_expire field in struct passwd],
1588 ac_cv_have_pw_expire_in_struct_passwd, [
1589 AC_TRY_COMPILE(
1590 [
1591#include <pwd.h>
1592 ],
1593 [ struct passwd p; p.pw_expire = 0; ],
1594 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1595 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1596 )
1597])
1598if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1599 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1600fi
1601
1602AC_CACHE_CHECK([for pw_change field in struct passwd],
1603 ac_cv_have_pw_change_in_struct_passwd, [
1604 AC_TRY_COMPILE(
1605 [
1606#include <pwd.h>
1607 ],
1608 [ struct passwd p; p.pw_change = 0; ],
1609 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1610 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1611 )
1612])
1613if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1614 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1615fi
Damien Miller61e50f12000-05-08 20:49:37 +10001616
Tim Rice28bbb0c2002-05-27 17:37:32 -07001617dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001618AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1619 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001620 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001621 [
Tim Riceae49fe62002-04-12 10:26:21 -07001622#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001623#include <sys/socket.h>
1624#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001625int main() {
1626#ifdef msg_accrights
1627exit(1);
1628#endif
1629struct msghdr m;
1630m.msg_accrights = 0;
1631exit(0);
1632}
Kevin Steves939c9db2002-03-22 17:23:25 +00001633 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001634 [ ac_cv_have_accrights_in_msghdr="yes" ],
1635 [ ac_cv_have_accrights_in_msghdr="no" ]
1636 )
1637])
1638if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1639 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1640fi
1641
Kevin Stevesa44e0352002-04-07 16:18:03 +00001642AC_CACHE_CHECK([for msg_control field in struct msghdr],
1643 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001644 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001645 [
Tim Riceae49fe62002-04-12 10:26:21 -07001646#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001647#include <sys/socket.h>
1648#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001649int main() {
1650#ifdef msg_control
1651exit(1);
1652#endif
1653struct msghdr m;
1654m.msg_control = 0;
1655exit(0);
1656}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001657 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001658 [ ac_cv_have_control_in_msghdr="yes" ],
1659 [ ac_cv_have_control_in_msghdr="no" ]
1660 )
1661])
1662if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1663 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1664fi
1665
Damien Miller61e50f12000-05-08 20:49:37 +10001666AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1667 AC_TRY_LINK([],
1668 [ extern char *__progname; printf("%s", __progname); ],
1669 [ ac_cv_libc_defines___progname="yes" ],
1670 [ ac_cv_libc_defines___progname="no" ]
1671 )
1672])
1673if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1674 AC_DEFINE(HAVE___PROGNAME)
1675fi
1676
Kevin Steves4846f4a2002-03-22 18:19:53 +00001677AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1678 AC_TRY_LINK([
1679#include <stdio.h>
1680],
1681 [ printf("%s", __FUNCTION__); ],
1682 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1683 [ ac_cv_cc_implements___FUNCTION__="no" ]
1684 )
1685])
1686if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1687 AC_DEFINE(HAVE___FUNCTION__)
1688fi
1689
1690AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1691 AC_TRY_LINK([
1692#include <stdio.h>
1693],
1694 [ printf("%s", __func__); ],
1695 [ ac_cv_cc_implements___func__="yes" ],
1696 [ ac_cv_cc_implements___func__="no" ]
1697 )
1698])
1699if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1700 AC_DEFINE(HAVE___func__)
1701fi
1702
Damien Miller4f8e6692001-07-14 13:22:53 +10001703AC_CACHE_CHECK([whether getopt has optreset support],
1704 ac_cv_have_getopt_optreset, [
1705 AC_TRY_LINK(
1706 [
1707#include <getopt.h>
1708 ],
1709 [ extern int optreset; optreset = 0; ],
1710 [ ac_cv_have_getopt_optreset="yes" ],
1711 [ ac_cv_have_getopt_optreset="no" ]
1712 )
1713])
1714if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1715 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1716fi
Damien Millera22ba012000-03-02 23:09:20 +11001717
Damien Millerecbb26d2000-07-15 14:59:14 +10001718AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1719 AC_TRY_LINK([],
1720 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1721 [ ac_cv_libc_defines_sys_errlist="yes" ],
1722 [ ac_cv_libc_defines_sys_errlist="no" ]
1723 )
1724])
1725if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1726 AC_DEFINE(HAVE_SYS_ERRLIST)
1727fi
1728
1729
Damien Miller11fa2cc2000-08-16 10:35:58 +10001730AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1731 AC_TRY_LINK([],
1732 [ extern int sys_nerr; printf("%i", sys_nerr);],
1733 [ ac_cv_libc_defines_sys_nerr="yes" ],
1734 [ ac_cv_libc_defines_sys_nerr="no" ]
1735 )
1736])
1737if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1738 AC_DEFINE(HAVE_SYS_NERR)
1739fi
1740
Damien Miller85de5802001-09-18 14:01:11 +10001741SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001742
1743# Check whether user wants sectok support
1744AC_ARG_WITH(sectok,
1745 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001746 [
1747 if test "x$withval" != "xno" ; then
1748 if test "x$withval" != "xyes" ; then
1749 CPPFLAGS="$CPPFLAGS -I${withval}"
1750 LDFLAGS="$LDFLAGS -L${withval}"
1751 if test ! -z "$need_dash_r" ; then
1752 LDFLAGS="$LDFLAGS -R${withval}"
1753 fi
1754 if test ! -z "$blibpath" ; then
1755 blibpath="$blibpath:${withval}"
1756 fi
1757 fi
1758 AC_CHECK_HEADERS(sectok.h)
1759 if test "$ac_cv_header_sectok_h" != yes; then
1760 AC_MSG_ERROR(Can't find sectok.h)
1761 fi
1762 AC_CHECK_LIB(sectok, sectok_open)
1763 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1764 AC_MSG_ERROR(Can't find libsectok)
1765 fi
1766 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001767 AC_DEFINE(USE_SECTOK)
1768 SCARD_MSG="yes, using sectok"
1769 fi
1770 ]
1771)
1772
1773# Check whether user wants OpenSC support
1774AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001775 AC_HELP_STRING([--with-opensc=PFX],
1776 [Enable smartcard support using OpenSC]),
1777 opensc_config_prefix="$withval", opensc_config_prefix="")
1778if test x$opensc_config_prefix != x ; then
1779 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1780 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1781 if test "$OPENSC_CONFIG" != "no"; then
1782 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1783 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1784 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1785 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1786 AC_DEFINE(SMARTCARD)
1787 AC_DEFINE(USE_OPENSC)
1788 SCARD_MSG="yes, using OpenSC"
1789 fi
1790fi
Damien Miller85de5802001-09-18 14:01:11 +10001791
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001792# Check whether user wants Kerberos 5 support
1793KRB5_MSG="no"
1794AC_ARG_WITH(kerberos5,
1795 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1796 [
1797 if test "x$withval" != "xno" ; then
1798 if test "x$withval" = "xyes" ; then
1799 KRB5ROOT="/usr/local"
1800 else
1801 KRB5ROOT=${withval}
1802 fi
1803 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1804 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1805 AC_DEFINE(KRB5)
1806 KRB5_MSG="yes"
1807 AC_MSG_CHECKING(whether we are using Heimdal)
1808 AC_TRY_COMPILE([ #include <krb5.h> ],
1809 [ char *tmp = heimdal_version; ],
1810 [ AC_MSG_RESULT(yes)
1811 AC_DEFINE(HEIMDAL)
1812 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1813 ],
1814 [ AC_MSG_RESULT(no)
1815 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1816 ]
1817 )
1818 if test ! -z "$need_dash_r" ; then
1819 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1820 fi
1821 if test ! -z "$blibpath" ; then
1822 blibpath="$blibpath:${KRB5ROOT}/lib"
1823 fi
1824 AC_CHECK_LIB(resolv, dn_expand, , )
1825
1826 KRB5=yes
1827 fi
1828 ]
1829)
1830# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001831KRB4_MSG="no"
1832AC_ARG_WITH(kerberos4,
1833 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1834 [
1835 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001836 if test "x$withval" != "xyes" ; then
1837 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1838 LDFLAGS="$LDFLAGS -L${withval}/lib"
1839 if test ! -z "$need_dash_r" ; then
1840 LDFLAGS="$LDFLAGS -R${withval}/lib"
1841 fi
1842 if test ! -z "$blibpath" ; then
1843 blibpath="$blibpath:${withval}/lib"
1844 fi
1845 else
1846 if test -d /usr/include/kerberosIV ; then
1847 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1848 fi
1849 fi
1850
1851 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001852 if test "$ac_cv_header_krb_h" != yes; then
1853 AC_MSG_WARN([Cannot find krb.h, build may fail])
1854 fi
Damien Miller98344742001-03-28 14:37:06 +10001855 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001856 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001857 AC_CHECK_LIB(krb4, main)
1858 if test "$ac_cv_lib_krb4_main" != yes; then
1859 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1860 else
1861 KLIBS="-lkrb4"
1862 fi
1863 else
1864 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001865 fi
Damien Miller98344742001-03-28 14:37:06 +10001866 AC_CHECK_LIB(des, des_cbc_encrypt)
1867 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1868 AC_CHECK_LIB(des425, des_cbc_encrypt)
1869 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1870 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1871 else
1872 KLIBS="-ldes425"
1873 fi
1874 else
1875 KLIBS="-ldes"
1876 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001877 AC_CHECK_LIB(resolv, dn_expand, , )
1878 KRB4=yes
1879 KRB4_MSG="yes"
1880 AC_DEFINE(KRB4)
1881 fi
1882 ]
1883)
1884
1885# Check whether user wants AFS support
1886AFS_MSG="no"
1887AC_ARG_WITH(afs,
1888 [ --with-afs=PATH Enable AFS support],
1889 [
1890 if test "x$withval" != "xno" ; then
1891
1892 if test "x$withval" != "xyes" ; then
1893 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1894 LDFLAGS="$LDFLAGS -L${withval}/lib"
1895 fi
1896
1897 if test -z "$KRB4" ; then
1898 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1899 fi
1900
1901 LIBS="-lkafs $LIBS"
1902 if test ! -z "$AFS_LIBS" ; then
1903 LIBS="$LIBS $AFS_LIBS"
1904 fi
1905 AC_DEFINE(AFS)
1906 AFS_MSG="yes"
1907 fi
1908 ]
1909)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001910LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001911
Damien Millera22ba012000-03-02 23:09:20 +11001912# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001913
Damien Millerf58c6722002-05-13 13:15:42 +10001914PRIVSEP_PATH=/var/empty
1915AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001916 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001917 [
1918 if test "x$withval" != "$no" ; then
1919 PRIVSEP_PATH=$withval
1920 fi
1921 ]
1922)
1923AC_SUBST(PRIVSEP_PATH)
1924
Damien Millera22ba012000-03-02 23:09:20 +11001925AC_ARG_WITH(xauth,
1926 [ --with-xauth=PATH Specify path to xauth program ],
1927 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001928 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001929 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001930 fi
1931 ],
1932 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001933 TestPath="$PATH"
1934 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1935 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1936 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1937 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1938 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001939 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001940 xauth_path="/usr/openwin/bin/xauth"
1941 fi
1942 ]
1943)
1944
Damien Miller7d901272003-01-13 16:55:22 +11001945STRIP_OPT=-s
1946AC_ARG_ENABLE(strip,
1947 [ --disable-strip Disable calling strip(1) on install],
1948 [
1949 if test "x$enableval" = "xno" ; then
1950 STRIP_OPT=
1951 fi
1952 ]
1953)
1954AC_SUBST(STRIP_OPT)
1955
Damien Millera19cf472000-11-29 13:28:50 +11001956if test -z "$xauth_path" ; then
1957 XAUTH_PATH="undefined"
1958 AC_SUBST(XAUTH_PATH)
1959else
Damien Millera22ba012000-03-02 23:09:20 +11001960 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001961 XAUTH_PATH=$xauth_path
1962 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001963fi
Damien Millera22ba012000-03-02 23:09:20 +11001964
1965# Check for mail directory (last resort if we cannot get it from headers)
1966if test ! -z "$MAIL" ; then
1967 maildir=`dirname $MAIL`
1968 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1969fi
1970
Damien Millera22ba012000-03-02 23:09:20 +11001971if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001972 if test "x$disable_ptmx_check" != "xyes" ; then
1973 AC_CHECK_FILE("/dev/ptmx",
1974 [
1975 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1976 have_dev_ptmx=1
1977 ]
1978 )
1979 fi
Damien Millera22ba012000-03-02 23:09:20 +11001980fi
Damien Miller204ad072000-03-02 23:56:12 +11001981AC_CHECK_FILE("/dev/ptc",
1982 [
1983 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1984 have_dev_ptc=1
1985 ]
1986)
1987
Damien Millera22ba012000-03-02 23:09:20 +11001988# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001989AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001990 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001991 [
Damien Miller897741e2001-04-16 10:41:46 +10001992 case "$withval" in
1993 man|cat|doc)
1994 MANTYPE=$withval
1995 ;;
1996 *)
1997 AC_MSG_ERROR(invalid man type: $withval)
1998 ;;
1999 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002000 ]
2001)
Ben Lindstrombc709922001-04-18 18:04:21 +00002002if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002003 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2004 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002005 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2006 MANTYPE=doc
2007 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2008 MANTYPE=man
2009 else
2010 MANTYPE=cat
2011 fi
2012fi
Damien Miller670a4b82000-01-22 13:53:11 +11002013AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002014if test "$MANTYPE" = "doc"; then
2015 mansubdir=man;
2016else
2017 mansubdir=$MANTYPE;
2018fi
2019AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002020
Damien Millera22ba012000-03-02 23:09:20 +11002021# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002022MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002023AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002024 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002025 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002026 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002027 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002028 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002029 fi
2030 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002031)
2032
Damien Millera22ba012000-03-02 23:09:20 +11002033# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002034AC_ARG_WITH(shadow,
2035 [ --without-shadow Disable shadow password support],
2036 [
2037 if test "x$withval" = "xno" ; then
2038 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002039 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002040 fi
2041 ]
2042)
2043
Damien Miller1f335fb2000-06-26 11:31:33 +10002044if test -z "$disable_shadow" ; then
2045 AC_MSG_CHECKING([if the systems has expire shadow information])
2046 AC_TRY_COMPILE(
2047 [
2048#include <sys/types.h>
2049#include <shadow.h>
2050 struct spwd sp;
2051 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2052 [ sp_expire_available=yes ], []
2053 )
2054
2055 if test "x$sp_expire_available" = "xyes" ; then
2056 AC_MSG_RESULT(yes)
2057 AC_DEFINE(HAS_SHADOW_EXPIRE)
2058 else
2059 AC_MSG_RESULT(no)
2060 fi
2061fi
2062
Damien Millera22ba012000-03-02 23:09:20 +11002063# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002064if test ! -z "$IPADDR_IN_DISPLAY" ; then
2065 DISPLAY_HACK_MSG="yes"
2066 AC_DEFINE(IPADDR_IN_DISPLAY)
2067else
2068 DISPLAY_HACK_MSG="no"
2069 AC_ARG_WITH(ipaddr-display,
2070 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2071 [
2072 if test "x$withval" != "xno" ; then
2073 AC_DEFINE(IPADDR_IN_DISPLAY)
2074 DISPLAY_HACK_MSG="yes"
2075 fi
2076 ]
2077 )
2078fi
Damien Miller76112de1999-12-21 11:18:08 +11002079
Tim Rice43a1c132002-04-17 21:19:14 -07002080dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2081if test $ac_cv_func_login_getcapbool = "yes" -a \
2082 $ac_cv_header_login_cap_h = "yes" ; then
2083 USES_LOGIN_CONF=yes
2084fi
Damien Millera22ba012000-03-02 23:09:20 +11002085# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002086SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002087AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002088 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002089 [
Tim Rice43a1c132002-04-17 21:19:14 -07002090 if test "$USES_LOGIN_CONF" = "yes" ; then
2091 AC_MSG_WARN([
2092--with-default-path=PATH has no effect on this system.
2093Edit /etc/login.conf instead.])
2094 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002095 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002096 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002097 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002098 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002099 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2100 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2101 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002102 AC_TRY_RUN(
2103 [
2104/* find out what STDPATH is */
2105#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002106#ifdef HAVE_PATHS_H
2107# include <paths.h>
2108#endif
2109#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002110# ifdef _PATH_USERPATH /* Irix */
2111# define _PATH_STDPATH _PATH_USERPATH
2112# else
2113# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2114# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002115#endif
2116#include <sys/types.h>
2117#include <sys/stat.h>
2118#include <fcntl.h>
2119#define DATA "conftest.stdpath"
2120
2121main()
2122{
2123 FILE *fd;
2124 int rc;
2125
2126 fd = fopen(DATA,"w");
2127 if(fd == NULL)
2128 exit(1);
2129
2130 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2131 exit(1);
2132
2133 exit(0);
2134}
2135 ], [ user_path=`cat conftest.stdpath` ],
2136 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2137 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2138 )
2139# make sure $bindir is in USER_PATH so scp will work
2140 t_bindir=`eval echo ${bindir}`
2141 case $t_bindir in
2142 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2143 esac
2144 case $t_bindir in
2145 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2146 esac
2147 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2148 if test $? -ne 0 ; then
2149 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2150 if test $? -ne 0 ; then
2151 user_path=$user_path:$t_bindir
2152 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2153 fi
2154 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002155 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002156)
Tim Rice43a1c132002-04-17 21:19:14 -07002157if test "$USES_LOGIN_CONF" != "yes" ; then
2158 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2159 AC_SUBST(user_path)
2160fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002161
Damien Millera18bbd32002-05-13 10:48:57 +10002162# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002163AC_ARG_WITH(superuser-path,
2164 [ --with-superuser-path= Specify different path for super-user],
2165 [
2166 if test "x$withval" != "xno" ; then
2167 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2168 superuser_path=$withval
2169 fi
2170 ]
2171)
2172
2173
Damien Millera22ba012000-03-02 23:09:20 +11002174# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002175IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002176AC_ARG_WITH(ipv4-default,
2177 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2178 [
2179 if test "x$withval" != "xno" ; then
2180 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002181 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002182 fi
2183 ]
2184)
2185
Damien Miller61e50f12000-05-08 20:49:37 +10002186AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002187IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002188AC_ARG_WITH(4in6,
2189 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2190 [
2191 if test "x$withval" != "xno" ; then
2192 AC_MSG_RESULT(yes)
2193 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002194 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002195 else
2196 AC_MSG_RESULT(no)
2197 fi
2198 ],[
2199 if test "x$inet6_default_4in6" = "xyes"; then
2200 AC_MSG_RESULT([yes (default)])
2201 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002202 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002203 else
2204 AC_MSG_RESULT([no (default)])
2205 fi
2206 ]
2207)
2208
Damien Miller60396b02001-02-18 17:01:00 +11002209# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002210BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002211AC_ARG_WITH(bsd-auth,
2212 [ --with-bsd-auth Enable BSD auth support],
2213 [
2214 if test "x$withval" != "xno" ; then
2215 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002216 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002217 fi
2218 ]
2219)
2220
Damien Millera22ba012000-03-02 23:09:20 +11002221# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002222piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002223# make sure the directory exists
2224if test ! -d $piddir ; then
2225 piddir=`eval echo ${sysconfdir}`
2226 case $piddir in
2227 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2228 esac
2229fi
2230
Tim Rice88f2ab52002-03-17 12:17:34 -08002231AC_ARG_WITH(pid-dir,
2232 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2233 [
2234 if test "x$withval" != "xno" ; then
2235 piddir=$withval
2236 if test ! -d $piddir ; then
2237 AC_MSG_WARN([** no $piddir directory on this system **])
2238 fi
2239 fi
2240 ]
2241)
2242
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002243AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002244AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002245
andre2ff7b5d2000-06-03 14:57:40 +00002246dnl allow user to disable some login recording features
2247AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002248 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002249 [ AC_DEFINE(DISABLE_LASTLOG) ]
2250)
2251AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002252 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002253 [ AC_DEFINE(DISABLE_UTMP) ]
2254)
2255AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002256 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002257 [ AC_DEFINE(DISABLE_UTMPX) ]
2258)
2259AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002260 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002261 [ AC_DEFINE(DISABLE_WTMP) ]
2262)
2263AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002264 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002265 [ AC_DEFINE(DISABLE_WTMPX) ]
2266)
2267AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002268 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002269 [ AC_DEFINE(DISABLE_LOGIN) ]
2270)
2271AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002272 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002273 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2274)
2275AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002276 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002277 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2278)
2279AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002280 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002281 [
2282 if test "x$withval" = "xno" ; then
2283 AC_DEFINE(DISABLE_LASTLOG)
2284 else
2285 conf_lastlog_location=$withval
2286 fi
2287 ]
2288)
andre2ff7b5d2000-06-03 14:57:40 +00002289
2290dnl lastlog, [uw]tmpx? detection
2291dnl NOTE: set the paths in the platform section to avoid the
2292dnl need for command-line parameters
2293dnl lastlog and [uw]tmp are subject to a file search if all else fails
2294
2295dnl lastlog detection
2296dnl NOTE: the code itself will detect if lastlog is a directory
2297AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2298AC_TRY_COMPILE([
2299#include <sys/types.h>
2300#include <utmp.h>
2301#ifdef HAVE_LASTLOG_H
2302# include <lastlog.h>
2303#endif
Damien Miller2994e082000-06-04 15:51:47 +10002304#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002305# include <paths.h>
2306#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002307#ifdef HAVE_LOGIN_H
2308# include <login.h>
2309#endif
andre2ff7b5d2000-06-03 14:57:40 +00002310 ],
2311 [ char *lastlog = LASTLOG_FILE; ],
2312 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002313 [
2314 AC_MSG_RESULT(no)
2315 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2316 AC_TRY_COMPILE([
2317#include <sys/types.h>
2318#include <utmp.h>
2319#ifdef HAVE_LASTLOG_H
2320# include <lastlog.h>
2321#endif
2322#ifdef HAVE_PATHS_H
2323# include <paths.h>
2324#endif
2325 ],
2326 [ char *lastlog = _PATH_LASTLOG; ],
2327 [ AC_MSG_RESULT(yes) ],
2328 [
andree441aa32000-06-12 22:34:38 +00002329 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002330 system_lastlog_path=no
2331 ])
2332 ]
andre2ff7b5d2000-06-03 14:57:40 +00002333)
Damien Miller2994e082000-06-04 15:51:47 +10002334
andre2ff7b5d2000-06-03 14:57:40 +00002335if test -z "$conf_lastlog_location"; then
2336 if test x"$system_lastlog_path" = x"no" ; then
2337 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002338 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002339 conf_lastlog_location=$f
2340 fi
2341 done
2342 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002343 AC_MSG_WARN([** Cannot find lastlog **])
2344 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002345 fi
2346 fi
2347fi
2348
2349if test -n "$conf_lastlog_location"; then
2350 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2351fi
2352
2353dnl utmp detection
2354AC_MSG_CHECKING([if your system defines UTMP_FILE])
2355AC_TRY_COMPILE([
2356#include <sys/types.h>
2357#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002358#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002359# include <paths.h>
2360#endif
2361 ],
2362 [ char *utmp = UTMP_FILE; ],
2363 [ AC_MSG_RESULT(yes) ],
2364 [ AC_MSG_RESULT(no)
2365 system_utmp_path=no ]
2366)
2367if test -z "$conf_utmp_location"; then
2368 if test x"$system_utmp_path" = x"no" ; then
2369 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2370 if test -f $f ; then
2371 conf_utmp_location=$f
2372 fi
2373 done
2374 if test -z "$conf_utmp_location"; then
2375 AC_DEFINE(DISABLE_UTMP)
2376 fi
2377 fi
2378fi
2379if test -n "$conf_utmp_location"; then
2380 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2381fi
2382
2383dnl wtmp detection
2384AC_MSG_CHECKING([if your system defines WTMP_FILE])
2385AC_TRY_COMPILE([
2386#include <sys/types.h>
2387#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002388#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002389# include <paths.h>
2390#endif
2391 ],
2392 [ char *wtmp = WTMP_FILE; ],
2393 [ AC_MSG_RESULT(yes) ],
2394 [ AC_MSG_RESULT(no)
2395 system_wtmp_path=no ]
2396)
2397if test -z "$conf_wtmp_location"; then
2398 if test x"$system_wtmp_path" = x"no" ; then
2399 for f in /usr/adm/wtmp /var/log/wtmp; do
2400 if test -f $f ; then
2401 conf_wtmp_location=$f
2402 fi
2403 done
2404 if test -z "$conf_wtmp_location"; then
2405 AC_DEFINE(DISABLE_WTMP)
2406 fi
2407 fi
2408fi
2409if test -n "$conf_wtmp_location"; then
2410 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2411fi
2412
2413
2414dnl utmpx detection - I don't know any system so perverse as to require
2415dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2416dnl there, though.
2417AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2418AC_TRY_COMPILE([
2419#include <sys/types.h>
2420#include <utmp.h>
2421#ifdef HAVE_UTMPX_H
2422#include <utmpx.h>
2423#endif
Damien Miller2994e082000-06-04 15:51:47 +10002424#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002425# include <paths.h>
2426#endif
2427 ],
2428 [ char *utmpx = UTMPX_FILE; ],
2429 [ AC_MSG_RESULT(yes) ],
2430 [ AC_MSG_RESULT(no)
2431 system_utmpx_path=no ]
2432)
2433if test -z "$conf_utmpx_location"; then
2434 if test x"$system_utmpx_path" = x"no" ; then
2435 AC_DEFINE(DISABLE_UTMPX)
2436 fi
2437else
2438 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2439fi
2440
2441dnl wtmpx detection
2442AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2443AC_TRY_COMPILE([
2444#include <sys/types.h>
2445#include <utmp.h>
2446#ifdef HAVE_UTMPX_H
2447#include <utmpx.h>
2448#endif
Damien Miller2994e082000-06-04 15:51:47 +10002449#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002450# include <paths.h>
2451#endif
2452 ],
2453 [ char *wtmpx = WTMPX_FILE; ],
2454 [ AC_MSG_RESULT(yes) ],
2455 [ AC_MSG_RESULT(no)
2456 system_wtmpx_path=no ]
2457)
2458if test -z "$conf_wtmpx_location"; then
2459 if test x"$system_wtmpx_path" = x"no" ; then
2460 AC_DEFINE(DISABLE_WTMPX)
2461 fi
2462else
2463 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2464fi
2465
Damien Miller4018c192000-04-30 09:30:44 +10002466
Damien Miller29ea30d2000-03-17 10:54:15 +11002467if test ! -z "$blibpath" ; then
2468 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2469 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2470fi
2471
Tim Rice4cec93f2002-02-26 08:40:48 -08002472dnl remove pam and dl because they are in $LIBPAM
2473if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002474 LIBS=`echo $LIBS | sed 's/-lpam //'`
2475fi
2476if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2477 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002478fi
2479
Damien Millerbac2d8a2000-09-05 16:13:06 +11002480AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002481AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2482AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002483
Damien Miller7b22d652000-06-18 14:07:04 +10002484# Print summary of options
2485
Damien Miller7b22d652000-06-18 14:07:04 +10002486# Someone please show me a better way :)
2487A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2488B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2489C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2490D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002491E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002492F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002493G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002494H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2495I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2496J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002497
2498echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002499echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002500echo " User binaries: $B"
2501echo " System binaries: $C"
2502echo " Configuration files: $D"
2503echo " Askpass program: $E"
2504echo " Manual pages: $F"
2505echo " PID file: $G"
2506echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002507if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002508echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002509else
Damien Millerf58c6722002-05-13 13:15:42 +10002510echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002511fi
Damien Millera18bbd32002-05-13 10:48:57 +10002512if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002513echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002514fi
Damien Millerf58c6722002-05-13 13:15:42 +10002515echo " Manpage format: $MANTYPE"
2516echo " PAM support: ${PAM_MSG}"
2517echo " KerberosIV support: $KRB4_MSG"
2518echo " KerberosV support: $KRB5_MSG"
2519echo " Smartcard support: $SCARD_MSG"
2520echo " AFS support: $AFS_MSG"
2521echo " S/KEY support: $SKEY_MSG"
2522echo " TCP Wrappers support: $TCPW_MSG"
2523echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002524echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002525echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2526echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2527echo " BSD Auth support: $BSD_AUTH_MSG"
2528echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002529if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002530echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002531fi
2532
Damien Miller7b22d652000-06-18 14:07:04 +10002533echo ""
2534
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002535echo " Host: ${host}"
2536echo " Compiler: ${CC}"
2537echo " Compiler flags: ${CFLAGS}"
2538echo "Preprocessor flags: ${CPPFLAGS}"
2539echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002540echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002541
2542echo ""
2543
Damien Miller82cf0ce2000-12-20 13:34:48 +11002544if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002545 echo "PAM is enabled. You may need to install a PAM control file "
2546 echo "for sshd, otherwise password authentication may fail. "
2547 echo "Example PAM control files can be found in the contrib/ "
2548 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002549 echo ""
2550fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002551
2552if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002553 echo "sftp-server will be disabled. Your compiler does not "
2554 echo "support 64bit integers."
2555 echo ""
2556fi
2557
2558if test ! -z "$RAND_HELPER_CMDHASH" ; then
2559 echo "WARNING: you are using the builtin random number collection "
2560 echo "service. Please read WARNING.RNG and request that your OS "
2561 echo "vendor includes kernel-based random number collection in "
2562 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002563 echo ""
2564fi
Damien Miller60396b02001-02-18 17:01:00 +11002565