blob: d6726eaabdaa5dc9519be2a1b79e02122e74f728 [file] [log] [blame]
Darren Tucker3c016542003-05-02 20:48:21 +10001# $Id: configure.ac,v 1.115 2003/05/02 10:48:21 dtucker 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 Millereab4bae2003-04-29 23:22:40 +100060 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110063 fi
Damien Millereab4bae2003-04-29 23:22:40 +100064 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
76 fi
77 LDFLAGS="$saved_LDFLAGS"
Tim Ricee958ed32002-07-05 07:12:33 -070078 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
81 LIBS="$LIBS -ls"
82 ])
83 ])
Damien Millereca71f82000-01-20 22:38:27 +110084 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100085 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000086 dnl AIX handles lastlog as part of its login message
87 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000088 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerec201962003-01-13 10:04:58 +110089 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
90 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller75b1d102000-01-07 14:01:41 +110091 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110092*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +110093 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -080094 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110095 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000096 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110097 AC_DEFINE(DISABLE_SHADOW)
98 AC_DEFINE(IPV4_DEFAULT)
99 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000100 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000101 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700102 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000103 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100104 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000105*-*-dgux*)
106 AC_DEFINE(IP_TOS_IS_BROKEN)
107 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000108*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000109 AC_MSG_CHECKING(if we have working getaddrinfo)
110 AC_TRY_RUN([#include <mach-o/dyld.h>
111main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
112 exit(0);
113 else
114 exit(1);
115}], [AC_MSG_RESULT(working)],
116 [AC_MSG_RESULT(buggy)
117 AC_DEFINE(BROKEN_GETADDRINFO)],
118 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000119 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000120*-*-hpux10.26)
121 if test -z "$GCC"; then
122 CFLAGS="$CFLAGS -Ae"
123 fi
124 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
125 IPADDR_IN_DISPLAY=yes
126 AC_DEFINE(HAVE_SECUREWARE)
127 AC_DEFINE(USE_PIPES)
128 AC_DEFINE(LOGIN_NO_ENDOPT)
129 AC_DEFINE(LOGIN_NEEDS_UTMPX)
130 AC_DEFINE(DISABLE_SHADOW)
131 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100132 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700133 LIBS="$LIBS -lsec -lsecpw"
134 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000135 disable_ptmx_check=yes
136 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100137*-*-hpux10*)
138 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000139 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100140 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000141 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100142 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000143 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000144 AC_DEFINE(LOGIN_NO_ENDOPT)
145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100146 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100147 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100148 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700149 LIBS="$LIBS -lsec"
150 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100151 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000152*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000153 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100154 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100155 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100156 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000157 AC_DEFINE(LOGIN_NO_ENDOPT)
158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100159 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100160 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100161 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700162 LIBS="$LIBS -lsec"
163 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000164 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100165*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000166 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000167 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100168 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000169 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000170 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100171 ;;
172*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000173 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000174 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100175 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000176 AC_DEFINE(WITH_IRIX_ARRAY)
177 AC_DEFINE(WITH_IRIX_PROJECT)
178 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000179 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000180 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000181 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100182 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100183*-*-linux*)
184 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100185 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100186 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000187 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100188 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
189 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100190 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000191 AC_MSG_CHECKING(for broken cmsg_type)
192 case `uname -r` in
193 2.0.*)
194 AC_MSG_RESULT(yes)
195 AC_DEFINE(BROKEN_CMSG_TYPE)
196 ;;
197 *)
198 AC_MSG_RESULT(no)
199 ;;
200 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100201 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000202mips-sony-bsd|mips-sony-newsos4)
203 AC_DEFINE(HAVE_NEWS4)
204 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000205 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100206*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000207 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100208 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100209 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100210*-*-freebsd*)
211 check_for_libcrypt_later=1
212 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000213*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000214 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100215 conf_utmp_location=/etc/utmp
216 conf_wtmp_location=/usr/adm/wtmp
217 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000218 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000219 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000220 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100221 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000222 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000223 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000224 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100225*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000226 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000227 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100228 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100229 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000230 AC_DEFINE(LOGIN_NEEDS_UTMPX)
231 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000232 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller933cc8f2003-03-10 11:38:10 +1100233 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000234 # hardwire lastlog location (can't detect it on some versions)
235 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000236 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
237 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
238 if test "$sol2ver" -ge 8; then
239 AC_MSG_RESULT(yes)
240 AC_DEFINE(DISABLE_UTMP)
241 AC_DEFINE(DISABLE_WTMP)
242 else
243 AC_MSG_RESULT(no)
244 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100245 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000246*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000247 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000248 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100249 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000250 conf_utmp_location=/etc/utmp
251 conf_wtmp_location=/var/adm/wtmp
252 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000253 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000254 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000255*-ncr-sysv*)
256 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
257 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700258 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000259 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000260 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000261*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700263 # /usr/ucblib MUST NOT be searched on ReliantUNIX
264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100265 IPADDR_IN_DISPLAY=yes
266 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000267 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700268 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
269 # Attention: always take care to bind libsocket and libnsl before libc,
270 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000271 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100272*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000273 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100275 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100276 ;;
277*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000278 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100279 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100280 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100281 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100282*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000283 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100284 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100285 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100286*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000287 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100288 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700289 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100290 RANLIB=true
291 no_dev_ptmx=1
292 AC_DEFINE(BROKEN_SYS_TERMIO_H)
293 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000294 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000295 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100296 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100297 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700298 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700299 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100300 ;;
301*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800302 if test -z "$GCC"; then
303 CFLAGS="$CFLAGS -belf"
304 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000305 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000306 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100307 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000308 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100309 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000310 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000311 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700312 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100313 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700314 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000315 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000316*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000317 AC_DEFINE(USE_PIPES)
318 AC_DEFINE(DISABLE_FD_PASSING)
319 LDFLAGS="$LDFLAGS"
320 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
321 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000322 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000323*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000324 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700325 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700326 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000327 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
328 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
329 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700330 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000331*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000332 AC_MSG_CHECKING(for Digital Unix SIA)
333 no_osfsia=""
334 AC_ARG_WITH(osfsia,
335 [ --with-osfsia Enable Digital Unix SIA],
336 [
337 if test "x$withval" = "xno" ; then
338 AC_MSG_RESULT(disabled)
339 no_osfsia=1
340 fi
341 ],
342 )
343 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000344 if test -f /etc/sia/matrix.conf; then
345 AC_MSG_RESULT(yes)
346 AC_DEFINE(HAVE_OSF_SIA)
347 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000348 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000349 LIBS="$LIBS -lsecurity -ldb -lm -laud"
350 else
351 AC_MSG_RESULT(no)
352 fi
353 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000354 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000355 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000356
357*-*-nto-qnx)
358 AC_DEFINE(USE_PIPES)
359 AC_DEFINE(NO_X11_UNIX_SOCKETS)
360 AC_DEFINE(MISSING_NFDBITS)
361 AC_DEFINE(MISSING_HOWMANY)
362 AC_DEFINE(MISSING_FD_MASK)
363 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100364esac
365
Damien Millere37bfc12000-06-05 09:37:43 +1000366# Allow user to specify flags
367AC_ARG_WITH(cflags,
368 [ --with-cflags Specify additional flags to pass to compiler],
369 [
370 if test "x$withval" != "xno" ; then
371 CFLAGS="$CFLAGS $withval"
372 fi
373 ]
374)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000375AC_ARG_WITH(cppflags,
376 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
377 [
378 if test "x$withval" != "xno"; then
379 CPPFLAGS="$CPPFLAGS $withval"
380 fi
381 ]
382)
Damien Millere37bfc12000-06-05 09:37:43 +1000383AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000384 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000385 [
386 if test "x$withval" != "xno" ; then
387 LDFLAGS="$LDFLAGS $withval"
388 fi
389 ]
390)
391AC_ARG_WITH(libs,
392 [ --with-libs Specify additional libraries to link with],
393 [
394 if test "x$withval" != "xno" ; then
395 LIBS="$LIBS $withval"
396 fi
397 ]
398)
399
Tim Rice4cec93f2002-02-26 08:40:48 -0800400# Checks for header files.
401AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100402 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800403 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000404 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000405 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800406 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100407 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000408 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700409 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800410 util.h utime.h utmp.h utmpx.h)
411
Damien Millera22ba012000-03-02 23:09:20 +1100412# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700413AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
414AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000415
Damien Millerdf288022001-02-18 13:07:07 +1100416dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700417if test "x$with_tcp_wrappers" != "xno" ; then
418 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
419 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
420 fi
421fi
Damien Millerdf288022001-02-18 13:07:07 +1100422
Tim Rice13aae5e2001-10-21 17:53:58 -0700423AC_CHECK_FUNC(getspnam, ,
424 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700425
Damien Miller150c8b52002-02-13 23:06:56 +1100426AC_ARG_WITH(rpath,
427 [ --without-rpath Disable auto-added -R linker paths],
428 [
429 if test "x$withval" = "xno" ; then
430 need_dash_r=""
431 fi
432 if test "x$withval" = "xyes" ; then
433 need_dash_r=1
434 fi
435 ]
436)
437
Tim Rice13aae5e2001-10-21 17:53:58 -0700438dnl zlib is required
439AC_ARG_WITH(zlib,
440 [ --with-zlib=PATH Use zlib in PATH],
441 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000442 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100443 AC_MSG_ERROR([*** zlib is required ***])
444 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700445 if test -d "$withval/lib"; then
446 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700447 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700448 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700449 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700450 fi
451 else
452 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700453 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700454 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700455 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700456 fi
457 fi
458 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700459 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700460 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700461 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700462 fi
463 ]
464)
465
Tim Rice17b93e52001-10-23 22:36:54 -0700466AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100467
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000468dnl UnixWare 2.x
469AC_CHECK_FUNC(strcasecmp,
470 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
471)
472AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700473 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
474 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000475)
Damien Millerab18c411999-11-11 10:40:23 +1100476
Tim Ricee589a292001-11-03 11:09:32 -0800477dnl Checks for libutil functions
478AC_CHECK_HEADERS(libutil.h)
479AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
480AC_CHECK_FUNCS(logout updwtmp logwtmp)
481
Ben Lindstrom8697e082001-02-24 21:41:10 +0000482AC_FUNC_STRFTIME
483
Damien Miller3c027682001-03-14 11:39:45 +1100484# Check for ALTDIRFUNC glob() extension
485AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
486AC_EGREP_CPP(FOUNDIT,
487 [
488 #include <glob.h>
489 #ifdef GLOB_ALTDIRFUNC
490 FOUNDIT
491 #endif
492 ],
493 [
494 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
495 AC_MSG_RESULT(yes)
496 ],
497 [
498 AC_MSG_RESULT(no)
499 ]
500)
Damien Millerab18c411999-11-11 10:40:23 +1100501
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000502# Check for g.gl_matchc glob() extension
503AC_MSG_CHECKING(for gl_matchc field in glob_t)
504AC_EGREP_CPP(FOUNDIT,
505 [
506 #include <glob.h>
507 int main(void){glob_t g; g.gl_matchc = 1;}
508 ],
509 [
510 AC_DEFINE(GLOB_HAS_GL_MATCHC)
511 AC_MSG_RESULT(yes)
512 ],
513 [
514 AC_MSG_RESULT(no)
515 ]
516)
517
Damien Miller18bb4732001-03-28 14:35:30 +1000518AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
519AC_TRY_RUN(
520 [
521#include <sys/types.h>
522#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700523int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000524 ],
525 [AC_MSG_RESULT(yes)],
526 [
527 AC_MSG_RESULT(no)
528 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
529 ]
530)
531
Damien Millerc547bf12001-02-16 10:18:12 +1100532# Check whether user wants S/Key support
533SKEY_MSG="no"
534AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700535 [ --with-skey[[=PATH]] Enable S/Key support
536 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100537 [
538 if test "x$withval" != "xno" ; then
539
540 if test "x$withval" != "xyes" ; then
541 CPPFLAGS="$CPPFLAGS -I${withval}/include"
542 LDFLAGS="$LDFLAGS -L${withval}/lib"
543 fi
544
545 AC_DEFINE(SKEY)
546 LIBS="-lskey $LIBS"
547 SKEY_MSG="yes"
548
Tim Rice4cec93f2002-02-26 08:40:48 -0800549 AC_MSG_CHECKING([for s/key support])
550 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100551 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800552#include <stdio.h>
553#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700554int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800555 ],
556 [AC_MSG_RESULT(yes)],
557 [
558 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100559 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
560 ])
561 fi
562 ]
563)
564
565# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700566TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100567AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
569 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100570 [
571 if test "x$withval" != "xno" ; then
572 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700573 saved_LDFLAGS="$LDFLAGS"
574 saved_CPPFLAGS="$CPPFLAGS"
575 if test -n "${withval}" -a "${withval}" != "yes"; then
576 if test -d "${withval}/lib"; then
577 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700578 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700579 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700580 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700581 fi
582 else
583 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700584 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700585 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700586 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700587 fi
588 fi
589 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700590 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700591 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700592 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700593 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700594 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800595 LIBWRAP="-lwrap"
596 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100597 AC_MSG_CHECKING(for libwrap)
598 AC_TRY_LINK(
599 [
600#include <tcpd.h>
601 int deny_severity = 0, allow_severity = 0;
602 ],
603 [hosts_access(0);],
604 [
605 AC_MSG_RESULT(yes)
606 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800607 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700608 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100609 ],
610 [
611 AC_MSG_ERROR([*** libwrap missing])
612 ]
613 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800614 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100615 fi
616 ]
617)
618
Damien Millerfe1f1432003-02-24 15:45:42 +1100619dnl Checks for library functions. Please keep in alphabetical order
620AC_CHECK_FUNCS(\
621 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
622 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
623 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
624 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
625 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
626 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
627 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
628 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
629 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
630 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
631 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
632)
Tim Rice13aae5e2001-10-21 17:53:58 -0700633
Damien Millercd6853c2003-01-28 11:33:42 +1100634AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000635AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100636
Ben Lindstrom3e006472002-10-16 00:24:03 +0000637dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
638AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
639
Tim Rice13aae5e2001-10-21 17:53:58 -0700640dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700641AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700642 AC_CHECK_LIB(gen, dirname,[
643 AC_CACHE_CHECK([for broken dirname],
644 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700645 save_LIBS="$LIBS"
646 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700647 AC_TRY_RUN(
648 [
649#include <libgen.h>
650#include <string.h>
651
652int main(int argc, char **argv) {
653 char *s, buf[32];
654
655 strncpy(buf,"/etc", 32);
656 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700657 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700658 exit(1);
659 } else {
660 exit(0);
661 }
662}
663 ],
664 [ ac_cv_have_broken_dirname="no" ],
665 [ ac_cv_have_broken_dirname="yes" ]
666 )
Tim Rice17b93e52001-10-23 22:36:54 -0700667 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700668 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700669 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700670 LIBS="$LIBS -lgen"
671 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700672 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700673 fi
674 ])
675])
676
Damien Millerad833b32000-08-23 10:46:23 +1000677dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000678AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000679dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000680AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000681AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000682dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000683AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000684AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100685
Damien Miller04f80141999-11-19 15:32:34 +1100686AC_CHECK_FUNC(daemon,
687 [AC_DEFINE(HAVE_DAEMON)],
688 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
689)
690
Damien Miller9fb07e42000-03-05 16:22:59 +1100691AC_CHECK_FUNC(getpagesize,
692 [AC_DEFINE(HAVE_GETPAGESIZE)],
693 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
694)
695
Damien Millercb170cb2000-07-01 16:52:55 +1000696# Check for broken snprintf
697if test "x$ac_cv_func_snprintf" = "xyes" ; then
698 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
699 AC_TRY_RUN(
700 [
701#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700702int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000703 ],
704 [AC_MSG_RESULT(yes)],
705 [
706 AC_MSG_RESULT(no)
707 AC_DEFINE(BROKEN_SNPRINTF)
708 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
709 ]
710 )
711fi
712
Damien Millere8328192003-01-07 15:18:32 +1100713dnl see whether mkstemp() requires XXXXXX
714if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
715AC_MSG_CHECKING([for (overly) strict mkstemp])
716AC_TRY_RUN(
717 [
718#include <stdlib.h>
719main() { char template[]="conftest.mkstemp-test";
720if (mkstemp(template) == -1)
721 exit(1);
722unlink(template); exit(0);
723}
724 ],
725 [
726 AC_MSG_RESULT(no)
727 ],
728 [
729 AC_MSG_RESULT(yes)
730 AC_DEFINE(HAVE_STRICT_MKSTEMP)
731 ],
732 [
733 AC_MSG_RESULT(yes)
734 AC_DEFINE(HAVE_STRICT_MKSTEMP)
735 ]
736)
737fi
738
Damien Miller606f8802000-09-16 15:39:56 +1100739AC_FUNC_GETPGRP
740
Damien Millera64b57a2001-01-17 10:44:13 +1100741# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000742PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100743AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100744 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100745 [
Damien Millera64b57a2001-01-17 10:44:13 +1100746 if test "x$withval" != "xno" ; then
747 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
748 AC_MSG_ERROR([PAM headers not found])
749 fi
750
751 AC_CHECK_LIB(dl, dlopen, , )
752 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
753 AC_CHECK_FUNCS(pam_getenvlist)
754
755 disable_shadow=yes
756 PAM_MSG="yes"
757
758 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800759 if test $ac_cv_lib_dl_dlopen = yes; then
760 LIBPAM="-lpam -ldl"
761 else
762 LIBPAM="-lpam"
763 fi
764 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100765 fi
766 ]
767)
Damien Millera22ba012000-03-02 23:09:20 +1100768
Damien Millera64b57a2001-01-17 10:44:13 +1100769# Check for older PAM
770if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100771 # Check PAM strerror arguments (old PAM)
772 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
773 AC_TRY_COMPILE(
774 [
Damien Miller81171112000-04-23 11:14:01 +1000775#include <stdlib.h>
776#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100777 ],
778 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
779 [AC_MSG_RESULT(no)],
780 [
781 AC_DEFINE(HAVE_OLD_PAM)
782 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000783 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100784 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100785 )
Damien Millera22ba012000-03-02 23:09:20 +1100786fi
787
Damien Millerfc93d4b2002-09-04 23:26:29 +1000788# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
789# because the system crypt() is more featureful.
790if test "x$check_for_libcrypt_before" = "x1"; then
791 AC_CHECK_LIB(crypt, crypt)
792fi
793
Tim Riceaef73712002-05-11 13:17:42 -0700794# Search for OpenSSL
795saved_CPPFLAGS="$CPPFLAGS"
796saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100797AC_ARG_WITH(ssl-dir,
798 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
799 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000800 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700801 if test -d "$withval/lib"; then
802 if test -n "${need_dash_r}"; then
803 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
804 else
805 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
806 fi
807 else
808 if test -n "${need_dash_r}"; then
809 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
810 else
811 LDFLAGS="-L${withval} ${LDFLAGS}"
812 fi
813 fi
814 if test -d "$withval/include"; then
815 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
816 else
817 CPPFLAGS="-I${withval} ${CPPFLAGS}"
818 fi
Damien Millera22ba012000-03-02 23:09:20 +1100819 fi
820 ]
821)
Tim Riceaef73712002-05-11 13:17:42 -0700822LIBS="$LIBS -lcrypto"
823AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000824 [
Tim Riceaef73712002-05-11 13:17:42 -0700825 dnl Check default openssl install dir
826 if test -n "${need_dash_r}"; then
827 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000828 else
Tim Riceaef73712002-05-11 13:17:42 -0700829 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000830 fi
Tim Riceaef73712002-05-11 13:17:42 -0700831 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
832 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
833 [
834 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
835 ]
836 )
837 ]
838)
839
Tim Riced730b782002-08-13 18:52:10 -0700840# Determine OpenSSL header version
841AC_MSG_CHECKING([OpenSSL header version])
842AC_TRY_RUN(
843 [
844#include <stdio.h>
845#include <string.h>
846#include <openssl/opensslv.h>
847#define DATA "conftest.sslincver"
848int main(void) {
849 FILE *fd;
850 int rc;
851
852 fd = fopen(DATA,"w");
853 if(fd == NULL)
854 exit(1);
855
856 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
857 exit(1);
858
859 exit(0);
860}
861 ],
862 [
863 ssl_header_ver=`cat conftest.sslincver`
864 AC_MSG_RESULT($ssl_header_ver)
865 ],
866 [
867 AC_MSG_RESULT(not found)
868 AC_MSG_ERROR(OpenSSL version header not found.)
869 ]
870)
871
872# Determine OpenSSL library version
873AC_MSG_CHECKING([OpenSSL library version])
874AC_TRY_RUN(
875 [
876#include <stdio.h>
877#include <string.h>
878#include <openssl/opensslv.h>
879#include <openssl/crypto.h>
880#define DATA "conftest.ssllibver"
881int main(void) {
882 FILE *fd;
883 int rc;
884
885 fd = fopen(DATA,"w");
886 if(fd == NULL)
887 exit(1);
888
889 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
890 exit(1);
891
892 exit(0);
893}
894 ],
895 [
896 ssl_library_ver=`cat conftest.ssllibver`
897 AC_MSG_RESULT($ssl_library_ver)
898 ],
899 [
900 AC_MSG_RESULT(not found)
901 AC_MSG_ERROR(OpenSSL library not found.)
902 ]
903)
Damien Millera22ba012000-03-02 23:09:20 +1100904
Damien Millerec932372002-01-22 22:16:03 +1100905# Sanity check OpenSSL headers
906AC_MSG_CHECKING([whether OpenSSL's headers match the library])
907AC_TRY_RUN(
908 [
909#include <string.h>
910#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700911int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100912 ],
913 [
914 AC_MSG_RESULT(yes)
915 ],
916 [
917 AC_MSG_RESULT(no)
918 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
919 ]
920)
921
Damien Millera64b57a2001-01-17 10:44:13 +1100922# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
923# version in OpenSSL. Skip this for PAM
924if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100925 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100926fi
927
Damien Miller6c21c512002-01-22 21:57:53 +1100928
929### Configure cryptographic random number support
930
931# Check wheter OpenSSL seeds itself
932AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
933AC_TRY_RUN(
934 [
935#include <string.h>
936#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700937int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100938 ],
939 [
940 OPENSSL_SEEDS_ITSELF=yes
941 AC_MSG_RESULT(yes)
942 ],
943 [
944 AC_MSG_RESULT(no)
945 # Default to use of the rand helper if OpenSSL doesn't
946 # seed itself
947 USE_RAND_HELPER=yes
948 ]
949)
950
951
952# Do we want to force the use of the rand helper?
953AC_ARG_WITH(rand-helper,
954 [ --with-rand-helper Use subprocess to gather strong randomness ],
955 [
956 if test "x$withval" = "xno" ; then
957 # Force use of OpenSSL's internal RNG, even if
958 # the previous test showed it to be unseeded.
959 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
960 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
961 OPENSSL_SEEDS_ITSELF=yes
962 USE_RAND_HELPER=""
963 fi
964 else
965 USE_RAND_HELPER=yes
966 fi
967 ],
968)
969
970# Which randomness source do we use?
971if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
972 # OpenSSL only
973 AC_DEFINE(OPENSSL_PRNG_ONLY)
974 RAND_MSG="OpenSSL internal ONLY"
975 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800976elif test ! -z "$USE_RAND_HELPER" ; then
977 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100978 RAND_MSG="ssh-rand-helper"
979 INSTALL_SSH_RAND_HELPER="yes"
980fi
981AC_SUBST(INSTALL_SSH_RAND_HELPER)
982
983### Configuration of ssh-rand-helper
984
985# PRNGD TCP socket
986AC_ARG_WITH(prngd-port,
987 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
988 [
Damien Millere996d722002-01-23 11:20:59 +1100989 case "$withval" in
990 no)
991 withval=""
992 ;;
993 [[0-9]]*)
994 ;;
995 *)
996 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
997 ;;
998 esac
999 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001000 PRNGD_PORT="$withval"
1001 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1002 fi
1003 ]
1004)
1005
1006# PRNGD Unix domain socket
1007AC_ARG_WITH(prngd-socket,
1008 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1009 [
Damien Millere996d722002-01-23 11:20:59 +11001010 case "$withval" in
1011 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001012 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001013 ;;
1014 no)
1015 withval=""
1016 ;;
1017 /*)
1018 ;;
1019 *)
1020 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1021 ;;
1022 esac
1023
1024 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001025 if test ! -z "$PRNGD_PORT" ; then
1026 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1027 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001028 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001029 AC_MSG_WARN(Entropy socket is not readable)
1030 fi
1031 PRNGD_SOCKET="$withval"
1032 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1033 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001034 ],
1035 [
1036 # Check for existing socket only if we don't have a random device already
1037 if test "$USE_RAND_HELPER" = yes ; then
1038 AC_MSG_CHECKING(for PRNGD/EGD socket)
1039 # Insert other locations here
1040 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1041 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1042 PRNGD_SOCKET="$sock"
1043 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1044 break;
1045 fi
1046 done
1047 if test ! -z "$PRNGD_SOCKET" ; then
1048 AC_MSG_RESULT($PRNGD_SOCKET)
1049 else
1050 AC_MSG_RESULT(not found)
1051 fi
1052 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001053 ]
1054)
1055
1056# Change default command timeout for hashing entropy source
1057entropy_timeout=200
1058AC_ARG_WITH(entropy-timeout,
1059 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1060 [
1061 if test "x$withval" != "xno" ; then
1062 entropy_timeout=$withval
1063 fi
1064 ]
1065)
Damien Miller6c21c512002-01-22 21:57:53 +11001066AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1067
Damien Millerd3f6ad22002-06-25 10:24:47 +10001068SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001069AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001070 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001071 [
1072 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001073 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001074 fi
1075 ]
1076)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001077AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1078AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001079
Tim Rice88f2ab52002-03-17 12:17:34 -08001080# We do this little dance with the search path to insure
1081# that programs that we select for use by installed programs
1082# (which may be run by the super-user) come from trusted
1083# locations before they come from the user's private area.
1084# This should help avoid accidentally configuring some
1085# random version of a program in someone's personal bin.
1086
1087OPATH=$PATH
1088PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001089test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001090test -d /sbin && PATH=$PATH:/sbin
1091test -d /usr/sbin && PATH=$PATH:/usr/sbin
1092PATH=$PATH:/etc:$OPATH
1093
Damien Miller6c21c512002-01-22 21:57:53 +11001094# These programs are used by the command hashing source to gather entropy
1095OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1096OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1097OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1098OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1099OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1100OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1101OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1102OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1103OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1104OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1105OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1106OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1107OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1108OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1109OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1110OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001111# restore PATH
1112PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001113
1114# Where does ssh-rand-helper get its randomness from?
1115INSTALL_SSH_PRNG_CMDS=""
1116if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1117 if test ! -z "$PRNGD_PORT" ; then
1118 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1119 elif test ! -z "$PRNGD_SOCKET" ; then
1120 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1121 else
1122 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1123 RAND_HELPER_CMDHASH=yes
1124 INSTALL_SSH_PRNG_CMDS="yes"
1125 fi
1126fi
1127AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1128
1129
Ben Lindstromb5628642000-10-18 00:02:25 +00001130# Cheap hack to ensure NEWS-OS libraries are arranged right.
1131if test ! -z "$SONY" ; then
1132 LIBS="$LIBS -liberty";
1133fi
1134
Damien Millera22ba012000-03-02 23:09:20 +11001135# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001136AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001137AC_CHECK_SIZEOF(short int, 2)
1138AC_CHECK_SIZEOF(int, 4)
1139AC_CHECK_SIZEOF(long int, 4)
1140AC_CHECK_SIZEOF(long long int, 8)
1141
Damien Millerfa2bb692002-04-23 23:22:25 +10001142# Sanity check long long for some platforms (AIX)
1143if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1144 ac_cv_sizeof_long_long_int=0
1145fi
1146
Damien Millera22ba012000-03-02 23:09:20 +11001147# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001148AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1149 AC_TRY_COMPILE(
1150 [ #include <sys/types.h> ],
1151 [ u_int a; a = 1;],
1152 [ ac_cv_have_u_int="yes" ],
1153 [ ac_cv_have_u_int="no" ]
1154 )
1155])
1156if test "x$ac_cv_have_u_int" = "xyes" ; then
1157 AC_DEFINE(HAVE_U_INT)
1158 have_u_int=1
1159fi
1160
Damien Miller61e50f12000-05-08 20:49:37 +10001161AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1162 AC_TRY_COMPILE(
1163 [ #include <sys/types.h> ],
1164 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1165 [ ac_cv_have_intxx_t="yes" ],
1166 [ ac_cv_have_intxx_t="no" ]
1167 )
1168])
1169if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1170 AC_DEFINE(HAVE_INTXX_T)
1171 have_intxx_t=1
1172fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001173
1174if (test -z "$have_intxx_t" && \
1175 test "x$ac_cv_header_stdint_h" = "xyes")
1176then
1177 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1178 AC_TRY_COMPILE(
1179 [ #include <stdint.h> ],
1180 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1181 [
1182 AC_DEFINE(HAVE_INTXX_T)
1183 AC_MSG_RESULT(yes)
1184 ],
1185 [ AC_MSG_RESULT(no) ]
1186 )
1187fi
1188
Damien Miller578783e2000-09-23 14:12:24 +11001189AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1190 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001191 [
1192#include <sys/types.h>
1193#ifdef HAVE_STDINT_H
1194# include <stdint.h>
1195#endif
1196#include <sys/socket.h>
1197#ifdef HAVE_SYS_BITYPES_H
1198# include <sys/bitypes.h>
1199#endif
1200 ],
Damien Miller578783e2000-09-23 14:12:24 +11001201 [ int64_t a; a = 1;],
1202 [ ac_cv_have_int64_t="yes" ],
1203 [ ac_cv_have_int64_t="no" ]
1204 )
1205])
1206if test "x$ac_cv_have_int64_t" = "xyes" ; then
1207 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001208fi
1209
Damien Miller61e50f12000-05-08 20:49:37 +10001210AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1211 AC_TRY_COMPILE(
1212 [ #include <sys/types.h> ],
1213 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1214 [ ac_cv_have_u_intxx_t="yes" ],
1215 [ ac_cv_have_u_intxx_t="no" ]
1216 )
1217])
1218if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1219 AC_DEFINE(HAVE_U_INTXX_T)
1220 have_u_intxx_t=1
1221fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001222
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001223if test -z "$have_u_intxx_t" ; then
1224 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1225 AC_TRY_COMPILE(
1226 [ #include <sys/socket.h> ],
1227 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1228 [
1229 AC_DEFINE(HAVE_U_INTXX_T)
1230 AC_MSG_RESULT(yes)
1231 ],
1232 [ AC_MSG_RESULT(no) ]
1233 )
1234fi
1235
Damien Miller578783e2000-09-23 14:12:24 +11001236AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1237 AC_TRY_COMPILE(
1238 [ #include <sys/types.h> ],
1239 [ u_int64_t a; a = 1;],
1240 [ ac_cv_have_u_int64_t="yes" ],
1241 [ ac_cv_have_u_int64_t="no" ]
1242 )
1243])
1244if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1245 AC_DEFINE(HAVE_U_INT64_T)
1246 have_u_int64_t=1
1247fi
1248
Tim Rice4cec93f2002-02-26 08:40:48 -08001249if test -z "$have_u_int64_t" ; then
1250 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1251 AC_TRY_COMPILE(
1252 [ #include <sys/bitypes.h> ],
1253 [ u_int64_t a; a = 1],
1254 [
1255 AC_DEFINE(HAVE_U_INT64_T)
1256 AC_MSG_RESULT(yes)
1257 ],
1258 [ AC_MSG_RESULT(no) ]
1259 )
1260fi
1261
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001262if test -z "$have_u_intxx_t" ; then
1263 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1264 AC_TRY_COMPILE(
1265 [
1266#include <sys/types.h>
1267 ],
1268 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1269 [ ac_cv_have_uintxx_t="yes" ],
1270 [ ac_cv_have_uintxx_t="no" ]
1271 )
1272 ])
1273 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1274 AC_DEFINE(HAVE_UINTXX_T)
1275 fi
1276fi
1277
1278if test -z "$have_uintxx_t" ; then
1279 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1280 AC_TRY_COMPILE(
1281 [ #include <stdint.h> ],
1282 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1283 [
1284 AC_DEFINE(HAVE_UINTXX_T)
1285 AC_MSG_RESULT(yes)
1286 ],
1287 [ AC_MSG_RESULT(no) ]
1288 )
1289fi
1290
Damien Milleredb82922000-06-20 13:25:52 +10001291if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1292 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001293then
1294 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1295 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001296 [
1297#include <sys/bitypes.h>
1298 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001299 [
Damien Miller70494d12000-04-03 15:57:06 +10001300 int8_t a; int16_t b; int32_t c;
1301 u_int8_t e; u_int16_t f; u_int32_t g;
1302 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001303 ],
1304 [
1305 AC_DEFINE(HAVE_U_INTXX_T)
1306 AC_DEFINE(HAVE_INTXX_T)
1307 AC_MSG_RESULT(yes)
1308 ],
1309 [AC_MSG_RESULT(no)]
1310 )
1311fi
1312
Damien Miller58be7382001-09-15 21:31:54 +10001313
1314AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1315 AC_TRY_COMPILE(
1316 [
1317#include <sys/types.h>
1318 ],
1319 [ u_char foo; foo = 125; ],
1320 [ ac_cv_have_u_char="yes" ],
1321 [ ac_cv_have_u_char="no" ]
1322 )
1323])
1324if test "x$ac_cv_have_u_char" = "xyes" ; then
1325 AC_DEFINE(HAVE_U_CHAR)
1326fi
1327
Tim Rice13aae5e2001-10-21 17:53:58 -07001328TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001329
Tim Rice200a5c02002-02-26 22:12:34 -08001330AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001331
Damien Miller61e50f12000-05-08 20:49:37 +10001332AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1333 AC_TRY_COMPILE(
1334 [
1335#include <sys/types.h>
1336 ],
1337 [ size_t foo; foo = 1235; ],
1338 [ ac_cv_have_size_t="yes" ],
1339 [ ac_cv_have_size_t="no" ]
1340 )
1341])
1342if test "x$ac_cv_have_size_t" = "xyes" ; then
1343 AC_DEFINE(HAVE_SIZE_T)
1344fi
Damien Miller95058511999-12-29 10:36:45 +11001345
Damien Miller615f9392000-05-17 22:53:33 +10001346AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1347 AC_TRY_COMPILE(
1348 [
1349#include <sys/types.h>
1350 ],
1351 [ ssize_t foo; foo = 1235; ],
1352 [ ac_cv_have_ssize_t="yes" ],
1353 [ ac_cv_have_ssize_t="no" ]
1354 )
1355])
1356if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1357 AC_DEFINE(HAVE_SSIZE_T)
1358fi
1359
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001360AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1361 AC_TRY_COMPILE(
1362 [
1363#include <time.h>
1364 ],
1365 [ clock_t foo; foo = 1235; ],
1366 [ ac_cv_have_clock_t="yes" ],
1367 [ ac_cv_have_clock_t="no" ]
1368 )
1369])
1370if test "x$ac_cv_have_clock_t" = "xyes" ; then
1371 AC_DEFINE(HAVE_CLOCK_T)
1372fi
1373
Damien Millerb54b40e2000-06-23 08:23:34 +10001374AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1375 AC_TRY_COMPILE(
1376 [
1377#include <sys/types.h>
1378#include <sys/socket.h>
1379 ],
1380 [ sa_family_t foo; foo = 1235; ],
1381 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001382 [ AC_TRY_COMPILE(
1383 [
1384#include <sys/types.h>
1385#include <sys/socket.h>
1386#include <netinet/in.h>
1387 ],
1388 [ sa_family_t foo; foo = 1235; ],
1389 [ ac_cv_have_sa_family_t="yes" ],
1390
Damien Millerb54b40e2000-06-23 08:23:34 +10001391 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001392 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001393 )
1394])
1395if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1396 AC_DEFINE(HAVE_SA_FAMILY_T)
1397fi
1398
Damien Miller0f91b4e2000-06-18 15:43:25 +10001399AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1400 AC_TRY_COMPILE(
1401 [
1402#include <sys/types.h>
1403 ],
1404 [ pid_t foo; foo = 1235; ],
1405 [ ac_cv_have_pid_t="yes" ],
1406 [ ac_cv_have_pid_t="no" ]
1407 )
1408])
1409if test "x$ac_cv_have_pid_t" = "xyes" ; then
1410 AC_DEFINE(HAVE_PID_T)
1411fi
1412
1413AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1414 AC_TRY_COMPILE(
1415 [
1416#include <sys/types.h>
1417 ],
1418 [ mode_t foo; foo = 1235; ],
1419 [ ac_cv_have_mode_t="yes" ],
1420 [ ac_cv_have_mode_t="no" ]
1421 )
1422])
1423if test "x$ac_cv_have_mode_t" = "xyes" ; then
1424 AC_DEFINE(HAVE_MODE_T)
1425fi
1426
Damien Miller61e50f12000-05-08 20:49:37 +10001427
1428AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1429 AC_TRY_COMPILE(
1430 [
Damien Miller81171112000-04-23 11:14:01 +10001431#include <sys/types.h>
1432#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001433 ],
1434 [ struct sockaddr_storage s; ],
1435 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1436 [ ac_cv_have_struct_sockaddr_storage="no" ]
1437 )
1438])
1439if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1440 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1441fi
Damien Miller34132e52000-01-14 15:45:46 +11001442
Damien Miller61e50f12000-05-08 20:49:37 +10001443AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1444 AC_TRY_COMPILE(
1445 [
Damien Miller7b22d652000-06-18 14:07:04 +10001446#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001447#include <netinet/in.h>
1448 ],
1449 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1450 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1451 [ ac_cv_have_struct_sockaddr_in6="no" ]
1452 )
1453])
1454if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1455 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1456fi
Damien Miller34132e52000-01-14 15:45:46 +11001457
Damien Miller61e50f12000-05-08 20:49:37 +10001458AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1459 AC_TRY_COMPILE(
1460 [
Damien Miller7b22d652000-06-18 14:07:04 +10001461#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001462#include <netinet/in.h>
1463 ],
1464 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1465 [ ac_cv_have_struct_in6_addr="yes" ],
1466 [ ac_cv_have_struct_in6_addr="no" ]
1467 )
1468])
1469if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1470 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1471fi
Damien Miller34132e52000-01-14 15:45:46 +11001472
Damien Miller61e50f12000-05-08 20:49:37 +10001473AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1474 AC_TRY_COMPILE(
1475 [
Damien Miller81171112000-04-23 11:14:01 +10001476#include <sys/types.h>
1477#include <sys/socket.h>
1478#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001479 ],
1480 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1481 [ ac_cv_have_struct_addrinfo="yes" ],
1482 [ ac_cv_have_struct_addrinfo="no" ]
1483 )
1484])
1485if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1486 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1487fi
1488
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001489AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1490 AC_TRY_COMPILE(
1491 [ #include <sys/time.h> ],
1492 [ struct timeval tv; tv.tv_sec = 1;],
1493 [ ac_cv_have_struct_timeval="yes" ],
1494 [ ac_cv_have_struct_timeval="no" ]
1495 )
1496])
1497if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1498 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1499 have_struct_timeval=1
1500fi
1501
Tim Rice4e4dc562003-03-18 10:21:40 -08001502AC_CHECK_TYPES(struct timespec)
1503
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001504# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001505if test "x$ac_cv_have_int64_t" = "xno" -a \
1506 "x$ac_cv_sizeof_long_int" != "x8" -a \
1507 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001508 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1509 echo "an alternative compiler (I.E., GCC) before continuing."
1510 echo ""
1511 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001512else
1513dnl test snprintf (broken on SCO w/gcc)
1514 AC_TRY_RUN(
1515 [
1516#include <stdio.h>
1517#include <string.h>
1518#ifdef HAVE_SNPRINTF
1519main()
1520{
1521 char buf[50];
1522 char expected_out[50];
1523 int mazsize = 50 ;
1524#if (SIZEOF_LONG_INT == 8)
1525 long int num = 0x7fffffffffffffff;
1526#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001527 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001528#endif
1529 strcpy(expected_out, "9223372036854775807");
1530 snprintf(buf, mazsize, "%lld", num);
1531 if(strcmp(buf, expected_out) != 0)
1532 exit(1);
1533 exit(0);
1534}
1535#else
1536main() { exit(0); }
1537#endif
1538 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1539 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001540fi
1541
Damien Miller78315eb2000-09-29 23:01:36 +11001542dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001543OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1544OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1545OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1546OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1547OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001548OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001549OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1550OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001551OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001552OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1553OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1554OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1555OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001556OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1557OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1558OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1559OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001560
1561AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001562
Damien Miller61e50f12000-05-08 20:49:37 +10001563AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1564 ac_cv_have_ss_family_in_struct_ss, [
1565 AC_TRY_COMPILE(
1566 [
Damien Miller81171112000-04-23 11:14:01 +10001567#include <sys/types.h>
1568#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001569 ],
1570 [ struct sockaddr_storage s; s.ss_family = 1; ],
1571 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1572 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1573 )
1574])
1575if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1576 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1577fi
1578
Damien Miller61e50f12000-05-08 20:49:37 +10001579AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1580 ac_cv_have___ss_family_in_struct_ss, [
1581 AC_TRY_COMPILE(
1582 [
Damien Miller81171112000-04-23 11:14:01 +10001583#include <sys/types.h>
1584#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001585 ],
1586 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1587 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1588 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1589 )
1590])
1591if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1592 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1593fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001594
Damien Millerad833b32000-08-23 10:46:23 +10001595AC_CACHE_CHECK([for pw_class field in struct passwd],
1596 ac_cv_have_pw_class_in_struct_passwd, [
1597 AC_TRY_COMPILE(
1598 [
Damien Millerad833b32000-08-23 10:46:23 +10001599#include <pwd.h>
1600 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001601 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001602 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1603 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1604 )
1605])
1606if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1607 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1608fi
1609
Kevin Steves82456952001-06-22 21:14:18 +00001610AC_CACHE_CHECK([for pw_expire field in struct passwd],
1611 ac_cv_have_pw_expire_in_struct_passwd, [
1612 AC_TRY_COMPILE(
1613 [
1614#include <pwd.h>
1615 ],
1616 [ struct passwd p; p.pw_expire = 0; ],
1617 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1618 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1619 )
1620])
1621if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1622 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1623fi
1624
1625AC_CACHE_CHECK([for pw_change field in struct passwd],
1626 ac_cv_have_pw_change_in_struct_passwd, [
1627 AC_TRY_COMPILE(
1628 [
1629#include <pwd.h>
1630 ],
1631 [ struct passwd p; p.pw_change = 0; ],
1632 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1633 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1634 )
1635])
1636if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1637 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1638fi
Damien Miller61e50f12000-05-08 20:49:37 +10001639
Tim Rice28bbb0c2002-05-27 17:37:32 -07001640dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001641AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1642 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001643 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001644 [
Tim Riceae49fe62002-04-12 10:26:21 -07001645#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001646#include <sys/socket.h>
1647#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001648int main() {
1649#ifdef msg_accrights
1650exit(1);
1651#endif
1652struct msghdr m;
1653m.msg_accrights = 0;
1654exit(0);
1655}
Kevin Steves939c9db2002-03-22 17:23:25 +00001656 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001657 [ ac_cv_have_accrights_in_msghdr="yes" ],
1658 [ ac_cv_have_accrights_in_msghdr="no" ]
1659 )
1660])
1661if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1662 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1663fi
1664
Kevin Stevesa44e0352002-04-07 16:18:03 +00001665AC_CACHE_CHECK([for msg_control field in struct msghdr],
1666 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001667 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001668 [
Tim Riceae49fe62002-04-12 10:26:21 -07001669#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001670#include <sys/socket.h>
1671#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001672int main() {
1673#ifdef msg_control
1674exit(1);
1675#endif
1676struct msghdr m;
1677m.msg_control = 0;
1678exit(0);
1679}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001680 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001681 [ ac_cv_have_control_in_msghdr="yes" ],
1682 [ ac_cv_have_control_in_msghdr="no" ]
1683 )
1684])
1685if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1686 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1687fi
1688
Damien Miller61e50f12000-05-08 20:49:37 +10001689AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1690 AC_TRY_LINK([],
1691 [ extern char *__progname; printf("%s", __progname); ],
1692 [ ac_cv_libc_defines___progname="yes" ],
1693 [ ac_cv_libc_defines___progname="no" ]
1694 )
1695])
1696if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1697 AC_DEFINE(HAVE___PROGNAME)
1698fi
1699
Kevin Steves4846f4a2002-03-22 18:19:53 +00001700AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1701 AC_TRY_LINK([
1702#include <stdio.h>
1703],
1704 [ printf("%s", __FUNCTION__); ],
1705 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1706 [ ac_cv_cc_implements___FUNCTION__="no" ]
1707 )
1708])
1709if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1710 AC_DEFINE(HAVE___FUNCTION__)
1711fi
1712
1713AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1714 AC_TRY_LINK([
1715#include <stdio.h>
1716],
1717 [ printf("%s", __func__); ],
1718 [ ac_cv_cc_implements___func__="yes" ],
1719 [ ac_cv_cc_implements___func__="no" ]
1720 )
1721])
1722if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1723 AC_DEFINE(HAVE___func__)
1724fi
1725
Damien Miller4f8e6692001-07-14 13:22:53 +10001726AC_CACHE_CHECK([whether getopt has optreset support],
1727 ac_cv_have_getopt_optreset, [
1728 AC_TRY_LINK(
1729 [
1730#include <getopt.h>
1731 ],
1732 [ extern int optreset; optreset = 0; ],
1733 [ ac_cv_have_getopt_optreset="yes" ],
1734 [ ac_cv_have_getopt_optreset="no" ]
1735 )
1736])
1737if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1738 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1739fi
Damien Millera22ba012000-03-02 23:09:20 +11001740
Damien Millerecbb26d2000-07-15 14:59:14 +10001741AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1742 AC_TRY_LINK([],
1743 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1744 [ ac_cv_libc_defines_sys_errlist="yes" ],
1745 [ ac_cv_libc_defines_sys_errlist="no" ]
1746 )
1747])
1748if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1749 AC_DEFINE(HAVE_SYS_ERRLIST)
1750fi
1751
1752
Damien Miller11fa2cc2000-08-16 10:35:58 +10001753AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1754 AC_TRY_LINK([],
1755 [ extern int sys_nerr; printf("%i", sys_nerr);],
1756 [ ac_cv_libc_defines_sys_nerr="yes" ],
1757 [ ac_cv_libc_defines_sys_nerr="no" ]
1758 )
1759])
1760if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1761 AC_DEFINE(HAVE_SYS_NERR)
1762fi
1763
Damien Miller85de5802001-09-18 14:01:11 +10001764SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001765
1766# Check whether user wants sectok support
1767AC_ARG_WITH(sectok,
1768 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001769 [
1770 if test "x$withval" != "xno" ; then
1771 if test "x$withval" != "xyes" ; then
1772 CPPFLAGS="$CPPFLAGS -I${withval}"
1773 LDFLAGS="$LDFLAGS -L${withval}"
1774 if test ! -z "$need_dash_r" ; then
1775 LDFLAGS="$LDFLAGS -R${withval}"
1776 fi
1777 if test ! -z "$blibpath" ; then
1778 blibpath="$blibpath:${withval}"
1779 fi
1780 fi
1781 AC_CHECK_HEADERS(sectok.h)
1782 if test "$ac_cv_header_sectok_h" != yes; then
1783 AC_MSG_ERROR(Can't find sectok.h)
1784 fi
1785 AC_CHECK_LIB(sectok, sectok_open)
1786 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1787 AC_MSG_ERROR(Can't find libsectok)
1788 fi
1789 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001790 AC_DEFINE(USE_SECTOK)
1791 SCARD_MSG="yes, using sectok"
1792 fi
1793 ]
1794)
1795
1796# Check whether user wants OpenSC support
1797AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001798 AC_HELP_STRING([--with-opensc=PFX],
1799 [Enable smartcard support using OpenSC]),
1800 opensc_config_prefix="$withval", opensc_config_prefix="")
1801if test x$opensc_config_prefix != x ; then
1802 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1803 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1804 if test "$OPENSC_CONFIG" != "no"; then
1805 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1806 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1807 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1808 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1809 AC_DEFINE(SMARTCARD)
1810 AC_DEFINE(USE_OPENSC)
1811 SCARD_MSG="yes, using OpenSC"
1812 fi
1813fi
Damien Miller85de5802001-09-18 14:01:11 +10001814
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001815# Check whether user wants Kerberos 5 support
1816KRB5_MSG="no"
1817AC_ARG_WITH(kerberos5,
1818 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1819 [
1820 if test "x$withval" != "xno" ; then
1821 if test "x$withval" = "xyes" ; then
1822 KRB5ROOT="/usr/local"
1823 else
1824 KRB5ROOT=${withval}
1825 fi
1826 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1827 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1828 AC_DEFINE(KRB5)
1829 KRB5_MSG="yes"
1830 AC_MSG_CHECKING(whether we are using Heimdal)
1831 AC_TRY_COMPILE([ #include <krb5.h> ],
1832 [ char *tmp = heimdal_version; ],
1833 [ AC_MSG_RESULT(yes)
1834 AC_DEFINE(HEIMDAL)
1835 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1836 ],
1837 [ AC_MSG_RESULT(no)
1838 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1839 ]
1840 )
1841 if test ! -z "$need_dash_r" ; then
1842 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1843 fi
1844 if test ! -z "$blibpath" ; then
1845 blibpath="$blibpath:${KRB5ROOT}/lib"
1846 fi
1847 AC_CHECK_LIB(resolv, dn_expand, , )
1848
1849 KRB5=yes
1850 fi
1851 ]
1852)
1853# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001854KRB4_MSG="no"
1855AC_ARG_WITH(kerberos4,
1856 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1857 [
1858 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001859 if test "x$withval" != "xyes" ; then
1860 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1861 LDFLAGS="$LDFLAGS -L${withval}/lib"
1862 if test ! -z "$need_dash_r" ; then
1863 LDFLAGS="$LDFLAGS -R${withval}/lib"
1864 fi
1865 if test ! -z "$blibpath" ; then
1866 blibpath="$blibpath:${withval}/lib"
1867 fi
1868 else
1869 if test -d /usr/include/kerberosIV ; then
1870 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1871 fi
1872 fi
1873
1874 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001875 if test "$ac_cv_header_krb_h" != yes; then
1876 AC_MSG_WARN([Cannot find krb.h, build may fail])
1877 fi
Damien Miller98344742001-03-28 14:37:06 +10001878 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001879 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001880 AC_CHECK_LIB(krb4, main)
1881 if test "$ac_cv_lib_krb4_main" != yes; then
1882 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1883 else
1884 KLIBS="-lkrb4"
1885 fi
1886 else
1887 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001888 fi
Damien Miller98344742001-03-28 14:37:06 +10001889 AC_CHECK_LIB(des, des_cbc_encrypt)
1890 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1891 AC_CHECK_LIB(des425, des_cbc_encrypt)
1892 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1893 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1894 else
1895 KLIBS="-ldes425"
1896 fi
1897 else
1898 KLIBS="-ldes"
1899 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001900 AC_CHECK_LIB(resolv, dn_expand, , )
1901 KRB4=yes
1902 KRB4_MSG="yes"
1903 AC_DEFINE(KRB4)
1904 fi
1905 ]
1906)
1907
1908# Check whether user wants AFS support
1909AFS_MSG="no"
1910AC_ARG_WITH(afs,
1911 [ --with-afs=PATH Enable AFS support],
1912 [
1913 if test "x$withval" != "xno" ; then
1914
1915 if test "x$withval" != "xyes" ; then
1916 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1917 LDFLAGS="$LDFLAGS -L${withval}/lib"
1918 fi
1919
1920 if test -z "$KRB4" ; then
1921 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1922 fi
1923
1924 LIBS="-lkafs $LIBS"
1925 if test ! -z "$AFS_LIBS" ; then
1926 LIBS="$LIBS $AFS_LIBS"
1927 fi
1928 AC_DEFINE(AFS)
1929 AFS_MSG="yes"
1930 fi
1931 ]
1932)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001933LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001934
Damien Millera22ba012000-03-02 23:09:20 +11001935# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001936
Damien Millerf58c6722002-05-13 13:15:42 +10001937PRIVSEP_PATH=/var/empty
1938AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001939 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001940 [
1941 if test "x$withval" != "$no" ; then
1942 PRIVSEP_PATH=$withval
1943 fi
1944 ]
1945)
1946AC_SUBST(PRIVSEP_PATH)
1947
Damien Millera22ba012000-03-02 23:09:20 +11001948AC_ARG_WITH(xauth,
1949 [ --with-xauth=PATH Specify path to xauth program ],
1950 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001951 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001952 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001953 fi
1954 ],
1955 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001956 TestPath="$PATH"
1957 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1958 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1959 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1960 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1961 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001962 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001963 xauth_path="/usr/openwin/bin/xauth"
1964 fi
1965 ]
1966)
1967
Damien Miller7d901272003-01-13 16:55:22 +11001968STRIP_OPT=-s
1969AC_ARG_ENABLE(strip,
1970 [ --disable-strip Disable calling strip(1) on install],
1971 [
1972 if test "x$enableval" = "xno" ; then
1973 STRIP_OPT=
1974 fi
1975 ]
1976)
1977AC_SUBST(STRIP_OPT)
1978
Damien Millera19cf472000-11-29 13:28:50 +11001979if test -z "$xauth_path" ; then
1980 XAUTH_PATH="undefined"
1981 AC_SUBST(XAUTH_PATH)
1982else
Damien Millera22ba012000-03-02 23:09:20 +11001983 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001984 XAUTH_PATH=$xauth_path
1985 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001986fi
Damien Millera22ba012000-03-02 23:09:20 +11001987
1988# Check for mail directory (last resort if we cannot get it from headers)
1989if test ! -z "$MAIL" ; then
1990 maildir=`dirname $MAIL`
1991 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1992fi
1993
Damien Millera22ba012000-03-02 23:09:20 +11001994if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001995 if test "x$disable_ptmx_check" != "xyes" ; then
1996 AC_CHECK_FILE("/dev/ptmx",
1997 [
1998 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1999 have_dev_ptmx=1
2000 ]
2001 )
2002 fi
Damien Millera22ba012000-03-02 23:09:20 +11002003fi
Damien Miller204ad072000-03-02 23:56:12 +11002004AC_CHECK_FILE("/dev/ptc",
2005 [
2006 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2007 have_dev_ptc=1
2008 ]
2009)
2010
Damien Millera22ba012000-03-02 23:09:20 +11002011# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002012AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002013 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002014 [
Damien Miller897741e2001-04-16 10:41:46 +10002015 case "$withval" in
2016 man|cat|doc)
2017 MANTYPE=$withval
2018 ;;
2019 *)
2020 AC_MSG_ERROR(invalid man type: $withval)
2021 ;;
2022 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002023 ]
2024)
Ben Lindstrombc709922001-04-18 18:04:21 +00002025if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002026 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2027 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002028 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2029 MANTYPE=doc
2030 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2031 MANTYPE=man
2032 else
2033 MANTYPE=cat
2034 fi
2035fi
Damien Miller670a4b82000-01-22 13:53:11 +11002036AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002037if test "$MANTYPE" = "doc"; then
2038 mansubdir=man;
2039else
2040 mansubdir=$MANTYPE;
2041fi
2042AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002043
Damien Millera22ba012000-03-02 23:09:20 +11002044# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002045MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002046AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002047 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002048 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002049 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002050 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002051 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002052 fi
2053 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002054)
2055
Damien Millera22ba012000-03-02 23:09:20 +11002056# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002057AC_ARG_WITH(shadow,
2058 [ --without-shadow Disable shadow password support],
2059 [
2060 if test "x$withval" = "xno" ; then
2061 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002062 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002063 fi
2064 ]
2065)
2066
Damien Miller1f335fb2000-06-26 11:31:33 +10002067if test -z "$disable_shadow" ; then
2068 AC_MSG_CHECKING([if the systems has expire shadow information])
2069 AC_TRY_COMPILE(
2070 [
2071#include <sys/types.h>
2072#include <shadow.h>
2073 struct spwd sp;
2074 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2075 [ sp_expire_available=yes ], []
2076 )
2077
2078 if test "x$sp_expire_available" = "xyes" ; then
2079 AC_MSG_RESULT(yes)
2080 AC_DEFINE(HAS_SHADOW_EXPIRE)
2081 else
2082 AC_MSG_RESULT(no)
2083 fi
2084fi
2085
Damien Millera22ba012000-03-02 23:09:20 +11002086# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002087if test ! -z "$IPADDR_IN_DISPLAY" ; then
2088 DISPLAY_HACK_MSG="yes"
2089 AC_DEFINE(IPADDR_IN_DISPLAY)
2090else
2091 DISPLAY_HACK_MSG="no"
2092 AC_ARG_WITH(ipaddr-display,
2093 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2094 [
2095 if test "x$withval" != "xno" ; then
2096 AC_DEFINE(IPADDR_IN_DISPLAY)
2097 DISPLAY_HACK_MSG="yes"
2098 fi
2099 ]
2100 )
2101fi
Damien Miller76112de1999-12-21 11:18:08 +11002102
Tim Rice43a1c132002-04-17 21:19:14 -07002103dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2104if test $ac_cv_func_login_getcapbool = "yes" -a \
2105 $ac_cv_header_login_cap_h = "yes" ; then
2106 USES_LOGIN_CONF=yes
2107fi
Damien Millera22ba012000-03-02 23:09:20 +11002108# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002109SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002110AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002111 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002112 [
Tim Rice43a1c132002-04-17 21:19:14 -07002113 if test "$USES_LOGIN_CONF" = "yes" ; then
2114 AC_MSG_WARN([
2115--with-default-path=PATH has no effect on this system.
2116Edit /etc/login.conf instead.])
2117 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002118 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002119 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002120 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002121 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002122 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2123 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2124 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002125 AC_TRY_RUN(
2126 [
2127/* find out what STDPATH is */
2128#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002129#ifdef HAVE_PATHS_H
2130# include <paths.h>
2131#endif
2132#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002133# ifdef _PATH_USERPATH /* Irix */
2134# define _PATH_STDPATH _PATH_USERPATH
2135# else
2136# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2137# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002138#endif
2139#include <sys/types.h>
2140#include <sys/stat.h>
2141#include <fcntl.h>
2142#define DATA "conftest.stdpath"
2143
2144main()
2145{
2146 FILE *fd;
2147 int rc;
2148
2149 fd = fopen(DATA,"w");
2150 if(fd == NULL)
2151 exit(1);
2152
2153 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2154 exit(1);
2155
2156 exit(0);
2157}
2158 ], [ user_path=`cat conftest.stdpath` ],
2159 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2160 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2161 )
2162# make sure $bindir is in USER_PATH so scp will work
2163 t_bindir=`eval echo ${bindir}`
2164 case $t_bindir in
2165 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2166 esac
2167 case $t_bindir in
2168 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2169 esac
2170 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2171 if test $? -ne 0 ; then
2172 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2173 if test $? -ne 0 ; then
2174 user_path=$user_path:$t_bindir
2175 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2176 fi
2177 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002178 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002179)
Tim Rice43a1c132002-04-17 21:19:14 -07002180if test "$USES_LOGIN_CONF" != "yes" ; then
2181 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2182 AC_SUBST(user_path)
2183fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002184
Damien Millera18bbd32002-05-13 10:48:57 +10002185# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002186AC_ARG_WITH(superuser-path,
2187 [ --with-superuser-path= Specify different path for super-user],
2188 [
2189 if test "x$withval" != "xno" ; then
2190 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2191 superuser_path=$withval
2192 fi
2193 ]
2194)
2195
2196
Damien Millera22ba012000-03-02 23:09:20 +11002197# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002198IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002199AC_ARG_WITH(ipv4-default,
2200 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2201 [
2202 if test "x$withval" != "xno" ; then
2203 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002204 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002205 fi
2206 ]
2207)
2208
Damien Miller61e50f12000-05-08 20:49:37 +10002209AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002210IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002211AC_ARG_WITH(4in6,
2212 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2213 [
2214 if test "x$withval" != "xno" ; then
2215 AC_MSG_RESULT(yes)
2216 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002217 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002218 else
2219 AC_MSG_RESULT(no)
2220 fi
2221 ],[
2222 if test "x$inet6_default_4in6" = "xyes"; then
2223 AC_MSG_RESULT([yes (default)])
2224 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002225 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002226 else
2227 AC_MSG_RESULT([no (default)])
2228 fi
2229 ]
2230)
2231
Damien Miller60396b02001-02-18 17:01:00 +11002232# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002233BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002234AC_ARG_WITH(bsd-auth,
2235 [ --with-bsd-auth Enable BSD auth support],
2236 [
2237 if test "x$withval" != "xno" ; then
2238 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002239 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002240 fi
2241 ]
2242)
2243
Damien Millera22ba012000-03-02 23:09:20 +11002244# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002245piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002246# make sure the directory exists
2247if test ! -d $piddir ; then
2248 piddir=`eval echo ${sysconfdir}`
2249 case $piddir in
2250 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2251 esac
2252fi
2253
Tim Rice88f2ab52002-03-17 12:17:34 -08002254AC_ARG_WITH(pid-dir,
2255 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2256 [
2257 if test "x$withval" != "xno" ; then
2258 piddir=$withval
2259 if test ! -d $piddir ; then
2260 AC_MSG_WARN([** no $piddir directory on this system **])
2261 fi
2262 fi
2263 ]
2264)
2265
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002266AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002267AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002268
andre2ff7b5d2000-06-03 14:57:40 +00002269dnl allow user to disable some login recording features
2270AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002271 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002272 [ AC_DEFINE(DISABLE_LASTLOG) ]
2273)
2274AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002275 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002276 [ AC_DEFINE(DISABLE_UTMP) ]
2277)
2278AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002279 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002280 [ AC_DEFINE(DISABLE_UTMPX) ]
2281)
2282AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002283 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002284 [ AC_DEFINE(DISABLE_WTMP) ]
2285)
2286AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002287 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002288 [ AC_DEFINE(DISABLE_WTMPX) ]
2289)
2290AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002291 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002292 [ AC_DEFINE(DISABLE_LOGIN) ]
2293)
2294AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002295 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002296 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2297)
2298AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002299 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002300 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2301)
2302AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002303 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002304 [
2305 if test "x$withval" = "xno" ; then
2306 AC_DEFINE(DISABLE_LASTLOG)
2307 else
2308 conf_lastlog_location=$withval
2309 fi
2310 ]
2311)
andre2ff7b5d2000-06-03 14:57:40 +00002312
2313dnl lastlog, [uw]tmpx? detection
2314dnl NOTE: set the paths in the platform section to avoid the
2315dnl need for command-line parameters
2316dnl lastlog and [uw]tmp are subject to a file search if all else fails
2317
2318dnl lastlog detection
2319dnl NOTE: the code itself will detect if lastlog is a directory
2320AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2321AC_TRY_COMPILE([
2322#include <sys/types.h>
2323#include <utmp.h>
2324#ifdef HAVE_LASTLOG_H
2325# include <lastlog.h>
2326#endif
Damien Miller2994e082000-06-04 15:51:47 +10002327#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002328# include <paths.h>
2329#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002330#ifdef HAVE_LOGIN_H
2331# include <login.h>
2332#endif
andre2ff7b5d2000-06-03 14:57:40 +00002333 ],
2334 [ char *lastlog = LASTLOG_FILE; ],
2335 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002336 [
2337 AC_MSG_RESULT(no)
2338 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2339 AC_TRY_COMPILE([
2340#include <sys/types.h>
2341#include <utmp.h>
2342#ifdef HAVE_LASTLOG_H
2343# include <lastlog.h>
2344#endif
2345#ifdef HAVE_PATHS_H
2346# include <paths.h>
2347#endif
2348 ],
2349 [ char *lastlog = _PATH_LASTLOG; ],
2350 [ AC_MSG_RESULT(yes) ],
2351 [
andree441aa32000-06-12 22:34:38 +00002352 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002353 system_lastlog_path=no
2354 ])
2355 ]
andre2ff7b5d2000-06-03 14:57:40 +00002356)
Damien Miller2994e082000-06-04 15:51:47 +10002357
andre2ff7b5d2000-06-03 14:57:40 +00002358if test -z "$conf_lastlog_location"; then
2359 if test x"$system_lastlog_path" = x"no" ; then
2360 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002361 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002362 conf_lastlog_location=$f
2363 fi
2364 done
2365 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002366 AC_MSG_WARN([** Cannot find lastlog **])
2367 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002368 fi
2369 fi
2370fi
2371
2372if test -n "$conf_lastlog_location"; then
2373 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2374fi
2375
2376dnl utmp detection
2377AC_MSG_CHECKING([if your system defines UTMP_FILE])
2378AC_TRY_COMPILE([
2379#include <sys/types.h>
2380#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002381#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002382# include <paths.h>
2383#endif
2384 ],
2385 [ char *utmp = UTMP_FILE; ],
2386 [ AC_MSG_RESULT(yes) ],
2387 [ AC_MSG_RESULT(no)
2388 system_utmp_path=no ]
2389)
2390if test -z "$conf_utmp_location"; then
2391 if test x"$system_utmp_path" = x"no" ; then
2392 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2393 if test -f $f ; then
2394 conf_utmp_location=$f
2395 fi
2396 done
2397 if test -z "$conf_utmp_location"; then
2398 AC_DEFINE(DISABLE_UTMP)
2399 fi
2400 fi
2401fi
2402if test -n "$conf_utmp_location"; then
2403 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2404fi
2405
2406dnl wtmp detection
2407AC_MSG_CHECKING([if your system defines WTMP_FILE])
2408AC_TRY_COMPILE([
2409#include <sys/types.h>
2410#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002411#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002412# include <paths.h>
2413#endif
2414 ],
2415 [ char *wtmp = WTMP_FILE; ],
2416 [ AC_MSG_RESULT(yes) ],
2417 [ AC_MSG_RESULT(no)
2418 system_wtmp_path=no ]
2419)
2420if test -z "$conf_wtmp_location"; then
2421 if test x"$system_wtmp_path" = x"no" ; then
2422 for f in /usr/adm/wtmp /var/log/wtmp; do
2423 if test -f $f ; then
2424 conf_wtmp_location=$f
2425 fi
2426 done
2427 if test -z "$conf_wtmp_location"; then
2428 AC_DEFINE(DISABLE_WTMP)
2429 fi
2430 fi
2431fi
2432if test -n "$conf_wtmp_location"; then
2433 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2434fi
2435
2436
2437dnl utmpx detection - I don't know any system so perverse as to require
2438dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2439dnl there, though.
2440AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2441AC_TRY_COMPILE([
2442#include <sys/types.h>
2443#include <utmp.h>
2444#ifdef HAVE_UTMPX_H
2445#include <utmpx.h>
2446#endif
Damien Miller2994e082000-06-04 15:51:47 +10002447#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002448# include <paths.h>
2449#endif
2450 ],
2451 [ char *utmpx = UTMPX_FILE; ],
2452 [ AC_MSG_RESULT(yes) ],
2453 [ AC_MSG_RESULT(no)
2454 system_utmpx_path=no ]
2455)
2456if test -z "$conf_utmpx_location"; then
2457 if test x"$system_utmpx_path" = x"no" ; then
2458 AC_DEFINE(DISABLE_UTMPX)
2459 fi
2460else
2461 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2462fi
2463
2464dnl wtmpx detection
2465AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2466AC_TRY_COMPILE([
2467#include <sys/types.h>
2468#include <utmp.h>
2469#ifdef HAVE_UTMPX_H
2470#include <utmpx.h>
2471#endif
Damien Miller2994e082000-06-04 15:51:47 +10002472#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002473# include <paths.h>
2474#endif
2475 ],
2476 [ char *wtmpx = WTMPX_FILE; ],
2477 [ AC_MSG_RESULT(yes) ],
2478 [ AC_MSG_RESULT(no)
2479 system_wtmpx_path=no ]
2480)
2481if test -z "$conf_wtmpx_location"; then
2482 if test x"$system_wtmpx_path" = x"no" ; then
2483 AC_DEFINE(DISABLE_WTMPX)
2484 fi
2485else
2486 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2487fi
2488
Damien Miller4018c192000-04-30 09:30:44 +10002489
Damien Miller29ea30d2000-03-17 10:54:15 +11002490if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002491 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2492 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002493fi
2494
Tim Rice4cec93f2002-02-26 08:40:48 -08002495dnl remove pam and dl because they are in $LIBPAM
2496if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002497 LIBS=`echo $LIBS | sed 's/-lpam //'`
2498fi
2499if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2500 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002501fi
2502
Damien Millerbac2d8a2000-09-05 16:13:06 +11002503AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002504AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2505AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002506
Damien Miller7b22d652000-06-18 14:07:04 +10002507# Print summary of options
2508
Damien Miller7b22d652000-06-18 14:07:04 +10002509# Someone please show me a better way :)
2510A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2511B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2512C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2513D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002514E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002515F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002516G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002517H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2518I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2519J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002520
2521echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002522echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002523echo " User binaries: $B"
2524echo " System binaries: $C"
2525echo " Configuration files: $D"
2526echo " Askpass program: $E"
2527echo " Manual pages: $F"
2528echo " PID file: $G"
2529echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002530if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002531echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002532else
Damien Millerf58c6722002-05-13 13:15:42 +10002533echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002534fi
Damien Millera18bbd32002-05-13 10:48:57 +10002535if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002536echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002537fi
Damien Millerf58c6722002-05-13 13:15:42 +10002538echo " Manpage format: $MANTYPE"
2539echo " PAM support: ${PAM_MSG}"
2540echo " KerberosIV support: $KRB4_MSG"
2541echo " KerberosV support: $KRB5_MSG"
2542echo " Smartcard support: $SCARD_MSG"
2543echo " AFS support: $AFS_MSG"
2544echo " S/KEY support: $SKEY_MSG"
2545echo " TCP Wrappers support: $TCPW_MSG"
2546echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002547echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002548echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2549echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2550echo " BSD Auth support: $BSD_AUTH_MSG"
2551echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002552if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002553echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002554fi
2555
Damien Miller7b22d652000-06-18 14:07:04 +10002556echo ""
2557
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002558echo " Host: ${host}"
2559echo " Compiler: ${CC}"
2560echo " Compiler flags: ${CFLAGS}"
2561echo "Preprocessor flags: ${CPPFLAGS}"
2562echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002563echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002564
2565echo ""
2566
Damien Miller82cf0ce2000-12-20 13:34:48 +11002567if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002568 echo "PAM is enabled. You may need to install a PAM control file "
2569 echo "for sshd, otherwise password authentication may fail. "
2570 echo "Example PAM control files can be found in the contrib/ "
2571 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002572 echo ""
2573fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002574
Damien Miller6c21c512002-01-22 21:57:53 +11002575if test ! -z "$RAND_HELPER_CMDHASH" ; then
2576 echo "WARNING: you are using the builtin random number collection "
2577 echo "service. Please read WARNING.RNG and request that your OS "
2578 echo "vendor includes kernel-based random number collection in "
2579 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002580 echo ""
2581fi
Damien Miller60396b02001-02-18 17:01:00 +11002582