blob: bdf80288e0355efa13060484cd37487f05682949 [file] [log] [blame]
Damien Millerfe1f1432003-02-24 15:45:42 +11001# $Id: configure.ac,v 1.109 2003/02/24 04:45:43 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100060 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Millerfa2bb692002-04-23 23:22:25 +100061 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
64 AC_TRY_LINK([],
65 [],
66 [
67 AC_MSG_RESULT(yes)
68 blibpath="/usr/lib:/lib:/usr/local/lib"
69 ],
70 [ AC_MSG_RESULT(no) ]
71 )
72 LDFLAGS="$saved_LDFLAGS"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Tim Ricee958ed32002-07-05 07:12:33 -070074 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
75 [AC_CHECK_LIB(s,authenticate,
76 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
77 LIBS="$LIBS -ls"
78 ])
79 ])
Damien Millereca71f82000-01-20 22:38:27 +110080 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100081 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000082 dnl AIX handles lastlog as part of its login message
83 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000084 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Millerec201962003-01-13 10:04:58 +110085 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
86 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller75b1d102000-01-07 14:01:41 +110087 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110088*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +110089 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -080090 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110091 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000092 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110093 AC_DEFINE(DISABLE_SHADOW)
94 AC_DEFINE(IPV4_DEFAULT)
95 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000096 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000097 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -070098 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +000099 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100100 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000101*-*-dgux*)
102 AC_DEFINE(IP_TOS_IS_BROKEN)
103 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000104*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000105 AC_MSG_CHECKING(if we have working getaddrinfo)
106 AC_TRY_RUN([#include <mach-o/dyld.h>
107main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
108 exit(0);
109 else
110 exit(1);
111}], [AC_MSG_RESULT(working)],
112 [AC_MSG_RESULT(buggy)
113 AC_DEFINE(BROKEN_GETADDRINFO)],
114 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000115 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000116*-*-hpux10.26)
117 if test -z "$GCC"; then
118 CFLAGS="$CFLAGS -Ae"
119 fi
120 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
121 IPADDR_IN_DISPLAY=yes
122 AC_DEFINE(HAVE_SECUREWARE)
123 AC_DEFINE(USE_PIPES)
124 AC_DEFINE(LOGIN_NO_ENDOPT)
125 AC_DEFINE(LOGIN_NEEDS_UTMPX)
126 AC_DEFINE(DISABLE_SHADOW)
127 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100128 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700129 LIBS="$LIBS -lsec -lsecpw"
130 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000131 disable_ptmx_check=yes
132 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100133*-*-hpux10*)
134 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000135 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100136 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000137 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100138 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000139 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100142 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100143 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100144 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700145 LIBS="$LIBS -lsec"
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100147 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000148*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000149 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100150 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100151 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100152 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000153 AC_DEFINE(LOGIN_NO_ENDOPT)
154 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100155 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100156 AC_DEFINE(DISABLE_UTMP)
Damien Millerec201962003-01-13 10:04:58 +1100157 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700158 LIBS="$LIBS -lsec"
159 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000160 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100161*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000162 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000163 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100164 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000165 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000166 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100167 ;;
168*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000169 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000170 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100171 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000172 AC_DEFINE(WITH_IRIX_ARRAY)
173 AC_DEFINE(WITH_IRIX_PROJECT)
174 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000175 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000176 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000177 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100178 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100179*-*-linux*)
180 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100181 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100182 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000183 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Millerec201962003-01-13 10:04:58 +1100184 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
185 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
Damien Miller7bcb0892000-03-11 20:45:40 +1100186 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100187 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000188mips-sony-bsd|mips-sony-newsos4)
189 AC_DEFINE(HAVE_NEWS4)
190 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000191 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100192*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000193 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100194 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100195 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100196*-*-freebsd*)
197 check_for_libcrypt_later=1
198 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000199*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000200 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100201 conf_utmp_location=/etc/utmp
202 conf_wtmp_location=/usr/adm/wtmp
203 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000204 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000205 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000206 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100207 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000209 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000210 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100211*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000213 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100214 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100215 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000216 AC_DEFINE(LOGIN_NEEDS_UTMPX)
217 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000218 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000219 # hardwire lastlog location (can't detect it on some versions)
220 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000221 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
222 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
223 if test "$sol2ver" -ge 8; then
224 AC_MSG_RESULT(yes)
225 AC_DEFINE(DISABLE_UTMP)
226 AC_DEFINE(DISABLE_WTMP)
227 else
228 AC_MSG_RESULT(no)
229 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100230 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000231*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000232 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000233 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100234 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000235 conf_utmp_location=/etc/utmp
236 conf_wtmp_location=/var/adm/wtmp
237 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000238 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000239 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000240*-ncr-sysv*)
241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
242 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700243 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000244 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000245 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000246*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000247 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700248 # /usr/ucblib MUST NOT be searched on ReliantUNIX
249 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100250 IPADDR_IN_DISPLAY=yes
251 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000252 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700253 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
254 # Attention: always take care to bind libsocket and libnsl before libc,
255 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000256 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100257*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000258 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100259 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100260 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100261 ;;
262*-*-sysv5*)
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 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100267*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000268 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100269 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100270 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100271*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000272 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100273 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700274 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100275 RANLIB=true
276 no_dev_ptmx=1
277 AC_DEFINE(BROKEN_SYS_TERMIO_H)
278 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000279 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000280 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100281 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100282 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700283 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700284 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100285 ;;
286*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800287 if test -z "$GCC"; then
288 CFLAGS="$CFLAGS -belf"
289 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000290 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000291 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100292 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000293 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100294 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000295 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000296 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700297 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100298 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700299 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000300 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000301*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000302 AC_DEFINE(USE_PIPES)
303 AC_DEFINE(DISABLE_FD_PASSING)
304 LDFLAGS="$LDFLAGS"
305 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
306 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000307 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000308*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000309 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700310 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700311 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000312 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
313 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
314 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700315 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000316*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000317 AC_MSG_CHECKING(for Digital Unix SIA)
318 no_osfsia=""
319 AC_ARG_WITH(osfsia,
320 [ --with-osfsia Enable Digital Unix SIA],
321 [
322 if test "x$withval" = "xno" ; then
323 AC_MSG_RESULT(disabled)
324 no_osfsia=1
325 fi
326 ],
327 )
328 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000329 if test -f /etc/sia/matrix.conf; then
330 AC_MSG_RESULT(yes)
331 AC_DEFINE(HAVE_OSF_SIA)
332 AC_DEFINE(DISABLE_LOGIN)
333 LIBS="$LIBS -lsecurity -ldb -lm -laud"
334 else
335 AC_MSG_RESULT(no)
336 fi
337 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000338 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000339 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000340
341*-*-nto-qnx)
342 AC_DEFINE(USE_PIPES)
343 AC_DEFINE(NO_X11_UNIX_SOCKETS)
344 AC_DEFINE(MISSING_NFDBITS)
345 AC_DEFINE(MISSING_HOWMANY)
346 AC_DEFINE(MISSING_FD_MASK)
347 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100348esac
349
Damien Millere37bfc12000-06-05 09:37:43 +1000350# Allow user to specify flags
351AC_ARG_WITH(cflags,
352 [ --with-cflags Specify additional flags to pass to compiler],
353 [
354 if test "x$withval" != "xno" ; then
355 CFLAGS="$CFLAGS $withval"
356 fi
357 ]
358)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000359AC_ARG_WITH(cppflags,
360 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
361 [
362 if test "x$withval" != "xno"; then
363 CPPFLAGS="$CPPFLAGS $withval"
364 fi
365 ]
366)
Damien Millere37bfc12000-06-05 09:37:43 +1000367AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000368 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000369 [
370 if test "x$withval" != "xno" ; then
371 LDFLAGS="$LDFLAGS $withval"
372 fi
373 ]
374)
375AC_ARG_WITH(libs,
376 [ --with-libs Specify additional libraries to link with],
377 [
378 if test "x$withval" != "xno" ; then
379 LIBS="$LIBS $withval"
380 fi
381 ]
382)
383
Tim Rice4cec93f2002-02-26 08:40:48 -0800384# Checks for header files.
385AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100386 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800387 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000388 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000389 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800390 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Damien Millera8ed44b2003-01-10 09:53:12 +1100391 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000392 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700393 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800394 util.h utime.h utmp.h utmpx.h)
395
Damien Millera22ba012000-03-02 23:09:20 +1100396# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700397AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
398AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000399
Damien Millerdf288022001-02-18 13:07:07 +1100400dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700401if test "x$with_tcp_wrappers" != "xno" ; then
402 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
403 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
404 fi
405fi
Damien Millerdf288022001-02-18 13:07:07 +1100406
Tim Rice13aae5e2001-10-21 17:53:58 -0700407AC_CHECK_FUNC(getspnam, ,
408 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700409
Damien Miller150c8b52002-02-13 23:06:56 +1100410AC_ARG_WITH(rpath,
411 [ --without-rpath Disable auto-added -R linker paths],
412 [
413 if test "x$withval" = "xno" ; then
414 need_dash_r=""
415 fi
416 if test "x$withval" = "xyes" ; then
417 need_dash_r=1
418 fi
419 ]
420)
421
Tim Rice13aae5e2001-10-21 17:53:58 -0700422dnl zlib is required
423AC_ARG_WITH(zlib,
424 [ --with-zlib=PATH Use zlib in PATH],
425 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000426 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100427 AC_MSG_ERROR([*** zlib is required ***])
428 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700429 if test -d "$withval/lib"; then
430 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700431 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700432 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700433 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700434 fi
435 else
436 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700437 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700438 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700439 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700440 fi
441 fi
442 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700443 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700444 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700445 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700446 fi
447 ]
448)
449
Tim Rice17b93e52001-10-23 22:36:54 -0700450AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100451
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000452dnl UnixWare 2.x
453AC_CHECK_FUNC(strcasecmp,
454 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
455)
456AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700457 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
458 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000459)
Damien Millerab18c411999-11-11 10:40:23 +1100460
Tim Ricee589a292001-11-03 11:09:32 -0800461dnl Checks for libutil functions
462AC_CHECK_HEADERS(libutil.h)
463AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
464AC_CHECK_FUNCS(logout updwtmp logwtmp)
465
Ben Lindstrom8697e082001-02-24 21:41:10 +0000466AC_FUNC_STRFTIME
467
Damien Miller3c027682001-03-14 11:39:45 +1100468# Check for ALTDIRFUNC glob() extension
469AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
470AC_EGREP_CPP(FOUNDIT,
471 [
472 #include <glob.h>
473 #ifdef GLOB_ALTDIRFUNC
474 FOUNDIT
475 #endif
476 ],
477 [
478 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
479 AC_MSG_RESULT(yes)
480 ],
481 [
482 AC_MSG_RESULT(no)
483 ]
484)
Damien Millerab18c411999-11-11 10:40:23 +1100485
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000486# Check for g.gl_matchc glob() extension
487AC_MSG_CHECKING(for gl_matchc field in glob_t)
488AC_EGREP_CPP(FOUNDIT,
489 [
490 #include <glob.h>
491 int main(void){glob_t g; g.gl_matchc = 1;}
492 ],
493 [
494 AC_DEFINE(GLOB_HAS_GL_MATCHC)
495 AC_MSG_RESULT(yes)
496 ],
497 [
498 AC_MSG_RESULT(no)
499 ]
500)
501
Damien Miller18bb4732001-03-28 14:35:30 +1000502AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
503AC_TRY_RUN(
504 [
505#include <sys/types.h>
506#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700507int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000508 ],
509 [AC_MSG_RESULT(yes)],
510 [
511 AC_MSG_RESULT(no)
512 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
513 ]
514)
515
Damien Millerc547bf12001-02-16 10:18:12 +1100516# Check whether user wants S/Key support
517SKEY_MSG="no"
518AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700519 [ --with-skey[[=PATH]] Enable S/Key support
520 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100521 [
522 if test "x$withval" != "xno" ; then
523
524 if test "x$withval" != "xyes" ; then
525 CPPFLAGS="$CPPFLAGS -I${withval}/include"
526 LDFLAGS="$LDFLAGS -L${withval}/lib"
527 fi
528
529 AC_DEFINE(SKEY)
530 LIBS="-lskey $LIBS"
531 SKEY_MSG="yes"
532
Tim Rice4cec93f2002-02-26 08:40:48 -0800533 AC_MSG_CHECKING([for s/key support])
534 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100535 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800536#include <stdio.h>
537#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700538int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800539 ],
540 [AC_MSG_RESULT(yes)],
541 [
542 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100543 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
544 ])
545 fi
546 ]
547)
548
549# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700550TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100551AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700552 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
553 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100554 [
555 if test "x$withval" != "xno" ; then
556 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700557 saved_LDFLAGS="$LDFLAGS"
558 saved_CPPFLAGS="$CPPFLAGS"
559 if test -n "${withval}" -a "${withval}" != "yes"; then
560 if test -d "${withval}/lib"; then
561 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700562 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700564 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700565 fi
566 else
567 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700568 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700570 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700571 fi
572 fi
573 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700574 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700575 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700576 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700578 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800579 LIBWRAP="-lwrap"
580 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100581 AC_MSG_CHECKING(for libwrap)
582 AC_TRY_LINK(
583 [
584#include <tcpd.h>
585 int deny_severity = 0, allow_severity = 0;
586 ],
587 [hosts_access(0);],
588 [
589 AC_MSG_RESULT(yes)
590 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800591 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700592 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100593 ],
594 [
595 AC_MSG_ERROR([*** libwrap missing])
596 ]
597 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800598 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100599 fi
600 ]
601)
602
Damien Millerfe1f1432003-02-24 15:45:42 +1100603dnl Checks for library functions. Please keep in alphabetical order
604AC_CHECK_FUNCS(\
605 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
606 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
607 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
608 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
609 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
610 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
611 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
612 setegid setenv seteuid setgroups setlogin setpcred setproctitle \
613 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \
614 snprintf socketpair strerror strlcat strlcpy strmode strnvis \
615 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \
616)
Tim Rice13aae5e2001-10-21 17:53:58 -0700617
Damien Millercd6853c2003-01-28 11:33:42 +1100618AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
619
Ben Lindstrom3e006472002-10-16 00:24:03 +0000620dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
621AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
622
Tim Rice13aae5e2001-10-21 17:53:58 -0700623dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700624AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700625 AC_CHECK_LIB(gen, dirname,[
626 AC_CACHE_CHECK([for broken dirname],
627 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700628 save_LIBS="$LIBS"
629 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700630 AC_TRY_RUN(
631 [
632#include <libgen.h>
633#include <string.h>
634
635int main(int argc, char **argv) {
636 char *s, buf[32];
637
638 strncpy(buf,"/etc", 32);
639 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700640 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700641 exit(1);
642 } else {
643 exit(0);
644 }
645}
646 ],
647 [ ac_cv_have_broken_dirname="no" ],
648 [ ac_cv_have_broken_dirname="yes" ]
649 )
Tim Rice17b93e52001-10-23 22:36:54 -0700650 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700651 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700652 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700653 LIBS="$LIBS -lgen"
654 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700655 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700656 fi
657 ])
658])
659
Damien Millerad833b32000-08-23 10:46:23 +1000660dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000661AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000662dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000663AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000664AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000665dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000666AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000667AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100668
Damien Miller04f80141999-11-19 15:32:34 +1100669AC_CHECK_FUNC(daemon,
670 [AC_DEFINE(HAVE_DAEMON)],
671 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
672)
673
Damien Miller9fb07e42000-03-05 16:22:59 +1100674AC_CHECK_FUNC(getpagesize,
675 [AC_DEFINE(HAVE_GETPAGESIZE)],
676 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
677)
678
Damien Millercb170cb2000-07-01 16:52:55 +1000679# Check for broken snprintf
680if test "x$ac_cv_func_snprintf" = "xyes" ; then
681 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
682 AC_TRY_RUN(
683 [
684#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700685int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000686 ],
687 [AC_MSG_RESULT(yes)],
688 [
689 AC_MSG_RESULT(no)
690 AC_DEFINE(BROKEN_SNPRINTF)
691 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
692 ]
693 )
694fi
695
Damien Millere8328192003-01-07 15:18:32 +1100696dnl see whether mkstemp() requires XXXXXX
697if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
698AC_MSG_CHECKING([for (overly) strict mkstemp])
699AC_TRY_RUN(
700 [
701#include <stdlib.h>
702main() { char template[]="conftest.mkstemp-test";
703if (mkstemp(template) == -1)
704 exit(1);
705unlink(template); exit(0);
706}
707 ],
708 [
709 AC_MSG_RESULT(no)
710 ],
711 [
712 AC_MSG_RESULT(yes)
713 AC_DEFINE(HAVE_STRICT_MKSTEMP)
714 ],
715 [
716 AC_MSG_RESULT(yes)
717 AC_DEFINE(HAVE_STRICT_MKSTEMP)
718 ]
719)
720fi
721
Damien Miller606f8802000-09-16 15:39:56 +1100722AC_FUNC_GETPGRP
723
Damien Millera64b57a2001-01-17 10:44:13 +1100724# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000725PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100726AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100727 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100728 [
Damien Millera64b57a2001-01-17 10:44:13 +1100729 if test "x$withval" != "xno" ; then
730 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
731 AC_MSG_ERROR([PAM headers not found])
732 fi
733
734 AC_CHECK_LIB(dl, dlopen, , )
735 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
736 AC_CHECK_FUNCS(pam_getenvlist)
737
738 disable_shadow=yes
739 PAM_MSG="yes"
740
741 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800742 if test $ac_cv_lib_dl_dlopen = yes; then
743 LIBPAM="-lpam -ldl"
744 else
745 LIBPAM="-lpam"
746 fi
747 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100748 fi
749 ]
750)
Damien Millera22ba012000-03-02 23:09:20 +1100751
Damien Millera64b57a2001-01-17 10:44:13 +1100752# Check for older PAM
753if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100754 # Check PAM strerror arguments (old PAM)
755 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
756 AC_TRY_COMPILE(
757 [
Damien Miller81171112000-04-23 11:14:01 +1000758#include <stdlib.h>
759#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100760 ],
761 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
762 [AC_MSG_RESULT(no)],
763 [
764 AC_DEFINE(HAVE_OLD_PAM)
765 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000766 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100767 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100768 )
Damien Millera22ba012000-03-02 23:09:20 +1100769fi
770
Damien Millerfc93d4b2002-09-04 23:26:29 +1000771# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
772# because the system crypt() is more featureful.
773if test "x$check_for_libcrypt_before" = "x1"; then
774 AC_CHECK_LIB(crypt, crypt)
775fi
776
Tim Riceaef73712002-05-11 13:17:42 -0700777# Search for OpenSSL
778saved_CPPFLAGS="$CPPFLAGS"
779saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100780AC_ARG_WITH(ssl-dir,
781 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
782 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000783 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700784 if test -d "$withval/lib"; then
785 if test -n "${need_dash_r}"; then
786 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
787 else
788 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
789 fi
790 else
791 if test -n "${need_dash_r}"; then
792 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
793 else
794 LDFLAGS="-L${withval} ${LDFLAGS}"
795 fi
796 fi
797 if test -d "$withval/include"; then
798 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
799 else
800 CPPFLAGS="-I${withval} ${CPPFLAGS}"
801 fi
Damien Millera22ba012000-03-02 23:09:20 +1100802 fi
803 ]
804)
Tim Riceaef73712002-05-11 13:17:42 -0700805LIBS="$LIBS -lcrypto"
806AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000807 [
Tim Riceaef73712002-05-11 13:17:42 -0700808 dnl Check default openssl install dir
809 if test -n "${need_dash_r}"; then
810 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000811 else
Tim Riceaef73712002-05-11 13:17:42 -0700812 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000813 fi
Tim Riceaef73712002-05-11 13:17:42 -0700814 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
815 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
816 [
817 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
818 ]
819 )
820 ]
821)
822
Tim Riced730b782002-08-13 18:52:10 -0700823# Determine OpenSSL header version
824AC_MSG_CHECKING([OpenSSL header version])
825AC_TRY_RUN(
826 [
827#include <stdio.h>
828#include <string.h>
829#include <openssl/opensslv.h>
830#define DATA "conftest.sslincver"
831int main(void) {
832 FILE *fd;
833 int rc;
834
835 fd = fopen(DATA,"w");
836 if(fd == NULL)
837 exit(1);
838
839 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
840 exit(1);
841
842 exit(0);
843}
844 ],
845 [
846 ssl_header_ver=`cat conftest.sslincver`
847 AC_MSG_RESULT($ssl_header_ver)
848 ],
849 [
850 AC_MSG_RESULT(not found)
851 AC_MSG_ERROR(OpenSSL version header not found.)
852 ]
853)
854
855# Determine OpenSSL library version
856AC_MSG_CHECKING([OpenSSL library version])
857AC_TRY_RUN(
858 [
859#include <stdio.h>
860#include <string.h>
861#include <openssl/opensslv.h>
862#include <openssl/crypto.h>
863#define DATA "conftest.ssllibver"
864int main(void) {
865 FILE *fd;
866 int rc;
867
868 fd = fopen(DATA,"w");
869 if(fd == NULL)
870 exit(1);
871
872 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
873 exit(1);
874
875 exit(0);
876}
877 ],
878 [
879 ssl_library_ver=`cat conftest.ssllibver`
880 AC_MSG_RESULT($ssl_library_ver)
881 ],
882 [
883 AC_MSG_RESULT(not found)
884 AC_MSG_ERROR(OpenSSL library not found.)
885 ]
886)
Damien Millera22ba012000-03-02 23:09:20 +1100887
Damien Millerec932372002-01-22 22:16:03 +1100888# Sanity check OpenSSL headers
889AC_MSG_CHECKING([whether OpenSSL's headers match the library])
890AC_TRY_RUN(
891 [
892#include <string.h>
893#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700894int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100895 ],
896 [
897 AC_MSG_RESULT(yes)
898 ],
899 [
900 AC_MSG_RESULT(no)
901 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
902 ]
903)
904
Damien Millera64b57a2001-01-17 10:44:13 +1100905# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
906# version in OpenSSL. Skip this for PAM
907if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100908 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100909fi
910
Damien Miller6c21c512002-01-22 21:57:53 +1100911
912### Configure cryptographic random number support
913
914# Check wheter OpenSSL seeds itself
915AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
916AC_TRY_RUN(
917 [
918#include <string.h>
919#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700920int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100921 ],
922 [
923 OPENSSL_SEEDS_ITSELF=yes
924 AC_MSG_RESULT(yes)
925 ],
926 [
927 AC_MSG_RESULT(no)
928 # Default to use of the rand helper if OpenSSL doesn't
929 # seed itself
930 USE_RAND_HELPER=yes
931 ]
932)
933
934
935# Do we want to force the use of the rand helper?
936AC_ARG_WITH(rand-helper,
937 [ --with-rand-helper Use subprocess to gather strong randomness ],
938 [
939 if test "x$withval" = "xno" ; then
940 # Force use of OpenSSL's internal RNG, even if
941 # the previous test showed it to be unseeded.
942 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
943 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
944 OPENSSL_SEEDS_ITSELF=yes
945 USE_RAND_HELPER=""
946 fi
947 else
948 USE_RAND_HELPER=yes
949 fi
950 ],
951)
952
953# Which randomness source do we use?
954if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
955 # OpenSSL only
956 AC_DEFINE(OPENSSL_PRNG_ONLY)
957 RAND_MSG="OpenSSL internal ONLY"
958 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800959elif test ! -z "$USE_RAND_HELPER" ; then
960 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100961 RAND_MSG="ssh-rand-helper"
962 INSTALL_SSH_RAND_HELPER="yes"
963fi
964AC_SUBST(INSTALL_SSH_RAND_HELPER)
965
966### Configuration of ssh-rand-helper
967
968# PRNGD TCP socket
969AC_ARG_WITH(prngd-port,
970 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
971 [
Damien Millere996d722002-01-23 11:20:59 +1100972 case "$withval" in
973 no)
974 withval=""
975 ;;
976 [[0-9]]*)
977 ;;
978 *)
979 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
980 ;;
981 esac
982 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100983 PRNGD_PORT="$withval"
984 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
985 fi
986 ]
987)
988
989# PRNGD Unix domain socket
990AC_ARG_WITH(prngd-socket,
991 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
992 [
Damien Millere996d722002-01-23 11:20:59 +1100993 case "$withval" in
994 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100995 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100996 ;;
997 no)
998 withval=""
999 ;;
1000 /*)
1001 ;;
1002 *)
1003 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1004 ;;
1005 esac
1006
1007 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001008 if test ! -z "$PRNGD_PORT" ; then
1009 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1010 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001011 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001012 AC_MSG_WARN(Entropy socket is not readable)
1013 fi
1014 PRNGD_SOCKET="$withval"
1015 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1016 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001017 ],
1018 [
1019 # Check for existing socket only if we don't have a random device already
1020 if test "$USE_RAND_HELPER" = yes ; then
1021 AC_MSG_CHECKING(for PRNGD/EGD socket)
1022 # Insert other locations here
1023 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1024 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1025 PRNGD_SOCKET="$sock"
1026 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1027 break;
1028 fi
1029 done
1030 if test ! -z "$PRNGD_SOCKET" ; then
1031 AC_MSG_RESULT($PRNGD_SOCKET)
1032 else
1033 AC_MSG_RESULT(not found)
1034 fi
1035 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001036 ]
1037)
1038
1039# Change default command timeout for hashing entropy source
1040entropy_timeout=200
1041AC_ARG_WITH(entropy-timeout,
1042 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1043 [
1044 if test "x$withval" != "xno" ; then
1045 entropy_timeout=$withval
1046 fi
1047 ]
1048)
Damien Miller6c21c512002-01-22 21:57:53 +11001049AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1050
Damien Millerd3f6ad22002-06-25 10:24:47 +10001051SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001052AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001053 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001054 [
1055 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001056 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001057 fi
1058 ]
1059)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001060AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1061AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001062
Tim Rice88f2ab52002-03-17 12:17:34 -08001063# We do this little dance with the search path to insure
1064# that programs that we select for use by installed programs
1065# (which may be run by the super-user) come from trusted
1066# locations before they come from the user's private area.
1067# This should help avoid accidentally configuring some
1068# random version of a program in someone's personal bin.
1069
1070OPATH=$PATH
1071PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001072test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001073test -d /sbin && PATH=$PATH:/sbin
1074test -d /usr/sbin && PATH=$PATH:/usr/sbin
1075PATH=$PATH:/etc:$OPATH
1076
Damien Miller6c21c512002-01-22 21:57:53 +11001077# These programs are used by the command hashing source to gather entropy
1078OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1079OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1080OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1081OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1082OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1083OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1084OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1085OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1086OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1087OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1088OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1089OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1090OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1091OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1092OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1093OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001094# restore PATH
1095PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001096
1097# Where does ssh-rand-helper get its randomness from?
1098INSTALL_SSH_PRNG_CMDS=""
1099if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1100 if test ! -z "$PRNGD_PORT" ; then
1101 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1102 elif test ! -z "$PRNGD_SOCKET" ; then
1103 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1104 else
1105 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1106 RAND_HELPER_CMDHASH=yes
1107 INSTALL_SSH_PRNG_CMDS="yes"
1108 fi
1109fi
1110AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1111
1112
Ben Lindstromb5628642000-10-18 00:02:25 +00001113# Cheap hack to ensure NEWS-OS libraries are arranged right.
1114if test ! -z "$SONY" ; then
1115 LIBS="$LIBS -liberty";
1116fi
1117
Damien Millera22ba012000-03-02 23:09:20 +11001118# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001119AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001120AC_CHECK_SIZEOF(short int, 2)
1121AC_CHECK_SIZEOF(int, 4)
1122AC_CHECK_SIZEOF(long int, 4)
1123AC_CHECK_SIZEOF(long long int, 8)
1124
Damien Millerfa2bb692002-04-23 23:22:25 +10001125# Sanity check long long for some platforms (AIX)
1126if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1127 ac_cv_sizeof_long_long_int=0
1128fi
1129
Damien Millera22ba012000-03-02 23:09:20 +11001130# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001131AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1132 AC_TRY_COMPILE(
1133 [ #include <sys/types.h> ],
1134 [ u_int a; a = 1;],
1135 [ ac_cv_have_u_int="yes" ],
1136 [ ac_cv_have_u_int="no" ]
1137 )
1138])
1139if test "x$ac_cv_have_u_int" = "xyes" ; then
1140 AC_DEFINE(HAVE_U_INT)
1141 have_u_int=1
1142fi
1143
Damien Miller61e50f12000-05-08 20:49:37 +10001144AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1145 AC_TRY_COMPILE(
1146 [ #include <sys/types.h> ],
1147 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1148 [ ac_cv_have_intxx_t="yes" ],
1149 [ ac_cv_have_intxx_t="no" ]
1150 )
1151])
1152if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1153 AC_DEFINE(HAVE_INTXX_T)
1154 have_intxx_t=1
1155fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001156
1157if (test -z "$have_intxx_t" && \
1158 test "x$ac_cv_header_stdint_h" = "xyes")
1159then
1160 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1161 AC_TRY_COMPILE(
1162 [ #include <stdint.h> ],
1163 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1164 [
1165 AC_DEFINE(HAVE_INTXX_T)
1166 AC_MSG_RESULT(yes)
1167 ],
1168 [ AC_MSG_RESULT(no) ]
1169 )
1170fi
1171
Damien Miller578783e2000-09-23 14:12:24 +11001172AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1173 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001174 [
1175#include <sys/types.h>
1176#ifdef HAVE_STDINT_H
1177# include <stdint.h>
1178#endif
1179#include <sys/socket.h>
1180#ifdef HAVE_SYS_BITYPES_H
1181# include <sys/bitypes.h>
1182#endif
1183 ],
Damien Miller578783e2000-09-23 14:12:24 +11001184 [ int64_t a; a = 1;],
1185 [ ac_cv_have_int64_t="yes" ],
1186 [ ac_cv_have_int64_t="no" ]
1187 )
1188])
1189if test "x$ac_cv_have_int64_t" = "xyes" ; then
1190 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001191fi
1192
Damien Miller61e50f12000-05-08 20:49:37 +10001193AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1194 AC_TRY_COMPILE(
1195 [ #include <sys/types.h> ],
1196 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1197 [ ac_cv_have_u_intxx_t="yes" ],
1198 [ ac_cv_have_u_intxx_t="no" ]
1199 )
1200])
1201if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_U_INTXX_T)
1203 have_u_intxx_t=1
1204fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001205
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001206if test -z "$have_u_intxx_t" ; then
1207 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1208 AC_TRY_COMPILE(
1209 [ #include <sys/socket.h> ],
1210 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1211 [
1212 AC_DEFINE(HAVE_U_INTXX_T)
1213 AC_MSG_RESULT(yes)
1214 ],
1215 [ AC_MSG_RESULT(no) ]
1216 )
1217fi
1218
Damien Miller578783e2000-09-23 14:12:24 +11001219AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1220 AC_TRY_COMPILE(
1221 [ #include <sys/types.h> ],
1222 [ u_int64_t a; a = 1;],
1223 [ ac_cv_have_u_int64_t="yes" ],
1224 [ ac_cv_have_u_int64_t="no" ]
1225 )
1226])
1227if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1228 AC_DEFINE(HAVE_U_INT64_T)
1229 have_u_int64_t=1
1230fi
1231
Tim Rice4cec93f2002-02-26 08:40:48 -08001232if test -z "$have_u_int64_t" ; then
1233 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1234 AC_TRY_COMPILE(
1235 [ #include <sys/bitypes.h> ],
1236 [ u_int64_t a; a = 1],
1237 [
1238 AC_DEFINE(HAVE_U_INT64_T)
1239 AC_MSG_RESULT(yes)
1240 ],
1241 [ AC_MSG_RESULT(no) ]
1242 )
1243fi
1244
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001245if test -z "$have_u_intxx_t" ; then
1246 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1247 AC_TRY_COMPILE(
1248 [
1249#include <sys/types.h>
1250 ],
1251 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1252 [ ac_cv_have_uintxx_t="yes" ],
1253 [ ac_cv_have_uintxx_t="no" ]
1254 )
1255 ])
1256 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1257 AC_DEFINE(HAVE_UINTXX_T)
1258 fi
1259fi
1260
1261if test -z "$have_uintxx_t" ; then
1262 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1263 AC_TRY_COMPILE(
1264 [ #include <stdint.h> ],
1265 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1266 [
1267 AC_DEFINE(HAVE_UINTXX_T)
1268 AC_MSG_RESULT(yes)
1269 ],
1270 [ AC_MSG_RESULT(no) ]
1271 )
1272fi
1273
Damien Milleredb82922000-06-20 13:25:52 +10001274if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1275 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001276then
1277 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1278 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001279 [
1280#include <sys/bitypes.h>
1281 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001282 [
Damien Miller70494d12000-04-03 15:57:06 +10001283 int8_t a; int16_t b; int32_t c;
1284 u_int8_t e; u_int16_t f; u_int32_t g;
1285 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001286 ],
1287 [
1288 AC_DEFINE(HAVE_U_INTXX_T)
1289 AC_DEFINE(HAVE_INTXX_T)
1290 AC_MSG_RESULT(yes)
1291 ],
1292 [AC_MSG_RESULT(no)]
1293 )
1294fi
1295
Damien Miller58be7382001-09-15 21:31:54 +10001296
1297AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1298 AC_TRY_COMPILE(
1299 [
1300#include <sys/types.h>
1301 ],
1302 [ u_char foo; foo = 125; ],
1303 [ ac_cv_have_u_char="yes" ],
1304 [ ac_cv_have_u_char="no" ]
1305 )
1306])
1307if test "x$ac_cv_have_u_char" = "xyes" ; then
1308 AC_DEFINE(HAVE_U_CHAR)
1309fi
1310
Tim Rice13aae5e2001-10-21 17:53:58 -07001311TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001312
Tim Rice200a5c02002-02-26 22:12:34 -08001313AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001314
Damien Miller61e50f12000-05-08 20:49:37 +10001315AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1316 AC_TRY_COMPILE(
1317 [
1318#include <sys/types.h>
1319 ],
1320 [ size_t foo; foo = 1235; ],
1321 [ ac_cv_have_size_t="yes" ],
1322 [ ac_cv_have_size_t="no" ]
1323 )
1324])
1325if test "x$ac_cv_have_size_t" = "xyes" ; then
1326 AC_DEFINE(HAVE_SIZE_T)
1327fi
Damien Miller95058511999-12-29 10:36:45 +11001328
Damien Miller615f9392000-05-17 22:53:33 +10001329AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1330 AC_TRY_COMPILE(
1331 [
1332#include <sys/types.h>
1333 ],
1334 [ ssize_t foo; foo = 1235; ],
1335 [ ac_cv_have_ssize_t="yes" ],
1336 [ ac_cv_have_ssize_t="no" ]
1337 )
1338])
1339if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1340 AC_DEFINE(HAVE_SSIZE_T)
1341fi
1342
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001343AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1344 AC_TRY_COMPILE(
1345 [
1346#include <time.h>
1347 ],
1348 [ clock_t foo; foo = 1235; ],
1349 [ ac_cv_have_clock_t="yes" ],
1350 [ ac_cv_have_clock_t="no" ]
1351 )
1352])
1353if test "x$ac_cv_have_clock_t" = "xyes" ; then
1354 AC_DEFINE(HAVE_CLOCK_T)
1355fi
1356
Damien Millerb54b40e2000-06-23 08:23:34 +10001357AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1358 AC_TRY_COMPILE(
1359 [
1360#include <sys/types.h>
1361#include <sys/socket.h>
1362 ],
1363 [ sa_family_t foo; foo = 1235; ],
1364 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001365 [ AC_TRY_COMPILE(
1366 [
1367#include <sys/types.h>
1368#include <sys/socket.h>
1369#include <netinet/in.h>
1370 ],
1371 [ sa_family_t foo; foo = 1235; ],
1372 [ ac_cv_have_sa_family_t="yes" ],
1373
Damien Millerb54b40e2000-06-23 08:23:34 +10001374 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001375 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001376 )
1377])
1378if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1379 AC_DEFINE(HAVE_SA_FAMILY_T)
1380fi
1381
Damien Miller0f91b4e2000-06-18 15:43:25 +10001382AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1383 AC_TRY_COMPILE(
1384 [
1385#include <sys/types.h>
1386 ],
1387 [ pid_t foo; foo = 1235; ],
1388 [ ac_cv_have_pid_t="yes" ],
1389 [ ac_cv_have_pid_t="no" ]
1390 )
1391])
1392if test "x$ac_cv_have_pid_t" = "xyes" ; then
1393 AC_DEFINE(HAVE_PID_T)
1394fi
1395
1396AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1397 AC_TRY_COMPILE(
1398 [
1399#include <sys/types.h>
1400 ],
1401 [ mode_t foo; foo = 1235; ],
1402 [ ac_cv_have_mode_t="yes" ],
1403 [ ac_cv_have_mode_t="no" ]
1404 )
1405])
1406if test "x$ac_cv_have_mode_t" = "xyes" ; then
1407 AC_DEFINE(HAVE_MODE_T)
1408fi
1409
Damien Miller61e50f12000-05-08 20:49:37 +10001410
1411AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1412 AC_TRY_COMPILE(
1413 [
Damien Miller81171112000-04-23 11:14:01 +10001414#include <sys/types.h>
1415#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001416 ],
1417 [ struct sockaddr_storage s; ],
1418 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1419 [ ac_cv_have_struct_sockaddr_storage="no" ]
1420 )
1421])
1422if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1423 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1424fi
Damien Miller34132e52000-01-14 15:45:46 +11001425
Damien Miller61e50f12000-05-08 20:49:37 +10001426AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1427 AC_TRY_COMPILE(
1428 [
Damien Miller7b22d652000-06-18 14:07:04 +10001429#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001430#include <netinet/in.h>
1431 ],
1432 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1433 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1434 [ ac_cv_have_struct_sockaddr_in6="no" ]
1435 )
1436])
1437if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1438 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1439fi
Damien Miller34132e52000-01-14 15:45:46 +11001440
Damien Miller61e50f12000-05-08 20:49:37 +10001441AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1442 AC_TRY_COMPILE(
1443 [
Damien Miller7b22d652000-06-18 14:07:04 +10001444#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001445#include <netinet/in.h>
1446 ],
1447 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1448 [ ac_cv_have_struct_in6_addr="yes" ],
1449 [ ac_cv_have_struct_in6_addr="no" ]
1450 )
1451])
1452if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1453 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1454fi
Damien Miller34132e52000-01-14 15:45:46 +11001455
Damien Miller61e50f12000-05-08 20:49:37 +10001456AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1457 AC_TRY_COMPILE(
1458 [
Damien Miller81171112000-04-23 11:14:01 +10001459#include <sys/types.h>
1460#include <sys/socket.h>
1461#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001462 ],
1463 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1464 [ ac_cv_have_struct_addrinfo="yes" ],
1465 [ ac_cv_have_struct_addrinfo="no" ]
1466 )
1467])
1468if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1469 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1470fi
1471
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001472AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1473 AC_TRY_COMPILE(
1474 [ #include <sys/time.h> ],
1475 [ struct timeval tv; tv.tv_sec = 1;],
1476 [ ac_cv_have_struct_timeval="yes" ],
1477 [ ac_cv_have_struct_timeval="no" ]
1478 )
1479])
1480if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1481 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1482 have_struct_timeval=1
1483fi
1484
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001485# If we don't have int64_t then we can't compile sftp-server. So don't
1486# even attempt to do it.
1487if test "x$ac_cv_have_int64_t" = "xno" -a \
1488 "x$ac_cv_sizeof_long_int" != "x8" -a \
1489 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1490 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001491else
1492dnl test snprintf (broken on SCO w/gcc)
1493 AC_TRY_RUN(
1494 [
1495#include <stdio.h>
1496#include <string.h>
1497#ifdef HAVE_SNPRINTF
1498main()
1499{
1500 char buf[50];
1501 char expected_out[50];
1502 int mazsize = 50 ;
1503#if (SIZEOF_LONG_INT == 8)
1504 long int num = 0x7fffffffffffffff;
1505#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001506 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001507#endif
1508 strcpy(expected_out, "9223372036854775807");
1509 snprintf(buf, mazsize, "%lld", num);
1510 if(strcmp(buf, expected_out) != 0)
1511 exit(1);
1512 exit(0);
1513}
1514#else
1515main() { exit(0); }
1516#endif
1517 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1518 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001519fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001520AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001521
Damien Miller78315eb2000-09-29 23:01:36 +11001522dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001523OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1524OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1525OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1526OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1527OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001528OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001529OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1530OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001531OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001532OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1533OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1535OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001536OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1537OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1538OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1539OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001540
1541AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001542
Damien Miller61e50f12000-05-08 20:49:37 +10001543AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1544 ac_cv_have_ss_family_in_struct_ss, [
1545 AC_TRY_COMPILE(
1546 [
Damien Miller81171112000-04-23 11:14:01 +10001547#include <sys/types.h>
1548#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001549 ],
1550 [ struct sockaddr_storage s; s.ss_family = 1; ],
1551 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1552 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1553 )
1554])
1555if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1556 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1557fi
1558
Damien Miller61e50f12000-05-08 20:49:37 +10001559AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1560 ac_cv_have___ss_family_in_struct_ss, [
1561 AC_TRY_COMPILE(
1562 [
Damien Miller81171112000-04-23 11:14:01 +10001563#include <sys/types.h>
1564#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001565 ],
1566 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1567 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1568 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1569 )
1570])
1571if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1572 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1573fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001574
Damien Millerad833b32000-08-23 10:46:23 +10001575AC_CACHE_CHECK([for pw_class field in struct passwd],
1576 ac_cv_have_pw_class_in_struct_passwd, [
1577 AC_TRY_COMPILE(
1578 [
Damien Millerad833b32000-08-23 10:46:23 +10001579#include <pwd.h>
1580 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001581 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001582 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1583 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1584 )
1585])
1586if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1587 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1588fi
1589
Kevin Steves82456952001-06-22 21:14:18 +00001590AC_CACHE_CHECK([for pw_expire field in struct passwd],
1591 ac_cv_have_pw_expire_in_struct_passwd, [
1592 AC_TRY_COMPILE(
1593 [
1594#include <pwd.h>
1595 ],
1596 [ struct passwd p; p.pw_expire = 0; ],
1597 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1598 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1599 )
1600])
1601if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1602 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1603fi
1604
1605AC_CACHE_CHECK([for pw_change field in struct passwd],
1606 ac_cv_have_pw_change_in_struct_passwd, [
1607 AC_TRY_COMPILE(
1608 [
1609#include <pwd.h>
1610 ],
1611 [ struct passwd p; p.pw_change = 0; ],
1612 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1613 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1614 )
1615])
1616if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1617 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1618fi
Damien Miller61e50f12000-05-08 20:49:37 +10001619
Tim Rice28bbb0c2002-05-27 17:37:32 -07001620dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001621AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1622 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001623 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001624 [
Tim Riceae49fe62002-04-12 10:26:21 -07001625#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001626#include <sys/socket.h>
1627#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001628int main() {
1629#ifdef msg_accrights
1630exit(1);
1631#endif
1632struct msghdr m;
1633m.msg_accrights = 0;
1634exit(0);
1635}
Kevin Steves939c9db2002-03-22 17:23:25 +00001636 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001637 [ ac_cv_have_accrights_in_msghdr="yes" ],
1638 [ ac_cv_have_accrights_in_msghdr="no" ]
1639 )
1640])
1641if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1642 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1643fi
1644
Kevin Stevesa44e0352002-04-07 16:18:03 +00001645AC_CACHE_CHECK([for msg_control field in struct msghdr],
1646 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001647 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001648 [
Tim Riceae49fe62002-04-12 10:26:21 -07001649#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001650#include <sys/socket.h>
1651#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001652int main() {
1653#ifdef msg_control
1654exit(1);
1655#endif
1656struct msghdr m;
1657m.msg_control = 0;
1658exit(0);
1659}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001660 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001661 [ ac_cv_have_control_in_msghdr="yes" ],
1662 [ ac_cv_have_control_in_msghdr="no" ]
1663 )
1664])
1665if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1666 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1667fi
1668
Damien Miller61e50f12000-05-08 20:49:37 +10001669AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1670 AC_TRY_LINK([],
1671 [ extern char *__progname; printf("%s", __progname); ],
1672 [ ac_cv_libc_defines___progname="yes" ],
1673 [ ac_cv_libc_defines___progname="no" ]
1674 )
1675])
1676if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1677 AC_DEFINE(HAVE___PROGNAME)
1678fi
1679
Kevin Steves4846f4a2002-03-22 18:19:53 +00001680AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1681 AC_TRY_LINK([
1682#include <stdio.h>
1683],
1684 [ printf("%s", __FUNCTION__); ],
1685 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1686 [ ac_cv_cc_implements___FUNCTION__="no" ]
1687 )
1688])
1689if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1690 AC_DEFINE(HAVE___FUNCTION__)
1691fi
1692
1693AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1694 AC_TRY_LINK([
1695#include <stdio.h>
1696],
1697 [ printf("%s", __func__); ],
1698 [ ac_cv_cc_implements___func__="yes" ],
1699 [ ac_cv_cc_implements___func__="no" ]
1700 )
1701])
1702if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1703 AC_DEFINE(HAVE___func__)
1704fi
1705
Damien Miller4f8e6692001-07-14 13:22:53 +10001706AC_CACHE_CHECK([whether getopt has optreset support],
1707 ac_cv_have_getopt_optreset, [
1708 AC_TRY_LINK(
1709 [
1710#include <getopt.h>
1711 ],
1712 [ extern int optreset; optreset = 0; ],
1713 [ ac_cv_have_getopt_optreset="yes" ],
1714 [ ac_cv_have_getopt_optreset="no" ]
1715 )
1716])
1717if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1718 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1719fi
Damien Millera22ba012000-03-02 23:09:20 +11001720
Damien Millerecbb26d2000-07-15 14:59:14 +10001721AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1722 AC_TRY_LINK([],
1723 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1724 [ ac_cv_libc_defines_sys_errlist="yes" ],
1725 [ ac_cv_libc_defines_sys_errlist="no" ]
1726 )
1727])
1728if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1729 AC_DEFINE(HAVE_SYS_ERRLIST)
1730fi
1731
1732
Damien Miller11fa2cc2000-08-16 10:35:58 +10001733AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1734 AC_TRY_LINK([],
1735 [ extern int sys_nerr; printf("%i", sys_nerr);],
1736 [ ac_cv_libc_defines_sys_nerr="yes" ],
1737 [ ac_cv_libc_defines_sys_nerr="no" ]
1738 )
1739])
1740if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1741 AC_DEFINE(HAVE_SYS_NERR)
1742fi
1743
Damien Miller85de5802001-09-18 14:01:11 +10001744SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001745
1746# Check whether user wants sectok support
1747AC_ARG_WITH(sectok,
1748 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001749 [
1750 if test "x$withval" != "xno" ; then
1751 if test "x$withval" != "xyes" ; then
1752 CPPFLAGS="$CPPFLAGS -I${withval}"
1753 LDFLAGS="$LDFLAGS -L${withval}"
1754 if test ! -z "$need_dash_r" ; then
1755 LDFLAGS="$LDFLAGS -R${withval}"
1756 fi
1757 if test ! -z "$blibpath" ; then
1758 blibpath="$blibpath:${withval}"
1759 fi
1760 fi
1761 AC_CHECK_HEADERS(sectok.h)
1762 if test "$ac_cv_header_sectok_h" != yes; then
1763 AC_MSG_ERROR(Can't find sectok.h)
1764 fi
1765 AC_CHECK_LIB(sectok, sectok_open)
1766 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1767 AC_MSG_ERROR(Can't find libsectok)
1768 fi
1769 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001770 AC_DEFINE(USE_SECTOK)
1771 SCARD_MSG="yes, using sectok"
1772 fi
1773 ]
1774)
1775
1776# Check whether user wants OpenSC support
1777AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001778 AC_HELP_STRING([--with-opensc=PFX],
1779 [Enable smartcard support using OpenSC]),
1780 opensc_config_prefix="$withval", opensc_config_prefix="")
1781if test x$opensc_config_prefix != x ; then
1782 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1783 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1784 if test "$OPENSC_CONFIG" != "no"; then
1785 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1786 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1787 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1788 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1789 AC_DEFINE(SMARTCARD)
1790 AC_DEFINE(USE_OPENSC)
1791 SCARD_MSG="yes, using OpenSC"
1792 fi
1793fi
Damien Miller85de5802001-09-18 14:01:11 +10001794
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001795# Check whether user wants Kerberos 5 support
1796KRB5_MSG="no"
1797AC_ARG_WITH(kerberos5,
1798 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1799 [
1800 if test "x$withval" != "xno" ; then
1801 if test "x$withval" = "xyes" ; then
1802 KRB5ROOT="/usr/local"
1803 else
1804 KRB5ROOT=${withval}
1805 fi
1806 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1807 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1808 AC_DEFINE(KRB5)
1809 KRB5_MSG="yes"
1810 AC_MSG_CHECKING(whether we are using Heimdal)
1811 AC_TRY_COMPILE([ #include <krb5.h> ],
1812 [ char *tmp = heimdal_version; ],
1813 [ AC_MSG_RESULT(yes)
1814 AC_DEFINE(HEIMDAL)
1815 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1816 ],
1817 [ AC_MSG_RESULT(no)
1818 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1819 ]
1820 )
1821 if test ! -z "$need_dash_r" ; then
1822 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1823 fi
1824 if test ! -z "$blibpath" ; then
1825 blibpath="$blibpath:${KRB5ROOT}/lib"
1826 fi
1827 AC_CHECK_LIB(resolv, dn_expand, , )
1828
1829 KRB5=yes
1830 fi
1831 ]
1832)
1833# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001834KRB4_MSG="no"
1835AC_ARG_WITH(kerberos4,
1836 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1837 [
1838 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001839 if test "x$withval" != "xyes" ; then
1840 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1841 LDFLAGS="$LDFLAGS -L${withval}/lib"
1842 if test ! -z "$need_dash_r" ; then
1843 LDFLAGS="$LDFLAGS -R${withval}/lib"
1844 fi
1845 if test ! -z "$blibpath" ; then
1846 blibpath="$blibpath:${withval}/lib"
1847 fi
1848 else
1849 if test -d /usr/include/kerberosIV ; then
1850 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1851 fi
1852 fi
1853
1854 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001855 if test "$ac_cv_header_krb_h" != yes; then
1856 AC_MSG_WARN([Cannot find krb.h, build may fail])
1857 fi
Damien Miller98344742001-03-28 14:37:06 +10001858 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001859 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001860 AC_CHECK_LIB(krb4, main)
1861 if test "$ac_cv_lib_krb4_main" != yes; then
1862 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1863 else
1864 KLIBS="-lkrb4"
1865 fi
1866 else
1867 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001868 fi
Damien Miller98344742001-03-28 14:37:06 +10001869 AC_CHECK_LIB(des, des_cbc_encrypt)
1870 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1871 AC_CHECK_LIB(des425, des_cbc_encrypt)
1872 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1873 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1874 else
1875 KLIBS="-ldes425"
1876 fi
1877 else
1878 KLIBS="-ldes"
1879 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001880 AC_CHECK_LIB(resolv, dn_expand, , )
1881 KRB4=yes
1882 KRB4_MSG="yes"
1883 AC_DEFINE(KRB4)
1884 fi
1885 ]
1886)
1887
1888# Check whether user wants AFS support
1889AFS_MSG="no"
1890AC_ARG_WITH(afs,
1891 [ --with-afs=PATH Enable AFS support],
1892 [
1893 if test "x$withval" != "xno" ; then
1894
1895 if test "x$withval" != "xyes" ; then
1896 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1897 LDFLAGS="$LDFLAGS -L${withval}/lib"
1898 fi
1899
1900 if test -z "$KRB4" ; then
1901 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1902 fi
1903
1904 LIBS="-lkafs $LIBS"
1905 if test ! -z "$AFS_LIBS" ; then
1906 LIBS="$LIBS $AFS_LIBS"
1907 fi
1908 AC_DEFINE(AFS)
1909 AFS_MSG="yes"
1910 fi
1911 ]
1912)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001913LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001914
Damien Millera22ba012000-03-02 23:09:20 +11001915# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001916
Damien Millerf58c6722002-05-13 13:15:42 +10001917PRIVSEP_PATH=/var/empty
1918AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001919 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001920 [
1921 if test "x$withval" != "$no" ; then
1922 PRIVSEP_PATH=$withval
1923 fi
1924 ]
1925)
1926AC_SUBST(PRIVSEP_PATH)
1927
Damien Millera22ba012000-03-02 23:09:20 +11001928AC_ARG_WITH(xauth,
1929 [ --with-xauth=PATH Specify path to xauth program ],
1930 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001931 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001932 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001933 fi
1934 ],
1935 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001936 TestPath="$PATH"
1937 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1938 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1939 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1940 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1941 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001942 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001943 xauth_path="/usr/openwin/bin/xauth"
1944 fi
1945 ]
1946)
1947
Damien Miller7d901272003-01-13 16:55:22 +11001948STRIP_OPT=-s
1949AC_ARG_ENABLE(strip,
1950 [ --disable-strip Disable calling strip(1) on install],
1951 [
1952 if test "x$enableval" = "xno" ; then
1953 STRIP_OPT=
1954 fi
1955 ]
1956)
1957AC_SUBST(STRIP_OPT)
1958
Damien Millera19cf472000-11-29 13:28:50 +11001959if test -z "$xauth_path" ; then
1960 XAUTH_PATH="undefined"
1961 AC_SUBST(XAUTH_PATH)
1962else
Damien Millera22ba012000-03-02 23:09:20 +11001963 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001964 XAUTH_PATH=$xauth_path
1965 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001966fi
Damien Millera22ba012000-03-02 23:09:20 +11001967
1968# Check for mail directory (last resort if we cannot get it from headers)
1969if test ! -z "$MAIL" ; then
1970 maildir=`dirname $MAIL`
1971 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1972fi
1973
Damien Millera22ba012000-03-02 23:09:20 +11001974if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001975 if test "x$disable_ptmx_check" != "xyes" ; then
1976 AC_CHECK_FILE("/dev/ptmx",
1977 [
1978 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1979 have_dev_ptmx=1
1980 ]
1981 )
1982 fi
Damien Millera22ba012000-03-02 23:09:20 +11001983fi
Damien Miller204ad072000-03-02 23:56:12 +11001984AC_CHECK_FILE("/dev/ptc",
1985 [
1986 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1987 have_dev_ptc=1
1988 ]
1989)
1990
Damien Millera22ba012000-03-02 23:09:20 +11001991# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001992AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001993 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001994 [
Damien Miller897741e2001-04-16 10:41:46 +10001995 case "$withval" in
1996 man|cat|doc)
1997 MANTYPE=$withval
1998 ;;
1999 *)
2000 AC_MSG_ERROR(invalid man type: $withval)
2001 ;;
2002 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002003 ]
2004)
Ben Lindstrombc709922001-04-18 18:04:21 +00002005if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002006 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2007 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002008 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2009 MANTYPE=doc
2010 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2011 MANTYPE=man
2012 else
2013 MANTYPE=cat
2014 fi
2015fi
Damien Miller670a4b82000-01-22 13:53:11 +11002016AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002017if test "$MANTYPE" = "doc"; then
2018 mansubdir=man;
2019else
2020 mansubdir=$MANTYPE;
2021fi
2022AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002023
Damien Millera22ba012000-03-02 23:09:20 +11002024# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002025MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002026AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002027 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002028 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002029 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002030 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002031 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002032 fi
2033 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002034)
2035
Damien Millera22ba012000-03-02 23:09:20 +11002036# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002037AC_ARG_WITH(shadow,
2038 [ --without-shadow Disable shadow password support],
2039 [
2040 if test "x$withval" = "xno" ; then
2041 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002042 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002043 fi
2044 ]
2045)
2046
Damien Miller1f335fb2000-06-26 11:31:33 +10002047if test -z "$disable_shadow" ; then
2048 AC_MSG_CHECKING([if the systems has expire shadow information])
2049 AC_TRY_COMPILE(
2050 [
2051#include <sys/types.h>
2052#include <shadow.h>
2053 struct spwd sp;
2054 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2055 [ sp_expire_available=yes ], []
2056 )
2057
2058 if test "x$sp_expire_available" = "xyes" ; then
2059 AC_MSG_RESULT(yes)
2060 AC_DEFINE(HAS_SHADOW_EXPIRE)
2061 else
2062 AC_MSG_RESULT(no)
2063 fi
2064fi
2065
Damien Millera22ba012000-03-02 23:09:20 +11002066# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002067if test ! -z "$IPADDR_IN_DISPLAY" ; then
2068 DISPLAY_HACK_MSG="yes"
2069 AC_DEFINE(IPADDR_IN_DISPLAY)
2070else
2071 DISPLAY_HACK_MSG="no"
2072 AC_ARG_WITH(ipaddr-display,
2073 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2074 [
2075 if test "x$withval" != "xno" ; then
2076 AC_DEFINE(IPADDR_IN_DISPLAY)
2077 DISPLAY_HACK_MSG="yes"
2078 fi
2079 ]
2080 )
2081fi
Damien Miller76112de1999-12-21 11:18:08 +11002082
Tim Rice43a1c132002-04-17 21:19:14 -07002083dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2084if test $ac_cv_func_login_getcapbool = "yes" -a \
2085 $ac_cv_header_login_cap_h = "yes" ; then
2086 USES_LOGIN_CONF=yes
2087fi
Damien Millera22ba012000-03-02 23:09:20 +11002088# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002089SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002090AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002091 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002092 [
Tim Rice43a1c132002-04-17 21:19:14 -07002093 if test "$USES_LOGIN_CONF" = "yes" ; then
2094 AC_MSG_WARN([
2095--with-default-path=PATH has no effect on this system.
2096Edit /etc/login.conf instead.])
2097 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002098 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002099 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002100 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002101 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002102 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2103 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2104 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002105 AC_TRY_RUN(
2106 [
2107/* find out what STDPATH is */
2108#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002109#ifdef HAVE_PATHS_H
2110# include <paths.h>
2111#endif
2112#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002113# ifdef _PATH_USERPATH /* Irix */
2114# define _PATH_STDPATH _PATH_USERPATH
2115# else
2116# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2117# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002118#endif
2119#include <sys/types.h>
2120#include <sys/stat.h>
2121#include <fcntl.h>
2122#define DATA "conftest.stdpath"
2123
2124main()
2125{
2126 FILE *fd;
2127 int rc;
2128
2129 fd = fopen(DATA,"w");
2130 if(fd == NULL)
2131 exit(1);
2132
2133 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2134 exit(1);
2135
2136 exit(0);
2137}
2138 ], [ user_path=`cat conftest.stdpath` ],
2139 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2140 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2141 )
2142# make sure $bindir is in USER_PATH so scp will work
2143 t_bindir=`eval echo ${bindir}`
2144 case $t_bindir in
2145 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2146 esac
2147 case $t_bindir in
2148 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2149 esac
2150 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2151 if test $? -ne 0 ; then
2152 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2153 if test $? -ne 0 ; then
2154 user_path=$user_path:$t_bindir
2155 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2156 fi
2157 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002158 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002159)
Tim Rice43a1c132002-04-17 21:19:14 -07002160if test "$USES_LOGIN_CONF" != "yes" ; then
2161 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2162 AC_SUBST(user_path)
2163fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002164
Damien Millera18bbd32002-05-13 10:48:57 +10002165# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002166AC_ARG_WITH(superuser-path,
2167 [ --with-superuser-path= Specify different path for super-user],
2168 [
2169 if test "x$withval" != "xno" ; then
2170 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2171 superuser_path=$withval
2172 fi
2173 ]
2174)
2175
2176
Damien Millera22ba012000-03-02 23:09:20 +11002177# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002178IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002179AC_ARG_WITH(ipv4-default,
2180 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2181 [
2182 if test "x$withval" != "xno" ; then
2183 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002184 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002185 fi
2186 ]
2187)
2188
Damien Miller61e50f12000-05-08 20:49:37 +10002189AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002190IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002191AC_ARG_WITH(4in6,
2192 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2193 [
2194 if test "x$withval" != "xno" ; then
2195 AC_MSG_RESULT(yes)
2196 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002197 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002198 else
2199 AC_MSG_RESULT(no)
2200 fi
2201 ],[
2202 if test "x$inet6_default_4in6" = "xyes"; then
2203 AC_MSG_RESULT([yes (default)])
2204 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002205 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002206 else
2207 AC_MSG_RESULT([no (default)])
2208 fi
2209 ]
2210)
2211
Damien Miller60396b02001-02-18 17:01:00 +11002212# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002213BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002214AC_ARG_WITH(bsd-auth,
2215 [ --with-bsd-auth Enable BSD auth support],
2216 [
2217 if test "x$withval" != "xno" ; then
2218 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002219 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002220 fi
2221 ]
2222)
2223
Damien Millera22ba012000-03-02 23:09:20 +11002224# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002225piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002226# make sure the directory exists
2227if test ! -d $piddir ; then
2228 piddir=`eval echo ${sysconfdir}`
2229 case $piddir in
2230 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2231 esac
2232fi
2233
Tim Rice88f2ab52002-03-17 12:17:34 -08002234AC_ARG_WITH(pid-dir,
2235 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2236 [
2237 if test "x$withval" != "xno" ; then
2238 piddir=$withval
2239 if test ! -d $piddir ; then
2240 AC_MSG_WARN([** no $piddir directory on this system **])
2241 fi
2242 fi
2243 ]
2244)
2245
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002246AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002247AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002248
andre2ff7b5d2000-06-03 14:57:40 +00002249dnl allow user to disable some login recording features
2250AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002251 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002252 [ AC_DEFINE(DISABLE_LASTLOG) ]
2253)
2254AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002255 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002256 [ AC_DEFINE(DISABLE_UTMP) ]
2257)
2258AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002259 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002260 [ AC_DEFINE(DISABLE_UTMPX) ]
2261)
2262AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002263 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002264 [ AC_DEFINE(DISABLE_WTMP) ]
2265)
2266AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002267 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002268 [ AC_DEFINE(DISABLE_WTMPX) ]
2269)
2270AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002271 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002272 [ AC_DEFINE(DISABLE_LOGIN) ]
2273)
2274AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002275 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002276 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2277)
2278AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002279 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002280 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2281)
2282AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002283 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002284 [
2285 if test "x$withval" = "xno" ; then
2286 AC_DEFINE(DISABLE_LASTLOG)
2287 else
2288 conf_lastlog_location=$withval
2289 fi
2290 ]
2291)
andre2ff7b5d2000-06-03 14:57:40 +00002292
2293dnl lastlog, [uw]tmpx? detection
2294dnl NOTE: set the paths in the platform section to avoid the
2295dnl need for command-line parameters
2296dnl lastlog and [uw]tmp are subject to a file search if all else fails
2297
2298dnl lastlog detection
2299dnl NOTE: the code itself will detect if lastlog is a directory
2300AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2301AC_TRY_COMPILE([
2302#include <sys/types.h>
2303#include <utmp.h>
2304#ifdef HAVE_LASTLOG_H
2305# include <lastlog.h>
2306#endif
Damien Miller2994e082000-06-04 15:51:47 +10002307#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002308# include <paths.h>
2309#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002310#ifdef HAVE_LOGIN_H
2311# include <login.h>
2312#endif
andre2ff7b5d2000-06-03 14:57:40 +00002313 ],
2314 [ char *lastlog = LASTLOG_FILE; ],
2315 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002316 [
2317 AC_MSG_RESULT(no)
2318 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2319 AC_TRY_COMPILE([
2320#include <sys/types.h>
2321#include <utmp.h>
2322#ifdef HAVE_LASTLOG_H
2323# include <lastlog.h>
2324#endif
2325#ifdef HAVE_PATHS_H
2326# include <paths.h>
2327#endif
2328 ],
2329 [ char *lastlog = _PATH_LASTLOG; ],
2330 [ AC_MSG_RESULT(yes) ],
2331 [
andree441aa32000-06-12 22:34:38 +00002332 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002333 system_lastlog_path=no
2334 ])
2335 ]
andre2ff7b5d2000-06-03 14:57:40 +00002336)
Damien Miller2994e082000-06-04 15:51:47 +10002337
andre2ff7b5d2000-06-03 14:57:40 +00002338if test -z "$conf_lastlog_location"; then
2339 if test x"$system_lastlog_path" = x"no" ; then
2340 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002341 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002342 conf_lastlog_location=$f
2343 fi
2344 done
2345 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002346 AC_MSG_WARN([** Cannot find lastlog **])
2347 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002348 fi
2349 fi
2350fi
2351
2352if test -n "$conf_lastlog_location"; then
2353 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2354fi
2355
2356dnl utmp detection
2357AC_MSG_CHECKING([if your system defines UTMP_FILE])
2358AC_TRY_COMPILE([
2359#include <sys/types.h>
2360#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002361#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002362# include <paths.h>
2363#endif
2364 ],
2365 [ char *utmp = UTMP_FILE; ],
2366 [ AC_MSG_RESULT(yes) ],
2367 [ AC_MSG_RESULT(no)
2368 system_utmp_path=no ]
2369)
2370if test -z "$conf_utmp_location"; then
2371 if test x"$system_utmp_path" = x"no" ; then
2372 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2373 if test -f $f ; then
2374 conf_utmp_location=$f
2375 fi
2376 done
2377 if test -z "$conf_utmp_location"; then
2378 AC_DEFINE(DISABLE_UTMP)
2379 fi
2380 fi
2381fi
2382if test -n "$conf_utmp_location"; then
2383 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2384fi
2385
2386dnl wtmp detection
2387AC_MSG_CHECKING([if your system defines WTMP_FILE])
2388AC_TRY_COMPILE([
2389#include <sys/types.h>
2390#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002391#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002392# include <paths.h>
2393#endif
2394 ],
2395 [ char *wtmp = WTMP_FILE; ],
2396 [ AC_MSG_RESULT(yes) ],
2397 [ AC_MSG_RESULT(no)
2398 system_wtmp_path=no ]
2399)
2400if test -z "$conf_wtmp_location"; then
2401 if test x"$system_wtmp_path" = x"no" ; then
2402 for f in /usr/adm/wtmp /var/log/wtmp; do
2403 if test -f $f ; then
2404 conf_wtmp_location=$f
2405 fi
2406 done
2407 if test -z "$conf_wtmp_location"; then
2408 AC_DEFINE(DISABLE_WTMP)
2409 fi
2410 fi
2411fi
2412if test -n "$conf_wtmp_location"; then
2413 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2414fi
2415
2416
2417dnl utmpx detection - I don't know any system so perverse as to require
2418dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2419dnl there, though.
2420AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2421AC_TRY_COMPILE([
2422#include <sys/types.h>
2423#include <utmp.h>
2424#ifdef HAVE_UTMPX_H
2425#include <utmpx.h>
2426#endif
Damien Miller2994e082000-06-04 15:51:47 +10002427#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002428# include <paths.h>
2429#endif
2430 ],
2431 [ char *utmpx = UTMPX_FILE; ],
2432 [ AC_MSG_RESULT(yes) ],
2433 [ AC_MSG_RESULT(no)
2434 system_utmpx_path=no ]
2435)
2436if test -z "$conf_utmpx_location"; then
2437 if test x"$system_utmpx_path" = x"no" ; then
2438 AC_DEFINE(DISABLE_UTMPX)
2439 fi
2440else
2441 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2442fi
2443
2444dnl wtmpx detection
2445AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2446AC_TRY_COMPILE([
2447#include <sys/types.h>
2448#include <utmp.h>
2449#ifdef HAVE_UTMPX_H
2450#include <utmpx.h>
2451#endif
Damien Miller2994e082000-06-04 15:51:47 +10002452#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002453# include <paths.h>
2454#endif
2455 ],
2456 [ char *wtmpx = WTMPX_FILE; ],
2457 [ AC_MSG_RESULT(yes) ],
2458 [ AC_MSG_RESULT(no)
2459 system_wtmpx_path=no ]
2460)
2461if test -z "$conf_wtmpx_location"; then
2462 if test x"$system_wtmpx_path" = x"no" ; then
2463 AC_DEFINE(DISABLE_WTMPX)
2464 fi
2465else
2466 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2467fi
2468
Damien Miller4018c192000-04-30 09:30:44 +10002469
Damien Miller29ea30d2000-03-17 10:54:15 +11002470if test ! -z "$blibpath" ; then
2471 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2472 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2473fi
2474
Tim Rice4cec93f2002-02-26 08:40:48 -08002475dnl remove pam and dl because they are in $LIBPAM
2476if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002477 LIBS=`echo $LIBS | sed 's/-lpam //'`
2478fi
2479if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2480 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002481fi
2482
Damien Millerbac2d8a2000-09-05 16:13:06 +11002483AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002484AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2485AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002486
Damien Miller7b22d652000-06-18 14:07:04 +10002487# Print summary of options
2488
Damien Miller7b22d652000-06-18 14:07:04 +10002489# Someone please show me a better way :)
2490A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2491B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2492C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2493D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002494E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002495F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002496G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002497H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2498I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2499J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002500
2501echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002502echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002503echo " User binaries: $B"
2504echo " System binaries: $C"
2505echo " Configuration files: $D"
2506echo " Askpass program: $E"
2507echo " Manual pages: $F"
2508echo " PID file: $G"
2509echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002510if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002511echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002512else
Damien Millerf58c6722002-05-13 13:15:42 +10002513echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002514fi
Damien Millera18bbd32002-05-13 10:48:57 +10002515if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002516echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002517fi
Damien Millerf58c6722002-05-13 13:15:42 +10002518echo " Manpage format: $MANTYPE"
2519echo " PAM support: ${PAM_MSG}"
2520echo " KerberosIV support: $KRB4_MSG"
2521echo " KerberosV support: $KRB5_MSG"
2522echo " Smartcard support: $SCARD_MSG"
2523echo " AFS support: $AFS_MSG"
2524echo " S/KEY support: $SKEY_MSG"
2525echo " TCP Wrappers support: $TCPW_MSG"
2526echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002527echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002528echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2529echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2530echo " BSD Auth support: $BSD_AUTH_MSG"
2531echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002532if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002533echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002534fi
2535
Damien Miller7b22d652000-06-18 14:07:04 +10002536echo ""
2537
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002538echo " Host: ${host}"
2539echo " Compiler: ${CC}"
2540echo " Compiler flags: ${CFLAGS}"
2541echo "Preprocessor flags: ${CPPFLAGS}"
2542echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002543echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002544
2545echo ""
2546
Damien Miller82cf0ce2000-12-20 13:34:48 +11002547if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002548 echo "PAM is enabled. You may need to install a PAM control file "
2549 echo "for sshd, otherwise password authentication may fail. "
2550 echo "Example PAM control files can be found in the contrib/ "
2551 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002552 echo ""
2553fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002554
2555if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002556 echo "sftp-server will be disabled. Your compiler does not "
2557 echo "support 64bit integers."
2558 echo ""
2559fi
2560
2561if test ! -z "$RAND_HELPER_CMDHASH" ; then
2562 echo "WARNING: you are using the builtin random number collection "
2563 echo "service. Please read WARNING.RNG and request that your OS "
2564 echo "vendor includes kernel-based random number collection in "
2565 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002566 echo ""
2567fi
Damien Miller60396b02001-02-18 17:01:00 +11002568