blob: 3469af2f4cce70afe27bf4b9e89999005a6d4714 [file] [log] [blame]
Damien Miller933cc8f2003-03-10 11:38:10 +11001# $Id: configure.ac,v 1.110 2003/03/10 00:38:10 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*)
Damien Millerc8936ac2003-02-11 10:04:03 +110089 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -080090 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110091 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000092 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110093 AC_DEFINE(DISABLE_SHADOW)
94 AC_DEFINE(IPV4_DEFAULT)
95 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000096 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000097 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -070098 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +000099 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100100 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000101*-*-dgux*)
102 AC_DEFINE(IP_TOS_IS_BROKEN)
103 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000104*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000105 AC_MSG_CHECKING(if we have working getaddrinfo)
106 AC_TRY_RUN([#include <mach-o/dyld.h>
107main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
108 exit(0);
109 else
110 exit(1);
111}], [AC_MSG_RESULT(working)],
112 [AC_MSG_RESULT(buggy)
113 AC_DEFINE(BROKEN_GETADDRINFO)],
114 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000115 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000116*-*-hpux10.26)
117 if test -z "$GCC"; then
118 CFLAGS="$CFLAGS -Ae"
119 fi
120 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
121 IPADDR_IN_DISPLAY=yes
122 AC_DEFINE(HAVE_SECUREWARE)
123 AC_DEFINE(USE_PIPES)
124 AC_DEFINE(LOGIN_NO_ENDOPT)
125 AC_DEFINE(LOGIN_NEEDS_UTMPX)
126 AC_DEFINE(DISABLE_SHADOW)
127 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100128 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700129 LIBS="$LIBS -lsec -lsecpw"
130 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000131 disable_ptmx_check=yes
132 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100133*-*-hpux10*)
134 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000135 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100136 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000137 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100138 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000139 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100142 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100143 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100144 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700145 LIBS="$LIBS -lsec"
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100147 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000148*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000149 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100150 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100151 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100152 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000153 AC_DEFINE(LOGIN_NO_ENDOPT)
154 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100155 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100156 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100157 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700158 LIBS="$LIBS -lsec"
159 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000160 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100161*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000162 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000163 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100164 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000165 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000166 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100167 ;;
168*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000169 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000170 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100171 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000172 AC_DEFINE(WITH_IRIX_ARRAY)
173 AC_DEFINE(WITH_IRIX_PROJECT)
174 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000175 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000176 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000177 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100178 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100179*-*-linux*)
180 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100181 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100182 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000183 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100184 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
185 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100186 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100187 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000188mips-sony-bsd|mips-sony-newsos4)
189 AC_DEFINE(HAVE_NEWS4)
190 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000191 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100192*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000193 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100194 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100195 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100196*-*-freebsd*)
197 check_for_libcrypt_later=1
198 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000199*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000200 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100201 conf_utmp_location=/etc/utmp
202 conf_wtmp_location=/usr/adm/wtmp
203 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000204 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000205 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000206 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100207 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000209 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000210 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100211*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000213 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100214 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100215 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000216 AC_DEFINE(LOGIN_NEEDS_UTMPX)
217 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000218 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller933cc8f2003-03-10 11:38:10 +1100219 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000220 # hardwire lastlog location (can't detect it on some versions)
221 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000222 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
223 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
224 if test "$sol2ver" -ge 8; then
225 AC_MSG_RESULT(yes)
226 AC_DEFINE(DISABLE_UTMP)
227 AC_DEFINE(DISABLE_WTMP)
228 else
229 AC_MSG_RESULT(no)
230 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100231 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000232*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000233 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000234 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100235 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000236 conf_utmp_location=/etc/utmp
237 conf_wtmp_location=/var/adm/wtmp
238 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000239 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000240 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000241*-ncr-sysv*)
242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700244 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000245 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000246 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000247*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000248 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700249 # /usr/ucblib MUST NOT be searched on ReliantUNIX
250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100251 IPADDR_IN_DISPLAY=yes
252 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000253 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700254 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
255 # Attention: always take care to bind libsocket and libnsl before libc,
256 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000257 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100258*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000259 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100260 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100261 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100262 ;;
263*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000264 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100265 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100266 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100267 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100268*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000269 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100270 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100271 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100272*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000273 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700275 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100276 RANLIB=true
277 no_dev_ptmx=1
278 AC_DEFINE(BROKEN_SYS_TERMIO_H)
279 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000280 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000281 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100282 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100283 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700284 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700285 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100286 ;;
287*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800288 if test -z "$GCC"; then
289 CFLAGS="$CFLAGS -belf"
290 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000291 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000292 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100293 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000294 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100295 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000296 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000297 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700298 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100299 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700300 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000301 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000302*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000303 AC_DEFINE(USE_PIPES)
304 AC_DEFINE(DISABLE_FD_PASSING)
305 LDFLAGS="$LDFLAGS"
306 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
307 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000308 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000309*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000310 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700311 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700312 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000313 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
314 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
315 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700316 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000317*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000318 AC_MSG_CHECKING(for Digital Unix SIA)
319 no_osfsia=""
320 AC_ARG_WITH(osfsia,
321 [ --with-osfsia Enable Digital Unix SIA],
322 [
323 if test "x$withval" = "xno" ; then
324 AC_MSG_RESULT(disabled)
325 no_osfsia=1
326 fi
327 ],
328 )
329 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000330 if test -f /etc/sia/matrix.conf; then
331 AC_MSG_RESULT(yes)
332 AC_DEFINE(HAVE_OSF_SIA)
333 AC_DEFINE(DISABLE_LOGIN)
334 LIBS="$LIBS -lsecurity -ldb -lm -laud"
335 else
336 AC_MSG_RESULT(no)
337 fi
338 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000339 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000340 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000341
342*-*-nto-qnx)
343 AC_DEFINE(USE_PIPES)
344 AC_DEFINE(NO_X11_UNIX_SOCKETS)
345 AC_DEFINE(MISSING_NFDBITS)
346 AC_DEFINE(MISSING_HOWMANY)
347 AC_DEFINE(MISSING_FD_MASK)
348 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100349esac
350
Damien Millere37bfc12000-06-05 09:37:43 +1000351# Allow user to specify flags
352AC_ARG_WITH(cflags,
353 [ --with-cflags Specify additional flags to pass to compiler],
354 [
355 if test "x$withval" != "xno" ; then
356 CFLAGS="$CFLAGS $withval"
357 fi
358 ]
359)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000360AC_ARG_WITH(cppflags,
361 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
362 [
363 if test "x$withval" != "xno"; then
364 CPPFLAGS="$CPPFLAGS $withval"
365 fi
366 ]
367)
Damien Millere37bfc12000-06-05 09:37:43 +1000368AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000369 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000370 [
371 if test "x$withval" != "xno" ; then
372 LDFLAGS="$LDFLAGS $withval"
373 fi
374 ]
375)
376AC_ARG_WITH(libs,
377 [ --with-libs Specify additional libraries to link with],
378 [
379 if test "x$withval" != "xno" ; then
380 LIBS="$LIBS $withval"
381 fi
382 ]
383)
384
Tim Rice4cec93f2002-02-26 08:40:48 -0800385# Checks for header files.
386AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100387 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800388 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000389 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000390 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800391 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100392 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000393 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700394 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800395 util.h utime.h utmp.h utmpx.h)
396
Damien Millera22ba012000-03-02 23:09:20 +1100397# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700398AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
399AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000400
Damien Millerdf288022001-02-18 13:07:07 +1100401dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700402if test "x$with_tcp_wrappers" != "xno" ; then
403 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
404 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
405 fi
406fi
Damien Millerdf288022001-02-18 13:07:07 +1100407
Tim Rice13aae5e2001-10-21 17:53:58 -0700408AC_CHECK_FUNC(getspnam, ,
409 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700410
Damien Miller150c8b52002-02-13 23:06:56 +1100411AC_ARG_WITH(rpath,
412 [ --without-rpath Disable auto-added -R linker paths],
413 [
414 if test "x$withval" = "xno" ; then
415 need_dash_r=""
416 fi
417 if test "x$withval" = "xyes" ; then
418 need_dash_r=1
419 fi
420 ]
421)
422
Tim Rice13aae5e2001-10-21 17:53:58 -0700423dnl zlib is required
424AC_ARG_WITH(zlib,
425 [ --with-zlib=PATH Use zlib in PATH],
426 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000427 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100428 AC_MSG_ERROR([*** zlib is required ***])
429 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700430 if test -d "$withval/lib"; then
431 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700432 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700433 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700434 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700435 fi
436 else
437 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700438 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700439 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700440 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700441 fi
442 fi
443 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700444 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700445 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700446 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700447 fi
448 ]
449)
450
Tim Rice17b93e52001-10-23 22:36:54 -0700451AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100452
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000453dnl UnixWare 2.x
454AC_CHECK_FUNC(strcasecmp,
455 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
456)
457AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700458 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
459 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000460)
Damien Millerab18c411999-11-11 10:40:23 +1100461
Tim Ricee589a292001-11-03 11:09:32 -0800462dnl Checks for libutil functions
463AC_CHECK_HEADERS(libutil.h)
464AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
465AC_CHECK_FUNCS(logout updwtmp logwtmp)
466
Ben Lindstrom8697e082001-02-24 21:41:10 +0000467AC_FUNC_STRFTIME
468
Damien Miller3c027682001-03-14 11:39:45 +1100469# Check for ALTDIRFUNC glob() extension
470AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
471AC_EGREP_CPP(FOUNDIT,
472 [
473 #include <glob.h>
474 #ifdef GLOB_ALTDIRFUNC
475 FOUNDIT
476 #endif
477 ],
478 [
479 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
480 AC_MSG_RESULT(yes)
481 ],
482 [
483 AC_MSG_RESULT(no)
484 ]
485)
Damien Millerab18c411999-11-11 10:40:23 +1100486
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000487# Check for g.gl_matchc glob() extension
488AC_MSG_CHECKING(for gl_matchc field in glob_t)
489AC_EGREP_CPP(FOUNDIT,
490 [
491 #include <glob.h>
492 int main(void){glob_t g; g.gl_matchc = 1;}
493 ],
494 [
495 AC_DEFINE(GLOB_HAS_GL_MATCHC)
496 AC_MSG_RESULT(yes)
497 ],
498 [
499 AC_MSG_RESULT(no)
500 ]
501)
502
Damien Miller18bb4732001-03-28 14:35:30 +1000503AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
504AC_TRY_RUN(
505 [
506#include <sys/types.h>
507#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700508int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000509 ],
510 [AC_MSG_RESULT(yes)],
511 [
512 AC_MSG_RESULT(no)
513 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
514 ]
515)
516
Damien Millerc547bf12001-02-16 10:18:12 +1100517# Check whether user wants S/Key support
518SKEY_MSG="no"
519AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700520 [ --with-skey[[=PATH]] Enable S/Key support
521 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100522 [
523 if test "x$withval" != "xno" ; then
524
525 if test "x$withval" != "xyes" ; then
526 CPPFLAGS="$CPPFLAGS -I${withval}/include"
527 LDFLAGS="$LDFLAGS -L${withval}/lib"
528 fi
529
530 AC_DEFINE(SKEY)
531 LIBS="-lskey $LIBS"
532 SKEY_MSG="yes"
533
Tim Rice4cec93f2002-02-26 08:40:48 -0800534 AC_MSG_CHECKING([for s/key support])
535 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100536 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800537#include <stdio.h>
538#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700539int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800540 ],
541 [AC_MSG_RESULT(yes)],
542 [
543 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100544 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
545 ])
546 fi
547 ]
548)
549
550# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700551TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100552AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700553 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
554 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100555 [
556 if test "x$withval" != "xno" ; then
557 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 saved_LDFLAGS="$LDFLAGS"
559 saved_CPPFLAGS="$CPPFLAGS"
560 if test -n "${withval}" -a "${withval}" != "yes"; then
561 if test -d "${withval}/lib"; then
562 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700563 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700564 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700565 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700566 fi
567 else
568 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700569 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700570 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700571 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700572 fi
573 fi
574 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700575 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700576 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700577 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700578 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700579 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800580 LIBWRAP="-lwrap"
581 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100582 AC_MSG_CHECKING(for libwrap)
583 AC_TRY_LINK(
584 [
585#include <tcpd.h>
586 int deny_severity = 0, allow_severity = 0;
587 ],
588 [hosts_access(0);],
589 [
590 AC_MSG_RESULT(yes)
591 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800592 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700593 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100594 ],
595 [
596 AC_MSG_ERROR([*** libwrap missing])
597 ]
598 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800599 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100600 fi
601 ]
602)
603
Damien Millerfe1f1432003-02-24 15:45:42 +1100604dnl Checks for library functions. Please keep in alphabetical order
605AC_CHECK_FUNCS(\
606 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
607 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
608 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
609 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
610 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
611 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
612 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
613 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
614 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
615 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
616 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
617)
Tim Rice13aae5e2001-10-21 17:53:58 -0700618
Damien Millercd6853c2003-01-28 11:33:42 +1100619AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
620
Ben Lindstrom3e006472002-10-16 00:24:03 +0000621dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
622AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
623
Tim Rice13aae5e2001-10-21 17:53:58 -0700624dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700625AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 AC_CHECK_LIB(gen, dirname,[
627 AC_CACHE_CHECK([for broken dirname],
628 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700629 save_LIBS="$LIBS"
630 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700631 AC_TRY_RUN(
632 [
633#include <libgen.h>
634#include <string.h>
635
636int main(int argc, char **argv) {
637 char *s, buf[32];
638
639 strncpy(buf,"/etc", 32);
640 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700641 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700642 exit(1);
643 } else {
644 exit(0);
645 }
646}
647 ],
648 [ ac_cv_have_broken_dirname="no" ],
649 [ ac_cv_have_broken_dirname="yes" ]
650 )
Tim Rice17b93e52001-10-23 22:36:54 -0700651 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700652 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700653 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700654 LIBS="$LIBS -lgen"
655 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700656 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700657 fi
658 ])
659])
660
Damien Millerad833b32000-08-23 10:46:23 +1000661dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000662AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000663dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000664AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000665AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000666dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000667AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000668AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100669
Damien Miller04f80141999-11-19 15:32:34 +1100670AC_CHECK_FUNC(daemon,
671 [AC_DEFINE(HAVE_DAEMON)],
672 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
673)
674
Damien Miller9fb07e42000-03-05 16:22:59 +1100675AC_CHECK_FUNC(getpagesize,
676 [AC_DEFINE(HAVE_GETPAGESIZE)],
677 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
678)
679
Damien Millercb170cb2000-07-01 16:52:55 +1000680# Check for broken snprintf
681if test "x$ac_cv_func_snprintf" = "xyes" ; then
682 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
683 AC_TRY_RUN(
684 [
685#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700686int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000687 ],
688 [AC_MSG_RESULT(yes)],
689 [
690 AC_MSG_RESULT(no)
691 AC_DEFINE(BROKEN_SNPRINTF)
692 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
693 ]
694 )
695fi
696
Damien Millere8328192003-01-07 15:18:32 +1100697dnl see whether mkstemp() requires XXXXXX
698if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
699AC_MSG_CHECKING([for (overly) strict mkstemp])
700AC_TRY_RUN(
701 [
702#include <stdlib.h>
703main() { char template[]="conftest.mkstemp-test";
704if (mkstemp(template) == -1)
705 exit(1);
706unlink(template); exit(0);
707}
708 ],
709 [
710 AC_MSG_RESULT(no)
711 ],
712 [
713 AC_MSG_RESULT(yes)
714 AC_DEFINE(HAVE_STRICT_MKSTEMP)
715 ],
716 [
717 AC_MSG_RESULT(yes)
718 AC_DEFINE(HAVE_STRICT_MKSTEMP)
719 ]
720)
721fi
722
Damien Miller606f8802000-09-16 15:39:56 +1100723AC_FUNC_GETPGRP
724
Damien Millera64b57a2001-01-17 10:44:13 +1100725# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000726PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100727AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100728 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100729 [
Damien Millera64b57a2001-01-17 10:44:13 +1100730 if test "x$withval" != "xno" ; then
731 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
732 AC_MSG_ERROR([PAM headers not found])
733 fi
734
735 AC_CHECK_LIB(dl, dlopen, , )
736 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
737 AC_CHECK_FUNCS(pam_getenvlist)
738
739 disable_shadow=yes
740 PAM_MSG="yes"
741
742 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800743 if test $ac_cv_lib_dl_dlopen = yes; then
744 LIBPAM="-lpam -ldl"
745 else
746 LIBPAM="-lpam"
747 fi
748 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100749 fi
750 ]
751)
Damien Millera22ba012000-03-02 23:09:20 +1100752
Damien Millera64b57a2001-01-17 10:44:13 +1100753# Check for older PAM
754if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100755 # Check PAM strerror arguments (old PAM)
756 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
757 AC_TRY_COMPILE(
758 [
Damien Miller81171112000-04-23 11:14:01 +1000759#include <stdlib.h>
760#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100761 ],
762 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
763 [AC_MSG_RESULT(no)],
764 [
765 AC_DEFINE(HAVE_OLD_PAM)
766 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000767 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100768 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100769 )
Damien Millera22ba012000-03-02 23:09:20 +1100770fi
771
Damien Millerfc93d4b2002-09-04 23:26:29 +1000772# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
773# because the system crypt() is more featureful.
774if test "x$check_for_libcrypt_before" = "x1"; then
775 AC_CHECK_LIB(crypt, crypt)
776fi
777
Tim Riceaef73712002-05-11 13:17:42 -0700778# Search for OpenSSL
779saved_CPPFLAGS="$CPPFLAGS"
780saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100781AC_ARG_WITH(ssl-dir,
782 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
783 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000784 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700785 if test -d "$withval/lib"; then
786 if test -n "${need_dash_r}"; then
787 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
788 else
789 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
790 fi
791 else
792 if test -n "${need_dash_r}"; then
793 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
794 else
795 LDFLAGS="-L${withval} ${LDFLAGS}"
796 fi
797 fi
798 if test -d "$withval/include"; then
799 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
800 else
801 CPPFLAGS="-I${withval} ${CPPFLAGS}"
802 fi
Damien Millera22ba012000-03-02 23:09:20 +1100803 fi
804 ]
805)
Tim Riceaef73712002-05-11 13:17:42 -0700806LIBS="$LIBS -lcrypto"
807AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000808 [
Tim Riceaef73712002-05-11 13:17:42 -0700809 dnl Check default openssl install dir
810 if test -n "${need_dash_r}"; then
811 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000812 else
Tim Riceaef73712002-05-11 13:17:42 -0700813 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000814 fi
Tim Riceaef73712002-05-11 13:17:42 -0700815 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
816 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
817 [
818 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
819 ]
820 )
821 ]
822)
823
Tim Riced730b782002-08-13 18:52:10 -0700824# Determine OpenSSL header version
825AC_MSG_CHECKING([OpenSSL header version])
826AC_TRY_RUN(
827 [
828#include <stdio.h>
829#include <string.h>
830#include <openssl/opensslv.h>
831#define DATA "conftest.sslincver"
832int main(void) {
833 FILE *fd;
834 int rc;
835
836 fd = fopen(DATA,"w");
837 if(fd == NULL)
838 exit(1);
839
840 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
841 exit(1);
842
843 exit(0);
844}
845 ],
846 [
847 ssl_header_ver=`cat conftest.sslincver`
848 AC_MSG_RESULT($ssl_header_ver)
849 ],
850 [
851 AC_MSG_RESULT(not found)
852 AC_MSG_ERROR(OpenSSL version header not found.)
853 ]
854)
855
856# Determine OpenSSL library version
857AC_MSG_CHECKING([OpenSSL library version])
858AC_TRY_RUN(
859 [
860#include <stdio.h>
861#include <string.h>
862#include <openssl/opensslv.h>
863#include <openssl/crypto.h>
864#define DATA "conftest.ssllibver"
865int main(void) {
866 FILE *fd;
867 int rc;
868
869 fd = fopen(DATA,"w");
870 if(fd == NULL)
871 exit(1);
872
873 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
874 exit(1);
875
876 exit(0);
877}
878 ],
879 [
880 ssl_library_ver=`cat conftest.ssllibver`
881 AC_MSG_RESULT($ssl_library_ver)
882 ],
883 [
884 AC_MSG_RESULT(not found)
885 AC_MSG_ERROR(OpenSSL library not found.)
886 ]
887)
Damien Millera22ba012000-03-02 23:09:20 +1100888
Damien Millerec932372002-01-22 22:16:03 +1100889# Sanity check OpenSSL headers
890AC_MSG_CHECKING([whether OpenSSL's headers match the library])
891AC_TRY_RUN(
892 [
893#include <string.h>
894#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700895int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100896 ],
897 [
898 AC_MSG_RESULT(yes)
899 ],
900 [
901 AC_MSG_RESULT(no)
902 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
903 ]
904)
905
Damien Millera64b57a2001-01-17 10:44:13 +1100906# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
907# version in OpenSSL. Skip this for PAM
908if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100909 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100910fi
911
Damien Miller6c21c512002-01-22 21:57:53 +1100912
913### Configure cryptographic random number support
914
915# Check wheter OpenSSL seeds itself
916AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
917AC_TRY_RUN(
918 [
919#include <string.h>
920#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700921int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100922 ],
923 [
924 OPENSSL_SEEDS_ITSELF=yes
925 AC_MSG_RESULT(yes)
926 ],
927 [
928 AC_MSG_RESULT(no)
929 # Default to use of the rand helper if OpenSSL doesn't
930 # seed itself
931 USE_RAND_HELPER=yes
932 ]
933)
934
935
936# Do we want to force the use of the rand helper?
937AC_ARG_WITH(rand-helper,
938 [ --with-rand-helper Use subprocess to gather strong randomness ],
939 [
940 if test "x$withval" = "xno" ; then
941 # Force use of OpenSSL's internal RNG, even if
942 # the previous test showed it to be unseeded.
943 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
944 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
945 OPENSSL_SEEDS_ITSELF=yes
946 USE_RAND_HELPER=""
947 fi
948 else
949 USE_RAND_HELPER=yes
950 fi
951 ],
952)
953
954# Which randomness source do we use?
955if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
956 # OpenSSL only
957 AC_DEFINE(OPENSSL_PRNG_ONLY)
958 RAND_MSG="OpenSSL internal ONLY"
959 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800960elif test ! -z "$USE_RAND_HELPER" ; then
961 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100962 RAND_MSG="ssh-rand-helper"
963 INSTALL_SSH_RAND_HELPER="yes"
964fi
965AC_SUBST(INSTALL_SSH_RAND_HELPER)
966
967### Configuration of ssh-rand-helper
968
969# PRNGD TCP socket
970AC_ARG_WITH(prngd-port,
971 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
972 [
Damien Millere996d722002-01-23 11:20:59 +1100973 case "$withval" in
974 no)
975 withval=""
976 ;;
977 [[0-9]]*)
978 ;;
979 *)
980 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
981 ;;
982 esac
983 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100984 PRNGD_PORT="$withval"
985 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
986 fi
987 ]
988)
989
990# PRNGD Unix domain socket
991AC_ARG_WITH(prngd-socket,
992 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
993 [
Damien Millere996d722002-01-23 11:20:59 +1100994 case "$withval" in
995 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100996 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100997 ;;
998 no)
999 withval=""
1000 ;;
1001 /*)
1002 ;;
1003 *)
1004 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1005 ;;
1006 esac
1007
1008 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001009 if test ! -z "$PRNGD_PORT" ; then
1010 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1011 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001012 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001013 AC_MSG_WARN(Entropy socket is not readable)
1014 fi
1015 PRNGD_SOCKET="$withval"
1016 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1017 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001018 ],
1019 [
1020 # Check for existing socket only if we don't have a random device already
1021 if test "$USE_RAND_HELPER" = yes ; then
1022 AC_MSG_CHECKING(for PRNGD/EGD socket)
1023 # Insert other locations here
1024 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1025 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1026 PRNGD_SOCKET="$sock"
1027 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1028 break;
1029 fi
1030 done
1031 if test ! -z "$PRNGD_SOCKET" ; then
1032 AC_MSG_RESULT($PRNGD_SOCKET)
1033 else
1034 AC_MSG_RESULT(not found)
1035 fi
1036 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001037 ]
1038)
1039
1040# Change default command timeout for hashing entropy source
1041entropy_timeout=200
1042AC_ARG_WITH(entropy-timeout,
1043 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1044 [
1045 if test "x$withval" != "xno" ; then
1046 entropy_timeout=$withval
1047 fi
1048 ]
1049)
Damien Miller6c21c512002-01-22 21:57:53 +11001050AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1051
Damien Millerd3f6ad22002-06-25 10:24:47 +10001052SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001053AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001054 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001055 [
1056 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001057 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001058 fi
1059 ]
1060)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001061AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1062AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001063
Tim Rice88f2ab52002-03-17 12:17:34 -08001064# We do this little dance with the search path to insure
1065# that programs that we select for use by installed programs
1066# (which may be run by the super-user) come from trusted
1067# locations before they come from the user's private area.
1068# This should help avoid accidentally configuring some
1069# random version of a program in someone's personal bin.
1070
1071OPATH=$PATH
1072PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001073test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001074test -d /sbin && PATH=$PATH:/sbin
1075test -d /usr/sbin && PATH=$PATH:/usr/sbin
1076PATH=$PATH:/etc:$OPATH
1077
Damien Miller6c21c512002-01-22 21:57:53 +11001078# These programs are used by the command hashing source to gather entropy
1079OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1080OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1081OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1082OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1083OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1084OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1085OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1086OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1087OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1088OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1089OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1090OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1091OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1092OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1093OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1094OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001095# restore PATH
1096PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001097
1098# Where does ssh-rand-helper get its randomness from?
1099INSTALL_SSH_PRNG_CMDS=""
1100if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1101 if test ! -z "$PRNGD_PORT" ; then
1102 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1103 elif test ! -z "$PRNGD_SOCKET" ; then
1104 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1105 else
1106 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1107 RAND_HELPER_CMDHASH=yes
1108 INSTALL_SSH_PRNG_CMDS="yes"
1109 fi
1110fi
1111AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1112
1113
Ben Lindstromb5628642000-10-18 00:02:25 +00001114# Cheap hack to ensure NEWS-OS libraries are arranged right.
1115if test ! -z "$SONY" ; then
1116 LIBS="$LIBS -liberty";
1117fi
1118
Damien Millera22ba012000-03-02 23:09:20 +11001119# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001120AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001121AC_CHECK_SIZEOF(short int, 2)
1122AC_CHECK_SIZEOF(int, 4)
1123AC_CHECK_SIZEOF(long int, 4)
1124AC_CHECK_SIZEOF(long long int, 8)
1125
Damien Millerfa2bb692002-04-23 23:22:25 +10001126# Sanity check long long for some platforms (AIX)
1127if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1128 ac_cv_sizeof_long_long_int=0
1129fi
1130
Damien Millera22ba012000-03-02 23:09:20 +11001131# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001132AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1133 AC_TRY_COMPILE(
1134 [ #include <sys/types.h> ],
1135 [ u_int a; a = 1;],
1136 [ ac_cv_have_u_int="yes" ],
1137 [ ac_cv_have_u_int="no" ]
1138 )
1139])
1140if test "x$ac_cv_have_u_int" = "xyes" ; then
1141 AC_DEFINE(HAVE_U_INT)
1142 have_u_int=1
1143fi
1144
Damien Miller61e50f12000-05-08 20:49:37 +10001145AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1146 AC_TRY_COMPILE(
1147 [ #include <sys/types.h> ],
1148 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1149 [ ac_cv_have_intxx_t="yes" ],
1150 [ ac_cv_have_intxx_t="no" ]
1151 )
1152])
1153if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1154 AC_DEFINE(HAVE_INTXX_T)
1155 have_intxx_t=1
1156fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001157
1158if (test -z "$have_intxx_t" && \
1159 test "x$ac_cv_header_stdint_h" = "xyes")
1160then
1161 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1162 AC_TRY_COMPILE(
1163 [ #include <stdint.h> ],
1164 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1165 [
1166 AC_DEFINE(HAVE_INTXX_T)
1167 AC_MSG_RESULT(yes)
1168 ],
1169 [ AC_MSG_RESULT(no) ]
1170 )
1171fi
1172
Damien Miller578783e2000-09-23 14:12:24 +11001173AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1174 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001175 [
1176#include <sys/types.h>
1177#ifdef HAVE_STDINT_H
1178# include <stdint.h>
1179#endif
1180#include <sys/socket.h>
1181#ifdef HAVE_SYS_BITYPES_H
1182# include <sys/bitypes.h>
1183#endif
1184 ],
Damien Miller578783e2000-09-23 14:12:24 +11001185 [ int64_t a; a = 1;],
1186 [ ac_cv_have_int64_t="yes" ],
1187 [ ac_cv_have_int64_t="no" ]
1188 )
1189])
1190if test "x$ac_cv_have_int64_t" = "xyes" ; then
1191 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001192fi
1193
Damien Miller61e50f12000-05-08 20:49:37 +10001194AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1195 AC_TRY_COMPILE(
1196 [ #include <sys/types.h> ],
1197 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1198 [ ac_cv_have_u_intxx_t="yes" ],
1199 [ ac_cv_have_u_intxx_t="no" ]
1200 )
1201])
1202if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1203 AC_DEFINE(HAVE_U_INTXX_T)
1204 have_u_intxx_t=1
1205fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001206
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001207if test -z "$have_u_intxx_t" ; then
1208 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1209 AC_TRY_COMPILE(
1210 [ #include <sys/socket.h> ],
1211 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1212 [
1213 AC_DEFINE(HAVE_U_INTXX_T)
1214 AC_MSG_RESULT(yes)
1215 ],
1216 [ AC_MSG_RESULT(no) ]
1217 )
1218fi
1219
Damien Miller578783e2000-09-23 14:12:24 +11001220AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1221 AC_TRY_COMPILE(
1222 [ #include <sys/types.h> ],
1223 [ u_int64_t a; a = 1;],
1224 [ ac_cv_have_u_int64_t="yes" ],
1225 [ ac_cv_have_u_int64_t="no" ]
1226 )
1227])
1228if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1229 AC_DEFINE(HAVE_U_INT64_T)
1230 have_u_int64_t=1
1231fi
1232
Tim Rice4cec93f2002-02-26 08:40:48 -08001233if test -z "$have_u_int64_t" ; then
1234 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1235 AC_TRY_COMPILE(
1236 [ #include <sys/bitypes.h> ],
1237 [ u_int64_t a; a = 1],
1238 [
1239 AC_DEFINE(HAVE_U_INT64_T)
1240 AC_MSG_RESULT(yes)
1241 ],
1242 [ AC_MSG_RESULT(no) ]
1243 )
1244fi
1245
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001246if test -z "$have_u_intxx_t" ; then
1247 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1248 AC_TRY_COMPILE(
1249 [
1250#include <sys/types.h>
1251 ],
1252 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1253 [ ac_cv_have_uintxx_t="yes" ],
1254 [ ac_cv_have_uintxx_t="no" ]
1255 )
1256 ])
1257 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1258 AC_DEFINE(HAVE_UINTXX_T)
1259 fi
1260fi
1261
1262if test -z "$have_uintxx_t" ; then
1263 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1264 AC_TRY_COMPILE(
1265 [ #include <stdint.h> ],
1266 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1267 [
1268 AC_DEFINE(HAVE_UINTXX_T)
1269 AC_MSG_RESULT(yes)
1270 ],
1271 [ AC_MSG_RESULT(no) ]
1272 )
1273fi
1274
Damien Milleredb82922000-06-20 13:25:52 +10001275if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1276 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001277then
1278 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1279 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001280 [
1281#include <sys/bitypes.h>
1282 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001283 [
Damien Miller70494d12000-04-03 15:57:06 +10001284 int8_t a; int16_t b; int32_t c;
1285 u_int8_t e; u_int16_t f; u_int32_t g;
1286 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001287 ],
1288 [
1289 AC_DEFINE(HAVE_U_INTXX_T)
1290 AC_DEFINE(HAVE_INTXX_T)
1291 AC_MSG_RESULT(yes)
1292 ],
1293 [AC_MSG_RESULT(no)]
1294 )
1295fi
1296
Damien Miller58be7382001-09-15 21:31:54 +10001297
1298AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1299 AC_TRY_COMPILE(
1300 [
1301#include <sys/types.h>
1302 ],
1303 [ u_char foo; foo = 125; ],
1304 [ ac_cv_have_u_char="yes" ],
1305 [ ac_cv_have_u_char="no" ]
1306 )
1307])
1308if test "x$ac_cv_have_u_char" = "xyes" ; then
1309 AC_DEFINE(HAVE_U_CHAR)
1310fi
1311
Tim Rice13aae5e2001-10-21 17:53:58 -07001312TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001313
Tim Rice200a5c02002-02-26 22:12:34 -08001314AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001315
Damien Miller61e50f12000-05-08 20:49:37 +10001316AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1317 AC_TRY_COMPILE(
1318 [
1319#include <sys/types.h>
1320 ],
1321 [ size_t foo; foo = 1235; ],
1322 [ ac_cv_have_size_t="yes" ],
1323 [ ac_cv_have_size_t="no" ]
1324 )
1325])
1326if test "x$ac_cv_have_size_t" = "xyes" ; then
1327 AC_DEFINE(HAVE_SIZE_T)
1328fi
Damien Miller95058511999-12-29 10:36:45 +11001329
Damien Miller615f9392000-05-17 22:53:33 +10001330AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1331 AC_TRY_COMPILE(
1332 [
1333#include <sys/types.h>
1334 ],
1335 [ ssize_t foo; foo = 1235; ],
1336 [ ac_cv_have_ssize_t="yes" ],
1337 [ ac_cv_have_ssize_t="no" ]
1338 )
1339])
1340if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1341 AC_DEFINE(HAVE_SSIZE_T)
1342fi
1343
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001344AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1345 AC_TRY_COMPILE(
1346 [
1347#include <time.h>
1348 ],
1349 [ clock_t foo; foo = 1235; ],
1350 [ ac_cv_have_clock_t="yes" ],
1351 [ ac_cv_have_clock_t="no" ]
1352 )
1353])
1354if test "x$ac_cv_have_clock_t" = "xyes" ; then
1355 AC_DEFINE(HAVE_CLOCK_T)
1356fi
1357
Damien Millerb54b40e2000-06-23 08:23:34 +10001358AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1359 AC_TRY_COMPILE(
1360 [
1361#include <sys/types.h>
1362#include <sys/socket.h>
1363 ],
1364 [ sa_family_t foo; foo = 1235; ],
1365 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001366 [ AC_TRY_COMPILE(
1367 [
1368#include <sys/types.h>
1369#include <sys/socket.h>
1370#include <netinet/in.h>
1371 ],
1372 [ sa_family_t foo; foo = 1235; ],
1373 [ ac_cv_have_sa_family_t="yes" ],
1374
Damien Millerb54b40e2000-06-23 08:23:34 +10001375 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001376 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001377 )
1378])
1379if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1380 AC_DEFINE(HAVE_SA_FAMILY_T)
1381fi
1382
Damien Miller0f91b4e2000-06-18 15:43:25 +10001383AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1384 AC_TRY_COMPILE(
1385 [
1386#include <sys/types.h>
1387 ],
1388 [ pid_t foo; foo = 1235; ],
1389 [ ac_cv_have_pid_t="yes" ],
1390 [ ac_cv_have_pid_t="no" ]
1391 )
1392])
1393if test "x$ac_cv_have_pid_t" = "xyes" ; then
1394 AC_DEFINE(HAVE_PID_T)
1395fi
1396
1397AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1398 AC_TRY_COMPILE(
1399 [
1400#include <sys/types.h>
1401 ],
1402 [ mode_t foo; foo = 1235; ],
1403 [ ac_cv_have_mode_t="yes" ],
1404 [ ac_cv_have_mode_t="no" ]
1405 )
1406])
1407if test "x$ac_cv_have_mode_t" = "xyes" ; then
1408 AC_DEFINE(HAVE_MODE_T)
1409fi
1410
Damien Miller61e50f12000-05-08 20:49:37 +10001411
1412AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1413 AC_TRY_COMPILE(
1414 [
Damien Miller81171112000-04-23 11:14:01 +10001415#include <sys/types.h>
1416#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001417 ],
1418 [ struct sockaddr_storage s; ],
1419 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1420 [ ac_cv_have_struct_sockaddr_storage="no" ]
1421 )
1422])
1423if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1424 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1425fi
Damien Miller34132e52000-01-14 15:45:46 +11001426
Damien Miller61e50f12000-05-08 20:49:37 +10001427AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1428 AC_TRY_COMPILE(
1429 [
Damien Miller7b22d652000-06-18 14:07:04 +10001430#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001431#include <netinet/in.h>
1432 ],
1433 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1434 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1435 [ ac_cv_have_struct_sockaddr_in6="no" ]
1436 )
1437])
1438if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1439 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1440fi
Damien Miller34132e52000-01-14 15:45:46 +11001441
Damien Miller61e50f12000-05-08 20:49:37 +10001442AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1443 AC_TRY_COMPILE(
1444 [
Damien Miller7b22d652000-06-18 14:07:04 +10001445#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001446#include <netinet/in.h>
1447 ],
1448 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1449 [ ac_cv_have_struct_in6_addr="yes" ],
1450 [ ac_cv_have_struct_in6_addr="no" ]
1451 )
1452])
1453if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1454 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1455fi
Damien Miller34132e52000-01-14 15:45:46 +11001456
Damien Miller61e50f12000-05-08 20:49:37 +10001457AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1458 AC_TRY_COMPILE(
1459 [
Damien Miller81171112000-04-23 11:14:01 +10001460#include <sys/types.h>
1461#include <sys/socket.h>
1462#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001463 ],
1464 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1465 [ ac_cv_have_struct_addrinfo="yes" ],
1466 [ ac_cv_have_struct_addrinfo="no" ]
1467 )
1468])
1469if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1470 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1471fi
1472
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001473AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1474 AC_TRY_COMPILE(
1475 [ #include <sys/time.h> ],
1476 [ struct timeval tv; tv.tv_sec = 1;],
1477 [ ac_cv_have_struct_timeval="yes" ],
1478 [ ac_cv_have_struct_timeval="no" ]
1479 )
1480])
1481if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1482 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1483 have_struct_timeval=1
1484fi
1485
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001486# If we don't have int64_t then we can't compile sftp-server. So don't
1487# even attempt to do it.
1488if test "x$ac_cv_have_int64_t" = "xno" -a \
1489 "x$ac_cv_sizeof_long_int" != "x8" -a \
1490 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1491 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001492else
1493dnl test snprintf (broken on SCO w/gcc)
1494 AC_TRY_RUN(
1495 [
1496#include <stdio.h>
1497#include <string.h>
1498#ifdef HAVE_SNPRINTF
1499main()
1500{
1501 char buf[50];
1502 char expected_out[50];
1503 int mazsize = 50 ;
1504#if (SIZEOF_LONG_INT == 8)
1505 long int num = 0x7fffffffffffffff;
1506#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001507 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001508#endif
1509 strcpy(expected_out, "9223372036854775807");
1510 snprintf(buf, mazsize, "%lld", num);
1511 if(strcmp(buf, expected_out) != 0)
1512 exit(1);
1513 exit(0);
1514}
1515#else
1516main() { exit(0); }
1517#endif
1518 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1519 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001520fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001521AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001522
Damien Miller78315eb2000-09-29 23:01:36 +11001523dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001524OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1525OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1526OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1527OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1528OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001529OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001530OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1531OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001532OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001533OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1535OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1536OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001537OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1538OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1539OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1540OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001541
1542AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001543
Damien Miller61e50f12000-05-08 20:49:37 +10001544AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1545 ac_cv_have_ss_family_in_struct_ss, [
1546 AC_TRY_COMPILE(
1547 [
Damien Miller81171112000-04-23 11:14:01 +10001548#include <sys/types.h>
1549#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001550 ],
1551 [ struct sockaddr_storage s; s.ss_family = 1; ],
1552 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1553 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1554 )
1555])
1556if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1557 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1558fi
1559
Damien Miller61e50f12000-05-08 20:49:37 +10001560AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1561 ac_cv_have___ss_family_in_struct_ss, [
1562 AC_TRY_COMPILE(
1563 [
Damien Miller81171112000-04-23 11:14:01 +10001564#include <sys/types.h>
1565#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001566 ],
1567 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1568 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1569 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1570 )
1571])
1572if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1573 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1574fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001575
Damien Millerad833b32000-08-23 10:46:23 +10001576AC_CACHE_CHECK([for pw_class field in struct passwd],
1577 ac_cv_have_pw_class_in_struct_passwd, [
1578 AC_TRY_COMPILE(
1579 [
Damien Millerad833b32000-08-23 10:46:23 +10001580#include <pwd.h>
1581 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001582 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001583 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1584 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1585 )
1586])
1587if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1588 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1589fi
1590
Kevin Steves82456952001-06-22 21:14:18 +00001591AC_CACHE_CHECK([for pw_expire field in struct passwd],
1592 ac_cv_have_pw_expire_in_struct_passwd, [
1593 AC_TRY_COMPILE(
1594 [
1595#include <pwd.h>
1596 ],
1597 [ struct passwd p; p.pw_expire = 0; ],
1598 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1599 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1600 )
1601])
1602if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1603 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1604fi
1605
1606AC_CACHE_CHECK([for pw_change field in struct passwd],
1607 ac_cv_have_pw_change_in_struct_passwd, [
1608 AC_TRY_COMPILE(
1609 [
1610#include <pwd.h>
1611 ],
1612 [ struct passwd p; p.pw_change = 0; ],
1613 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1614 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1615 )
1616])
1617if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1618 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1619fi
Damien Miller61e50f12000-05-08 20:49:37 +10001620
Tim Rice28bbb0c2002-05-27 17:37:32 -07001621dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001622AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1623 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001624 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001625 [
Tim Riceae49fe62002-04-12 10:26:21 -07001626#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001627#include <sys/socket.h>
1628#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001629int main() {
1630#ifdef msg_accrights
1631exit(1);
1632#endif
1633struct msghdr m;
1634m.msg_accrights = 0;
1635exit(0);
1636}
Kevin Steves939c9db2002-03-22 17:23:25 +00001637 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001638 [ ac_cv_have_accrights_in_msghdr="yes" ],
1639 [ ac_cv_have_accrights_in_msghdr="no" ]
1640 )
1641])
1642if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1643 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1644fi
1645
Kevin Stevesa44e0352002-04-07 16:18:03 +00001646AC_CACHE_CHECK([for msg_control field in struct msghdr],
1647 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001648 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001649 [
Tim Riceae49fe62002-04-12 10:26:21 -07001650#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001651#include <sys/socket.h>
1652#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001653int main() {
1654#ifdef msg_control
1655exit(1);
1656#endif
1657struct msghdr m;
1658m.msg_control = 0;
1659exit(0);
1660}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001661 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001662 [ ac_cv_have_control_in_msghdr="yes" ],
1663 [ ac_cv_have_control_in_msghdr="no" ]
1664 )
1665])
1666if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1667 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1668fi
1669
Damien Miller61e50f12000-05-08 20:49:37 +10001670AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1671 AC_TRY_LINK([],
1672 [ extern char *__progname; printf("%s", __progname); ],
1673 [ ac_cv_libc_defines___progname="yes" ],
1674 [ ac_cv_libc_defines___progname="no" ]
1675 )
1676])
1677if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1678 AC_DEFINE(HAVE___PROGNAME)
1679fi
1680
Kevin Steves4846f4a2002-03-22 18:19:53 +00001681AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1682 AC_TRY_LINK([
1683#include <stdio.h>
1684],
1685 [ printf("%s", __FUNCTION__); ],
1686 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1687 [ ac_cv_cc_implements___FUNCTION__="no" ]
1688 )
1689])
1690if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1691 AC_DEFINE(HAVE___FUNCTION__)
1692fi
1693
1694AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1695 AC_TRY_LINK([
1696#include <stdio.h>
1697],
1698 [ printf("%s", __func__); ],
1699 [ ac_cv_cc_implements___func__="yes" ],
1700 [ ac_cv_cc_implements___func__="no" ]
1701 )
1702])
1703if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1704 AC_DEFINE(HAVE___func__)
1705fi
1706
Damien Miller4f8e6692001-07-14 13:22:53 +10001707AC_CACHE_CHECK([whether getopt has optreset support],
1708 ac_cv_have_getopt_optreset, [
1709 AC_TRY_LINK(
1710 [
1711#include <getopt.h>
1712 ],
1713 [ extern int optreset; optreset = 0; ],
1714 [ ac_cv_have_getopt_optreset="yes" ],
1715 [ ac_cv_have_getopt_optreset="no" ]
1716 )
1717])
1718if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1719 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1720fi
Damien Millera22ba012000-03-02 23:09:20 +11001721
Damien Millerecbb26d2000-07-15 14:59:14 +10001722AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1723 AC_TRY_LINK([],
1724 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1725 [ ac_cv_libc_defines_sys_errlist="yes" ],
1726 [ ac_cv_libc_defines_sys_errlist="no" ]
1727 )
1728])
1729if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1730 AC_DEFINE(HAVE_SYS_ERRLIST)
1731fi
1732
1733
Damien Miller11fa2cc2000-08-16 10:35:58 +10001734AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1735 AC_TRY_LINK([],
1736 [ extern int sys_nerr; printf("%i", sys_nerr);],
1737 [ ac_cv_libc_defines_sys_nerr="yes" ],
1738 [ ac_cv_libc_defines_sys_nerr="no" ]
1739 )
1740])
1741if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1742 AC_DEFINE(HAVE_SYS_NERR)
1743fi
1744
Damien Miller85de5802001-09-18 14:01:11 +10001745SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001746
1747# Check whether user wants sectok support
1748AC_ARG_WITH(sectok,
1749 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001750 [
1751 if test "x$withval" != "xno" ; then
1752 if test "x$withval" != "xyes" ; then
1753 CPPFLAGS="$CPPFLAGS -I${withval}"
1754 LDFLAGS="$LDFLAGS -L${withval}"
1755 if test ! -z "$need_dash_r" ; then
1756 LDFLAGS="$LDFLAGS -R${withval}"
1757 fi
1758 if test ! -z "$blibpath" ; then
1759 blibpath="$blibpath:${withval}"
1760 fi
1761 fi
1762 AC_CHECK_HEADERS(sectok.h)
1763 if test "$ac_cv_header_sectok_h" != yes; then
1764 AC_MSG_ERROR(Can't find sectok.h)
1765 fi
1766 AC_CHECK_LIB(sectok, sectok_open)
1767 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1768 AC_MSG_ERROR(Can't find libsectok)
1769 fi
1770 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001771 AC_DEFINE(USE_SECTOK)
1772 SCARD_MSG="yes, using sectok"
1773 fi
1774 ]
1775)
1776
1777# Check whether user wants OpenSC support
1778AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001779 AC_HELP_STRING([--with-opensc=PFX],
1780 [Enable smartcard support using OpenSC]),
1781 opensc_config_prefix="$withval", opensc_config_prefix="")
1782if test x$opensc_config_prefix != x ; then
1783 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1784 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1785 if test "$OPENSC_CONFIG" != "no"; then
1786 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1787 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1788 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1789 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1790 AC_DEFINE(SMARTCARD)
1791 AC_DEFINE(USE_OPENSC)
1792 SCARD_MSG="yes, using OpenSC"
1793 fi
1794fi
Damien Miller85de5802001-09-18 14:01:11 +10001795
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001796# Check whether user wants Kerberos 5 support
1797KRB5_MSG="no"
1798AC_ARG_WITH(kerberos5,
1799 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1800 [
1801 if test "x$withval" != "xno" ; then
1802 if test "x$withval" = "xyes" ; then
1803 KRB5ROOT="/usr/local"
1804 else
1805 KRB5ROOT=${withval}
1806 fi
1807 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1808 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1809 AC_DEFINE(KRB5)
1810 KRB5_MSG="yes"
1811 AC_MSG_CHECKING(whether we are using Heimdal)
1812 AC_TRY_COMPILE([ #include <krb5.h> ],
1813 [ char *tmp = heimdal_version; ],
1814 [ AC_MSG_RESULT(yes)
1815 AC_DEFINE(HEIMDAL)
1816 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1817 ],
1818 [ AC_MSG_RESULT(no)
1819 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1820 ]
1821 )
1822 if test ! -z "$need_dash_r" ; then
1823 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1824 fi
1825 if test ! -z "$blibpath" ; then
1826 blibpath="$blibpath:${KRB5ROOT}/lib"
1827 fi
1828 AC_CHECK_LIB(resolv, dn_expand, , )
1829
1830 KRB5=yes
1831 fi
1832 ]
1833)
1834# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001835KRB4_MSG="no"
1836AC_ARG_WITH(kerberos4,
1837 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1838 [
1839 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001840 if test "x$withval" != "xyes" ; then
1841 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1842 LDFLAGS="$LDFLAGS -L${withval}/lib"
1843 if test ! -z "$need_dash_r" ; then
1844 LDFLAGS="$LDFLAGS -R${withval}/lib"
1845 fi
1846 if test ! -z "$blibpath" ; then
1847 blibpath="$blibpath:${withval}/lib"
1848 fi
1849 else
1850 if test -d /usr/include/kerberosIV ; then
1851 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1852 fi
1853 fi
1854
1855 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001856 if test "$ac_cv_header_krb_h" != yes; then
1857 AC_MSG_WARN([Cannot find krb.h, build may fail])
1858 fi
Damien Miller98344742001-03-28 14:37:06 +10001859 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001860 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001861 AC_CHECK_LIB(krb4, main)
1862 if test "$ac_cv_lib_krb4_main" != yes; then
1863 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1864 else
1865 KLIBS="-lkrb4"
1866 fi
1867 else
1868 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001869 fi
Damien Miller98344742001-03-28 14:37:06 +10001870 AC_CHECK_LIB(des, des_cbc_encrypt)
1871 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1872 AC_CHECK_LIB(des425, des_cbc_encrypt)
1873 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1874 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1875 else
1876 KLIBS="-ldes425"
1877 fi
1878 else
1879 KLIBS="-ldes"
1880 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001881 AC_CHECK_LIB(resolv, dn_expand, , )
1882 KRB4=yes
1883 KRB4_MSG="yes"
1884 AC_DEFINE(KRB4)
1885 fi
1886 ]
1887)
1888
1889# Check whether user wants AFS support
1890AFS_MSG="no"
1891AC_ARG_WITH(afs,
1892 [ --with-afs=PATH Enable AFS support],
1893 [
1894 if test "x$withval" != "xno" ; then
1895
1896 if test "x$withval" != "xyes" ; then
1897 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1898 LDFLAGS="$LDFLAGS -L${withval}/lib"
1899 fi
1900
1901 if test -z "$KRB4" ; then
1902 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1903 fi
1904
1905 LIBS="-lkafs $LIBS"
1906 if test ! -z "$AFS_LIBS" ; then
1907 LIBS="$LIBS $AFS_LIBS"
1908 fi
1909 AC_DEFINE(AFS)
1910 AFS_MSG="yes"
1911 fi
1912 ]
1913)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001914LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001915
Damien Millera22ba012000-03-02 23:09:20 +11001916# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001917
Damien Millerf58c6722002-05-13 13:15:42 +10001918PRIVSEP_PATH=/var/empty
1919AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001920 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001921 [
1922 if test "x$withval" != "$no" ; then
1923 PRIVSEP_PATH=$withval
1924 fi
1925 ]
1926)
1927AC_SUBST(PRIVSEP_PATH)
1928
Damien Millera22ba012000-03-02 23:09:20 +11001929AC_ARG_WITH(xauth,
1930 [ --with-xauth=PATH Specify path to xauth program ],
1931 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001932 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001933 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001934 fi
1935 ],
1936 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001937 TestPath="$PATH"
1938 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1939 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1940 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1941 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1942 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001943 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001944 xauth_path="/usr/openwin/bin/xauth"
1945 fi
1946 ]
1947)
1948
Damien Miller7d901272003-01-13 16:55:22 +11001949STRIP_OPT=-s
1950AC_ARG_ENABLE(strip,
1951 [ --disable-strip Disable calling strip(1) on install],
1952 [
1953 if test "x$enableval" = "xno" ; then
1954 STRIP_OPT=
1955 fi
1956 ]
1957)
1958AC_SUBST(STRIP_OPT)
1959
Damien Millera19cf472000-11-29 13:28:50 +11001960if test -z "$xauth_path" ; then
1961 XAUTH_PATH="undefined"
1962 AC_SUBST(XAUTH_PATH)
1963else
Damien Millera22ba012000-03-02 23:09:20 +11001964 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001965 XAUTH_PATH=$xauth_path
1966 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001967fi
Damien Millera22ba012000-03-02 23:09:20 +11001968
1969# Check for mail directory (last resort if we cannot get it from headers)
1970if test ! -z "$MAIL" ; then
1971 maildir=`dirname $MAIL`
1972 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1973fi
1974
Damien Millera22ba012000-03-02 23:09:20 +11001975if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001976 if test "x$disable_ptmx_check" != "xyes" ; then
1977 AC_CHECK_FILE("/dev/ptmx",
1978 [
1979 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1980 have_dev_ptmx=1
1981 ]
1982 )
1983 fi
Damien Millera22ba012000-03-02 23:09:20 +11001984fi
Damien Miller204ad072000-03-02 23:56:12 +11001985AC_CHECK_FILE("/dev/ptc",
1986 [
1987 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1988 have_dev_ptc=1
1989 ]
1990)
1991
Damien Millera22ba012000-03-02 23:09:20 +11001992# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001993AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001994 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001995 [
Damien Miller897741e2001-04-16 10:41:46 +10001996 case "$withval" in
1997 man|cat|doc)
1998 MANTYPE=$withval
1999 ;;
2000 *)
2001 AC_MSG_ERROR(invalid man type: $withval)
2002 ;;
2003 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002004 ]
2005)
Ben Lindstrombc709922001-04-18 18:04:21 +00002006if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002007 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2008 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002009 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2010 MANTYPE=doc
2011 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2012 MANTYPE=man
2013 else
2014 MANTYPE=cat
2015 fi
2016fi
Damien Miller670a4b82000-01-22 13:53:11 +11002017AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002018if test "$MANTYPE" = "doc"; then
2019 mansubdir=man;
2020else
2021 mansubdir=$MANTYPE;
2022fi
2023AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002024
Damien Millera22ba012000-03-02 23:09:20 +11002025# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002026MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002027AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002028 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002029 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002030 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002031 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002032 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002033 fi
2034 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002035)
2036
Damien Millera22ba012000-03-02 23:09:20 +11002037# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002038AC_ARG_WITH(shadow,
2039 [ --without-shadow Disable shadow password support],
2040 [
2041 if test "x$withval" = "xno" ; then
2042 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002043 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002044 fi
2045 ]
2046)
2047
Damien Miller1f335fb2000-06-26 11:31:33 +10002048if test -z "$disable_shadow" ; then
2049 AC_MSG_CHECKING([if the systems has expire shadow information])
2050 AC_TRY_COMPILE(
2051 [
2052#include <sys/types.h>
2053#include <shadow.h>
2054 struct spwd sp;
2055 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2056 [ sp_expire_available=yes ], []
2057 )
2058
2059 if test "x$sp_expire_available" = "xyes" ; then
2060 AC_MSG_RESULT(yes)
2061 AC_DEFINE(HAS_SHADOW_EXPIRE)
2062 else
2063 AC_MSG_RESULT(no)
2064 fi
2065fi
2066
Damien Millera22ba012000-03-02 23:09:20 +11002067# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002068if test ! -z "$IPADDR_IN_DISPLAY" ; then
2069 DISPLAY_HACK_MSG="yes"
2070 AC_DEFINE(IPADDR_IN_DISPLAY)
2071else
2072 DISPLAY_HACK_MSG="no"
2073 AC_ARG_WITH(ipaddr-display,
2074 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2075 [
2076 if test "x$withval" != "xno" ; then
2077 AC_DEFINE(IPADDR_IN_DISPLAY)
2078 DISPLAY_HACK_MSG="yes"
2079 fi
2080 ]
2081 )
2082fi
Damien Miller76112de1999-12-21 11:18:08 +11002083
Tim Rice43a1c132002-04-17 21:19:14 -07002084dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2085if test $ac_cv_func_login_getcapbool = "yes" -a \
2086 $ac_cv_header_login_cap_h = "yes" ; then
2087 USES_LOGIN_CONF=yes
2088fi
Damien Millera22ba012000-03-02 23:09:20 +11002089# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002090SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002091AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002092 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002093 [
Tim Rice43a1c132002-04-17 21:19:14 -07002094 if test "$USES_LOGIN_CONF" = "yes" ; then
2095 AC_MSG_WARN([
2096--with-default-path=PATH has no effect on this system.
2097Edit /etc/login.conf instead.])
2098 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002099 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002100 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002101 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002102 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002103 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2104 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2105 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002106 AC_TRY_RUN(
2107 [
2108/* find out what STDPATH is */
2109#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002110#ifdef HAVE_PATHS_H
2111# include <paths.h>
2112#endif
2113#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002114# ifdef _PATH_USERPATH /* Irix */
2115# define _PATH_STDPATH _PATH_USERPATH
2116# else
2117# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2118# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002119#endif
2120#include <sys/types.h>
2121#include <sys/stat.h>
2122#include <fcntl.h>
2123#define DATA "conftest.stdpath"
2124
2125main()
2126{
2127 FILE *fd;
2128 int rc;
2129
2130 fd = fopen(DATA,"w");
2131 if(fd == NULL)
2132 exit(1);
2133
2134 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2135 exit(1);
2136
2137 exit(0);
2138}
2139 ], [ user_path=`cat conftest.stdpath` ],
2140 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2141 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2142 )
2143# make sure $bindir is in USER_PATH so scp will work
2144 t_bindir=`eval echo ${bindir}`
2145 case $t_bindir in
2146 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2147 esac
2148 case $t_bindir in
2149 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2150 esac
2151 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2152 if test $? -ne 0 ; then
2153 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2154 if test $? -ne 0 ; then
2155 user_path=$user_path:$t_bindir
2156 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2157 fi
2158 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002159 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002160)
Tim Rice43a1c132002-04-17 21:19:14 -07002161if test "$USES_LOGIN_CONF" != "yes" ; then
2162 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2163 AC_SUBST(user_path)
2164fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002165
Damien Millera18bbd32002-05-13 10:48:57 +10002166# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002167AC_ARG_WITH(superuser-path,
2168 [ --with-superuser-path= Specify different path for super-user],
2169 [
2170 if test "x$withval" != "xno" ; then
2171 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2172 superuser_path=$withval
2173 fi
2174 ]
2175)
2176
2177
Damien Millera22ba012000-03-02 23:09:20 +11002178# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002179IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002180AC_ARG_WITH(ipv4-default,
2181 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2182 [
2183 if test "x$withval" != "xno" ; then
2184 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002185 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002186 fi
2187 ]
2188)
2189
Damien Miller61e50f12000-05-08 20:49:37 +10002190AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002191IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002192AC_ARG_WITH(4in6,
2193 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2194 [
2195 if test "x$withval" != "xno" ; then
2196 AC_MSG_RESULT(yes)
2197 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002198 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002199 else
2200 AC_MSG_RESULT(no)
2201 fi
2202 ],[
2203 if test "x$inet6_default_4in6" = "xyes"; then
2204 AC_MSG_RESULT([yes (default)])
2205 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002206 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002207 else
2208 AC_MSG_RESULT([no (default)])
2209 fi
2210 ]
2211)
2212
Damien Miller60396b02001-02-18 17:01:00 +11002213# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002214BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002215AC_ARG_WITH(bsd-auth,
2216 [ --with-bsd-auth Enable BSD auth support],
2217 [
2218 if test "x$withval" != "xno" ; then
2219 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002220 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002221 fi
2222 ]
2223)
2224
Damien Millera22ba012000-03-02 23:09:20 +11002225# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002226piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002227# make sure the directory exists
2228if test ! -d $piddir ; then
2229 piddir=`eval echo ${sysconfdir}`
2230 case $piddir in
2231 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2232 esac
2233fi
2234
Tim Rice88f2ab52002-03-17 12:17:34 -08002235AC_ARG_WITH(pid-dir,
2236 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2237 [
2238 if test "x$withval" != "xno" ; then
2239 piddir=$withval
2240 if test ! -d $piddir ; then
2241 AC_MSG_WARN([** no $piddir directory on this system **])
2242 fi
2243 fi
2244 ]
2245)
2246
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002247AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002248AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002249
andre2ff7b5d2000-06-03 14:57:40 +00002250dnl allow user to disable some login recording features
2251AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002252 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002253 [ AC_DEFINE(DISABLE_LASTLOG) ]
2254)
2255AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002256 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002257 [ AC_DEFINE(DISABLE_UTMP) ]
2258)
2259AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002260 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002261 [ AC_DEFINE(DISABLE_UTMPX) ]
2262)
2263AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002264 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002265 [ AC_DEFINE(DISABLE_WTMP) ]
2266)
2267AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002268 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002269 [ AC_DEFINE(DISABLE_WTMPX) ]
2270)
2271AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002272 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002273 [ AC_DEFINE(DISABLE_LOGIN) ]
2274)
2275AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002276 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002277 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2278)
2279AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002280 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002281 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2282)
2283AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002284 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002285 [
2286 if test "x$withval" = "xno" ; then
2287 AC_DEFINE(DISABLE_LASTLOG)
2288 else
2289 conf_lastlog_location=$withval
2290 fi
2291 ]
2292)
andre2ff7b5d2000-06-03 14:57:40 +00002293
2294dnl lastlog, [uw]tmpx? detection
2295dnl NOTE: set the paths in the platform section to avoid the
2296dnl need for command-line parameters
2297dnl lastlog and [uw]tmp are subject to a file search if all else fails
2298
2299dnl lastlog detection
2300dnl NOTE: the code itself will detect if lastlog is a directory
2301AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2302AC_TRY_COMPILE([
2303#include <sys/types.h>
2304#include <utmp.h>
2305#ifdef HAVE_LASTLOG_H
2306# include <lastlog.h>
2307#endif
Damien Miller2994e082000-06-04 15:51:47 +10002308#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002309# include <paths.h>
2310#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002311#ifdef HAVE_LOGIN_H
2312# include <login.h>
2313#endif
andre2ff7b5d2000-06-03 14:57:40 +00002314 ],
2315 [ char *lastlog = LASTLOG_FILE; ],
2316 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002317 [
2318 AC_MSG_RESULT(no)
2319 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2320 AC_TRY_COMPILE([
2321#include <sys/types.h>
2322#include <utmp.h>
2323#ifdef HAVE_LASTLOG_H
2324# include <lastlog.h>
2325#endif
2326#ifdef HAVE_PATHS_H
2327# include <paths.h>
2328#endif
2329 ],
2330 [ char *lastlog = _PATH_LASTLOG; ],
2331 [ AC_MSG_RESULT(yes) ],
2332 [
andree441aa32000-06-12 22:34:38 +00002333 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002334 system_lastlog_path=no
2335 ])
2336 ]
andre2ff7b5d2000-06-03 14:57:40 +00002337)
Damien Miller2994e082000-06-04 15:51:47 +10002338
andre2ff7b5d2000-06-03 14:57:40 +00002339if test -z "$conf_lastlog_location"; then
2340 if test x"$system_lastlog_path" = x"no" ; then
2341 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002342 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002343 conf_lastlog_location=$f
2344 fi
2345 done
2346 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002347 AC_MSG_WARN([** Cannot find lastlog **])
2348 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002349 fi
2350 fi
2351fi
2352
2353if test -n "$conf_lastlog_location"; then
2354 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2355fi
2356
2357dnl utmp detection
2358AC_MSG_CHECKING([if your system defines UTMP_FILE])
2359AC_TRY_COMPILE([
2360#include <sys/types.h>
2361#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002362#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002363# include <paths.h>
2364#endif
2365 ],
2366 [ char *utmp = UTMP_FILE; ],
2367 [ AC_MSG_RESULT(yes) ],
2368 [ AC_MSG_RESULT(no)
2369 system_utmp_path=no ]
2370)
2371if test -z "$conf_utmp_location"; then
2372 if test x"$system_utmp_path" = x"no" ; then
2373 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2374 if test -f $f ; then
2375 conf_utmp_location=$f
2376 fi
2377 done
2378 if test -z "$conf_utmp_location"; then
2379 AC_DEFINE(DISABLE_UTMP)
2380 fi
2381 fi
2382fi
2383if test -n "$conf_utmp_location"; then
2384 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2385fi
2386
2387dnl wtmp detection
2388AC_MSG_CHECKING([if your system defines WTMP_FILE])
2389AC_TRY_COMPILE([
2390#include <sys/types.h>
2391#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002392#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002393# include <paths.h>
2394#endif
2395 ],
2396 [ char *wtmp = WTMP_FILE; ],
2397 [ AC_MSG_RESULT(yes) ],
2398 [ AC_MSG_RESULT(no)
2399 system_wtmp_path=no ]
2400)
2401if test -z "$conf_wtmp_location"; then
2402 if test x"$system_wtmp_path" = x"no" ; then
2403 for f in /usr/adm/wtmp /var/log/wtmp; do
2404 if test -f $f ; then
2405 conf_wtmp_location=$f
2406 fi
2407 done
2408 if test -z "$conf_wtmp_location"; then
2409 AC_DEFINE(DISABLE_WTMP)
2410 fi
2411 fi
2412fi
2413if test -n "$conf_wtmp_location"; then
2414 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2415fi
2416
2417
2418dnl utmpx detection - I don't know any system so perverse as to require
2419dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2420dnl there, though.
2421AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2422AC_TRY_COMPILE([
2423#include <sys/types.h>
2424#include <utmp.h>
2425#ifdef HAVE_UTMPX_H
2426#include <utmpx.h>
2427#endif
Damien Miller2994e082000-06-04 15:51:47 +10002428#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002429# include <paths.h>
2430#endif
2431 ],
2432 [ char *utmpx = UTMPX_FILE; ],
2433 [ AC_MSG_RESULT(yes) ],
2434 [ AC_MSG_RESULT(no)
2435 system_utmpx_path=no ]
2436)
2437if test -z "$conf_utmpx_location"; then
2438 if test x"$system_utmpx_path" = x"no" ; then
2439 AC_DEFINE(DISABLE_UTMPX)
2440 fi
2441else
2442 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2443fi
2444
2445dnl wtmpx detection
2446AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2447AC_TRY_COMPILE([
2448#include <sys/types.h>
2449#include <utmp.h>
2450#ifdef HAVE_UTMPX_H
2451#include <utmpx.h>
2452#endif
Damien Miller2994e082000-06-04 15:51:47 +10002453#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002454# include <paths.h>
2455#endif
2456 ],
2457 [ char *wtmpx = WTMPX_FILE; ],
2458 [ AC_MSG_RESULT(yes) ],
2459 [ AC_MSG_RESULT(no)
2460 system_wtmpx_path=no ]
2461)
2462if test -z "$conf_wtmpx_location"; then
2463 if test x"$system_wtmpx_path" = x"no" ; then
2464 AC_DEFINE(DISABLE_WTMPX)
2465 fi
2466else
2467 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2468fi
2469
Damien Miller4018c192000-04-30 09:30:44 +10002470
Damien Miller29ea30d2000-03-17 10:54:15 +11002471if test ! -z "$blibpath" ; then
2472 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2473 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2474fi
2475
Tim Rice4cec93f2002-02-26 08:40:48 -08002476dnl remove pam and dl because they are in $LIBPAM
2477if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002478 LIBS=`echo $LIBS | sed 's/-lpam //'`
2479fi
2480if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2481 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002482fi
2483
Damien Millerbac2d8a2000-09-05 16:13:06 +11002484AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002485AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2486AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002487
Damien Miller7b22d652000-06-18 14:07:04 +10002488# Print summary of options
2489
Damien Miller7b22d652000-06-18 14:07:04 +10002490# Someone please show me a better way :)
2491A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2492B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2493C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2494D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002495E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002496F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002497G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002498H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2499I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2500J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002501
2502echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002503echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002504echo " User binaries: $B"
2505echo " System binaries: $C"
2506echo " Configuration files: $D"
2507echo " Askpass program: $E"
2508echo " Manual pages: $F"
2509echo " PID file: $G"
2510echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002511if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002512echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002513else
Damien Millerf58c6722002-05-13 13:15:42 +10002514echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002515fi
Damien Millera18bbd32002-05-13 10:48:57 +10002516if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002517echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002518fi
Damien Millerf58c6722002-05-13 13:15:42 +10002519echo " Manpage format: $MANTYPE"
2520echo " PAM support: ${PAM_MSG}"
2521echo " KerberosIV support: $KRB4_MSG"
2522echo " KerberosV support: $KRB5_MSG"
2523echo " Smartcard support: $SCARD_MSG"
2524echo " AFS support: $AFS_MSG"
2525echo " S/KEY support: $SKEY_MSG"
2526echo " TCP Wrappers support: $TCPW_MSG"
2527echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002528echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002529echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2530echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2531echo " BSD Auth support: $BSD_AUTH_MSG"
2532echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002533if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002534echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002535fi
2536
Damien Miller7b22d652000-06-18 14:07:04 +10002537echo ""
2538
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002539echo " Host: ${host}"
2540echo " Compiler: ${CC}"
2541echo " Compiler flags: ${CFLAGS}"
2542echo "Preprocessor flags: ${CPPFLAGS}"
2543echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002544echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002545
2546echo ""
2547
Damien Miller82cf0ce2000-12-20 13:34:48 +11002548if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002549 echo "PAM is enabled. You may need to install a PAM control file "
2550 echo "for sshd, otherwise password authentication may fail. "
2551 echo "Example PAM control files can be found in the contrib/ "
2552 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002553 echo ""
2554fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002555
2556if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002557 echo "sftp-server will be disabled. Your compiler does not "
2558 echo "support 64bit integers."
2559 echo ""
2560fi
2561
2562if test ! -z "$RAND_HELPER_CMDHASH" ; then
2563 echo "WARNING: you are using the builtin random number collection "
2564 echo "service. Please read WARNING.RNG and request that your OS "
2565 echo "vendor includes kernel-based random number collection in "
2566 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002567 echo ""
2568fi
Damien Miller60396b02001-02-18 17:01:00 +11002569