blob: d384f7dd7e35c2dedd1aef3299be93c0b1e7b321 [file] [log] [blame]
Tim Riced0d7a8b2003-01-08 17:22:59 -08001# $Id: configure.ac,v 1.97 2003/01/09 01:22:59 tim 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 Miller75b1d102000-01-07 14:01:41 +110085 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110086*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080087 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110088 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000089 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110090 AC_DEFINE(DISABLE_SHADOW)
91 AC_DEFINE(IPV4_DEFAULT)
92 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000093 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000094 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -070095 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +000096 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110097 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000098*-*-dgux*)
99 AC_DEFINE(IP_TOS_IS_BROKEN)
100 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000101*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000102 AC_MSG_CHECKING(if we have working getaddrinfo)
103 AC_TRY_RUN([#include <mach-o/dyld.h>
104main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
105 exit(0);
106 else
107 exit(1);
108}], [AC_MSG_RESULT(working)],
109 [AC_MSG_RESULT(buggy)
110 AC_DEFINE(BROKEN_GETADDRINFO)],
111 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000112 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000113*-*-hpux10.26)
114 if test -z "$GCC"; then
115 CFLAGS="$CFLAGS -Ae"
116 fi
117 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
118 IPADDR_IN_DISPLAY=yes
119 AC_DEFINE(HAVE_SECUREWARE)
120 AC_DEFINE(USE_PIPES)
121 AC_DEFINE(LOGIN_NO_ENDOPT)
122 AC_DEFINE(LOGIN_NEEDS_UTMPX)
123 AC_DEFINE(DISABLE_SHADOW)
124 AC_DEFINE(DISABLE_UTMP)
125 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700126 LIBS="$LIBS -lsec -lsecpw"
127 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000128 disable_ptmx_check=yes
129 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100130*-*-hpux10*)
131 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000132 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100133 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000134 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100135 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000136 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000137 AC_DEFINE(LOGIN_NO_ENDOPT)
138 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100139 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100140 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000141 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700142 LIBS="$LIBS -lsec"
143 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100144 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000145*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000146 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100147 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100148 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100149 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000150 AC_DEFINE(LOGIN_NO_ENDOPT)
151 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100152 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100153 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000154 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700155 LIBS="$LIBS -lsec"
156 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000157 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100158*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000159 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000160 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100161 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000162 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000163 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100164 ;;
165*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000166 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000167 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100168 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000169 AC_DEFINE(WITH_IRIX_ARRAY)
170 AC_DEFINE(WITH_IRIX_PROJECT)
171 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000172 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000173 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000174 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100175 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100176*-*-linux*)
177 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100178 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100179 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000180 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100181 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100182 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000183mips-sony-bsd|mips-sony-newsos4)
184 AC_DEFINE(HAVE_NEWS4)
185 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000186 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100187*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000188 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100189 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100190 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100191*-*-freebsd*)
192 check_for_libcrypt_later=1
193 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000194*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000195 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100196 conf_utmp_location=/etc/utmp
197 conf_wtmp_location=/usr/adm/wtmp
198 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000199 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000200 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000201 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100202 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000203 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000204 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000205 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100206*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000208 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100209 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100210 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000211 AC_DEFINE(LOGIN_NEEDS_UTMPX)
212 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000213 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000214 # hardwire lastlog location (can't detect it on some versions)
215 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000216 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
217 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
218 if test "$sol2ver" -ge 8; then
219 AC_MSG_RESULT(yes)
220 AC_DEFINE(DISABLE_UTMP)
221 AC_DEFINE(DISABLE_WTMP)
222 else
223 AC_MSG_RESULT(no)
224 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100225 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000226*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000227 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000228 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100229 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000230 conf_utmp_location=/etc/utmp
231 conf_wtmp_location=/var/adm/wtmp
232 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000233 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000234 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000235*-ncr-sysv*)
236 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
237 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700238 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000239 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000240 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000241*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700243 # /usr/ucblib MUST NOT be searched on ReliantUNIX
244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100245 IPADDR_IN_DISPLAY=yes
246 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000247 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700248 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
249 # Attention: always take care to bind libsocket and libnsl before libc,
250 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000251 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100252*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000253 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100254 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100255 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100256 ;;
257*-*-sysv5*)
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 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100262*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100265 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100266*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000267 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100268 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700269 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100270 RANLIB=true
271 no_dev_ptmx=1
272 AC_DEFINE(BROKEN_SYS_TERMIO_H)
273 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000274 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000275 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100276 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100277 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700278 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700279 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100280 ;;
281*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000282 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000283 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100284 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000285 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100286 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000287 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000288 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700289 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100290 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700291 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000292 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000293*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000294 AC_DEFINE(USE_PIPES)
295 AC_DEFINE(DISABLE_FD_PASSING)
296 LDFLAGS="$LDFLAGS"
297 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
298 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000299 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000300*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000301 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700302 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700303 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000304 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
305 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
306 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700307 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000308*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000309 AC_MSG_CHECKING(for Digital Unix SIA)
310 no_osfsia=""
311 AC_ARG_WITH(osfsia,
312 [ --with-osfsia Enable Digital Unix SIA],
313 [
314 if test "x$withval" = "xno" ; then
315 AC_MSG_RESULT(disabled)
316 no_osfsia=1
317 fi
318 ],
319 )
320 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000321 if test -f /etc/sia/matrix.conf; then
322 AC_MSG_RESULT(yes)
323 AC_DEFINE(HAVE_OSF_SIA)
324 AC_DEFINE(DISABLE_LOGIN)
325 LIBS="$LIBS -lsecurity -ldb -lm -laud"
326 else
327 AC_MSG_RESULT(no)
328 fi
329 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000330 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000331 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000332
333*-*-nto-qnx)
334 AC_DEFINE(USE_PIPES)
335 AC_DEFINE(NO_X11_UNIX_SOCKETS)
336 AC_DEFINE(MISSING_NFDBITS)
337 AC_DEFINE(MISSING_HOWMANY)
338 AC_DEFINE(MISSING_FD_MASK)
339 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100340esac
341
Damien Millere37bfc12000-06-05 09:37:43 +1000342# Allow user to specify flags
343AC_ARG_WITH(cflags,
344 [ --with-cflags Specify additional flags to pass to compiler],
345 [
346 if test "x$withval" != "xno" ; then
347 CFLAGS="$CFLAGS $withval"
348 fi
349 ]
350)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000351AC_ARG_WITH(cppflags,
352 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
353 [
354 if test "x$withval" != "xno"; then
355 CPPFLAGS="$CPPFLAGS $withval"
356 fi
357 ]
358)
Damien Millere37bfc12000-06-05 09:37:43 +1000359AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000360 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000361 [
362 if test "x$withval" != "xno" ; then
363 LDFLAGS="$LDFLAGS $withval"
364 fi
365 ]
366)
367AC_ARG_WITH(libs,
368 [ --with-libs Specify additional libraries to link with],
369 [
370 if test "x$withval" != "xno" ; then
371 LIBS="$LIBS $withval"
372 fi
373 ]
374)
375
Tim Rice4cec93f2002-02-26 08:40:48 -0800376# Checks for header files.
377AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700378 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800379 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000380 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000381 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800382 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Kevin Stevesb1184bb2002-04-07 18:12:03 +0000383 sys/mman.h sys/select.h sys/stat.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800384 sys/stropts.h sys/sysmacros.h sys/time.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700385 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800386 util.h utime.h utmp.h utmpx.h)
387
Damien Millera22ba012000-03-02 23:09:20 +1100388# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700389AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
390AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000391
Damien Millerdf288022001-02-18 13:07:07 +1100392dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700393if test "x$with_tcp_wrappers" != "xno" ; then
394 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
395 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
396 fi
397fi
Damien Millerdf288022001-02-18 13:07:07 +1100398
Tim Rice13aae5e2001-10-21 17:53:58 -0700399AC_CHECK_FUNC(getspnam, ,
400 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700401
Damien Miller150c8b52002-02-13 23:06:56 +1100402AC_ARG_WITH(rpath,
403 [ --without-rpath Disable auto-added -R linker paths],
404 [
405 if test "x$withval" = "xno" ; then
406 need_dash_r=""
407 fi
408 if test "x$withval" = "xyes" ; then
409 need_dash_r=1
410 fi
411 ]
412)
413
Tim Rice13aae5e2001-10-21 17:53:58 -0700414dnl zlib is required
415AC_ARG_WITH(zlib,
416 [ --with-zlib=PATH Use zlib in PATH],
417 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000418 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100419 AC_MSG_ERROR([*** zlib is required ***])
420 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700421 if test -d "$withval/lib"; then
422 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700423 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700424 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700425 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700426 fi
427 else
428 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700429 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700430 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700431 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700432 fi
433 fi
434 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700435 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700436 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700437 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700438 fi
439 ]
440)
441
Tim Rice17b93e52001-10-23 22:36:54 -0700442AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100443
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000444dnl UnixWare 2.x
445AC_CHECK_FUNC(strcasecmp,
446 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
447)
448AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700449 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
450 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000451)
Damien Millerab18c411999-11-11 10:40:23 +1100452
Tim Ricee589a292001-11-03 11:09:32 -0800453dnl Checks for libutil functions
454AC_CHECK_HEADERS(libutil.h)
455AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
456AC_CHECK_FUNCS(logout updwtmp logwtmp)
457
Ben Lindstrom8697e082001-02-24 21:41:10 +0000458AC_FUNC_STRFTIME
459
Damien Miller3c027682001-03-14 11:39:45 +1100460# Check for ALTDIRFUNC glob() extension
461AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
462AC_EGREP_CPP(FOUNDIT,
463 [
464 #include <glob.h>
465 #ifdef GLOB_ALTDIRFUNC
466 FOUNDIT
467 #endif
468 ],
469 [
470 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
471 AC_MSG_RESULT(yes)
472 ],
473 [
474 AC_MSG_RESULT(no)
475 ]
476)
Damien Millerab18c411999-11-11 10:40:23 +1100477
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000478# Check for g.gl_matchc glob() extension
479AC_MSG_CHECKING(for gl_matchc field in glob_t)
480AC_EGREP_CPP(FOUNDIT,
481 [
482 #include <glob.h>
483 int main(void){glob_t g; g.gl_matchc = 1;}
484 ],
485 [
486 AC_DEFINE(GLOB_HAS_GL_MATCHC)
487 AC_MSG_RESULT(yes)
488 ],
489 [
490 AC_MSG_RESULT(no)
491 ]
492)
493
Damien Miller18bb4732001-03-28 14:35:30 +1000494AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
495AC_TRY_RUN(
496 [
497#include <sys/types.h>
498#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700499int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000500 ],
501 [AC_MSG_RESULT(yes)],
502 [
503 AC_MSG_RESULT(no)
504 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
505 ]
506)
507
Damien Millerc547bf12001-02-16 10:18:12 +1100508# Check whether user wants S/Key support
509SKEY_MSG="no"
510AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700511 [ --with-skey[[=PATH]] Enable S/Key support
512 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100513 [
514 if test "x$withval" != "xno" ; then
515
516 if test "x$withval" != "xyes" ; then
517 CPPFLAGS="$CPPFLAGS -I${withval}/include"
518 LDFLAGS="$LDFLAGS -L${withval}/lib"
519 fi
520
521 AC_DEFINE(SKEY)
522 LIBS="-lskey $LIBS"
523 SKEY_MSG="yes"
524
Tim Rice4cec93f2002-02-26 08:40:48 -0800525 AC_MSG_CHECKING([for s/key support])
526 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100527 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800528#include <stdio.h>
529#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700530int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800531 ],
532 [AC_MSG_RESULT(yes)],
533 [
534 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100535 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
536 ])
537 fi
538 ]
539)
540
541# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700542TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100543AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700544 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
545 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100546 [
547 if test "x$withval" != "xno" ; then
548 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700549 saved_LDFLAGS="$LDFLAGS"
550 saved_CPPFLAGS="$CPPFLAGS"
551 if test -n "${withval}" -a "${withval}" != "yes"; then
552 if test -d "${withval}/lib"; then
553 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700554 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700555 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700556 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700557 fi
558 else
559 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700560 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700561 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700562 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 fi
564 fi
565 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700566 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700567 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700568 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700570 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800571 LIBWRAP="-lwrap"
572 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100573 AC_MSG_CHECKING(for libwrap)
574 AC_TRY_LINK(
575 [
576#include <tcpd.h>
577 int deny_severity = 0, allow_severity = 0;
578 ],
579 [hosts_access(0);],
580 [
581 AC_MSG_RESULT(yes)
582 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800583 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700584 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100585 ],
586 [
587 AC_MSG_ERROR([*** libwrap missing])
588 ]
589 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800590 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100591 fi
592 ]
593)
594
Damien Millerad833b32000-08-23 10:46:23 +1000595dnl Checks for library functions.
Ben Lindstromfdee8ef2002-04-06 23:52:02 +0000596AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
Tim Rice13aae5e2001-10-21 17:53:58 -0700597 clock fchmod fchown freeaddrinfo futimes gai_strerror \
Damien Miller771721f2002-09-12 10:32:59 +1000598 getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
Tim Rice13aae5e2001-10-21 17:53:58 -0700599 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
600 inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller594a71b2002-04-23 20:22:59 +1000601 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
602 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
Ben Lindstrom837461b2002-06-12 16:57:14 +0000603 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
Ben Lindstromf0bfa832002-06-21 00:01:18 +0000604 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
Damien Millerb93addb2003-01-07 17:04:18 +1100605 socketpair strerror strlcat strlcpy strmode strvis sysconf \
Damien Millerbc9b7c42003-01-08 00:06:48 +1100606 tcgetpgrp truncate utimes vhangup vsnprintf waitpid __b64_ntop \
607 _getpty)
Tim Rice13aae5e2001-10-21 17:53:58 -0700608
Ben Lindstrom3e006472002-10-16 00:24:03 +0000609dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
610AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
611
Tim Rice13aae5e2001-10-21 17:53:58 -0700612dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700613AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 AC_CHECK_LIB(gen, dirname,[
615 AC_CACHE_CHECK([for broken dirname],
616 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700617 save_LIBS="$LIBS"
618 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700619 AC_TRY_RUN(
620 [
621#include <libgen.h>
622#include <string.h>
623
624int main(int argc, char **argv) {
625 char *s, buf[32];
626
627 strncpy(buf,"/etc", 32);
628 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700629 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700630 exit(1);
631 } else {
632 exit(0);
633 }
634}
635 ],
636 [ ac_cv_have_broken_dirname="no" ],
637 [ ac_cv_have_broken_dirname="yes" ]
638 )
Tim Rice17b93e52001-10-23 22:36:54 -0700639 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700640 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700641 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700642 LIBS="$LIBS -lgen"
643 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700644 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700645 fi
646 ])
647])
648
Damien Millerad833b32000-08-23 10:46:23 +1000649dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000650AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000651dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000652AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000653AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000654dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000655AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000656AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100657
Damien Miller04f80141999-11-19 15:32:34 +1100658AC_CHECK_FUNC(daemon,
659 [AC_DEFINE(HAVE_DAEMON)],
660 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
661)
662
Damien Miller9fb07e42000-03-05 16:22:59 +1100663AC_CHECK_FUNC(getpagesize,
664 [AC_DEFINE(HAVE_GETPAGESIZE)],
665 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
666)
667
Damien Millercb170cb2000-07-01 16:52:55 +1000668# Check for broken snprintf
669if test "x$ac_cv_func_snprintf" = "xyes" ; then
670 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
671 AC_TRY_RUN(
672 [
673#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700674int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000675 ],
676 [AC_MSG_RESULT(yes)],
677 [
678 AC_MSG_RESULT(no)
679 AC_DEFINE(BROKEN_SNPRINTF)
680 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
681 ]
682 )
683fi
684
Damien Millere8328192003-01-07 15:18:32 +1100685dnl see whether mkstemp() requires XXXXXX
686if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
687AC_MSG_CHECKING([for (overly) strict mkstemp])
688AC_TRY_RUN(
689 [
690#include <stdlib.h>
691main() { char template[]="conftest.mkstemp-test";
692if (mkstemp(template) == -1)
693 exit(1);
694unlink(template); exit(0);
695}
696 ],
697 [
698 AC_MSG_RESULT(no)
699 ],
700 [
701 AC_MSG_RESULT(yes)
702 AC_DEFINE(HAVE_STRICT_MKSTEMP)
703 ],
704 [
705 AC_MSG_RESULT(yes)
706 AC_DEFINE(HAVE_STRICT_MKSTEMP)
707 ]
708)
709fi
710
Damien Miller606f8802000-09-16 15:39:56 +1100711AC_FUNC_GETPGRP
712
Damien Millera64b57a2001-01-17 10:44:13 +1100713# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000714PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100715AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100716 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100717 [
Damien Millera64b57a2001-01-17 10:44:13 +1100718 if test "x$withval" != "xno" ; then
719 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
720 AC_MSG_ERROR([PAM headers not found])
721 fi
722
723 AC_CHECK_LIB(dl, dlopen, , )
724 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
725 AC_CHECK_FUNCS(pam_getenvlist)
726
727 disable_shadow=yes
728 PAM_MSG="yes"
729
730 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800731 if test $ac_cv_lib_dl_dlopen = yes; then
732 LIBPAM="-lpam -ldl"
733 else
734 LIBPAM="-lpam"
735 fi
736 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100737 fi
738 ]
739)
Damien Millera22ba012000-03-02 23:09:20 +1100740
Damien Millera64b57a2001-01-17 10:44:13 +1100741# Check for older PAM
742if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100743 # Check PAM strerror arguments (old PAM)
744 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
745 AC_TRY_COMPILE(
746 [
Damien Miller81171112000-04-23 11:14:01 +1000747#include <stdlib.h>
748#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100749 ],
750 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
751 [AC_MSG_RESULT(no)],
752 [
753 AC_DEFINE(HAVE_OLD_PAM)
754 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000755 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100756 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100757 )
Damien Millera22ba012000-03-02 23:09:20 +1100758fi
759
Damien Millerfc93d4b2002-09-04 23:26:29 +1000760# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
761# because the system crypt() is more featureful.
762if test "x$check_for_libcrypt_before" = "x1"; then
763 AC_CHECK_LIB(crypt, crypt)
764fi
765
Tim Riceaef73712002-05-11 13:17:42 -0700766# Search for OpenSSL
767saved_CPPFLAGS="$CPPFLAGS"
768saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100769AC_ARG_WITH(ssl-dir,
770 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
771 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000772 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700773 if test -d "$withval/lib"; then
774 if test -n "${need_dash_r}"; then
775 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
776 else
777 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
778 fi
779 else
780 if test -n "${need_dash_r}"; then
781 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
782 else
783 LDFLAGS="-L${withval} ${LDFLAGS}"
784 fi
785 fi
786 if test -d "$withval/include"; then
787 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
788 else
789 CPPFLAGS="-I${withval} ${CPPFLAGS}"
790 fi
Damien Millera22ba012000-03-02 23:09:20 +1100791 fi
792 ]
793)
Tim Riceaef73712002-05-11 13:17:42 -0700794LIBS="$LIBS -lcrypto"
795AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000796 [
Tim Riceaef73712002-05-11 13:17:42 -0700797 dnl Check default openssl install dir
798 if test -n "${need_dash_r}"; then
799 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000800 else
Tim Riceaef73712002-05-11 13:17:42 -0700801 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000802 fi
Tim Riceaef73712002-05-11 13:17:42 -0700803 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
804 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
805 [
806 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
807 ]
808 )
809 ]
810)
811
Tim Riced730b782002-08-13 18:52:10 -0700812# Determine OpenSSL header version
813AC_MSG_CHECKING([OpenSSL header version])
814AC_TRY_RUN(
815 [
816#include <stdio.h>
817#include <string.h>
818#include <openssl/opensslv.h>
819#define DATA "conftest.sslincver"
820int main(void) {
821 FILE *fd;
822 int rc;
823
824 fd = fopen(DATA,"w");
825 if(fd == NULL)
826 exit(1);
827
828 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
829 exit(1);
830
831 exit(0);
832}
833 ],
834 [
835 ssl_header_ver=`cat conftest.sslincver`
836 AC_MSG_RESULT($ssl_header_ver)
837 ],
838 [
839 AC_MSG_RESULT(not found)
840 AC_MSG_ERROR(OpenSSL version header not found.)
841 ]
842)
843
844# Determine OpenSSL library version
845AC_MSG_CHECKING([OpenSSL library version])
846AC_TRY_RUN(
847 [
848#include <stdio.h>
849#include <string.h>
850#include <openssl/opensslv.h>
851#include <openssl/crypto.h>
852#define DATA "conftest.ssllibver"
853int main(void) {
854 FILE *fd;
855 int rc;
856
857 fd = fopen(DATA,"w");
858 if(fd == NULL)
859 exit(1);
860
861 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
862 exit(1);
863
864 exit(0);
865}
866 ],
867 [
868 ssl_library_ver=`cat conftest.ssllibver`
869 AC_MSG_RESULT($ssl_library_ver)
870 ],
871 [
872 AC_MSG_RESULT(not found)
873 AC_MSG_ERROR(OpenSSL library not found.)
874 ]
875)
Damien Millera22ba012000-03-02 23:09:20 +1100876
Damien Millerec932372002-01-22 22:16:03 +1100877# Sanity check OpenSSL headers
878AC_MSG_CHECKING([whether OpenSSL's headers match the library])
879AC_TRY_RUN(
880 [
881#include <string.h>
882#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700883int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100884 ],
885 [
886 AC_MSG_RESULT(yes)
887 ],
888 [
889 AC_MSG_RESULT(no)
890 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
891 ]
892)
893
Damien Millera64b57a2001-01-17 10:44:13 +1100894# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
895# version in OpenSSL. Skip this for PAM
896if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100897 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100898fi
899
Damien Miller6c21c512002-01-22 21:57:53 +1100900
901### Configure cryptographic random number support
902
903# Check wheter OpenSSL seeds itself
904AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
905AC_TRY_RUN(
906 [
907#include <string.h>
908#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700909int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100910 ],
911 [
912 OPENSSL_SEEDS_ITSELF=yes
913 AC_MSG_RESULT(yes)
914 ],
915 [
916 AC_MSG_RESULT(no)
917 # Default to use of the rand helper if OpenSSL doesn't
918 # seed itself
919 USE_RAND_HELPER=yes
920 ]
921)
922
923
924# Do we want to force the use of the rand helper?
925AC_ARG_WITH(rand-helper,
926 [ --with-rand-helper Use subprocess to gather strong randomness ],
927 [
928 if test "x$withval" = "xno" ; then
929 # Force use of OpenSSL's internal RNG, even if
930 # the previous test showed it to be unseeded.
931 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
932 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
933 OPENSSL_SEEDS_ITSELF=yes
934 USE_RAND_HELPER=""
935 fi
936 else
937 USE_RAND_HELPER=yes
938 fi
939 ],
940)
941
942# Which randomness source do we use?
943if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
944 # OpenSSL only
945 AC_DEFINE(OPENSSL_PRNG_ONLY)
946 RAND_MSG="OpenSSL internal ONLY"
947 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800948elif test ! -z "$USE_RAND_HELPER" ; then
949 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100950 RAND_MSG="ssh-rand-helper"
951 INSTALL_SSH_RAND_HELPER="yes"
952fi
953AC_SUBST(INSTALL_SSH_RAND_HELPER)
954
955### Configuration of ssh-rand-helper
956
957# PRNGD TCP socket
958AC_ARG_WITH(prngd-port,
959 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
960 [
Damien Millere996d722002-01-23 11:20:59 +1100961 case "$withval" in
962 no)
963 withval=""
964 ;;
965 [[0-9]]*)
966 ;;
967 *)
968 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
969 ;;
970 esac
971 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100972 PRNGD_PORT="$withval"
973 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
974 fi
975 ]
976)
977
978# PRNGD Unix domain socket
979AC_ARG_WITH(prngd-socket,
980 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
981 [
Damien Millere996d722002-01-23 11:20:59 +1100982 case "$withval" in
983 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100984 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100985 ;;
986 no)
987 withval=""
988 ;;
989 /*)
990 ;;
991 *)
992 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
993 ;;
994 esac
995
996 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100997 if test ! -z "$PRNGD_PORT" ; then
998 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
999 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001000 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001001 AC_MSG_WARN(Entropy socket is not readable)
1002 fi
1003 PRNGD_SOCKET="$withval"
1004 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1005 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001006 ],
1007 [
1008 # Check for existing socket only if we don't have a random device already
1009 if test "$USE_RAND_HELPER" = yes ; then
1010 AC_MSG_CHECKING(for PRNGD/EGD socket)
1011 # Insert other locations here
1012 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1013 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1014 PRNGD_SOCKET="$sock"
1015 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1016 break;
1017 fi
1018 done
1019 if test ! -z "$PRNGD_SOCKET" ; then
1020 AC_MSG_RESULT($PRNGD_SOCKET)
1021 else
1022 AC_MSG_RESULT(not found)
1023 fi
1024 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001025 ]
1026)
1027
1028# Change default command timeout for hashing entropy source
1029entropy_timeout=200
1030AC_ARG_WITH(entropy-timeout,
1031 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1032 [
1033 if test "x$withval" != "xno" ; then
1034 entropy_timeout=$withval
1035 fi
1036 ]
1037)
Damien Miller6c21c512002-01-22 21:57:53 +11001038AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1039
Damien Millerd3f6ad22002-06-25 10:24:47 +10001040SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001041AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001042 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001043 [
1044 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001045 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001046 fi
1047 ]
1048)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001049AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1050AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001051
Tim Rice88f2ab52002-03-17 12:17:34 -08001052# We do this little dance with the search path to insure
1053# that programs that we select for use by installed programs
1054# (which may be run by the super-user) come from trusted
1055# locations before they come from the user's private area.
1056# This should help avoid accidentally configuring some
1057# random version of a program in someone's personal bin.
1058
1059OPATH=$PATH
1060PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001061test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001062test -d /sbin && PATH=$PATH:/sbin
1063test -d /usr/sbin && PATH=$PATH:/usr/sbin
1064PATH=$PATH:/etc:$OPATH
1065
Damien Miller6c21c512002-01-22 21:57:53 +11001066# These programs are used by the command hashing source to gather entropy
1067OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1068OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1069OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1070OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1071OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1072OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1073OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1074OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1075OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1076OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1077OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1078OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1079OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1080OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1081OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1082OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001083# restore PATH
1084PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001085
1086# Where does ssh-rand-helper get its randomness from?
1087INSTALL_SSH_PRNG_CMDS=""
1088if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1089 if test ! -z "$PRNGD_PORT" ; then
1090 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1091 elif test ! -z "$PRNGD_SOCKET" ; then
1092 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1093 else
1094 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1095 RAND_HELPER_CMDHASH=yes
1096 INSTALL_SSH_PRNG_CMDS="yes"
1097 fi
1098fi
1099AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1100
1101
Ben Lindstromb5628642000-10-18 00:02:25 +00001102# Cheap hack to ensure NEWS-OS libraries are arranged right.
1103if test ! -z "$SONY" ; then
1104 LIBS="$LIBS -liberty";
1105fi
1106
Damien Millera22ba012000-03-02 23:09:20 +11001107# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001108AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001109AC_CHECK_SIZEOF(short int, 2)
1110AC_CHECK_SIZEOF(int, 4)
1111AC_CHECK_SIZEOF(long int, 4)
1112AC_CHECK_SIZEOF(long long int, 8)
1113
Damien Millerfa2bb692002-04-23 23:22:25 +10001114# Sanity check long long for some platforms (AIX)
1115if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1116 ac_cv_sizeof_long_long_int=0
1117fi
1118
Damien Millera22ba012000-03-02 23:09:20 +11001119# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001120AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1121 AC_TRY_COMPILE(
1122 [ #include <sys/types.h> ],
1123 [ u_int a; a = 1;],
1124 [ ac_cv_have_u_int="yes" ],
1125 [ ac_cv_have_u_int="no" ]
1126 )
1127])
1128if test "x$ac_cv_have_u_int" = "xyes" ; then
1129 AC_DEFINE(HAVE_U_INT)
1130 have_u_int=1
1131fi
1132
Damien Miller61e50f12000-05-08 20:49:37 +10001133AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1134 AC_TRY_COMPILE(
1135 [ #include <sys/types.h> ],
1136 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1137 [ ac_cv_have_intxx_t="yes" ],
1138 [ ac_cv_have_intxx_t="no" ]
1139 )
1140])
1141if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1142 AC_DEFINE(HAVE_INTXX_T)
1143 have_intxx_t=1
1144fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001145
1146if (test -z "$have_intxx_t" && \
1147 test "x$ac_cv_header_stdint_h" = "xyes")
1148then
1149 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1150 AC_TRY_COMPILE(
1151 [ #include <stdint.h> ],
1152 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1153 [
1154 AC_DEFINE(HAVE_INTXX_T)
1155 AC_MSG_RESULT(yes)
1156 ],
1157 [ AC_MSG_RESULT(no) ]
1158 )
1159fi
1160
Damien Miller578783e2000-09-23 14:12:24 +11001161AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1162 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001163 [
1164#include <sys/types.h>
1165#ifdef HAVE_STDINT_H
1166# include <stdint.h>
1167#endif
1168#include <sys/socket.h>
1169#ifdef HAVE_SYS_BITYPES_H
1170# include <sys/bitypes.h>
1171#endif
1172 ],
Damien Miller578783e2000-09-23 14:12:24 +11001173 [ int64_t a; a = 1;],
1174 [ ac_cv_have_int64_t="yes" ],
1175 [ ac_cv_have_int64_t="no" ]
1176 )
1177])
1178if test "x$ac_cv_have_int64_t" = "xyes" ; then
1179 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001180fi
1181
Damien Miller61e50f12000-05-08 20:49:37 +10001182AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1183 AC_TRY_COMPILE(
1184 [ #include <sys/types.h> ],
1185 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1186 [ ac_cv_have_u_intxx_t="yes" ],
1187 [ ac_cv_have_u_intxx_t="no" ]
1188 )
1189])
1190if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1191 AC_DEFINE(HAVE_U_INTXX_T)
1192 have_u_intxx_t=1
1193fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001194
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001195if test -z "$have_u_intxx_t" ; then
1196 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1197 AC_TRY_COMPILE(
1198 [ #include <sys/socket.h> ],
1199 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1200 [
1201 AC_DEFINE(HAVE_U_INTXX_T)
1202 AC_MSG_RESULT(yes)
1203 ],
1204 [ AC_MSG_RESULT(no) ]
1205 )
1206fi
1207
Damien Miller578783e2000-09-23 14:12:24 +11001208AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1209 AC_TRY_COMPILE(
1210 [ #include <sys/types.h> ],
1211 [ u_int64_t a; a = 1;],
1212 [ ac_cv_have_u_int64_t="yes" ],
1213 [ ac_cv_have_u_int64_t="no" ]
1214 )
1215])
1216if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1217 AC_DEFINE(HAVE_U_INT64_T)
1218 have_u_int64_t=1
1219fi
1220
Tim Rice4cec93f2002-02-26 08:40:48 -08001221if test -z "$have_u_int64_t" ; then
1222 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1223 AC_TRY_COMPILE(
1224 [ #include <sys/bitypes.h> ],
1225 [ u_int64_t a; a = 1],
1226 [
1227 AC_DEFINE(HAVE_U_INT64_T)
1228 AC_MSG_RESULT(yes)
1229 ],
1230 [ AC_MSG_RESULT(no) ]
1231 )
1232fi
1233
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001234if test -z "$have_u_intxx_t" ; then
1235 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1236 AC_TRY_COMPILE(
1237 [
1238#include <sys/types.h>
1239 ],
1240 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1241 [ ac_cv_have_uintxx_t="yes" ],
1242 [ ac_cv_have_uintxx_t="no" ]
1243 )
1244 ])
1245 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1246 AC_DEFINE(HAVE_UINTXX_T)
1247 fi
1248fi
1249
1250if test -z "$have_uintxx_t" ; then
1251 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1252 AC_TRY_COMPILE(
1253 [ #include <stdint.h> ],
1254 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1255 [
1256 AC_DEFINE(HAVE_UINTXX_T)
1257 AC_MSG_RESULT(yes)
1258 ],
1259 [ AC_MSG_RESULT(no) ]
1260 )
1261fi
1262
Damien Milleredb82922000-06-20 13:25:52 +10001263if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1264 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001265then
1266 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1267 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001268 [
1269#include <sys/bitypes.h>
1270 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001271 [
Damien Miller70494d12000-04-03 15:57:06 +10001272 int8_t a; int16_t b; int32_t c;
1273 u_int8_t e; u_int16_t f; u_int32_t g;
1274 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001275 ],
1276 [
1277 AC_DEFINE(HAVE_U_INTXX_T)
1278 AC_DEFINE(HAVE_INTXX_T)
1279 AC_MSG_RESULT(yes)
1280 ],
1281 [AC_MSG_RESULT(no)]
1282 )
1283fi
1284
Damien Miller58be7382001-09-15 21:31:54 +10001285
1286AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1287 AC_TRY_COMPILE(
1288 [
1289#include <sys/types.h>
1290 ],
1291 [ u_char foo; foo = 125; ],
1292 [ ac_cv_have_u_char="yes" ],
1293 [ ac_cv_have_u_char="no" ]
1294 )
1295])
1296if test "x$ac_cv_have_u_char" = "xyes" ; then
1297 AC_DEFINE(HAVE_U_CHAR)
1298fi
1299
Tim Rice13aae5e2001-10-21 17:53:58 -07001300TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001301
Tim Rice200a5c02002-02-26 22:12:34 -08001302AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001303
Damien Miller61e50f12000-05-08 20:49:37 +10001304AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1305 AC_TRY_COMPILE(
1306 [
1307#include <sys/types.h>
1308 ],
1309 [ size_t foo; foo = 1235; ],
1310 [ ac_cv_have_size_t="yes" ],
1311 [ ac_cv_have_size_t="no" ]
1312 )
1313])
1314if test "x$ac_cv_have_size_t" = "xyes" ; then
1315 AC_DEFINE(HAVE_SIZE_T)
1316fi
Damien Miller95058511999-12-29 10:36:45 +11001317
Damien Miller615f9392000-05-17 22:53:33 +10001318AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1319 AC_TRY_COMPILE(
1320 [
1321#include <sys/types.h>
1322 ],
1323 [ ssize_t foo; foo = 1235; ],
1324 [ ac_cv_have_ssize_t="yes" ],
1325 [ ac_cv_have_ssize_t="no" ]
1326 )
1327])
1328if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1329 AC_DEFINE(HAVE_SSIZE_T)
1330fi
1331
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001332AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1333 AC_TRY_COMPILE(
1334 [
1335#include <time.h>
1336 ],
1337 [ clock_t foo; foo = 1235; ],
1338 [ ac_cv_have_clock_t="yes" ],
1339 [ ac_cv_have_clock_t="no" ]
1340 )
1341])
1342if test "x$ac_cv_have_clock_t" = "xyes" ; then
1343 AC_DEFINE(HAVE_CLOCK_T)
1344fi
1345
Damien Millerb54b40e2000-06-23 08:23:34 +10001346AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1347 AC_TRY_COMPILE(
1348 [
1349#include <sys/types.h>
1350#include <sys/socket.h>
1351 ],
1352 [ sa_family_t foo; foo = 1235; ],
1353 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001354 [ AC_TRY_COMPILE(
1355 [
1356#include <sys/types.h>
1357#include <sys/socket.h>
1358#include <netinet/in.h>
1359 ],
1360 [ sa_family_t foo; foo = 1235; ],
1361 [ ac_cv_have_sa_family_t="yes" ],
1362
Damien Millerb54b40e2000-06-23 08:23:34 +10001363 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001364 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001365 )
1366])
1367if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1368 AC_DEFINE(HAVE_SA_FAMILY_T)
1369fi
1370
Damien Miller0f91b4e2000-06-18 15:43:25 +10001371AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1372 AC_TRY_COMPILE(
1373 [
1374#include <sys/types.h>
1375 ],
1376 [ pid_t foo; foo = 1235; ],
1377 [ ac_cv_have_pid_t="yes" ],
1378 [ ac_cv_have_pid_t="no" ]
1379 )
1380])
1381if test "x$ac_cv_have_pid_t" = "xyes" ; then
1382 AC_DEFINE(HAVE_PID_T)
1383fi
1384
1385AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1386 AC_TRY_COMPILE(
1387 [
1388#include <sys/types.h>
1389 ],
1390 [ mode_t foo; foo = 1235; ],
1391 [ ac_cv_have_mode_t="yes" ],
1392 [ ac_cv_have_mode_t="no" ]
1393 )
1394])
1395if test "x$ac_cv_have_mode_t" = "xyes" ; then
1396 AC_DEFINE(HAVE_MODE_T)
1397fi
1398
Damien Miller61e50f12000-05-08 20:49:37 +10001399
1400AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1401 AC_TRY_COMPILE(
1402 [
Damien Miller81171112000-04-23 11:14:01 +10001403#include <sys/types.h>
1404#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001405 ],
1406 [ struct sockaddr_storage s; ],
1407 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1408 [ ac_cv_have_struct_sockaddr_storage="no" ]
1409 )
1410])
1411if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1412 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1413fi
Damien Miller34132e52000-01-14 15:45:46 +11001414
Damien Miller61e50f12000-05-08 20:49:37 +10001415AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1416 AC_TRY_COMPILE(
1417 [
Damien Miller7b22d652000-06-18 14:07:04 +10001418#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001419#include <netinet/in.h>
1420 ],
1421 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1422 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1423 [ ac_cv_have_struct_sockaddr_in6="no" ]
1424 )
1425])
1426if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1427 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1428fi
Damien Miller34132e52000-01-14 15:45:46 +11001429
Damien Miller61e50f12000-05-08 20:49:37 +10001430AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1431 AC_TRY_COMPILE(
1432 [
Damien Miller7b22d652000-06-18 14:07:04 +10001433#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001434#include <netinet/in.h>
1435 ],
1436 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1437 [ ac_cv_have_struct_in6_addr="yes" ],
1438 [ ac_cv_have_struct_in6_addr="no" ]
1439 )
1440])
1441if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1442 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1443fi
Damien Miller34132e52000-01-14 15:45:46 +11001444
Damien Miller61e50f12000-05-08 20:49:37 +10001445AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1446 AC_TRY_COMPILE(
1447 [
Damien Miller81171112000-04-23 11:14:01 +10001448#include <sys/types.h>
1449#include <sys/socket.h>
1450#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001451 ],
1452 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1453 [ ac_cv_have_struct_addrinfo="yes" ],
1454 [ ac_cv_have_struct_addrinfo="no" ]
1455 )
1456])
1457if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1458 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1459fi
1460
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001461AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1462 AC_TRY_COMPILE(
1463 [ #include <sys/time.h> ],
1464 [ struct timeval tv; tv.tv_sec = 1;],
1465 [ ac_cv_have_struct_timeval="yes" ],
1466 [ ac_cv_have_struct_timeval="no" ]
1467 )
1468])
1469if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1470 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1471 have_struct_timeval=1
1472fi
1473
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001474# If we don't have int64_t then we can't compile sftp-server. So don't
1475# even attempt to do it.
1476if test "x$ac_cv_have_int64_t" = "xno" -a \
1477 "x$ac_cv_sizeof_long_int" != "x8" -a \
1478 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1479 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001480else
1481dnl test snprintf (broken on SCO w/gcc)
1482 AC_TRY_RUN(
1483 [
1484#include <stdio.h>
1485#include <string.h>
1486#ifdef HAVE_SNPRINTF
1487main()
1488{
1489 char buf[50];
1490 char expected_out[50];
1491 int mazsize = 50 ;
1492#if (SIZEOF_LONG_INT == 8)
1493 long int num = 0x7fffffffffffffff;
1494#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001495 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001496#endif
1497 strcpy(expected_out, "9223372036854775807");
1498 snprintf(buf, mazsize, "%lld", num);
1499 if(strcmp(buf, expected_out) != 0)
1500 exit(1);
1501 exit(0);
1502}
1503#else
1504main() { exit(0); }
1505#endif
1506 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1507 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001508fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001509AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001510
Damien Miller78315eb2000-09-29 23:01:36 +11001511dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001512OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1513OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1514OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1515OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1516OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001517OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001518OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1519OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001520OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001521OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1522OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1523OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1524OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001525OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1526OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1527OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1528OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001529
1530AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001531
Damien Miller61e50f12000-05-08 20:49:37 +10001532AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1533 ac_cv_have_ss_family_in_struct_ss, [
1534 AC_TRY_COMPILE(
1535 [
Damien Miller81171112000-04-23 11:14:01 +10001536#include <sys/types.h>
1537#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001538 ],
1539 [ struct sockaddr_storage s; s.ss_family = 1; ],
1540 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1541 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1542 )
1543])
1544if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1545 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1546fi
1547
Damien Miller61e50f12000-05-08 20:49:37 +10001548AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1549 ac_cv_have___ss_family_in_struct_ss, [
1550 AC_TRY_COMPILE(
1551 [
Damien Miller81171112000-04-23 11:14:01 +10001552#include <sys/types.h>
1553#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001554 ],
1555 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1556 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1557 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1558 )
1559])
1560if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1561 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1562fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001563
Damien Millerad833b32000-08-23 10:46:23 +10001564AC_CACHE_CHECK([for pw_class field in struct passwd],
1565 ac_cv_have_pw_class_in_struct_passwd, [
1566 AC_TRY_COMPILE(
1567 [
Damien Millerad833b32000-08-23 10:46:23 +10001568#include <pwd.h>
1569 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001570 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001571 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1572 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1573 )
1574])
1575if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1576 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1577fi
1578
Kevin Steves82456952001-06-22 21:14:18 +00001579AC_CACHE_CHECK([for pw_expire field in struct passwd],
1580 ac_cv_have_pw_expire_in_struct_passwd, [
1581 AC_TRY_COMPILE(
1582 [
1583#include <pwd.h>
1584 ],
1585 [ struct passwd p; p.pw_expire = 0; ],
1586 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1587 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1588 )
1589])
1590if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1591 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1592fi
1593
1594AC_CACHE_CHECK([for pw_change field in struct passwd],
1595 ac_cv_have_pw_change_in_struct_passwd, [
1596 AC_TRY_COMPILE(
1597 [
1598#include <pwd.h>
1599 ],
1600 [ struct passwd p; p.pw_change = 0; ],
1601 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1602 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1603 )
1604])
1605if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1606 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1607fi
Damien Miller61e50f12000-05-08 20:49:37 +10001608
Tim Rice28bbb0c2002-05-27 17:37:32 -07001609dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001610AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1611 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001612 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001613 [
Tim Riceae49fe62002-04-12 10:26:21 -07001614#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001615#include <sys/socket.h>
1616#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001617int main() {
1618#ifdef msg_accrights
1619exit(1);
1620#endif
1621struct msghdr m;
1622m.msg_accrights = 0;
1623exit(0);
1624}
Kevin Steves939c9db2002-03-22 17:23:25 +00001625 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001626 [ ac_cv_have_accrights_in_msghdr="yes" ],
1627 [ ac_cv_have_accrights_in_msghdr="no" ]
1628 )
1629])
1630if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1631 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1632fi
1633
Kevin Stevesa44e0352002-04-07 16:18:03 +00001634AC_CACHE_CHECK([for msg_control field in struct msghdr],
1635 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001636 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001637 [
Tim Riceae49fe62002-04-12 10:26:21 -07001638#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001639#include <sys/socket.h>
1640#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001641int main() {
1642#ifdef msg_control
1643exit(1);
1644#endif
1645struct msghdr m;
1646m.msg_control = 0;
1647exit(0);
1648}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001649 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001650 [ ac_cv_have_control_in_msghdr="yes" ],
1651 [ ac_cv_have_control_in_msghdr="no" ]
1652 )
1653])
1654if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1655 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1656fi
1657
Damien Miller61e50f12000-05-08 20:49:37 +10001658AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1659 AC_TRY_LINK([],
1660 [ extern char *__progname; printf("%s", __progname); ],
1661 [ ac_cv_libc_defines___progname="yes" ],
1662 [ ac_cv_libc_defines___progname="no" ]
1663 )
1664])
1665if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1666 AC_DEFINE(HAVE___PROGNAME)
1667fi
1668
Kevin Steves4846f4a2002-03-22 18:19:53 +00001669AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1670 AC_TRY_LINK([
1671#include <stdio.h>
1672],
1673 [ printf("%s", __FUNCTION__); ],
1674 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1675 [ ac_cv_cc_implements___FUNCTION__="no" ]
1676 )
1677])
1678if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1679 AC_DEFINE(HAVE___FUNCTION__)
1680fi
1681
1682AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1683 AC_TRY_LINK([
1684#include <stdio.h>
1685],
1686 [ printf("%s", __func__); ],
1687 [ ac_cv_cc_implements___func__="yes" ],
1688 [ ac_cv_cc_implements___func__="no" ]
1689 )
1690])
1691if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1692 AC_DEFINE(HAVE___func__)
1693fi
1694
Damien Miller4f8e6692001-07-14 13:22:53 +10001695AC_CACHE_CHECK([whether getopt has optreset support],
1696 ac_cv_have_getopt_optreset, [
1697 AC_TRY_LINK(
1698 [
1699#include <getopt.h>
1700 ],
1701 [ extern int optreset; optreset = 0; ],
1702 [ ac_cv_have_getopt_optreset="yes" ],
1703 [ ac_cv_have_getopt_optreset="no" ]
1704 )
1705])
1706if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1707 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1708fi
Damien Millera22ba012000-03-02 23:09:20 +11001709
Damien Millerecbb26d2000-07-15 14:59:14 +10001710AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1711 AC_TRY_LINK([],
1712 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1713 [ ac_cv_libc_defines_sys_errlist="yes" ],
1714 [ ac_cv_libc_defines_sys_errlist="no" ]
1715 )
1716])
1717if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1718 AC_DEFINE(HAVE_SYS_ERRLIST)
1719fi
1720
1721
Damien Miller11fa2cc2000-08-16 10:35:58 +10001722AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1723 AC_TRY_LINK([],
1724 [ extern int sys_nerr; printf("%i", sys_nerr);],
1725 [ ac_cv_libc_defines_sys_nerr="yes" ],
1726 [ ac_cv_libc_defines_sys_nerr="no" ]
1727 )
1728])
1729if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1730 AC_DEFINE(HAVE_SYS_NERR)
1731fi
1732
Damien Miller85de5802001-09-18 14:01:11 +10001733SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001734
1735# Check whether user wants sectok support
1736AC_ARG_WITH(sectok,
1737 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001738 [
1739 if test "x$withval" != "xno" ; then
1740 if test "x$withval" != "xyes" ; then
1741 CPPFLAGS="$CPPFLAGS -I${withval}"
1742 LDFLAGS="$LDFLAGS -L${withval}"
1743 if test ! -z "$need_dash_r" ; then
1744 LDFLAGS="$LDFLAGS -R${withval}"
1745 fi
1746 if test ! -z "$blibpath" ; then
1747 blibpath="$blibpath:${withval}"
1748 fi
1749 fi
1750 AC_CHECK_HEADERS(sectok.h)
1751 if test "$ac_cv_header_sectok_h" != yes; then
1752 AC_MSG_ERROR(Can't find sectok.h)
1753 fi
1754 AC_CHECK_LIB(sectok, sectok_open)
1755 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1756 AC_MSG_ERROR(Can't find libsectok)
1757 fi
1758 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001759 AC_DEFINE(USE_SECTOK)
1760 SCARD_MSG="yes, using sectok"
1761 fi
1762 ]
1763)
1764
1765# Check whether user wants OpenSC support
1766AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001767 AC_HELP_STRING([--with-opensc=PFX],
1768 [Enable smartcard support using OpenSC]),
1769 opensc_config_prefix="$withval", opensc_config_prefix="")
1770if test x$opensc_config_prefix != x ; then
1771 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1772 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1773 if test "$OPENSC_CONFIG" != "no"; then
1774 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1775 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1776 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1777 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1778 AC_DEFINE(SMARTCARD)
1779 AC_DEFINE(USE_OPENSC)
1780 SCARD_MSG="yes, using OpenSC"
1781 fi
1782fi
Damien Miller85de5802001-09-18 14:01:11 +10001783
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001784# Check whether user wants Kerberos 5 support
1785KRB5_MSG="no"
1786AC_ARG_WITH(kerberos5,
1787 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1788 [
1789 if test "x$withval" != "xno" ; then
1790 if test "x$withval" = "xyes" ; then
1791 KRB5ROOT="/usr/local"
1792 else
1793 KRB5ROOT=${withval}
1794 fi
1795 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1796 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1797 AC_DEFINE(KRB5)
1798 KRB5_MSG="yes"
1799 AC_MSG_CHECKING(whether we are using Heimdal)
1800 AC_TRY_COMPILE([ #include <krb5.h> ],
1801 [ char *tmp = heimdal_version; ],
1802 [ AC_MSG_RESULT(yes)
1803 AC_DEFINE(HEIMDAL)
1804 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1805 ],
1806 [ AC_MSG_RESULT(no)
1807 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1808 ]
1809 )
1810 if test ! -z "$need_dash_r" ; then
1811 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1812 fi
1813 if test ! -z "$blibpath" ; then
1814 blibpath="$blibpath:${KRB5ROOT}/lib"
1815 fi
1816 AC_CHECK_LIB(resolv, dn_expand, , )
1817
1818 KRB5=yes
1819 fi
1820 ]
1821)
1822# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001823KRB4_MSG="no"
1824AC_ARG_WITH(kerberos4,
1825 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1826 [
1827 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001828 if test "x$withval" != "xyes" ; then
1829 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1830 LDFLAGS="$LDFLAGS -L${withval}/lib"
1831 if test ! -z "$need_dash_r" ; then
1832 LDFLAGS="$LDFLAGS -R${withval}/lib"
1833 fi
1834 if test ! -z "$blibpath" ; then
1835 blibpath="$blibpath:${withval}/lib"
1836 fi
1837 else
1838 if test -d /usr/include/kerberosIV ; then
1839 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1840 fi
1841 fi
1842
1843 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001844 if test "$ac_cv_header_krb_h" != yes; then
1845 AC_MSG_WARN([Cannot find krb.h, build may fail])
1846 fi
Damien Miller98344742001-03-28 14:37:06 +10001847 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001848 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001849 AC_CHECK_LIB(krb4, main)
1850 if test "$ac_cv_lib_krb4_main" != yes; then
1851 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1852 else
1853 KLIBS="-lkrb4"
1854 fi
1855 else
1856 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001857 fi
Damien Miller98344742001-03-28 14:37:06 +10001858 AC_CHECK_LIB(des, des_cbc_encrypt)
1859 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1860 AC_CHECK_LIB(des425, des_cbc_encrypt)
1861 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1862 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1863 else
1864 KLIBS="-ldes425"
1865 fi
1866 else
1867 KLIBS="-ldes"
1868 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001869 AC_CHECK_LIB(resolv, dn_expand, , )
1870 KRB4=yes
1871 KRB4_MSG="yes"
1872 AC_DEFINE(KRB4)
1873 fi
1874 ]
1875)
1876
1877# Check whether user wants AFS support
1878AFS_MSG="no"
1879AC_ARG_WITH(afs,
1880 [ --with-afs=PATH Enable AFS support],
1881 [
1882 if test "x$withval" != "xno" ; then
1883
1884 if test "x$withval" != "xyes" ; then
1885 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1886 LDFLAGS="$LDFLAGS -L${withval}/lib"
1887 fi
1888
1889 if test -z "$KRB4" ; then
1890 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1891 fi
1892
1893 LIBS="-lkafs $LIBS"
1894 if test ! -z "$AFS_LIBS" ; then
1895 LIBS="$LIBS $AFS_LIBS"
1896 fi
1897 AC_DEFINE(AFS)
1898 AFS_MSG="yes"
1899 fi
1900 ]
1901)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001902LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001903
Damien Millera22ba012000-03-02 23:09:20 +11001904# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001905
Damien Millerf58c6722002-05-13 13:15:42 +10001906PRIVSEP_PATH=/var/empty
1907AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001908 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001909 [
1910 if test "x$withval" != "$no" ; then
1911 PRIVSEP_PATH=$withval
1912 fi
1913 ]
1914)
1915AC_SUBST(PRIVSEP_PATH)
1916
Damien Millera22ba012000-03-02 23:09:20 +11001917AC_ARG_WITH(xauth,
1918 [ --with-xauth=PATH Specify path to xauth program ],
1919 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001920 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001921 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001922 fi
1923 ],
1924 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001925 TestPath="$PATH"
1926 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1927 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1928 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1929 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1930 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001931 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001932 xauth_path="/usr/openwin/bin/xauth"
1933 fi
1934 ]
1935)
1936
Damien Millera19cf472000-11-29 13:28:50 +11001937if test -z "$xauth_path" ; then
1938 XAUTH_PATH="undefined"
1939 AC_SUBST(XAUTH_PATH)
1940else
Damien Millera22ba012000-03-02 23:09:20 +11001941 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001942 XAUTH_PATH=$xauth_path
1943 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001944fi
Damien Millera22ba012000-03-02 23:09:20 +11001945
1946# Check for mail directory (last resort if we cannot get it from headers)
1947if test ! -z "$MAIL" ; then
1948 maildir=`dirname $MAIL`
1949 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1950fi
1951
Damien Millera22ba012000-03-02 23:09:20 +11001952if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001953 if test "x$disable_ptmx_check" != "xyes" ; then
1954 AC_CHECK_FILE("/dev/ptmx",
1955 [
1956 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1957 have_dev_ptmx=1
1958 ]
1959 )
1960 fi
Damien Millera22ba012000-03-02 23:09:20 +11001961fi
Damien Miller204ad072000-03-02 23:56:12 +11001962AC_CHECK_FILE("/dev/ptc",
1963 [
1964 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1965 have_dev_ptc=1
1966 ]
1967)
1968
Damien Millera22ba012000-03-02 23:09:20 +11001969# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001970AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001971 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001972 [
Damien Miller897741e2001-04-16 10:41:46 +10001973 case "$withval" in
1974 man|cat|doc)
1975 MANTYPE=$withval
1976 ;;
1977 *)
1978 AC_MSG_ERROR(invalid man type: $withval)
1979 ;;
1980 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001981 ]
1982)
Ben Lindstrombc709922001-04-18 18:04:21 +00001983if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07001984 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
1985 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00001986 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1987 MANTYPE=doc
1988 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1989 MANTYPE=man
1990 else
1991 MANTYPE=cat
1992 fi
1993fi
Damien Miller670a4b82000-01-22 13:53:11 +11001994AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001995if test "$MANTYPE" = "doc"; then
1996 mansubdir=man;
1997else
1998 mansubdir=$MANTYPE;
1999fi
2000AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002001
Damien Millera22ba012000-03-02 23:09:20 +11002002# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002003MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002004AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002005 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002006 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002007 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002008 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002009 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002010 fi
2011 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002012)
2013
Damien Millera22ba012000-03-02 23:09:20 +11002014# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002015AC_ARG_WITH(shadow,
2016 [ --without-shadow Disable shadow password support],
2017 [
2018 if test "x$withval" = "xno" ; then
2019 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002020 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002021 fi
2022 ]
2023)
2024
Damien Miller1f335fb2000-06-26 11:31:33 +10002025if test -z "$disable_shadow" ; then
2026 AC_MSG_CHECKING([if the systems has expire shadow information])
2027 AC_TRY_COMPILE(
2028 [
2029#include <sys/types.h>
2030#include <shadow.h>
2031 struct spwd sp;
2032 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2033 [ sp_expire_available=yes ], []
2034 )
2035
2036 if test "x$sp_expire_available" = "xyes" ; then
2037 AC_MSG_RESULT(yes)
2038 AC_DEFINE(HAS_SHADOW_EXPIRE)
2039 else
2040 AC_MSG_RESULT(no)
2041 fi
2042fi
2043
Damien Millera22ba012000-03-02 23:09:20 +11002044# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002045if test ! -z "$IPADDR_IN_DISPLAY" ; then
2046 DISPLAY_HACK_MSG="yes"
2047 AC_DEFINE(IPADDR_IN_DISPLAY)
2048else
2049 DISPLAY_HACK_MSG="no"
2050 AC_ARG_WITH(ipaddr-display,
2051 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2052 [
2053 if test "x$withval" != "xno" ; then
2054 AC_DEFINE(IPADDR_IN_DISPLAY)
2055 DISPLAY_HACK_MSG="yes"
2056 fi
2057 ]
2058 )
2059fi
Damien Miller76112de1999-12-21 11:18:08 +11002060
Tim Rice43a1c132002-04-17 21:19:14 -07002061dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2062if test $ac_cv_func_login_getcapbool = "yes" -a \
2063 $ac_cv_header_login_cap_h = "yes" ; then
2064 USES_LOGIN_CONF=yes
2065fi
Damien Millera22ba012000-03-02 23:09:20 +11002066# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002067SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002068AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002069 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002070 [
Tim Rice43a1c132002-04-17 21:19:14 -07002071 if test "$USES_LOGIN_CONF" = "yes" ; then
2072 AC_MSG_WARN([
2073--with-default-path=PATH has no effect on this system.
2074Edit /etc/login.conf instead.])
2075 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002076 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002077 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002078 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002079 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002080 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2081 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2082 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002083 AC_TRY_RUN(
2084 [
2085/* find out what STDPATH is */
2086#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002087#ifdef HAVE_PATHS_H
2088# include <paths.h>
2089#endif
2090#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002091# ifdef _PATH_USERPATH /* Irix */
2092# define _PATH_STDPATH _PATH_USERPATH
2093# else
2094# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2095# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002096#endif
2097#include <sys/types.h>
2098#include <sys/stat.h>
2099#include <fcntl.h>
2100#define DATA "conftest.stdpath"
2101
2102main()
2103{
2104 FILE *fd;
2105 int rc;
2106
2107 fd = fopen(DATA,"w");
2108 if(fd == NULL)
2109 exit(1);
2110
2111 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2112 exit(1);
2113
2114 exit(0);
2115}
2116 ], [ user_path=`cat conftest.stdpath` ],
2117 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2118 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2119 )
2120# make sure $bindir is in USER_PATH so scp will work
2121 t_bindir=`eval echo ${bindir}`
2122 case $t_bindir in
2123 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2124 esac
2125 case $t_bindir in
2126 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2127 esac
2128 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2129 if test $? -ne 0 ; then
2130 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2131 if test $? -ne 0 ; then
2132 user_path=$user_path:$t_bindir
2133 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2134 fi
2135 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002136 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002137)
Tim Rice43a1c132002-04-17 21:19:14 -07002138if test "$USES_LOGIN_CONF" != "yes" ; then
2139 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2140 AC_SUBST(user_path)
2141fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002142
Damien Millera18bbd32002-05-13 10:48:57 +10002143# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002144AC_ARG_WITH(superuser-path,
2145 [ --with-superuser-path= Specify different path for super-user],
2146 [
2147 if test "x$withval" != "xno" ; then
2148 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2149 superuser_path=$withval
2150 fi
2151 ]
2152)
2153
2154
Damien Millera22ba012000-03-02 23:09:20 +11002155# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002156IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002157AC_ARG_WITH(ipv4-default,
2158 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2159 [
2160 if test "x$withval" != "xno" ; then
2161 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002162 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002163 fi
2164 ]
2165)
2166
Damien Miller61e50f12000-05-08 20:49:37 +10002167AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002168IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002169AC_ARG_WITH(4in6,
2170 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2171 [
2172 if test "x$withval" != "xno" ; then
2173 AC_MSG_RESULT(yes)
2174 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002175 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002176 else
2177 AC_MSG_RESULT(no)
2178 fi
2179 ],[
2180 if test "x$inet6_default_4in6" = "xyes"; then
2181 AC_MSG_RESULT([yes (default)])
2182 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002183 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002184 else
2185 AC_MSG_RESULT([no (default)])
2186 fi
2187 ]
2188)
2189
Damien Miller60396b02001-02-18 17:01:00 +11002190# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002191BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002192AC_ARG_WITH(bsd-auth,
2193 [ --with-bsd-auth Enable BSD auth support],
2194 [
2195 if test "x$withval" != "xno" ; then
2196 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002197 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002198 fi
2199 ]
2200)
2201
Damien Millera22ba012000-03-02 23:09:20 +11002202# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002203piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002204# make sure the directory exists
2205if test ! -d $piddir ; then
2206 piddir=`eval echo ${sysconfdir}`
2207 case $piddir in
2208 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2209 esac
2210fi
2211
Tim Rice88f2ab52002-03-17 12:17:34 -08002212AC_ARG_WITH(pid-dir,
2213 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2214 [
2215 if test "x$withval" != "xno" ; then
2216 piddir=$withval
2217 if test ! -d $piddir ; then
2218 AC_MSG_WARN([** no $piddir directory on this system **])
2219 fi
2220 fi
2221 ]
2222)
2223
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002224AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002225AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002226
andre2ff7b5d2000-06-03 14:57:40 +00002227dnl allow user to disable some login recording features
2228AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002229 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002230 [ AC_DEFINE(DISABLE_LASTLOG) ]
2231)
2232AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002233 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002234 [ AC_DEFINE(DISABLE_UTMP) ]
2235)
2236AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002237 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002238 [ AC_DEFINE(DISABLE_UTMPX) ]
2239)
2240AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002241 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002242 [ AC_DEFINE(DISABLE_WTMP) ]
2243)
2244AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002245 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002246 [ AC_DEFINE(DISABLE_WTMPX) ]
2247)
2248AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002249 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002250 [ AC_DEFINE(DISABLE_LOGIN) ]
2251)
2252AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002253 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002254 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2255)
2256AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002257 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002258 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2259)
2260AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002261 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002262 [
2263 if test "x$withval" = "xno" ; then
2264 AC_DEFINE(DISABLE_LASTLOG)
2265 else
2266 conf_lastlog_location=$withval
2267 fi
2268 ]
2269)
andre2ff7b5d2000-06-03 14:57:40 +00002270
2271dnl lastlog, [uw]tmpx? detection
2272dnl NOTE: set the paths in the platform section to avoid the
2273dnl need for command-line parameters
2274dnl lastlog and [uw]tmp are subject to a file search if all else fails
2275
2276dnl lastlog detection
2277dnl NOTE: the code itself will detect if lastlog is a directory
2278AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2279AC_TRY_COMPILE([
2280#include <sys/types.h>
2281#include <utmp.h>
2282#ifdef HAVE_LASTLOG_H
2283# include <lastlog.h>
2284#endif
Damien Miller2994e082000-06-04 15:51:47 +10002285#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002286# include <paths.h>
2287#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002288#ifdef HAVE_LOGIN_H
2289# include <login.h>
2290#endif
andre2ff7b5d2000-06-03 14:57:40 +00002291 ],
2292 [ char *lastlog = LASTLOG_FILE; ],
2293 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002294 [
2295 AC_MSG_RESULT(no)
2296 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2297 AC_TRY_COMPILE([
2298#include <sys/types.h>
2299#include <utmp.h>
2300#ifdef HAVE_LASTLOG_H
2301# include <lastlog.h>
2302#endif
2303#ifdef HAVE_PATHS_H
2304# include <paths.h>
2305#endif
2306 ],
2307 [ char *lastlog = _PATH_LASTLOG; ],
2308 [ AC_MSG_RESULT(yes) ],
2309 [
andree441aa32000-06-12 22:34:38 +00002310 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002311 system_lastlog_path=no
2312 ])
2313 ]
andre2ff7b5d2000-06-03 14:57:40 +00002314)
Damien Miller2994e082000-06-04 15:51:47 +10002315
andre2ff7b5d2000-06-03 14:57:40 +00002316if test -z "$conf_lastlog_location"; then
2317 if test x"$system_lastlog_path" = x"no" ; then
2318 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002319 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002320 conf_lastlog_location=$f
2321 fi
2322 done
2323 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002324 AC_MSG_WARN([** Cannot find lastlog **])
2325 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002326 fi
2327 fi
2328fi
2329
2330if test -n "$conf_lastlog_location"; then
2331 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2332fi
2333
2334dnl utmp detection
2335AC_MSG_CHECKING([if your system defines UTMP_FILE])
2336AC_TRY_COMPILE([
2337#include <sys/types.h>
2338#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002339#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002340# include <paths.h>
2341#endif
2342 ],
2343 [ char *utmp = UTMP_FILE; ],
2344 [ AC_MSG_RESULT(yes) ],
2345 [ AC_MSG_RESULT(no)
2346 system_utmp_path=no ]
2347)
2348if test -z "$conf_utmp_location"; then
2349 if test x"$system_utmp_path" = x"no" ; then
2350 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2351 if test -f $f ; then
2352 conf_utmp_location=$f
2353 fi
2354 done
2355 if test -z "$conf_utmp_location"; then
2356 AC_DEFINE(DISABLE_UTMP)
2357 fi
2358 fi
2359fi
2360if test -n "$conf_utmp_location"; then
2361 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2362fi
2363
2364dnl wtmp detection
2365AC_MSG_CHECKING([if your system defines WTMP_FILE])
2366AC_TRY_COMPILE([
2367#include <sys/types.h>
2368#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002369#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002370# include <paths.h>
2371#endif
2372 ],
2373 [ char *wtmp = WTMP_FILE; ],
2374 [ AC_MSG_RESULT(yes) ],
2375 [ AC_MSG_RESULT(no)
2376 system_wtmp_path=no ]
2377)
2378if test -z "$conf_wtmp_location"; then
2379 if test x"$system_wtmp_path" = x"no" ; then
2380 for f in /usr/adm/wtmp /var/log/wtmp; do
2381 if test -f $f ; then
2382 conf_wtmp_location=$f
2383 fi
2384 done
2385 if test -z "$conf_wtmp_location"; then
2386 AC_DEFINE(DISABLE_WTMP)
2387 fi
2388 fi
2389fi
2390if test -n "$conf_wtmp_location"; then
2391 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2392fi
2393
2394
2395dnl utmpx detection - I don't know any system so perverse as to require
2396dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2397dnl there, though.
2398AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2399AC_TRY_COMPILE([
2400#include <sys/types.h>
2401#include <utmp.h>
2402#ifdef HAVE_UTMPX_H
2403#include <utmpx.h>
2404#endif
Damien Miller2994e082000-06-04 15:51:47 +10002405#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002406# include <paths.h>
2407#endif
2408 ],
2409 [ char *utmpx = UTMPX_FILE; ],
2410 [ AC_MSG_RESULT(yes) ],
2411 [ AC_MSG_RESULT(no)
2412 system_utmpx_path=no ]
2413)
2414if test -z "$conf_utmpx_location"; then
2415 if test x"$system_utmpx_path" = x"no" ; then
2416 AC_DEFINE(DISABLE_UTMPX)
2417 fi
2418else
2419 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2420fi
2421
2422dnl wtmpx detection
2423AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2424AC_TRY_COMPILE([
2425#include <sys/types.h>
2426#include <utmp.h>
2427#ifdef HAVE_UTMPX_H
2428#include <utmpx.h>
2429#endif
Damien Miller2994e082000-06-04 15:51:47 +10002430#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002431# include <paths.h>
2432#endif
2433 ],
2434 [ char *wtmpx = WTMPX_FILE; ],
2435 [ AC_MSG_RESULT(yes) ],
2436 [ AC_MSG_RESULT(no)
2437 system_wtmpx_path=no ]
2438)
2439if test -z "$conf_wtmpx_location"; then
2440 if test x"$system_wtmpx_path" = x"no" ; then
2441 AC_DEFINE(DISABLE_WTMPX)
2442 fi
2443else
2444 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2445fi
2446
Damien Miller4018c192000-04-30 09:30:44 +10002447
Damien Miller29ea30d2000-03-17 10:54:15 +11002448if test ! -z "$blibpath" ; then
2449 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2450 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2451fi
2452
Tim Rice4cec93f2002-02-26 08:40:48 -08002453dnl remove pam and dl because they are in $LIBPAM
2454if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002455 LIBS=`echo $LIBS | sed 's/-lpam //'`
2456fi
2457if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2458 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002459fi
2460
Damien Millerbac2d8a2000-09-05 16:13:06 +11002461AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002462AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2463AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002464
Damien Miller7b22d652000-06-18 14:07:04 +10002465# Print summary of options
2466
Damien Miller7b22d652000-06-18 14:07:04 +10002467# Someone please show me a better way :)
2468A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2469B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2470C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2471D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002472E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002473F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002474G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002475H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2476I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2477J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002478
2479echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002480echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002481echo " User binaries: $B"
2482echo " System binaries: $C"
2483echo " Configuration files: $D"
2484echo " Askpass program: $E"
2485echo " Manual pages: $F"
2486echo " PID file: $G"
2487echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002488if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002489echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002490else
Damien Millerf58c6722002-05-13 13:15:42 +10002491echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002492fi
Damien Millera18bbd32002-05-13 10:48:57 +10002493if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002494echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002495fi
Damien Millerf58c6722002-05-13 13:15:42 +10002496echo " Manpage format: $MANTYPE"
2497echo " PAM support: ${PAM_MSG}"
2498echo " KerberosIV support: $KRB4_MSG"
2499echo " KerberosV support: $KRB5_MSG"
2500echo " Smartcard support: $SCARD_MSG"
2501echo " AFS support: $AFS_MSG"
2502echo " S/KEY support: $SKEY_MSG"
2503echo " TCP Wrappers support: $TCPW_MSG"
2504echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002505echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002506echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2507echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2508echo " BSD Auth support: $BSD_AUTH_MSG"
2509echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002510if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002511echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002512fi
2513
Damien Miller7b22d652000-06-18 14:07:04 +10002514echo ""
2515
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002516echo " Host: ${host}"
2517echo " Compiler: ${CC}"
2518echo " Compiler flags: ${CFLAGS}"
2519echo "Preprocessor flags: ${CPPFLAGS}"
2520echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002521echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002522
2523echo ""
2524
Damien Miller82cf0ce2000-12-20 13:34:48 +11002525if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002526 echo "PAM is enabled. You may need to install a PAM control file "
2527 echo "for sshd, otherwise password authentication may fail. "
2528 echo "Example PAM control files can be found in the contrib/ "
2529 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002530 echo ""
2531fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002532
2533if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002534 echo "sftp-server will be disabled. Your compiler does not "
2535 echo "support 64bit integers."
2536 echo ""
2537fi
2538
2539if test ! -z "$RAND_HELPER_CMDHASH" ; then
2540 echo "WARNING: you are using the builtin random number collection "
2541 echo "service. Please read WARNING.RNG and request that your OS "
2542 echo "vendor includes kernel-based random number collection in "
2543 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002544 echo ""
2545fi
Damien Miller60396b02001-02-18 17:01:00 +11002546