blob: 38cc4d401133de55202a66ba2660347c2fda7ae3 [file] [log] [blame]
Damien Millereab4bae2003-04-29 23:22:40 +10001# $Id: configure.ac,v 1.114 2003/04/29 13:22:40 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien 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
Damien Millerb29ea912000-01-15 14:12:03 +1100191 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000192mips-sony-bsd|mips-sony-newsos4)
193 AC_DEFINE(HAVE_NEWS4)
194 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000195 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100196*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000197 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100198 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100199 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100200*-*-freebsd*)
201 check_for_libcrypt_later=1
202 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000203*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000204 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100205 conf_utmp_location=/etc/utmp
206 conf_wtmp_location=/usr/adm/wtmp
207 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000208 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000209 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000210 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100211 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000213 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000214 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100215*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000216 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000217 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100218 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100219 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000220 AC_DEFINE(LOGIN_NEEDS_UTMPX)
221 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000222 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller933cc8f2003-03-10 11:38:10 +1100223 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000224 # hardwire lastlog location (can't detect it on some versions)
225 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000226 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
227 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
228 if test "$sol2ver" -ge 8; then
229 AC_MSG_RESULT(yes)
230 AC_DEFINE(DISABLE_UTMP)
231 AC_DEFINE(DISABLE_WTMP)
232 else
233 AC_MSG_RESULT(no)
234 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100235 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000236*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000237 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000238 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100239 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000240 conf_utmp_location=/etc/utmp
241 conf_wtmp_location=/var/adm/wtmp
242 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000243 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000244 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000245*-ncr-sysv*)
246 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
247 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700248 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000249 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000250 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000251*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000252 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700253 # /usr/ucblib MUST NOT be searched on ReliantUNIX
254 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100255 IPADDR_IN_DISPLAY=yes
256 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000257 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700258 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
259 # Attention: always take care to bind libsocket and libnsl before libc,
260 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000261 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100262*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100265 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100266 ;;
267*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000268 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100269 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100270 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100271 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100272*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000273 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100274 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100275 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100276*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000277 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100278 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700279 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100280 RANLIB=true
281 no_dev_ptmx=1
282 AC_DEFINE(BROKEN_SYS_TERMIO_H)
283 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000284 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000285 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100286 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100287 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700288 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700289 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100290 ;;
291*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800292 if test -z "$GCC"; then
293 CFLAGS="$CFLAGS -belf"
294 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000296 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100297 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000298 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100299 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000300 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000301 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700302 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100303 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700304 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000305 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000306*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000307 AC_DEFINE(USE_PIPES)
308 AC_DEFINE(DISABLE_FD_PASSING)
309 LDFLAGS="$LDFLAGS"
310 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
311 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000312 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000313*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000314 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700315 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700316 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000317 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
318 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
319 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700320 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000321*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000322 AC_MSG_CHECKING(for Digital Unix SIA)
323 no_osfsia=""
324 AC_ARG_WITH(osfsia,
325 [ --with-osfsia Enable Digital Unix SIA],
326 [
327 if test "x$withval" = "xno" ; then
328 AC_MSG_RESULT(disabled)
329 no_osfsia=1
330 fi
331 ],
332 )
333 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000334 if test -f /etc/sia/matrix.conf; then
335 AC_MSG_RESULT(yes)
336 AC_DEFINE(HAVE_OSF_SIA)
337 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000338 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000339 LIBS="$LIBS -lsecurity -ldb -lm -laud"
340 else
341 AC_MSG_RESULT(no)
342 fi
343 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000344 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000345 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000346
347*-*-nto-qnx)
348 AC_DEFINE(USE_PIPES)
349 AC_DEFINE(NO_X11_UNIX_SOCKETS)
350 AC_DEFINE(MISSING_NFDBITS)
351 AC_DEFINE(MISSING_HOWMANY)
352 AC_DEFINE(MISSING_FD_MASK)
353 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100354esac
355
Damien Millere37bfc12000-06-05 09:37:43 +1000356# Allow user to specify flags
357AC_ARG_WITH(cflags,
358 [ --with-cflags Specify additional flags to pass to compiler],
359 [
360 if test "x$withval" != "xno" ; then
361 CFLAGS="$CFLAGS $withval"
362 fi
363 ]
364)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000365AC_ARG_WITH(cppflags,
366 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
367 [
368 if test "x$withval" != "xno"; then
369 CPPFLAGS="$CPPFLAGS $withval"
370 fi
371 ]
372)
Damien Millere37bfc12000-06-05 09:37:43 +1000373AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000374 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000375 [
376 if test "x$withval" != "xno" ; then
377 LDFLAGS="$LDFLAGS $withval"
378 fi
379 ]
380)
381AC_ARG_WITH(libs,
382 [ --with-libs Specify additional libraries to link with],
383 [
384 if test "x$withval" != "xno" ; then
385 LIBS="$LIBS $withval"
386 fi
387 ]
388)
389
Tim Rice4cec93f2002-02-26 08:40:48 -0800390# Checks for header files.
391AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100392 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800393 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000394 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000395 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800396 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100397 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000398 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700399 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800400 util.h utime.h utmp.h utmpx.h)
401
Damien Millera22ba012000-03-02 23:09:20 +1100402# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700403AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
404AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000405
Damien Millerdf288022001-02-18 13:07:07 +1100406dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700407if test "x$with_tcp_wrappers" != "xno" ; then
408 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
409 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
410 fi
411fi
Damien Millerdf288022001-02-18 13:07:07 +1100412
Tim Rice13aae5e2001-10-21 17:53:58 -0700413AC_CHECK_FUNC(getspnam, ,
414 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700415
Damien Miller150c8b52002-02-13 23:06:56 +1100416AC_ARG_WITH(rpath,
417 [ --without-rpath Disable auto-added -R linker paths],
418 [
419 if test "x$withval" = "xno" ; then
420 need_dash_r=""
421 fi
422 if test "x$withval" = "xyes" ; then
423 need_dash_r=1
424 fi
425 ]
426)
427
Tim Rice13aae5e2001-10-21 17:53:58 -0700428dnl zlib is required
429AC_ARG_WITH(zlib,
430 [ --with-zlib=PATH Use zlib in PATH],
431 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000432 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100433 AC_MSG_ERROR([*** zlib is required ***])
434 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700435 if test -d "$withval/lib"; then
436 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700437 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700438 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700439 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700440 fi
441 else
442 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700443 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700444 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700445 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700446 fi
447 fi
448 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700449 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700450 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700451 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700452 fi
453 ]
454)
455
Tim Rice17b93e52001-10-23 22:36:54 -0700456AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100457
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000458dnl UnixWare 2.x
459AC_CHECK_FUNC(strcasecmp,
460 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
461)
462AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700463 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
464 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000465)
Damien Millerab18c411999-11-11 10:40:23 +1100466
Tim Ricee589a292001-11-03 11:09:32 -0800467dnl Checks for libutil functions
468AC_CHECK_HEADERS(libutil.h)
469AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
470AC_CHECK_FUNCS(logout updwtmp logwtmp)
471
Ben Lindstrom8697e082001-02-24 21:41:10 +0000472AC_FUNC_STRFTIME
473
Damien Miller3c027682001-03-14 11:39:45 +1100474# Check for ALTDIRFUNC glob() extension
475AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
476AC_EGREP_CPP(FOUNDIT,
477 [
478 #include <glob.h>
479 #ifdef GLOB_ALTDIRFUNC
480 FOUNDIT
481 #endif
482 ],
483 [
484 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
485 AC_MSG_RESULT(yes)
486 ],
487 [
488 AC_MSG_RESULT(no)
489 ]
490)
Damien Millerab18c411999-11-11 10:40:23 +1100491
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000492# Check for g.gl_matchc glob() extension
493AC_MSG_CHECKING(for gl_matchc field in glob_t)
494AC_EGREP_CPP(FOUNDIT,
495 [
496 #include <glob.h>
497 int main(void){glob_t g; g.gl_matchc = 1;}
498 ],
499 [
500 AC_DEFINE(GLOB_HAS_GL_MATCHC)
501 AC_MSG_RESULT(yes)
502 ],
503 [
504 AC_MSG_RESULT(no)
505 ]
506)
507
Damien Miller18bb4732001-03-28 14:35:30 +1000508AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
509AC_TRY_RUN(
510 [
511#include <sys/types.h>
512#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700513int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000514 ],
515 [AC_MSG_RESULT(yes)],
516 [
517 AC_MSG_RESULT(no)
518 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
519 ]
520)
521
Damien Millerc547bf12001-02-16 10:18:12 +1100522# Check whether user wants S/Key support
523SKEY_MSG="no"
524AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700525 [ --with-skey[[=PATH]] Enable S/Key support
526 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100527 [
528 if test "x$withval" != "xno" ; then
529
530 if test "x$withval" != "xyes" ; then
531 CPPFLAGS="$CPPFLAGS -I${withval}/include"
532 LDFLAGS="$LDFLAGS -L${withval}/lib"
533 fi
534
535 AC_DEFINE(SKEY)
536 LIBS="-lskey $LIBS"
537 SKEY_MSG="yes"
538
Tim Rice4cec93f2002-02-26 08:40:48 -0800539 AC_MSG_CHECKING([for s/key support])
540 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100541 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800542#include <stdio.h>
543#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700544int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800545 ],
546 [AC_MSG_RESULT(yes)],
547 [
548 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100549 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
550 ])
551 fi
552 ]
553)
554
555# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700556TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100557AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
559 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100560 [
561 if test "x$withval" != "xno" ; then
562 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 saved_LDFLAGS="$LDFLAGS"
564 saved_CPPFLAGS="$CPPFLAGS"
565 if test -n "${withval}" -a "${withval}" != "yes"; then
566 if test -d "${withval}/lib"; then
567 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700568 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700570 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700571 fi
572 else
573 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700574 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700575 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700576 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 fi
578 fi
579 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700580 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700581 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700582 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700583 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700584 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800585 LIBWRAP="-lwrap"
586 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100587 AC_MSG_CHECKING(for libwrap)
588 AC_TRY_LINK(
589 [
590#include <tcpd.h>
591 int deny_severity = 0, allow_severity = 0;
592 ],
593 [hosts_access(0);],
594 [
595 AC_MSG_RESULT(yes)
596 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800597 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700598 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100599 ],
600 [
601 AC_MSG_ERROR([*** libwrap missing])
602 ]
603 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800604 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100605 fi
606 ]
607)
608
Damien Millerfe1f1432003-02-24 15:45:42 +1100609dnl Checks for library functions. Please keep in alphabetical order
610AC_CHECK_FUNCS(\
611 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
612 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
613 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
614 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
615 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
616 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
617 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
618 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
619 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
620 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
621 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
622)
Tim Rice13aae5e2001-10-21 17:53:58 -0700623
Damien Millercd6853c2003-01-28 11:33:42 +1100624AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000625AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100626
Ben Lindstrom3e006472002-10-16 00:24:03 +0000627dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
628AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
629
Tim Rice13aae5e2001-10-21 17:53:58 -0700630dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700631AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700632 AC_CHECK_LIB(gen, dirname,[
633 AC_CACHE_CHECK([for broken dirname],
634 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700635 save_LIBS="$LIBS"
636 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700637 AC_TRY_RUN(
638 [
639#include <libgen.h>
640#include <string.h>
641
642int main(int argc, char **argv) {
643 char *s, buf[32];
644
645 strncpy(buf,"/etc", 32);
646 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700647 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700648 exit(1);
649 } else {
650 exit(0);
651 }
652}
653 ],
654 [ ac_cv_have_broken_dirname="no" ],
655 [ ac_cv_have_broken_dirname="yes" ]
656 )
Tim Rice17b93e52001-10-23 22:36:54 -0700657 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700658 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700659 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700660 LIBS="$LIBS -lgen"
661 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700662 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700663 fi
664 ])
665])
666
Damien Millerad833b32000-08-23 10:46:23 +1000667dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000668AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000669dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000670AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000671AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000672dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000673AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000674AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100675
Damien Miller04f80141999-11-19 15:32:34 +1100676AC_CHECK_FUNC(daemon,
677 [AC_DEFINE(HAVE_DAEMON)],
678 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
679)
680
Damien Miller9fb07e42000-03-05 16:22:59 +1100681AC_CHECK_FUNC(getpagesize,
682 [AC_DEFINE(HAVE_GETPAGESIZE)],
683 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
684)
685
Damien Millercb170cb2000-07-01 16:52:55 +1000686# Check for broken snprintf
687if test "x$ac_cv_func_snprintf" = "xyes" ; then
688 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
689 AC_TRY_RUN(
690 [
691#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700692int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000693 ],
694 [AC_MSG_RESULT(yes)],
695 [
696 AC_MSG_RESULT(no)
697 AC_DEFINE(BROKEN_SNPRINTF)
698 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
699 ]
700 )
701fi
702
Damien Millere8328192003-01-07 15:18:32 +1100703dnl see whether mkstemp() requires XXXXXX
704if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
705AC_MSG_CHECKING([for (overly) strict mkstemp])
706AC_TRY_RUN(
707 [
708#include <stdlib.h>
709main() { char template[]="conftest.mkstemp-test";
710if (mkstemp(template) == -1)
711 exit(1);
712unlink(template); exit(0);
713}
714 ],
715 [
716 AC_MSG_RESULT(no)
717 ],
718 [
719 AC_MSG_RESULT(yes)
720 AC_DEFINE(HAVE_STRICT_MKSTEMP)
721 ],
722 [
723 AC_MSG_RESULT(yes)
724 AC_DEFINE(HAVE_STRICT_MKSTEMP)
725 ]
726)
727fi
728
Damien Miller606f8802000-09-16 15:39:56 +1100729AC_FUNC_GETPGRP
730
Damien Millera64b57a2001-01-17 10:44:13 +1100731# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000732PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100733AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100734 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100735 [
Damien Millera64b57a2001-01-17 10:44:13 +1100736 if test "x$withval" != "xno" ; then
737 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
738 AC_MSG_ERROR([PAM headers not found])
739 fi
740
741 AC_CHECK_LIB(dl, dlopen, , )
742 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
743 AC_CHECK_FUNCS(pam_getenvlist)
744
745 disable_shadow=yes
746 PAM_MSG="yes"
747
748 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800749 if test $ac_cv_lib_dl_dlopen = yes; then
750 LIBPAM="-lpam -ldl"
751 else
752 LIBPAM="-lpam"
753 fi
754 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100755 fi
756 ]
757)
Damien Millera22ba012000-03-02 23:09:20 +1100758
Damien Millera64b57a2001-01-17 10:44:13 +1100759# Check for older PAM
760if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100761 # Check PAM strerror arguments (old PAM)
762 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
763 AC_TRY_COMPILE(
764 [
Damien Miller81171112000-04-23 11:14:01 +1000765#include <stdlib.h>
766#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100767 ],
768 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
769 [AC_MSG_RESULT(no)],
770 [
771 AC_DEFINE(HAVE_OLD_PAM)
772 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000773 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100774 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100775 )
Damien Millera22ba012000-03-02 23:09:20 +1100776fi
777
Damien Millerfc93d4b2002-09-04 23:26:29 +1000778# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
779# because the system crypt() is more featureful.
780if test "x$check_for_libcrypt_before" = "x1"; then
781 AC_CHECK_LIB(crypt, crypt)
782fi
783
Tim Riceaef73712002-05-11 13:17:42 -0700784# Search for OpenSSL
785saved_CPPFLAGS="$CPPFLAGS"
786saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100787AC_ARG_WITH(ssl-dir,
788 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
789 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000790 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700791 if test -d "$withval/lib"; then
792 if test -n "${need_dash_r}"; then
793 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
794 else
795 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
796 fi
797 else
798 if test -n "${need_dash_r}"; then
799 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
800 else
801 LDFLAGS="-L${withval} ${LDFLAGS}"
802 fi
803 fi
804 if test -d "$withval/include"; then
805 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
806 else
807 CPPFLAGS="-I${withval} ${CPPFLAGS}"
808 fi
Damien Millera22ba012000-03-02 23:09:20 +1100809 fi
810 ]
811)
Tim Riceaef73712002-05-11 13:17:42 -0700812LIBS="$LIBS -lcrypto"
813AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000814 [
Tim Riceaef73712002-05-11 13:17:42 -0700815 dnl Check default openssl install dir
816 if test -n "${need_dash_r}"; then
817 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000818 else
Tim Riceaef73712002-05-11 13:17:42 -0700819 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000820 fi
Tim Riceaef73712002-05-11 13:17:42 -0700821 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
822 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
823 [
824 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
825 ]
826 )
827 ]
828)
829
Tim Riced730b782002-08-13 18:52:10 -0700830# Determine OpenSSL header version
831AC_MSG_CHECKING([OpenSSL header version])
832AC_TRY_RUN(
833 [
834#include <stdio.h>
835#include <string.h>
836#include <openssl/opensslv.h>
837#define DATA "conftest.sslincver"
838int main(void) {
839 FILE *fd;
840 int rc;
841
842 fd = fopen(DATA,"w");
843 if(fd == NULL)
844 exit(1);
845
846 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
847 exit(1);
848
849 exit(0);
850}
851 ],
852 [
853 ssl_header_ver=`cat conftest.sslincver`
854 AC_MSG_RESULT($ssl_header_ver)
855 ],
856 [
857 AC_MSG_RESULT(not found)
858 AC_MSG_ERROR(OpenSSL version header not found.)
859 ]
860)
861
862# Determine OpenSSL library version
863AC_MSG_CHECKING([OpenSSL library version])
864AC_TRY_RUN(
865 [
866#include <stdio.h>
867#include <string.h>
868#include <openssl/opensslv.h>
869#include <openssl/crypto.h>
870#define DATA "conftest.ssllibver"
871int main(void) {
872 FILE *fd;
873 int rc;
874
875 fd = fopen(DATA,"w");
876 if(fd == NULL)
877 exit(1);
878
879 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
880 exit(1);
881
882 exit(0);
883}
884 ],
885 [
886 ssl_library_ver=`cat conftest.ssllibver`
887 AC_MSG_RESULT($ssl_library_ver)
888 ],
889 [
890 AC_MSG_RESULT(not found)
891 AC_MSG_ERROR(OpenSSL library not found.)
892 ]
893)
Damien Millera22ba012000-03-02 23:09:20 +1100894
Damien Millerec932372002-01-22 22:16:03 +1100895# Sanity check OpenSSL headers
896AC_MSG_CHECKING([whether OpenSSL's headers match the library])
897AC_TRY_RUN(
898 [
899#include <string.h>
900#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700901int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100902 ],
903 [
904 AC_MSG_RESULT(yes)
905 ],
906 [
907 AC_MSG_RESULT(no)
908 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
909 ]
910)
911
Damien Millera64b57a2001-01-17 10:44:13 +1100912# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
913# version in OpenSSL. Skip this for PAM
914if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100915 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100916fi
917
Damien Miller6c21c512002-01-22 21:57:53 +1100918
919### Configure cryptographic random number support
920
921# Check wheter OpenSSL seeds itself
922AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
923AC_TRY_RUN(
924 [
925#include <string.h>
926#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700927int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100928 ],
929 [
930 OPENSSL_SEEDS_ITSELF=yes
931 AC_MSG_RESULT(yes)
932 ],
933 [
934 AC_MSG_RESULT(no)
935 # Default to use of the rand helper if OpenSSL doesn't
936 # seed itself
937 USE_RAND_HELPER=yes
938 ]
939)
940
941
942# Do we want to force the use of the rand helper?
943AC_ARG_WITH(rand-helper,
944 [ --with-rand-helper Use subprocess to gather strong randomness ],
945 [
946 if test "x$withval" = "xno" ; then
947 # Force use of OpenSSL's internal RNG, even if
948 # the previous test showed it to be unseeded.
949 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
950 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
951 OPENSSL_SEEDS_ITSELF=yes
952 USE_RAND_HELPER=""
953 fi
954 else
955 USE_RAND_HELPER=yes
956 fi
957 ],
958)
959
960# Which randomness source do we use?
961if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
962 # OpenSSL only
963 AC_DEFINE(OPENSSL_PRNG_ONLY)
964 RAND_MSG="OpenSSL internal ONLY"
965 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800966elif test ! -z "$USE_RAND_HELPER" ; then
967 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100968 RAND_MSG="ssh-rand-helper"
969 INSTALL_SSH_RAND_HELPER="yes"
970fi
971AC_SUBST(INSTALL_SSH_RAND_HELPER)
972
973### Configuration of ssh-rand-helper
974
975# PRNGD TCP socket
976AC_ARG_WITH(prngd-port,
977 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
978 [
Damien Millere996d722002-01-23 11:20:59 +1100979 case "$withval" in
980 no)
981 withval=""
982 ;;
983 [[0-9]]*)
984 ;;
985 *)
986 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
987 ;;
988 esac
989 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100990 PRNGD_PORT="$withval"
991 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
992 fi
993 ]
994)
995
996# PRNGD Unix domain socket
997AC_ARG_WITH(prngd-socket,
998 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
999 [
Damien Millere996d722002-01-23 11:20:59 +11001000 case "$withval" in
1001 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001002 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001003 ;;
1004 no)
1005 withval=""
1006 ;;
1007 /*)
1008 ;;
1009 *)
1010 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1011 ;;
1012 esac
1013
1014 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001015 if test ! -z "$PRNGD_PORT" ; then
1016 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1017 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001018 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001019 AC_MSG_WARN(Entropy socket is not readable)
1020 fi
1021 PRNGD_SOCKET="$withval"
1022 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1023 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001024 ],
1025 [
1026 # Check for existing socket only if we don't have a random device already
1027 if test "$USE_RAND_HELPER" = yes ; then
1028 AC_MSG_CHECKING(for PRNGD/EGD socket)
1029 # Insert other locations here
1030 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1031 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1032 PRNGD_SOCKET="$sock"
1033 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1034 break;
1035 fi
1036 done
1037 if test ! -z "$PRNGD_SOCKET" ; then
1038 AC_MSG_RESULT($PRNGD_SOCKET)
1039 else
1040 AC_MSG_RESULT(not found)
1041 fi
1042 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001043 ]
1044)
1045
1046# Change default command timeout for hashing entropy source
1047entropy_timeout=200
1048AC_ARG_WITH(entropy-timeout,
1049 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1050 [
1051 if test "x$withval" != "xno" ; then
1052 entropy_timeout=$withval
1053 fi
1054 ]
1055)
Damien Miller6c21c512002-01-22 21:57:53 +11001056AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1057
Damien Millerd3f6ad22002-06-25 10:24:47 +10001058SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001059AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001060 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001061 [
1062 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001063 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001064 fi
1065 ]
1066)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001067AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1068AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001069
Tim Rice88f2ab52002-03-17 12:17:34 -08001070# We do this little dance with the search path to insure
1071# that programs that we select for use by installed programs
1072# (which may be run by the super-user) come from trusted
1073# locations before they come from the user's private area.
1074# This should help avoid accidentally configuring some
1075# random version of a program in someone's personal bin.
1076
1077OPATH=$PATH
1078PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001079test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001080test -d /sbin && PATH=$PATH:/sbin
1081test -d /usr/sbin && PATH=$PATH:/usr/sbin
1082PATH=$PATH:/etc:$OPATH
1083
Damien Miller6c21c512002-01-22 21:57:53 +11001084# These programs are used by the command hashing source to gather entropy
1085OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1086OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1087OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1088OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1089OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1090OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1091OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1092OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1093OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1094OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1095OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1096OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1097OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1098OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1099OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1100OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001101# restore PATH
1102PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001103
1104# Where does ssh-rand-helper get its randomness from?
1105INSTALL_SSH_PRNG_CMDS=""
1106if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1107 if test ! -z "$PRNGD_PORT" ; then
1108 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1109 elif test ! -z "$PRNGD_SOCKET" ; then
1110 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1111 else
1112 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1113 RAND_HELPER_CMDHASH=yes
1114 INSTALL_SSH_PRNG_CMDS="yes"
1115 fi
1116fi
1117AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1118
1119
Ben Lindstromb5628642000-10-18 00:02:25 +00001120# Cheap hack to ensure NEWS-OS libraries are arranged right.
1121if test ! -z "$SONY" ; then
1122 LIBS="$LIBS -liberty";
1123fi
1124
Damien Millera22ba012000-03-02 23:09:20 +11001125# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001126AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001127AC_CHECK_SIZEOF(short int, 2)
1128AC_CHECK_SIZEOF(int, 4)
1129AC_CHECK_SIZEOF(long int, 4)
1130AC_CHECK_SIZEOF(long long int, 8)
1131
Damien Millerfa2bb692002-04-23 23:22:25 +10001132# Sanity check long long for some platforms (AIX)
1133if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1134 ac_cv_sizeof_long_long_int=0
1135fi
1136
Damien Millera22ba012000-03-02 23:09:20 +11001137# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001138AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1139 AC_TRY_COMPILE(
1140 [ #include <sys/types.h> ],
1141 [ u_int a; a = 1;],
1142 [ ac_cv_have_u_int="yes" ],
1143 [ ac_cv_have_u_int="no" ]
1144 )
1145])
1146if test "x$ac_cv_have_u_int" = "xyes" ; then
1147 AC_DEFINE(HAVE_U_INT)
1148 have_u_int=1
1149fi
1150
Damien Miller61e50f12000-05-08 20:49:37 +10001151AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1152 AC_TRY_COMPILE(
1153 [ #include <sys/types.h> ],
1154 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1155 [ ac_cv_have_intxx_t="yes" ],
1156 [ ac_cv_have_intxx_t="no" ]
1157 )
1158])
1159if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1160 AC_DEFINE(HAVE_INTXX_T)
1161 have_intxx_t=1
1162fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001163
1164if (test -z "$have_intxx_t" && \
1165 test "x$ac_cv_header_stdint_h" = "xyes")
1166then
1167 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1168 AC_TRY_COMPILE(
1169 [ #include <stdint.h> ],
1170 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1171 [
1172 AC_DEFINE(HAVE_INTXX_T)
1173 AC_MSG_RESULT(yes)
1174 ],
1175 [ AC_MSG_RESULT(no) ]
1176 )
1177fi
1178
Damien Miller578783e2000-09-23 14:12:24 +11001179AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1180 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001181 [
1182#include <sys/types.h>
1183#ifdef HAVE_STDINT_H
1184# include <stdint.h>
1185#endif
1186#include <sys/socket.h>
1187#ifdef HAVE_SYS_BITYPES_H
1188# include <sys/bitypes.h>
1189#endif
1190 ],
Damien Miller578783e2000-09-23 14:12:24 +11001191 [ int64_t a; a = 1;],
1192 [ ac_cv_have_int64_t="yes" ],
1193 [ ac_cv_have_int64_t="no" ]
1194 )
1195])
1196if test "x$ac_cv_have_int64_t" = "xyes" ; then
1197 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001198fi
1199
Damien Miller61e50f12000-05-08 20:49:37 +10001200AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1201 AC_TRY_COMPILE(
1202 [ #include <sys/types.h> ],
1203 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1204 [ ac_cv_have_u_intxx_t="yes" ],
1205 [ ac_cv_have_u_intxx_t="no" ]
1206 )
1207])
1208if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1209 AC_DEFINE(HAVE_U_INTXX_T)
1210 have_u_intxx_t=1
1211fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001212
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001213if test -z "$have_u_intxx_t" ; then
1214 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1215 AC_TRY_COMPILE(
1216 [ #include <sys/socket.h> ],
1217 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1218 [
1219 AC_DEFINE(HAVE_U_INTXX_T)
1220 AC_MSG_RESULT(yes)
1221 ],
1222 [ AC_MSG_RESULT(no) ]
1223 )
1224fi
1225
Damien Miller578783e2000-09-23 14:12:24 +11001226AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1227 AC_TRY_COMPILE(
1228 [ #include <sys/types.h> ],
1229 [ u_int64_t a; a = 1;],
1230 [ ac_cv_have_u_int64_t="yes" ],
1231 [ ac_cv_have_u_int64_t="no" ]
1232 )
1233])
1234if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1235 AC_DEFINE(HAVE_U_INT64_T)
1236 have_u_int64_t=1
1237fi
1238
Tim Rice4cec93f2002-02-26 08:40:48 -08001239if test -z "$have_u_int64_t" ; then
1240 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1241 AC_TRY_COMPILE(
1242 [ #include <sys/bitypes.h> ],
1243 [ u_int64_t a; a = 1],
1244 [
1245 AC_DEFINE(HAVE_U_INT64_T)
1246 AC_MSG_RESULT(yes)
1247 ],
1248 [ AC_MSG_RESULT(no) ]
1249 )
1250fi
1251
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001252if test -z "$have_u_intxx_t" ; then
1253 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1254 AC_TRY_COMPILE(
1255 [
1256#include <sys/types.h>
1257 ],
1258 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1259 [ ac_cv_have_uintxx_t="yes" ],
1260 [ ac_cv_have_uintxx_t="no" ]
1261 )
1262 ])
1263 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1264 AC_DEFINE(HAVE_UINTXX_T)
1265 fi
1266fi
1267
1268if test -z "$have_uintxx_t" ; then
1269 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1270 AC_TRY_COMPILE(
1271 [ #include <stdint.h> ],
1272 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1273 [
1274 AC_DEFINE(HAVE_UINTXX_T)
1275 AC_MSG_RESULT(yes)
1276 ],
1277 [ AC_MSG_RESULT(no) ]
1278 )
1279fi
1280
Damien Milleredb82922000-06-20 13:25:52 +10001281if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1282 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001283then
1284 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1285 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001286 [
1287#include <sys/bitypes.h>
1288 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001289 [
Damien Miller70494d12000-04-03 15:57:06 +10001290 int8_t a; int16_t b; int32_t c;
1291 u_int8_t e; u_int16_t f; u_int32_t g;
1292 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001293 ],
1294 [
1295 AC_DEFINE(HAVE_U_INTXX_T)
1296 AC_DEFINE(HAVE_INTXX_T)
1297 AC_MSG_RESULT(yes)
1298 ],
1299 [AC_MSG_RESULT(no)]
1300 )
1301fi
1302
Damien Miller58be7382001-09-15 21:31:54 +10001303
1304AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1305 AC_TRY_COMPILE(
1306 [
1307#include <sys/types.h>
1308 ],
1309 [ u_char foo; foo = 125; ],
1310 [ ac_cv_have_u_char="yes" ],
1311 [ ac_cv_have_u_char="no" ]
1312 )
1313])
1314if test "x$ac_cv_have_u_char" = "xyes" ; then
1315 AC_DEFINE(HAVE_U_CHAR)
1316fi
1317
Tim Rice13aae5e2001-10-21 17:53:58 -07001318TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001319
Tim Rice200a5c02002-02-26 22:12:34 -08001320AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001321
Damien Miller61e50f12000-05-08 20:49:37 +10001322AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1323 AC_TRY_COMPILE(
1324 [
1325#include <sys/types.h>
1326 ],
1327 [ size_t foo; foo = 1235; ],
1328 [ ac_cv_have_size_t="yes" ],
1329 [ ac_cv_have_size_t="no" ]
1330 )
1331])
1332if test "x$ac_cv_have_size_t" = "xyes" ; then
1333 AC_DEFINE(HAVE_SIZE_T)
1334fi
Damien Miller95058511999-12-29 10:36:45 +11001335
Damien Miller615f9392000-05-17 22:53:33 +10001336AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1337 AC_TRY_COMPILE(
1338 [
1339#include <sys/types.h>
1340 ],
1341 [ ssize_t foo; foo = 1235; ],
1342 [ ac_cv_have_ssize_t="yes" ],
1343 [ ac_cv_have_ssize_t="no" ]
1344 )
1345])
1346if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1347 AC_DEFINE(HAVE_SSIZE_T)
1348fi
1349
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001350AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1351 AC_TRY_COMPILE(
1352 [
1353#include <time.h>
1354 ],
1355 [ clock_t foo; foo = 1235; ],
1356 [ ac_cv_have_clock_t="yes" ],
1357 [ ac_cv_have_clock_t="no" ]
1358 )
1359])
1360if test "x$ac_cv_have_clock_t" = "xyes" ; then
1361 AC_DEFINE(HAVE_CLOCK_T)
1362fi
1363
Damien Millerb54b40e2000-06-23 08:23:34 +10001364AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1365 AC_TRY_COMPILE(
1366 [
1367#include <sys/types.h>
1368#include <sys/socket.h>
1369 ],
1370 [ sa_family_t foo; foo = 1235; ],
1371 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001372 [ AC_TRY_COMPILE(
1373 [
1374#include <sys/types.h>
1375#include <sys/socket.h>
1376#include <netinet/in.h>
1377 ],
1378 [ sa_family_t foo; foo = 1235; ],
1379 [ ac_cv_have_sa_family_t="yes" ],
1380
Damien Millerb54b40e2000-06-23 08:23:34 +10001381 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001382 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001383 )
1384])
1385if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1386 AC_DEFINE(HAVE_SA_FAMILY_T)
1387fi
1388
Damien Miller0f91b4e2000-06-18 15:43:25 +10001389AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1390 AC_TRY_COMPILE(
1391 [
1392#include <sys/types.h>
1393 ],
1394 [ pid_t foo; foo = 1235; ],
1395 [ ac_cv_have_pid_t="yes" ],
1396 [ ac_cv_have_pid_t="no" ]
1397 )
1398])
1399if test "x$ac_cv_have_pid_t" = "xyes" ; then
1400 AC_DEFINE(HAVE_PID_T)
1401fi
1402
1403AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1404 AC_TRY_COMPILE(
1405 [
1406#include <sys/types.h>
1407 ],
1408 [ mode_t foo; foo = 1235; ],
1409 [ ac_cv_have_mode_t="yes" ],
1410 [ ac_cv_have_mode_t="no" ]
1411 )
1412])
1413if test "x$ac_cv_have_mode_t" = "xyes" ; then
1414 AC_DEFINE(HAVE_MODE_T)
1415fi
1416
Damien Miller61e50f12000-05-08 20:49:37 +10001417
1418AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1419 AC_TRY_COMPILE(
1420 [
Damien Miller81171112000-04-23 11:14:01 +10001421#include <sys/types.h>
1422#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001423 ],
1424 [ struct sockaddr_storage s; ],
1425 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1426 [ ac_cv_have_struct_sockaddr_storage="no" ]
1427 )
1428])
1429if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1430 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1431fi
Damien Miller34132e52000-01-14 15:45:46 +11001432
Damien Miller61e50f12000-05-08 20:49:37 +10001433AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1434 AC_TRY_COMPILE(
1435 [
Damien Miller7b22d652000-06-18 14:07:04 +10001436#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001437#include <netinet/in.h>
1438 ],
1439 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1440 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1441 [ ac_cv_have_struct_sockaddr_in6="no" ]
1442 )
1443])
1444if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1445 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1446fi
Damien Miller34132e52000-01-14 15:45:46 +11001447
Damien Miller61e50f12000-05-08 20:49:37 +10001448AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1449 AC_TRY_COMPILE(
1450 [
Damien Miller7b22d652000-06-18 14:07:04 +10001451#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001452#include <netinet/in.h>
1453 ],
1454 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1455 [ ac_cv_have_struct_in6_addr="yes" ],
1456 [ ac_cv_have_struct_in6_addr="no" ]
1457 )
1458])
1459if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1460 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1461fi
Damien Miller34132e52000-01-14 15:45:46 +11001462
Damien Miller61e50f12000-05-08 20:49:37 +10001463AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1464 AC_TRY_COMPILE(
1465 [
Damien Miller81171112000-04-23 11:14:01 +10001466#include <sys/types.h>
1467#include <sys/socket.h>
1468#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001469 ],
1470 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1471 [ ac_cv_have_struct_addrinfo="yes" ],
1472 [ ac_cv_have_struct_addrinfo="no" ]
1473 )
1474])
1475if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1476 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1477fi
1478
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001479AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1480 AC_TRY_COMPILE(
1481 [ #include <sys/time.h> ],
1482 [ struct timeval tv; tv.tv_sec = 1;],
1483 [ ac_cv_have_struct_timeval="yes" ],
1484 [ ac_cv_have_struct_timeval="no" ]
1485 )
1486])
1487if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1488 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1489 have_struct_timeval=1
1490fi
1491
Tim Rice4e4dc562003-03-18 10:21:40 -08001492AC_CHECK_TYPES(struct timespec)
1493
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001494# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001495if test "x$ac_cv_have_int64_t" = "xno" -a \
1496 "x$ac_cv_sizeof_long_int" != "x8" -a \
1497 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001498 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1499 echo "an alternative compiler (I.E., GCC) before continuing."
1500 echo ""
1501 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001502else
1503dnl test snprintf (broken on SCO w/gcc)
1504 AC_TRY_RUN(
1505 [
1506#include <stdio.h>
1507#include <string.h>
1508#ifdef HAVE_SNPRINTF
1509main()
1510{
1511 char buf[50];
1512 char expected_out[50];
1513 int mazsize = 50 ;
1514#if (SIZEOF_LONG_INT == 8)
1515 long int num = 0x7fffffffffffffff;
1516#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001517 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001518#endif
1519 strcpy(expected_out, "9223372036854775807");
1520 snprintf(buf, mazsize, "%lld", num);
1521 if(strcmp(buf, expected_out) != 0)
1522 exit(1);
1523 exit(0);
1524}
1525#else
1526main() { exit(0); }
1527#endif
1528 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1529 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001530fi
1531
Damien Miller78315eb2000-09-29 23:01:36 +11001532dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001533OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1535OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1536OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1537OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001538OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001539OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1540OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001541OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001542OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1543OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1544OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1545OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001546OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1547OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1548OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1549OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001550
1551AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001552
Damien Miller61e50f12000-05-08 20:49:37 +10001553AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1554 ac_cv_have_ss_family_in_struct_ss, [
1555 AC_TRY_COMPILE(
1556 [
Damien Miller81171112000-04-23 11:14:01 +10001557#include <sys/types.h>
1558#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001559 ],
1560 [ struct sockaddr_storage s; s.ss_family = 1; ],
1561 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1562 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1563 )
1564])
1565if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1566 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1567fi
1568
Damien Miller61e50f12000-05-08 20:49:37 +10001569AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1570 ac_cv_have___ss_family_in_struct_ss, [
1571 AC_TRY_COMPILE(
1572 [
Damien Miller81171112000-04-23 11:14:01 +10001573#include <sys/types.h>
1574#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001575 ],
1576 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1577 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1578 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1579 )
1580])
1581if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1582 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1583fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001584
Damien Millerad833b32000-08-23 10:46:23 +10001585AC_CACHE_CHECK([for pw_class field in struct passwd],
1586 ac_cv_have_pw_class_in_struct_passwd, [
1587 AC_TRY_COMPILE(
1588 [
Damien Millerad833b32000-08-23 10:46:23 +10001589#include <pwd.h>
1590 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001591 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001592 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1593 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1594 )
1595])
1596if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1597 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1598fi
1599
Kevin Steves82456952001-06-22 21:14:18 +00001600AC_CACHE_CHECK([for pw_expire field in struct passwd],
1601 ac_cv_have_pw_expire_in_struct_passwd, [
1602 AC_TRY_COMPILE(
1603 [
1604#include <pwd.h>
1605 ],
1606 [ struct passwd p; p.pw_expire = 0; ],
1607 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1608 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1609 )
1610])
1611if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1612 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1613fi
1614
1615AC_CACHE_CHECK([for pw_change field in struct passwd],
1616 ac_cv_have_pw_change_in_struct_passwd, [
1617 AC_TRY_COMPILE(
1618 [
1619#include <pwd.h>
1620 ],
1621 [ struct passwd p; p.pw_change = 0; ],
1622 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1623 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1624 )
1625])
1626if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1627 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1628fi
Damien Miller61e50f12000-05-08 20:49:37 +10001629
Tim Rice28bbb0c2002-05-27 17:37:32 -07001630dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001631AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1632 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001633 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001634 [
Tim Riceae49fe62002-04-12 10:26:21 -07001635#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001636#include <sys/socket.h>
1637#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001638int main() {
1639#ifdef msg_accrights
1640exit(1);
1641#endif
1642struct msghdr m;
1643m.msg_accrights = 0;
1644exit(0);
1645}
Kevin Steves939c9db2002-03-22 17:23:25 +00001646 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001647 [ ac_cv_have_accrights_in_msghdr="yes" ],
1648 [ ac_cv_have_accrights_in_msghdr="no" ]
1649 )
1650])
1651if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1652 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1653fi
1654
Kevin Stevesa44e0352002-04-07 16:18:03 +00001655AC_CACHE_CHECK([for msg_control field in struct msghdr],
1656 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001657 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001658 [
Tim Riceae49fe62002-04-12 10:26:21 -07001659#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001660#include <sys/socket.h>
1661#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001662int main() {
1663#ifdef msg_control
1664exit(1);
1665#endif
1666struct msghdr m;
1667m.msg_control = 0;
1668exit(0);
1669}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001670 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001671 [ ac_cv_have_control_in_msghdr="yes" ],
1672 [ ac_cv_have_control_in_msghdr="no" ]
1673 )
1674])
1675if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1676 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1677fi
1678
Damien Miller61e50f12000-05-08 20:49:37 +10001679AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1680 AC_TRY_LINK([],
1681 [ extern char *__progname; printf("%s", __progname); ],
1682 [ ac_cv_libc_defines___progname="yes" ],
1683 [ ac_cv_libc_defines___progname="no" ]
1684 )
1685])
1686if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1687 AC_DEFINE(HAVE___PROGNAME)
1688fi
1689
Kevin Steves4846f4a2002-03-22 18:19:53 +00001690AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1691 AC_TRY_LINK([
1692#include <stdio.h>
1693],
1694 [ printf("%s", __FUNCTION__); ],
1695 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1696 [ ac_cv_cc_implements___FUNCTION__="no" ]
1697 )
1698])
1699if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1700 AC_DEFINE(HAVE___FUNCTION__)
1701fi
1702
1703AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1704 AC_TRY_LINK([
1705#include <stdio.h>
1706],
1707 [ printf("%s", __func__); ],
1708 [ ac_cv_cc_implements___func__="yes" ],
1709 [ ac_cv_cc_implements___func__="no" ]
1710 )
1711])
1712if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1713 AC_DEFINE(HAVE___func__)
1714fi
1715
Damien Miller4f8e6692001-07-14 13:22:53 +10001716AC_CACHE_CHECK([whether getopt has optreset support],
1717 ac_cv_have_getopt_optreset, [
1718 AC_TRY_LINK(
1719 [
1720#include <getopt.h>
1721 ],
1722 [ extern int optreset; optreset = 0; ],
1723 [ ac_cv_have_getopt_optreset="yes" ],
1724 [ ac_cv_have_getopt_optreset="no" ]
1725 )
1726])
1727if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1728 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1729fi
Damien Millera22ba012000-03-02 23:09:20 +11001730
Damien Millerecbb26d2000-07-15 14:59:14 +10001731AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1732 AC_TRY_LINK([],
1733 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1734 [ ac_cv_libc_defines_sys_errlist="yes" ],
1735 [ ac_cv_libc_defines_sys_errlist="no" ]
1736 )
1737])
1738if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1739 AC_DEFINE(HAVE_SYS_ERRLIST)
1740fi
1741
1742
Damien Miller11fa2cc2000-08-16 10:35:58 +10001743AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1744 AC_TRY_LINK([],
1745 [ extern int sys_nerr; printf("%i", sys_nerr);],
1746 [ ac_cv_libc_defines_sys_nerr="yes" ],
1747 [ ac_cv_libc_defines_sys_nerr="no" ]
1748 )
1749])
1750if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1751 AC_DEFINE(HAVE_SYS_NERR)
1752fi
1753
Damien Miller85de5802001-09-18 14:01:11 +10001754SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001755
1756# Check whether user wants sectok support
1757AC_ARG_WITH(sectok,
1758 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001759 [
1760 if test "x$withval" != "xno" ; then
1761 if test "x$withval" != "xyes" ; then
1762 CPPFLAGS="$CPPFLAGS -I${withval}"
1763 LDFLAGS="$LDFLAGS -L${withval}"
1764 if test ! -z "$need_dash_r" ; then
1765 LDFLAGS="$LDFLAGS -R${withval}"
1766 fi
1767 if test ! -z "$blibpath" ; then
1768 blibpath="$blibpath:${withval}"
1769 fi
1770 fi
1771 AC_CHECK_HEADERS(sectok.h)
1772 if test "$ac_cv_header_sectok_h" != yes; then
1773 AC_MSG_ERROR(Can't find sectok.h)
1774 fi
1775 AC_CHECK_LIB(sectok, sectok_open)
1776 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1777 AC_MSG_ERROR(Can't find libsectok)
1778 fi
1779 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001780 AC_DEFINE(USE_SECTOK)
1781 SCARD_MSG="yes, using sectok"
1782 fi
1783 ]
1784)
1785
1786# Check whether user wants OpenSC support
1787AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001788 AC_HELP_STRING([--with-opensc=PFX],
1789 [Enable smartcard support using OpenSC]),
1790 opensc_config_prefix="$withval", opensc_config_prefix="")
1791if test x$opensc_config_prefix != x ; then
1792 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1793 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1794 if test "$OPENSC_CONFIG" != "no"; then
1795 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1796 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1797 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1798 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1799 AC_DEFINE(SMARTCARD)
1800 AC_DEFINE(USE_OPENSC)
1801 SCARD_MSG="yes, using OpenSC"
1802 fi
1803fi
Damien Miller85de5802001-09-18 14:01:11 +10001804
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001805# Check whether user wants Kerberos 5 support
1806KRB5_MSG="no"
1807AC_ARG_WITH(kerberos5,
1808 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1809 [
1810 if test "x$withval" != "xno" ; then
1811 if test "x$withval" = "xyes" ; then
1812 KRB5ROOT="/usr/local"
1813 else
1814 KRB5ROOT=${withval}
1815 fi
1816 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1817 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1818 AC_DEFINE(KRB5)
1819 KRB5_MSG="yes"
1820 AC_MSG_CHECKING(whether we are using Heimdal)
1821 AC_TRY_COMPILE([ #include <krb5.h> ],
1822 [ char *tmp = heimdal_version; ],
1823 [ AC_MSG_RESULT(yes)
1824 AC_DEFINE(HEIMDAL)
1825 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1826 ],
1827 [ AC_MSG_RESULT(no)
1828 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1829 ]
1830 )
1831 if test ! -z "$need_dash_r" ; then
1832 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1833 fi
1834 if test ! -z "$blibpath" ; then
1835 blibpath="$blibpath:${KRB5ROOT}/lib"
1836 fi
1837 AC_CHECK_LIB(resolv, dn_expand, , )
1838
1839 KRB5=yes
1840 fi
1841 ]
1842)
1843# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001844KRB4_MSG="no"
1845AC_ARG_WITH(kerberos4,
1846 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1847 [
1848 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001849 if test "x$withval" != "xyes" ; then
1850 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1851 LDFLAGS="$LDFLAGS -L${withval}/lib"
1852 if test ! -z "$need_dash_r" ; then
1853 LDFLAGS="$LDFLAGS -R${withval}/lib"
1854 fi
1855 if test ! -z "$blibpath" ; then
1856 blibpath="$blibpath:${withval}/lib"
1857 fi
1858 else
1859 if test -d /usr/include/kerberosIV ; then
1860 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1861 fi
1862 fi
1863
1864 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001865 if test "$ac_cv_header_krb_h" != yes; then
1866 AC_MSG_WARN([Cannot find krb.h, build may fail])
1867 fi
Damien Miller98344742001-03-28 14:37:06 +10001868 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001869 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001870 AC_CHECK_LIB(krb4, main)
1871 if test "$ac_cv_lib_krb4_main" != yes; then
1872 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1873 else
1874 KLIBS="-lkrb4"
1875 fi
1876 else
1877 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001878 fi
Damien Miller98344742001-03-28 14:37:06 +10001879 AC_CHECK_LIB(des, des_cbc_encrypt)
1880 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1881 AC_CHECK_LIB(des425, des_cbc_encrypt)
1882 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1883 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1884 else
1885 KLIBS="-ldes425"
1886 fi
1887 else
1888 KLIBS="-ldes"
1889 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001890 AC_CHECK_LIB(resolv, dn_expand, , )
1891 KRB4=yes
1892 KRB4_MSG="yes"
1893 AC_DEFINE(KRB4)
1894 fi
1895 ]
1896)
1897
1898# Check whether user wants AFS support
1899AFS_MSG="no"
1900AC_ARG_WITH(afs,
1901 [ --with-afs=PATH Enable AFS support],
1902 [
1903 if test "x$withval" != "xno" ; then
1904
1905 if test "x$withval" != "xyes" ; then
1906 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1907 LDFLAGS="$LDFLAGS -L${withval}/lib"
1908 fi
1909
1910 if test -z "$KRB4" ; then
1911 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1912 fi
1913
1914 LIBS="-lkafs $LIBS"
1915 if test ! -z "$AFS_LIBS" ; then
1916 LIBS="$LIBS $AFS_LIBS"
1917 fi
1918 AC_DEFINE(AFS)
1919 AFS_MSG="yes"
1920 fi
1921 ]
1922)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001923LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001924
Damien Millera22ba012000-03-02 23:09:20 +11001925# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001926
Damien Millerf58c6722002-05-13 13:15:42 +10001927PRIVSEP_PATH=/var/empty
1928AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001929 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001930 [
1931 if test "x$withval" != "$no" ; then
1932 PRIVSEP_PATH=$withval
1933 fi
1934 ]
1935)
1936AC_SUBST(PRIVSEP_PATH)
1937
Damien Millera22ba012000-03-02 23:09:20 +11001938AC_ARG_WITH(xauth,
1939 [ --with-xauth=PATH Specify path to xauth program ],
1940 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001941 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001942 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001943 fi
1944 ],
1945 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001946 TestPath="$PATH"
1947 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1948 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1949 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1950 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1951 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001952 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001953 xauth_path="/usr/openwin/bin/xauth"
1954 fi
1955 ]
1956)
1957
Damien Miller7d901272003-01-13 16:55:22 +11001958STRIP_OPT=-s
1959AC_ARG_ENABLE(strip,
1960 [ --disable-strip Disable calling strip(1) on install],
1961 [
1962 if test "x$enableval" = "xno" ; then
1963 STRIP_OPT=
1964 fi
1965 ]
1966)
1967AC_SUBST(STRIP_OPT)
1968
Damien Millera19cf472000-11-29 13:28:50 +11001969if test -z "$xauth_path" ; then
1970 XAUTH_PATH="undefined"
1971 AC_SUBST(XAUTH_PATH)
1972else
Damien Millera22ba012000-03-02 23:09:20 +11001973 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001974 XAUTH_PATH=$xauth_path
1975 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001976fi
Damien Millera22ba012000-03-02 23:09:20 +11001977
1978# Check for mail directory (last resort if we cannot get it from headers)
1979if test ! -z "$MAIL" ; then
1980 maildir=`dirname $MAIL`
1981 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1982fi
1983
Damien Millera22ba012000-03-02 23:09:20 +11001984if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001985 if test "x$disable_ptmx_check" != "xyes" ; then
1986 AC_CHECK_FILE("/dev/ptmx",
1987 [
1988 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1989 have_dev_ptmx=1
1990 ]
1991 )
1992 fi
Damien Millera22ba012000-03-02 23:09:20 +11001993fi
Damien Miller204ad072000-03-02 23:56:12 +11001994AC_CHECK_FILE("/dev/ptc",
1995 [
1996 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1997 have_dev_ptc=1
1998 ]
1999)
2000
Damien Millera22ba012000-03-02 23:09:20 +11002001# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002002AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002003 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002004 [
Damien Miller897741e2001-04-16 10:41:46 +10002005 case "$withval" in
2006 man|cat|doc)
2007 MANTYPE=$withval
2008 ;;
2009 *)
2010 AC_MSG_ERROR(invalid man type: $withval)
2011 ;;
2012 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002013 ]
2014)
Ben Lindstrombc709922001-04-18 18:04:21 +00002015if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002016 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2017 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002018 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2019 MANTYPE=doc
2020 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2021 MANTYPE=man
2022 else
2023 MANTYPE=cat
2024 fi
2025fi
Damien Miller670a4b82000-01-22 13:53:11 +11002026AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002027if test "$MANTYPE" = "doc"; then
2028 mansubdir=man;
2029else
2030 mansubdir=$MANTYPE;
2031fi
2032AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002033
Damien Millera22ba012000-03-02 23:09:20 +11002034# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002035MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002036AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002037 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002038 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002039 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002040 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002041 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002042 fi
2043 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002044)
2045
Damien Millera22ba012000-03-02 23:09:20 +11002046# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002047AC_ARG_WITH(shadow,
2048 [ --without-shadow Disable shadow password support],
2049 [
2050 if test "x$withval" = "xno" ; then
2051 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002052 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002053 fi
2054 ]
2055)
2056
Damien Miller1f335fb2000-06-26 11:31:33 +10002057if test -z "$disable_shadow" ; then
2058 AC_MSG_CHECKING([if the systems has expire shadow information])
2059 AC_TRY_COMPILE(
2060 [
2061#include <sys/types.h>
2062#include <shadow.h>
2063 struct spwd sp;
2064 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2065 [ sp_expire_available=yes ], []
2066 )
2067
2068 if test "x$sp_expire_available" = "xyes" ; then
2069 AC_MSG_RESULT(yes)
2070 AC_DEFINE(HAS_SHADOW_EXPIRE)
2071 else
2072 AC_MSG_RESULT(no)
2073 fi
2074fi
2075
Damien Millera22ba012000-03-02 23:09:20 +11002076# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002077if test ! -z "$IPADDR_IN_DISPLAY" ; then
2078 DISPLAY_HACK_MSG="yes"
2079 AC_DEFINE(IPADDR_IN_DISPLAY)
2080else
2081 DISPLAY_HACK_MSG="no"
2082 AC_ARG_WITH(ipaddr-display,
2083 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2084 [
2085 if test "x$withval" != "xno" ; then
2086 AC_DEFINE(IPADDR_IN_DISPLAY)
2087 DISPLAY_HACK_MSG="yes"
2088 fi
2089 ]
2090 )
2091fi
Damien Miller76112de1999-12-21 11:18:08 +11002092
Tim Rice43a1c132002-04-17 21:19:14 -07002093dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2094if test $ac_cv_func_login_getcapbool = "yes" -a \
2095 $ac_cv_header_login_cap_h = "yes" ; then
2096 USES_LOGIN_CONF=yes
2097fi
Damien Millera22ba012000-03-02 23:09:20 +11002098# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002099SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002100AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002101 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002102 [
Tim Rice43a1c132002-04-17 21:19:14 -07002103 if test "$USES_LOGIN_CONF" = "yes" ; then
2104 AC_MSG_WARN([
2105--with-default-path=PATH has no effect on this system.
2106Edit /etc/login.conf instead.])
2107 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002108 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002109 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002110 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002111 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002112 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2113 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2114 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002115 AC_TRY_RUN(
2116 [
2117/* find out what STDPATH is */
2118#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002119#ifdef HAVE_PATHS_H
2120# include <paths.h>
2121#endif
2122#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002123# ifdef _PATH_USERPATH /* Irix */
2124# define _PATH_STDPATH _PATH_USERPATH
2125# else
2126# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2127# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002128#endif
2129#include <sys/types.h>
2130#include <sys/stat.h>
2131#include <fcntl.h>
2132#define DATA "conftest.stdpath"
2133
2134main()
2135{
2136 FILE *fd;
2137 int rc;
2138
2139 fd = fopen(DATA,"w");
2140 if(fd == NULL)
2141 exit(1);
2142
2143 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2144 exit(1);
2145
2146 exit(0);
2147}
2148 ], [ user_path=`cat conftest.stdpath` ],
2149 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2150 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2151 )
2152# make sure $bindir is in USER_PATH so scp will work
2153 t_bindir=`eval echo ${bindir}`
2154 case $t_bindir in
2155 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2156 esac
2157 case $t_bindir in
2158 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2159 esac
2160 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2161 if test $? -ne 0 ; then
2162 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2163 if test $? -ne 0 ; then
2164 user_path=$user_path:$t_bindir
2165 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2166 fi
2167 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002168 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002169)
Tim Rice43a1c132002-04-17 21:19:14 -07002170if test "$USES_LOGIN_CONF" != "yes" ; then
2171 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2172 AC_SUBST(user_path)
2173fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002174
Damien Millera18bbd32002-05-13 10:48:57 +10002175# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002176AC_ARG_WITH(superuser-path,
2177 [ --with-superuser-path= Specify different path for super-user],
2178 [
2179 if test "x$withval" != "xno" ; then
2180 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2181 superuser_path=$withval
2182 fi
2183 ]
2184)
2185
2186
Damien Millera22ba012000-03-02 23:09:20 +11002187# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002188IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002189AC_ARG_WITH(ipv4-default,
2190 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2191 [
2192 if test "x$withval" != "xno" ; then
2193 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002194 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002195 fi
2196 ]
2197)
2198
Damien Miller61e50f12000-05-08 20:49:37 +10002199AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002200IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002201AC_ARG_WITH(4in6,
2202 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2203 [
2204 if test "x$withval" != "xno" ; then
2205 AC_MSG_RESULT(yes)
2206 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002207 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002208 else
2209 AC_MSG_RESULT(no)
2210 fi
2211 ],[
2212 if test "x$inet6_default_4in6" = "xyes"; then
2213 AC_MSG_RESULT([yes (default)])
2214 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002215 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002216 else
2217 AC_MSG_RESULT([no (default)])
2218 fi
2219 ]
2220)
2221
Damien Miller60396b02001-02-18 17:01:00 +11002222# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002223BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002224AC_ARG_WITH(bsd-auth,
2225 [ --with-bsd-auth Enable BSD auth support],
2226 [
2227 if test "x$withval" != "xno" ; then
2228 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002229 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002230 fi
2231 ]
2232)
2233
Damien Millera22ba012000-03-02 23:09:20 +11002234# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002235piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002236# make sure the directory exists
2237if test ! -d $piddir ; then
2238 piddir=`eval echo ${sysconfdir}`
2239 case $piddir in
2240 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2241 esac
2242fi
2243
Tim Rice88f2ab52002-03-17 12:17:34 -08002244AC_ARG_WITH(pid-dir,
2245 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2246 [
2247 if test "x$withval" != "xno" ; then
2248 piddir=$withval
2249 if test ! -d $piddir ; then
2250 AC_MSG_WARN([** no $piddir directory on this system **])
2251 fi
2252 fi
2253 ]
2254)
2255
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002256AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002257AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002258
andre2ff7b5d2000-06-03 14:57:40 +00002259dnl allow user to disable some login recording features
2260AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002261 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002262 [ AC_DEFINE(DISABLE_LASTLOG) ]
2263)
2264AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002265 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002266 [ AC_DEFINE(DISABLE_UTMP) ]
2267)
2268AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002269 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002270 [ AC_DEFINE(DISABLE_UTMPX) ]
2271)
2272AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002273 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002274 [ AC_DEFINE(DISABLE_WTMP) ]
2275)
2276AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002277 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002278 [ AC_DEFINE(DISABLE_WTMPX) ]
2279)
2280AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002281 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002282 [ AC_DEFINE(DISABLE_LOGIN) ]
2283)
2284AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002285 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002286 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2287)
2288AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002289 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002290 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2291)
2292AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002293 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002294 [
2295 if test "x$withval" = "xno" ; then
2296 AC_DEFINE(DISABLE_LASTLOG)
2297 else
2298 conf_lastlog_location=$withval
2299 fi
2300 ]
2301)
andre2ff7b5d2000-06-03 14:57:40 +00002302
2303dnl lastlog, [uw]tmpx? detection
2304dnl NOTE: set the paths in the platform section to avoid the
2305dnl need for command-line parameters
2306dnl lastlog and [uw]tmp are subject to a file search if all else fails
2307
2308dnl lastlog detection
2309dnl NOTE: the code itself will detect if lastlog is a directory
2310AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2311AC_TRY_COMPILE([
2312#include <sys/types.h>
2313#include <utmp.h>
2314#ifdef HAVE_LASTLOG_H
2315# include <lastlog.h>
2316#endif
Damien Miller2994e082000-06-04 15:51:47 +10002317#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002318# include <paths.h>
2319#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002320#ifdef HAVE_LOGIN_H
2321# include <login.h>
2322#endif
andre2ff7b5d2000-06-03 14:57:40 +00002323 ],
2324 [ char *lastlog = LASTLOG_FILE; ],
2325 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002326 [
2327 AC_MSG_RESULT(no)
2328 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2329 AC_TRY_COMPILE([
2330#include <sys/types.h>
2331#include <utmp.h>
2332#ifdef HAVE_LASTLOG_H
2333# include <lastlog.h>
2334#endif
2335#ifdef HAVE_PATHS_H
2336# include <paths.h>
2337#endif
2338 ],
2339 [ char *lastlog = _PATH_LASTLOG; ],
2340 [ AC_MSG_RESULT(yes) ],
2341 [
andree441aa32000-06-12 22:34:38 +00002342 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002343 system_lastlog_path=no
2344 ])
2345 ]
andre2ff7b5d2000-06-03 14:57:40 +00002346)
Damien Miller2994e082000-06-04 15:51:47 +10002347
andre2ff7b5d2000-06-03 14:57:40 +00002348if test -z "$conf_lastlog_location"; then
2349 if test x"$system_lastlog_path" = x"no" ; then
2350 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002351 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002352 conf_lastlog_location=$f
2353 fi
2354 done
2355 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002356 AC_MSG_WARN([** Cannot find lastlog **])
2357 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002358 fi
2359 fi
2360fi
2361
2362if test -n "$conf_lastlog_location"; then
2363 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2364fi
2365
2366dnl utmp detection
2367AC_MSG_CHECKING([if your system defines UTMP_FILE])
2368AC_TRY_COMPILE([
2369#include <sys/types.h>
2370#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002371#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002372# include <paths.h>
2373#endif
2374 ],
2375 [ char *utmp = UTMP_FILE; ],
2376 [ AC_MSG_RESULT(yes) ],
2377 [ AC_MSG_RESULT(no)
2378 system_utmp_path=no ]
2379)
2380if test -z "$conf_utmp_location"; then
2381 if test x"$system_utmp_path" = x"no" ; then
2382 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2383 if test -f $f ; then
2384 conf_utmp_location=$f
2385 fi
2386 done
2387 if test -z "$conf_utmp_location"; then
2388 AC_DEFINE(DISABLE_UTMP)
2389 fi
2390 fi
2391fi
2392if test -n "$conf_utmp_location"; then
2393 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2394fi
2395
2396dnl wtmp detection
2397AC_MSG_CHECKING([if your system defines WTMP_FILE])
2398AC_TRY_COMPILE([
2399#include <sys/types.h>
2400#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002401#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002402# include <paths.h>
2403#endif
2404 ],
2405 [ char *wtmp = WTMP_FILE; ],
2406 [ AC_MSG_RESULT(yes) ],
2407 [ AC_MSG_RESULT(no)
2408 system_wtmp_path=no ]
2409)
2410if test -z "$conf_wtmp_location"; then
2411 if test x"$system_wtmp_path" = x"no" ; then
2412 for f in /usr/adm/wtmp /var/log/wtmp; do
2413 if test -f $f ; then
2414 conf_wtmp_location=$f
2415 fi
2416 done
2417 if test -z "$conf_wtmp_location"; then
2418 AC_DEFINE(DISABLE_WTMP)
2419 fi
2420 fi
2421fi
2422if test -n "$conf_wtmp_location"; then
2423 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2424fi
2425
2426
2427dnl utmpx detection - I don't know any system so perverse as to require
2428dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2429dnl there, though.
2430AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2431AC_TRY_COMPILE([
2432#include <sys/types.h>
2433#include <utmp.h>
2434#ifdef HAVE_UTMPX_H
2435#include <utmpx.h>
2436#endif
Damien Miller2994e082000-06-04 15:51:47 +10002437#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002438# include <paths.h>
2439#endif
2440 ],
2441 [ char *utmpx = UTMPX_FILE; ],
2442 [ AC_MSG_RESULT(yes) ],
2443 [ AC_MSG_RESULT(no)
2444 system_utmpx_path=no ]
2445)
2446if test -z "$conf_utmpx_location"; then
2447 if test x"$system_utmpx_path" = x"no" ; then
2448 AC_DEFINE(DISABLE_UTMPX)
2449 fi
2450else
2451 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2452fi
2453
2454dnl wtmpx detection
2455AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2456AC_TRY_COMPILE([
2457#include <sys/types.h>
2458#include <utmp.h>
2459#ifdef HAVE_UTMPX_H
2460#include <utmpx.h>
2461#endif
Damien Miller2994e082000-06-04 15:51:47 +10002462#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002463# include <paths.h>
2464#endif
2465 ],
2466 [ char *wtmpx = WTMPX_FILE; ],
2467 [ AC_MSG_RESULT(yes) ],
2468 [ AC_MSG_RESULT(no)
2469 system_wtmpx_path=no ]
2470)
2471if test -z "$conf_wtmpx_location"; then
2472 if test x"$system_wtmpx_path" = x"no" ; then
2473 AC_DEFINE(DISABLE_WTMPX)
2474 fi
2475else
2476 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2477fi
2478
Damien Miller4018c192000-04-30 09:30:44 +10002479
Damien Miller29ea30d2000-03-17 10:54:15 +11002480if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002481 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2482 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002483fi
2484
Tim Rice4cec93f2002-02-26 08:40:48 -08002485dnl remove pam and dl because they are in $LIBPAM
2486if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002487 LIBS=`echo $LIBS | sed 's/-lpam //'`
2488fi
2489if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2490 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002491fi
2492
Damien Millerbac2d8a2000-09-05 16:13:06 +11002493AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002494AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2495AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002496
Damien Miller7b22d652000-06-18 14:07:04 +10002497# Print summary of options
2498
Damien Miller7b22d652000-06-18 14:07:04 +10002499# Someone please show me a better way :)
2500A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2501B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2502C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2503D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002504E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002505F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002506G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002507H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2508I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2509J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002510
2511echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002512echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002513echo " User binaries: $B"
2514echo " System binaries: $C"
2515echo " Configuration files: $D"
2516echo " Askpass program: $E"
2517echo " Manual pages: $F"
2518echo " PID file: $G"
2519echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002520if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002521echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002522else
Damien Millerf58c6722002-05-13 13:15:42 +10002523echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002524fi
Damien Millera18bbd32002-05-13 10:48:57 +10002525if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002526echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002527fi
Damien Millerf58c6722002-05-13 13:15:42 +10002528echo " Manpage format: $MANTYPE"
2529echo " PAM support: ${PAM_MSG}"
2530echo " KerberosIV support: $KRB4_MSG"
2531echo " KerberosV support: $KRB5_MSG"
2532echo " Smartcard support: $SCARD_MSG"
2533echo " AFS support: $AFS_MSG"
2534echo " S/KEY support: $SKEY_MSG"
2535echo " TCP Wrappers support: $TCPW_MSG"
2536echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002537echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002538echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2539echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2540echo " BSD Auth support: $BSD_AUTH_MSG"
2541echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002542if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002543echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002544fi
2545
Damien Miller7b22d652000-06-18 14:07:04 +10002546echo ""
2547
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002548echo " Host: ${host}"
2549echo " Compiler: ${CC}"
2550echo " Compiler flags: ${CFLAGS}"
2551echo "Preprocessor flags: ${CPPFLAGS}"
2552echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002553echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002554
2555echo ""
2556
Damien Miller82cf0ce2000-12-20 13:34:48 +11002557if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002558 echo "PAM is enabled. You may need to install a PAM control file "
2559 echo "for sshd, otherwise password authentication may fail. "
2560 echo "Example PAM control files can be found in the contrib/ "
2561 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002562 echo ""
2563fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002564
Damien Miller6c21c512002-01-22 21:57:53 +11002565if test ! -z "$RAND_HELPER_CMDHASH" ; then
2566 echo "WARNING: you are using the builtin random number collection "
2567 echo "service. Please read WARNING.RNG and request that your OS "
2568 echo "vendor includes kernel-based random number collection in "
2569 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002570 echo ""
2571fi
Damien Miller60396b02001-02-18 17:01:00 +11002572