blob: a115d3cd28f019be8ab839b811b5d36d2a40c615 [file] [log] [blame]
Damien Millerbc9b7c42003-01-08 00:06:48 +11001# $Id: configure.ac,v 1.96 2003/01/07 13:06:48 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110020AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070023AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110024
Damien Millere8bb4502001-09-25 16:39:35 +100025# System features
26AC_SYS_LARGEFILE
27
Damien Miller3f62aba2000-11-29 11:56:35 +110028if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
30fi
31
Damien Millerad833b32000-08-23 10:46:23 +100032# Use LOGIN_PROGRAM from environment if possible
33if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
35else
36 # Search for login
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
40 fi
41fi
42
Damien Miller166bd442000-03-16 10:48:25 +110043if test -z "$LD" ; then
44 LD=$CC
45fi
46AC_SUBST(LD)
47
Damien Miller166bd442000-03-16 10:48:25 +110048AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100049if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110051fi
52
Damien Millera22ba012000-03-02 23:09:20 +110053# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110054case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110055*-*-aix*)
56 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100059 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Millerfa2bb692002-04-23 23:22:25 +100060 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
61 saved_LDFLAGS="$LDFLAGS"
62 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
63 AC_TRY_LINK([],
64 [],
65 [
66 AC_MSG_RESULT(yes)
67 blibpath="/usr/lib:/lib:/usr/local/lib"
68 ],
69 [ AC_MSG_RESULT(no) ]
70 )
71 LDFLAGS="$saved_LDFLAGS"
Damien Miller29ea30d2000-03-17 10:54:15 +110072 fi
Tim Ricee958ed32002-07-05 07:12:33 -070073 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
74 [AC_CHECK_LIB(s,authenticate,
75 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
76 LIBS="$LIBS -ls"
77 ])
78 ])
Damien Millereca71f82000-01-20 22:38:27 +110079 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100080 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000081 dnl AIX handles lastlog as part of its login message
82 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +000083 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller75b1d102000-01-07 14:01:41 +110084 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110085*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080086 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110087 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000088 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110089 AC_DEFINE(DISABLE_SHADOW)
90 AC_DEFINE(IPV4_DEFAULT)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000092 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +000093 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -070094 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +000095 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110096 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000097*-*-dgux*)
98 AC_DEFINE(IP_TOS_IS_BROKEN)
99 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000100*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000101 AC_MSG_CHECKING(if we have working getaddrinfo)
102 AC_TRY_RUN([#include <mach-o/dyld.h>
103main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
104 exit(0);
105 else
106 exit(1);
107}], [AC_MSG_RESULT(working)],
108 [AC_MSG_RESULT(buggy)
109 AC_DEFINE(BROKEN_GETADDRINFO)],
110 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000111 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000112*-*-hpux10.26)
113 if test -z "$GCC"; then
114 CFLAGS="$CFLAGS -Ae"
115 fi
116 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
117 IPADDR_IN_DISPLAY=yes
118 AC_DEFINE(HAVE_SECUREWARE)
119 AC_DEFINE(USE_PIPES)
120 AC_DEFINE(LOGIN_NO_ENDOPT)
121 AC_DEFINE(LOGIN_NEEDS_UTMPX)
122 AC_DEFINE(DISABLE_SHADOW)
123 AC_DEFINE(DISABLE_UTMP)
124 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700125 LIBS="$LIBS -lsec -lsecpw"
126 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000127 disable_ptmx_check=yes
128 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100129*-*-hpux10*)
130 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000131 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100132 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000133 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100134 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000135 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000136 AC_DEFINE(LOGIN_NO_ENDOPT)
137 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100138 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100139 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000140 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700141 LIBS="$LIBS -lsec"
142 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100143 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000144*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000145 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100146 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100147 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100148 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000149 AC_DEFINE(LOGIN_NO_ENDOPT)
150 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100151 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100152 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000153 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700154 LIBS="$LIBS -lsec"
155 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000156 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100157*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000159 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100160 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000161 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000162 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100163 ;;
164*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000165 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000166 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100167 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000168 AC_DEFINE(WITH_IRIX_ARRAY)
169 AC_DEFINE(WITH_IRIX_PROJECT)
170 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000171 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000172 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000173 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100174 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100175*-*-linux*)
176 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100177 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100178 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000179 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100180 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100181 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000182mips-sony-bsd|mips-sony-newsos4)
183 AC_DEFINE(HAVE_NEWS4)
184 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000185 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100186*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000187 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100188 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100189 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100190*-*-freebsd*)
191 check_for_libcrypt_later=1
192 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000193*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000194 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100195 conf_utmp_location=/etc/utmp
196 conf_wtmp_location=/usr/adm/wtmp
197 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000198 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000199 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000200 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100201 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000203 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000204 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100205*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000206 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000207 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100208 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100209 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000210 AC_DEFINE(LOGIN_NEEDS_UTMPX)
211 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000212 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000213 # hardwire lastlog location (can't detect it on some versions)
214 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000215 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
216 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
217 if test "$sol2ver" -ge 8; then
218 AC_MSG_RESULT(yes)
219 AC_DEFINE(DISABLE_UTMP)
220 AC_DEFINE(DISABLE_WTMP)
221 else
222 AC_MSG_RESULT(no)
223 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100224 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000225*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000226 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000227 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100228 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000229 conf_utmp_location=/etc/utmp
230 conf_wtmp_location=/var/adm/wtmp
231 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000232 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000233 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000234*-ncr-sysv*)
235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700237 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000238 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000239 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000240*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000241 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700242 # /usr/ucblib MUST NOT be searched on ReliantUNIX
243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100244 IPADDR_IN_DISPLAY=yes
245 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000246 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700247 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
248 # Attention: always take care to bind libsocket and libnsl before libc,
249 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000250 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100251*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000252 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100253 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100254 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100255 ;;
256*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000257 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100258 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100259 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100260 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100261*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100264 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100265*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000266 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100267 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700268 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100269 RANLIB=true
270 no_dev_ptmx=1
271 AC_DEFINE(BROKEN_SYS_TERMIO_H)
272 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000273 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000274 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100275 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100276 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700277 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700278 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100279 ;;
280*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000281 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000282 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100283 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000284 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100285 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000286 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000287 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700288 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100289 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700290 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000291 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000292*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000293 AC_DEFINE(USE_PIPES)
294 AC_DEFINE(DISABLE_FD_PASSING)
295 LDFLAGS="$LDFLAGS"
296 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
297 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000298 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000299*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000300 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700301 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700302 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000303 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
304 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
305 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700306 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000307*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000308 AC_MSG_CHECKING(for Digital Unix SIA)
309 no_osfsia=""
310 AC_ARG_WITH(osfsia,
311 [ --with-osfsia Enable Digital Unix SIA],
312 [
313 if test "x$withval" = "xno" ; then
314 AC_MSG_RESULT(disabled)
315 no_osfsia=1
316 fi
317 ],
318 )
319 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000320 if test -f /etc/sia/matrix.conf; then
321 AC_MSG_RESULT(yes)
322 AC_DEFINE(HAVE_OSF_SIA)
323 AC_DEFINE(DISABLE_LOGIN)
324 LIBS="$LIBS -lsecurity -ldb -lm -laud"
325 else
326 AC_MSG_RESULT(no)
327 fi
328 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000329 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000330 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000331
332*-*-nto-qnx)
333 AC_DEFINE(USE_PIPES)
334 AC_DEFINE(NO_X11_UNIX_SOCKETS)
335 AC_DEFINE(MISSING_NFDBITS)
336 AC_DEFINE(MISSING_HOWMANY)
337 AC_DEFINE(MISSING_FD_MASK)
338 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100339esac
340
Damien Millere37bfc12000-06-05 09:37:43 +1000341# Allow user to specify flags
342AC_ARG_WITH(cflags,
343 [ --with-cflags Specify additional flags to pass to compiler],
344 [
345 if test "x$withval" != "xno" ; then
346 CFLAGS="$CFLAGS $withval"
347 fi
348 ]
349)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000350AC_ARG_WITH(cppflags,
351 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
352 [
353 if test "x$withval" != "xno"; then
354 CPPFLAGS="$CPPFLAGS $withval"
355 fi
356 ]
357)
Damien Millere37bfc12000-06-05 09:37:43 +1000358AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000359 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000360 [
361 if test "x$withval" != "xno" ; then
362 LDFLAGS="$LDFLAGS $withval"
363 fi
364 ]
365)
366AC_ARG_WITH(libs,
367 [ --with-libs Specify additional libraries to link with],
368 [
369 if test "x$withval" != "xno" ; then
370 LIBS="$LIBS $withval"
371 fi
372 ]
373)
374
Tim Rice4cec93f2002-02-26 08:40:48 -0800375# Checks for header files.
376AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700377 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800378 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000379 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000380 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800381 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Kevin Stevesb1184bb2002-04-07 18:12:03 +0000382 sys/mman.h sys/select.h sys/stat.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800383 sys/stropts.h sys/sysmacros.h sys/time.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700384 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800385 util.h utime.h utmp.h utmpx.h)
386
Damien Millera22ba012000-03-02 23:09:20 +1100387# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700388AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
389AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000390
Damien Millerdf288022001-02-18 13:07:07 +1100391dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700392if test "x$with_tcp_wrappers" != "xno" ; then
393 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
394 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
395 fi
396fi
Damien Millerdf288022001-02-18 13:07:07 +1100397
Tim Rice13aae5e2001-10-21 17:53:58 -0700398AC_CHECK_FUNC(getspnam, ,
399 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700400
Damien Miller150c8b52002-02-13 23:06:56 +1100401AC_ARG_WITH(rpath,
402 [ --without-rpath Disable auto-added -R linker paths],
403 [
404 if test "x$withval" = "xno" ; then
405 need_dash_r=""
406 fi
407 if test "x$withval" = "xyes" ; then
408 need_dash_r=1
409 fi
410 ]
411)
412
Tim Rice13aae5e2001-10-21 17:53:58 -0700413dnl zlib is required
414AC_ARG_WITH(zlib,
415 [ --with-zlib=PATH Use zlib in PATH],
416 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000417 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100418 AC_MSG_ERROR([*** zlib is required ***])
419 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700420 if test -d "$withval/lib"; then
421 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700422 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700423 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700424 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700425 fi
426 else
427 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700428 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700429 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700430 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700431 fi
432 fi
433 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700434 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700435 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700436 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700437 fi
438 ]
439)
440
Tim Rice17b93e52001-10-23 22:36:54 -0700441AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100442
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000443dnl UnixWare 2.x
444AC_CHECK_FUNC(strcasecmp,
445 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
446)
447AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700448 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
449 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000450)
Damien Millerab18c411999-11-11 10:40:23 +1100451
Tim Ricee589a292001-11-03 11:09:32 -0800452dnl Checks for libutil functions
453AC_CHECK_HEADERS(libutil.h)
454AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
455AC_CHECK_FUNCS(logout updwtmp logwtmp)
456
Ben Lindstrom8697e082001-02-24 21:41:10 +0000457AC_FUNC_STRFTIME
458
Damien Miller3c027682001-03-14 11:39:45 +1100459# Check for ALTDIRFUNC glob() extension
460AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
461AC_EGREP_CPP(FOUNDIT,
462 [
463 #include <glob.h>
464 #ifdef GLOB_ALTDIRFUNC
465 FOUNDIT
466 #endif
467 ],
468 [
469 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
470 AC_MSG_RESULT(yes)
471 ],
472 [
473 AC_MSG_RESULT(no)
474 ]
475)
Damien Millerab18c411999-11-11 10:40:23 +1100476
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000477# Check for g.gl_matchc glob() extension
478AC_MSG_CHECKING(for gl_matchc field in glob_t)
479AC_EGREP_CPP(FOUNDIT,
480 [
481 #include <glob.h>
482 int main(void){glob_t g; g.gl_matchc = 1;}
483 ],
484 [
485 AC_DEFINE(GLOB_HAS_GL_MATCHC)
486 AC_MSG_RESULT(yes)
487 ],
488 [
489 AC_MSG_RESULT(no)
490 ]
491)
492
Damien Miller18bb4732001-03-28 14:35:30 +1000493AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
494AC_TRY_RUN(
495 [
496#include <sys/types.h>
497#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700498int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000499 ],
500 [AC_MSG_RESULT(yes)],
501 [
502 AC_MSG_RESULT(no)
503 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
504 ]
505)
506
Damien Millerc547bf12001-02-16 10:18:12 +1100507# Check whether user wants S/Key support
508SKEY_MSG="no"
509AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700510 [ --with-skey[[=PATH]] Enable S/Key support
511 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100512 [
513 if test "x$withval" != "xno" ; then
514
515 if test "x$withval" != "xyes" ; then
516 CPPFLAGS="$CPPFLAGS -I${withval}/include"
517 LDFLAGS="$LDFLAGS -L${withval}/lib"
518 fi
519
520 AC_DEFINE(SKEY)
521 LIBS="-lskey $LIBS"
522 SKEY_MSG="yes"
523
Tim Rice4cec93f2002-02-26 08:40:48 -0800524 AC_MSG_CHECKING([for s/key support])
525 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100526 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800527#include <stdio.h>
528#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700529int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800530 ],
531 [AC_MSG_RESULT(yes)],
532 [
533 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100534 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
535 ])
536 fi
537 ]
538)
539
540# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700541TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100542AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700543 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
544 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100545 [
546 if test "x$withval" != "xno" ; then
547 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700548 saved_LDFLAGS="$LDFLAGS"
549 saved_CPPFLAGS="$CPPFLAGS"
550 if test -n "${withval}" -a "${withval}" != "yes"; then
551 if test -d "${withval}/lib"; then
552 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700553 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700554 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700555 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 fi
557 else
558 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700559 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700561 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700562 fi
563 fi
564 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700565 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700566 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700567 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700569 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800570 LIBWRAP="-lwrap"
571 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100572 AC_MSG_CHECKING(for libwrap)
573 AC_TRY_LINK(
574 [
575#include <tcpd.h>
576 int deny_severity = 0, allow_severity = 0;
577 ],
578 [hosts_access(0);],
579 [
580 AC_MSG_RESULT(yes)
581 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800582 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700583 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100584 ],
585 [
586 AC_MSG_ERROR([*** libwrap missing])
587 ]
588 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800589 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100590 fi
591 ]
592)
593
Damien Millerad833b32000-08-23 10:46:23 +1000594dnl Checks for library functions.
Ben Lindstromfdee8ef2002-04-06 23:52:02 +0000595AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
Tim Rice13aae5e2001-10-21 17:53:58 -0700596 clock fchmod fchown freeaddrinfo futimes gai_strerror \
Damien Miller771721f2002-09-12 10:32:59 +1000597 getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\
Tim Rice13aae5e2001-10-21 17:53:58 -0700598 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
599 inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller594a71b2002-04-23 20:22:59 +1000600 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
601 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
Ben Lindstrom837461b2002-06-12 16:57:14 +0000602 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
Ben Lindstromf0bfa832002-06-21 00:01:18 +0000603 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
Damien Millerb93addb2003-01-07 17:04:18 +1100604 socketpair strerror strlcat strlcpy strmode strvis sysconf \
Damien Millerbc9b7c42003-01-08 00:06:48 +1100605 tcgetpgrp truncate utimes vhangup vsnprintf waitpid __b64_ntop \
606 _getpty)
Tim Rice13aae5e2001-10-21 17:53:58 -0700607
Ben Lindstrom3e006472002-10-16 00:24:03 +0000608dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
609AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
610
Tim Rice13aae5e2001-10-21 17:53:58 -0700611dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700612AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700613 AC_CHECK_LIB(gen, dirname,[
614 AC_CACHE_CHECK([for broken dirname],
615 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700616 save_LIBS="$LIBS"
617 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700618 AC_TRY_RUN(
619 [
620#include <libgen.h>
621#include <string.h>
622
623int main(int argc, char **argv) {
624 char *s, buf[32];
625
626 strncpy(buf,"/etc", 32);
627 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700628 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700629 exit(1);
630 } else {
631 exit(0);
632 }
633}
634 ],
635 [ ac_cv_have_broken_dirname="no" ],
636 [ ac_cv_have_broken_dirname="yes" ]
637 )
Tim Rice17b93e52001-10-23 22:36:54 -0700638 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700639 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700640 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700641 LIBS="$LIBS -lgen"
642 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700643 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700644 fi
645 ])
646])
647
Damien Millerad833b32000-08-23 10:46:23 +1000648dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000649AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000650dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000651AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000652AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000653dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000654AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000655AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100656
Damien Miller04f80141999-11-19 15:32:34 +1100657AC_CHECK_FUNC(daemon,
658 [AC_DEFINE(HAVE_DAEMON)],
659 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
660)
661
Damien Miller9fb07e42000-03-05 16:22:59 +1100662AC_CHECK_FUNC(getpagesize,
663 [AC_DEFINE(HAVE_GETPAGESIZE)],
664 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
665)
666
Damien Millercb170cb2000-07-01 16:52:55 +1000667# Check for broken snprintf
668if test "x$ac_cv_func_snprintf" = "xyes" ; then
669 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
670 AC_TRY_RUN(
671 [
672#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700673int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000674 ],
675 [AC_MSG_RESULT(yes)],
676 [
677 AC_MSG_RESULT(no)
678 AC_DEFINE(BROKEN_SNPRINTF)
679 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
680 ]
681 )
682fi
683
Damien Millere8328192003-01-07 15:18:32 +1100684dnl see whether mkstemp() requires XXXXXX
685if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
686AC_MSG_CHECKING([for (overly) strict mkstemp])
687AC_TRY_RUN(
688 [
689#include <stdlib.h>
690main() { char template[]="conftest.mkstemp-test";
691if (mkstemp(template) == -1)
692 exit(1);
693unlink(template); exit(0);
694}
695 ],
696 [
697 AC_MSG_RESULT(no)
698 ],
699 [
700 AC_MSG_RESULT(yes)
701 AC_DEFINE(HAVE_STRICT_MKSTEMP)
702 ],
703 [
704 AC_MSG_RESULT(yes)
705 AC_DEFINE(HAVE_STRICT_MKSTEMP)
706 ]
707)
708fi
709
Damien Miller606f8802000-09-16 15:39:56 +1100710AC_FUNC_GETPGRP
711
Damien Millera64b57a2001-01-17 10:44:13 +1100712# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000713PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100714AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100715 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100716 [
Damien Millera64b57a2001-01-17 10:44:13 +1100717 if test "x$withval" != "xno" ; then
718 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
719 AC_MSG_ERROR([PAM headers not found])
720 fi
721
722 AC_CHECK_LIB(dl, dlopen, , )
723 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
724 AC_CHECK_FUNCS(pam_getenvlist)
725
726 disable_shadow=yes
727 PAM_MSG="yes"
728
729 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800730 if test $ac_cv_lib_dl_dlopen = yes; then
731 LIBPAM="-lpam -ldl"
732 else
733 LIBPAM="-lpam"
734 fi
735 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100736 fi
737 ]
738)
Damien Millera22ba012000-03-02 23:09:20 +1100739
Damien Millera64b57a2001-01-17 10:44:13 +1100740# Check for older PAM
741if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100742 # Check PAM strerror arguments (old PAM)
743 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
744 AC_TRY_COMPILE(
745 [
Damien Miller81171112000-04-23 11:14:01 +1000746#include <stdlib.h>
747#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100748 ],
749 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
750 [AC_MSG_RESULT(no)],
751 [
752 AC_DEFINE(HAVE_OLD_PAM)
753 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000754 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100755 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100756 )
Damien Millera22ba012000-03-02 23:09:20 +1100757fi
758
Damien Millerfc93d4b2002-09-04 23:26:29 +1000759# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
760# because the system crypt() is more featureful.
761if test "x$check_for_libcrypt_before" = "x1"; then
762 AC_CHECK_LIB(crypt, crypt)
763fi
764
Tim Riceaef73712002-05-11 13:17:42 -0700765# Search for OpenSSL
766saved_CPPFLAGS="$CPPFLAGS"
767saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100768AC_ARG_WITH(ssl-dir,
769 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
770 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000771 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700772 if test -d "$withval/lib"; then
773 if test -n "${need_dash_r}"; then
774 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
775 else
776 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
777 fi
778 else
779 if test -n "${need_dash_r}"; then
780 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
781 else
782 LDFLAGS="-L${withval} ${LDFLAGS}"
783 fi
784 fi
785 if test -d "$withval/include"; then
786 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
787 else
788 CPPFLAGS="-I${withval} ${CPPFLAGS}"
789 fi
Damien Millera22ba012000-03-02 23:09:20 +1100790 fi
791 ]
792)
Tim Riceaef73712002-05-11 13:17:42 -0700793LIBS="$LIBS -lcrypto"
794AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000795 [
Tim Riceaef73712002-05-11 13:17:42 -0700796 dnl Check default openssl install dir
797 if test -n "${need_dash_r}"; then
798 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000799 else
Tim Riceaef73712002-05-11 13:17:42 -0700800 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000801 fi
Tim Riceaef73712002-05-11 13:17:42 -0700802 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
803 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
804 [
805 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
806 ]
807 )
808 ]
809)
810
Tim Riced730b782002-08-13 18:52:10 -0700811# Determine OpenSSL header version
812AC_MSG_CHECKING([OpenSSL header version])
813AC_TRY_RUN(
814 [
815#include <stdio.h>
816#include <string.h>
817#include <openssl/opensslv.h>
818#define DATA "conftest.sslincver"
819int main(void) {
820 FILE *fd;
821 int rc;
822
823 fd = fopen(DATA,"w");
824 if(fd == NULL)
825 exit(1);
826
827 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
828 exit(1);
829
830 exit(0);
831}
832 ],
833 [
834 ssl_header_ver=`cat conftest.sslincver`
835 AC_MSG_RESULT($ssl_header_ver)
836 ],
837 [
838 AC_MSG_RESULT(not found)
839 AC_MSG_ERROR(OpenSSL version header not found.)
840 ]
841)
842
843# Determine OpenSSL library version
844AC_MSG_CHECKING([OpenSSL library version])
845AC_TRY_RUN(
846 [
847#include <stdio.h>
848#include <string.h>
849#include <openssl/opensslv.h>
850#include <openssl/crypto.h>
851#define DATA "conftest.ssllibver"
852int main(void) {
853 FILE *fd;
854 int rc;
855
856 fd = fopen(DATA,"w");
857 if(fd == NULL)
858 exit(1);
859
860 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
861 exit(1);
862
863 exit(0);
864}
865 ],
866 [
867 ssl_library_ver=`cat conftest.ssllibver`
868 AC_MSG_RESULT($ssl_library_ver)
869 ],
870 [
871 AC_MSG_RESULT(not found)
872 AC_MSG_ERROR(OpenSSL library not found.)
873 ]
874)
Damien Millera22ba012000-03-02 23:09:20 +1100875
Damien Millerec932372002-01-22 22:16:03 +1100876# Sanity check OpenSSL headers
877AC_MSG_CHECKING([whether OpenSSL's headers match the library])
878AC_TRY_RUN(
879 [
880#include <string.h>
881#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700882int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100883 ],
884 [
885 AC_MSG_RESULT(yes)
886 ],
887 [
888 AC_MSG_RESULT(no)
889 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
890 ]
891)
892
Damien Millera64b57a2001-01-17 10:44:13 +1100893# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
894# version in OpenSSL. Skip this for PAM
895if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100896 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100897fi
898
Damien Miller6c21c512002-01-22 21:57:53 +1100899
900### Configure cryptographic random number support
901
902# Check wheter OpenSSL seeds itself
903AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
904AC_TRY_RUN(
905 [
906#include <string.h>
907#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700908int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +1100909 ],
910 [
911 OPENSSL_SEEDS_ITSELF=yes
912 AC_MSG_RESULT(yes)
913 ],
914 [
915 AC_MSG_RESULT(no)
916 # Default to use of the rand helper if OpenSSL doesn't
917 # seed itself
918 USE_RAND_HELPER=yes
919 ]
920)
921
922
923# Do we want to force the use of the rand helper?
924AC_ARG_WITH(rand-helper,
925 [ --with-rand-helper Use subprocess to gather strong randomness ],
926 [
927 if test "x$withval" = "xno" ; then
928 # Force use of OpenSSL's internal RNG, even if
929 # the previous test showed it to be unseeded.
930 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
931 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
932 OPENSSL_SEEDS_ITSELF=yes
933 USE_RAND_HELPER=""
934 fi
935 else
936 USE_RAND_HELPER=yes
937 fi
938 ],
939)
940
941# Which randomness source do we use?
942if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
943 # OpenSSL only
944 AC_DEFINE(OPENSSL_PRNG_ONLY)
945 RAND_MSG="OpenSSL internal ONLY"
946 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800947elif test ! -z "$USE_RAND_HELPER" ; then
948 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100949 RAND_MSG="ssh-rand-helper"
950 INSTALL_SSH_RAND_HELPER="yes"
951fi
952AC_SUBST(INSTALL_SSH_RAND_HELPER)
953
954### Configuration of ssh-rand-helper
955
956# PRNGD TCP socket
957AC_ARG_WITH(prngd-port,
958 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
959 [
Damien Millere996d722002-01-23 11:20:59 +1100960 case "$withval" in
961 no)
962 withval=""
963 ;;
964 [[0-9]]*)
965 ;;
966 *)
967 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
968 ;;
969 esac
970 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100971 PRNGD_PORT="$withval"
972 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
973 fi
974 ]
975)
976
977# PRNGD Unix domain socket
978AC_ARG_WITH(prngd-socket,
979 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
980 [
Damien Millere996d722002-01-23 11:20:59 +1100981 case "$withval" in
982 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100983 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100984 ;;
985 no)
986 withval=""
987 ;;
988 /*)
989 ;;
990 *)
991 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
992 ;;
993 esac
994
995 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100996 if test ! -z "$PRNGD_PORT" ; then
997 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
998 fi
Damien Miller6385ba02002-01-23 08:12:36 +1100999 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001000 AC_MSG_WARN(Entropy socket is not readable)
1001 fi
1002 PRNGD_SOCKET="$withval"
1003 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1004 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001005 ],
1006 [
1007 # Check for existing socket only if we don't have a random device already
1008 if test "$USE_RAND_HELPER" = yes ; then
1009 AC_MSG_CHECKING(for PRNGD/EGD socket)
1010 # Insert other locations here
1011 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1012 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1013 PRNGD_SOCKET="$sock"
1014 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1015 break;
1016 fi
1017 done
1018 if test ! -z "$PRNGD_SOCKET" ; then
1019 AC_MSG_RESULT($PRNGD_SOCKET)
1020 else
1021 AC_MSG_RESULT(not found)
1022 fi
1023 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001024 ]
1025)
1026
1027# Change default command timeout for hashing entropy source
1028entropy_timeout=200
1029AC_ARG_WITH(entropy-timeout,
1030 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1031 [
1032 if test "x$withval" != "xno" ; then
1033 entropy_timeout=$withval
1034 fi
1035 ]
1036)
Damien Miller6c21c512002-01-22 21:57:53 +11001037AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1038
Damien Millerd3f6ad22002-06-25 10:24:47 +10001039SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001040AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001041 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001042 [
1043 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001044 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001045 fi
1046 ]
1047)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001048AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1049AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001050
Tim Rice88f2ab52002-03-17 12:17:34 -08001051# We do this little dance with the search path to insure
1052# that programs that we select for use by installed programs
1053# (which may be run by the super-user) come from trusted
1054# locations before they come from the user's private area.
1055# This should help avoid accidentally configuring some
1056# random version of a program in someone's personal bin.
1057
1058OPATH=$PATH
1059PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001060test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001061test -d /sbin && PATH=$PATH:/sbin
1062test -d /usr/sbin && PATH=$PATH:/usr/sbin
1063PATH=$PATH:/etc:$OPATH
1064
Damien Miller6c21c512002-01-22 21:57:53 +11001065# These programs are used by the command hashing source to gather entropy
1066OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1067OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1068OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1069OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1070OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1071OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1072OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1073OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1074OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1075OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1076OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1077OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1078OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1079OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1080OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1081OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001082# restore PATH
1083PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001084
1085# Where does ssh-rand-helper get its randomness from?
1086INSTALL_SSH_PRNG_CMDS=""
1087if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1088 if test ! -z "$PRNGD_PORT" ; then
1089 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1090 elif test ! -z "$PRNGD_SOCKET" ; then
1091 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1092 else
1093 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1094 RAND_HELPER_CMDHASH=yes
1095 INSTALL_SSH_PRNG_CMDS="yes"
1096 fi
1097fi
1098AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1099
1100
Ben Lindstromb5628642000-10-18 00:02:25 +00001101# Cheap hack to ensure NEWS-OS libraries are arranged right.
1102if test ! -z "$SONY" ; then
1103 LIBS="$LIBS -liberty";
1104fi
1105
Damien Millera22ba012000-03-02 23:09:20 +11001106# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001107AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001108AC_CHECK_SIZEOF(short int, 2)
1109AC_CHECK_SIZEOF(int, 4)
1110AC_CHECK_SIZEOF(long int, 4)
1111AC_CHECK_SIZEOF(long long int, 8)
1112
Damien Millerfa2bb692002-04-23 23:22:25 +10001113# Sanity check long long for some platforms (AIX)
1114if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1115 ac_cv_sizeof_long_long_int=0
1116fi
1117
Damien Millera22ba012000-03-02 23:09:20 +11001118# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001119AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1120 AC_TRY_COMPILE(
1121 [ #include <sys/types.h> ],
1122 [ u_int a; a = 1;],
1123 [ ac_cv_have_u_int="yes" ],
1124 [ ac_cv_have_u_int="no" ]
1125 )
1126])
1127if test "x$ac_cv_have_u_int" = "xyes" ; then
1128 AC_DEFINE(HAVE_U_INT)
1129 have_u_int=1
1130fi
1131
Damien Miller61e50f12000-05-08 20:49:37 +10001132AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1133 AC_TRY_COMPILE(
1134 [ #include <sys/types.h> ],
1135 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1136 [ ac_cv_have_intxx_t="yes" ],
1137 [ ac_cv_have_intxx_t="no" ]
1138 )
1139])
1140if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1141 AC_DEFINE(HAVE_INTXX_T)
1142 have_intxx_t=1
1143fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001144
1145if (test -z "$have_intxx_t" && \
1146 test "x$ac_cv_header_stdint_h" = "xyes")
1147then
1148 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1149 AC_TRY_COMPILE(
1150 [ #include <stdint.h> ],
1151 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1152 [
1153 AC_DEFINE(HAVE_INTXX_T)
1154 AC_MSG_RESULT(yes)
1155 ],
1156 [ AC_MSG_RESULT(no) ]
1157 )
1158fi
1159
Damien Miller578783e2000-09-23 14:12:24 +11001160AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1161 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001162 [
1163#include <sys/types.h>
1164#ifdef HAVE_STDINT_H
1165# include <stdint.h>
1166#endif
1167#include <sys/socket.h>
1168#ifdef HAVE_SYS_BITYPES_H
1169# include <sys/bitypes.h>
1170#endif
1171 ],
Damien Miller578783e2000-09-23 14:12:24 +11001172 [ int64_t a; a = 1;],
1173 [ ac_cv_have_int64_t="yes" ],
1174 [ ac_cv_have_int64_t="no" ]
1175 )
1176])
1177if test "x$ac_cv_have_int64_t" = "xyes" ; then
1178 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001179fi
1180
Damien Miller61e50f12000-05-08 20:49:37 +10001181AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1182 AC_TRY_COMPILE(
1183 [ #include <sys/types.h> ],
1184 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1185 [ ac_cv_have_u_intxx_t="yes" ],
1186 [ ac_cv_have_u_intxx_t="no" ]
1187 )
1188])
1189if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1190 AC_DEFINE(HAVE_U_INTXX_T)
1191 have_u_intxx_t=1
1192fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001193
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001194if test -z "$have_u_intxx_t" ; then
1195 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1196 AC_TRY_COMPILE(
1197 [ #include <sys/socket.h> ],
1198 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1199 [
1200 AC_DEFINE(HAVE_U_INTXX_T)
1201 AC_MSG_RESULT(yes)
1202 ],
1203 [ AC_MSG_RESULT(no) ]
1204 )
1205fi
1206
Damien Miller578783e2000-09-23 14:12:24 +11001207AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1208 AC_TRY_COMPILE(
1209 [ #include <sys/types.h> ],
1210 [ u_int64_t a; a = 1;],
1211 [ ac_cv_have_u_int64_t="yes" ],
1212 [ ac_cv_have_u_int64_t="no" ]
1213 )
1214])
1215if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1216 AC_DEFINE(HAVE_U_INT64_T)
1217 have_u_int64_t=1
1218fi
1219
Tim Rice4cec93f2002-02-26 08:40:48 -08001220if test -z "$have_u_int64_t" ; then
1221 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1222 AC_TRY_COMPILE(
1223 [ #include <sys/bitypes.h> ],
1224 [ u_int64_t a; a = 1],
1225 [
1226 AC_DEFINE(HAVE_U_INT64_T)
1227 AC_MSG_RESULT(yes)
1228 ],
1229 [ AC_MSG_RESULT(no) ]
1230 )
1231fi
1232
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001233if test -z "$have_u_intxx_t" ; then
1234 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1235 AC_TRY_COMPILE(
1236 [
1237#include <sys/types.h>
1238 ],
1239 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1240 [ ac_cv_have_uintxx_t="yes" ],
1241 [ ac_cv_have_uintxx_t="no" ]
1242 )
1243 ])
1244 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1245 AC_DEFINE(HAVE_UINTXX_T)
1246 fi
1247fi
1248
1249if test -z "$have_uintxx_t" ; then
1250 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1251 AC_TRY_COMPILE(
1252 [ #include <stdint.h> ],
1253 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1254 [
1255 AC_DEFINE(HAVE_UINTXX_T)
1256 AC_MSG_RESULT(yes)
1257 ],
1258 [ AC_MSG_RESULT(no) ]
1259 )
1260fi
1261
Damien Milleredb82922000-06-20 13:25:52 +10001262if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1263 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001264then
1265 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1266 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001267 [
1268#include <sys/bitypes.h>
1269 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001270 [
Damien Miller70494d12000-04-03 15:57:06 +10001271 int8_t a; int16_t b; int32_t c;
1272 u_int8_t e; u_int16_t f; u_int32_t g;
1273 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001274 ],
1275 [
1276 AC_DEFINE(HAVE_U_INTXX_T)
1277 AC_DEFINE(HAVE_INTXX_T)
1278 AC_MSG_RESULT(yes)
1279 ],
1280 [AC_MSG_RESULT(no)]
1281 )
1282fi
1283
Damien Miller58be7382001-09-15 21:31:54 +10001284
1285AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1286 AC_TRY_COMPILE(
1287 [
1288#include <sys/types.h>
1289 ],
1290 [ u_char foo; foo = 125; ],
1291 [ ac_cv_have_u_char="yes" ],
1292 [ ac_cv_have_u_char="no" ]
1293 )
1294])
1295if test "x$ac_cv_have_u_char" = "xyes" ; then
1296 AC_DEFINE(HAVE_U_CHAR)
1297fi
1298
Tim Rice13aae5e2001-10-21 17:53:58 -07001299TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001300
Tim Rice200a5c02002-02-26 22:12:34 -08001301AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001302
Damien Miller61e50f12000-05-08 20:49:37 +10001303AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1304 AC_TRY_COMPILE(
1305 [
1306#include <sys/types.h>
1307 ],
1308 [ size_t foo; foo = 1235; ],
1309 [ ac_cv_have_size_t="yes" ],
1310 [ ac_cv_have_size_t="no" ]
1311 )
1312])
1313if test "x$ac_cv_have_size_t" = "xyes" ; then
1314 AC_DEFINE(HAVE_SIZE_T)
1315fi
Damien Miller95058511999-12-29 10:36:45 +11001316
Damien Miller615f9392000-05-17 22:53:33 +10001317AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1318 AC_TRY_COMPILE(
1319 [
1320#include <sys/types.h>
1321 ],
1322 [ ssize_t foo; foo = 1235; ],
1323 [ ac_cv_have_ssize_t="yes" ],
1324 [ ac_cv_have_ssize_t="no" ]
1325 )
1326])
1327if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1328 AC_DEFINE(HAVE_SSIZE_T)
1329fi
1330
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001331AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1332 AC_TRY_COMPILE(
1333 [
1334#include <time.h>
1335 ],
1336 [ clock_t foo; foo = 1235; ],
1337 [ ac_cv_have_clock_t="yes" ],
1338 [ ac_cv_have_clock_t="no" ]
1339 )
1340])
1341if test "x$ac_cv_have_clock_t" = "xyes" ; then
1342 AC_DEFINE(HAVE_CLOCK_T)
1343fi
1344
Damien Millerb54b40e2000-06-23 08:23:34 +10001345AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1346 AC_TRY_COMPILE(
1347 [
1348#include <sys/types.h>
1349#include <sys/socket.h>
1350 ],
1351 [ sa_family_t foo; foo = 1235; ],
1352 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001353 [ AC_TRY_COMPILE(
1354 [
1355#include <sys/types.h>
1356#include <sys/socket.h>
1357#include <netinet/in.h>
1358 ],
1359 [ sa_family_t foo; foo = 1235; ],
1360 [ ac_cv_have_sa_family_t="yes" ],
1361
Damien Millerb54b40e2000-06-23 08:23:34 +10001362 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001363 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001364 )
1365])
1366if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1367 AC_DEFINE(HAVE_SA_FAMILY_T)
1368fi
1369
Damien Miller0f91b4e2000-06-18 15:43:25 +10001370AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1371 AC_TRY_COMPILE(
1372 [
1373#include <sys/types.h>
1374 ],
1375 [ pid_t foo; foo = 1235; ],
1376 [ ac_cv_have_pid_t="yes" ],
1377 [ ac_cv_have_pid_t="no" ]
1378 )
1379])
1380if test "x$ac_cv_have_pid_t" = "xyes" ; then
1381 AC_DEFINE(HAVE_PID_T)
1382fi
1383
1384AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1385 AC_TRY_COMPILE(
1386 [
1387#include <sys/types.h>
1388 ],
1389 [ mode_t foo; foo = 1235; ],
1390 [ ac_cv_have_mode_t="yes" ],
1391 [ ac_cv_have_mode_t="no" ]
1392 )
1393])
1394if test "x$ac_cv_have_mode_t" = "xyes" ; then
1395 AC_DEFINE(HAVE_MODE_T)
1396fi
1397
Damien Miller61e50f12000-05-08 20:49:37 +10001398
1399AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1400 AC_TRY_COMPILE(
1401 [
Damien Miller81171112000-04-23 11:14:01 +10001402#include <sys/types.h>
1403#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001404 ],
1405 [ struct sockaddr_storage s; ],
1406 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1407 [ ac_cv_have_struct_sockaddr_storage="no" ]
1408 )
1409])
1410if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1411 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1412fi
Damien Miller34132e52000-01-14 15:45:46 +11001413
Damien Miller61e50f12000-05-08 20:49:37 +10001414AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1415 AC_TRY_COMPILE(
1416 [
Damien Miller7b22d652000-06-18 14:07:04 +10001417#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001418#include <netinet/in.h>
1419 ],
1420 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1421 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1422 [ ac_cv_have_struct_sockaddr_in6="no" ]
1423 )
1424])
1425if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1426 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1427fi
Damien Miller34132e52000-01-14 15:45:46 +11001428
Damien Miller61e50f12000-05-08 20:49:37 +10001429AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1430 AC_TRY_COMPILE(
1431 [
Damien Miller7b22d652000-06-18 14:07:04 +10001432#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001433#include <netinet/in.h>
1434 ],
1435 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1436 [ ac_cv_have_struct_in6_addr="yes" ],
1437 [ ac_cv_have_struct_in6_addr="no" ]
1438 )
1439])
1440if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1441 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1442fi
Damien Miller34132e52000-01-14 15:45:46 +11001443
Damien Miller61e50f12000-05-08 20:49:37 +10001444AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1445 AC_TRY_COMPILE(
1446 [
Damien Miller81171112000-04-23 11:14:01 +10001447#include <sys/types.h>
1448#include <sys/socket.h>
1449#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001450 ],
1451 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1452 [ ac_cv_have_struct_addrinfo="yes" ],
1453 [ ac_cv_have_struct_addrinfo="no" ]
1454 )
1455])
1456if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1457 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1458fi
1459
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001460AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1461 AC_TRY_COMPILE(
1462 [ #include <sys/time.h> ],
1463 [ struct timeval tv; tv.tv_sec = 1;],
1464 [ ac_cv_have_struct_timeval="yes" ],
1465 [ ac_cv_have_struct_timeval="no" ]
1466 )
1467])
1468if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1469 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1470 have_struct_timeval=1
1471fi
1472
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001473# If we don't have int64_t then we can't compile sftp-server. So don't
1474# even attempt to do it.
1475if test "x$ac_cv_have_int64_t" = "xno" -a \
1476 "x$ac_cv_sizeof_long_int" != "x8" -a \
1477 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1478 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001479else
1480dnl test snprintf (broken on SCO w/gcc)
1481 AC_TRY_RUN(
1482 [
1483#include <stdio.h>
1484#include <string.h>
1485#ifdef HAVE_SNPRINTF
1486main()
1487{
1488 char buf[50];
1489 char expected_out[50];
1490 int mazsize = 50 ;
1491#if (SIZEOF_LONG_INT == 8)
1492 long int num = 0x7fffffffffffffff;
1493#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001494 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001495#endif
1496 strcpy(expected_out, "9223372036854775807");
1497 snprintf(buf, mazsize, "%lld", num);
1498 if(strcmp(buf, expected_out) != 0)
1499 exit(1);
1500 exit(0);
1501}
1502#else
1503main() { exit(0); }
1504#endif
1505 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1506 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001507fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001508AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001509
Damien Miller78315eb2000-09-29 23:01:36 +11001510dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001511OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1512OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1513OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1514OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1515OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001516OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001517OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1518OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001519OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001520OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1521OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1522OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1523OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001524OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1525OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1526OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1527OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001528
1529AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001530
Damien Miller61e50f12000-05-08 20:49:37 +10001531AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1532 ac_cv_have_ss_family_in_struct_ss, [
1533 AC_TRY_COMPILE(
1534 [
Damien Miller81171112000-04-23 11:14:01 +10001535#include <sys/types.h>
1536#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001537 ],
1538 [ struct sockaddr_storage s; s.ss_family = 1; ],
1539 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1540 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1541 )
1542])
1543if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1544 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1545fi
1546
Damien Miller61e50f12000-05-08 20:49:37 +10001547AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1548 ac_cv_have___ss_family_in_struct_ss, [
1549 AC_TRY_COMPILE(
1550 [
Damien Miller81171112000-04-23 11:14:01 +10001551#include <sys/types.h>
1552#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001553 ],
1554 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1555 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1556 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1557 )
1558])
1559if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1560 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1561fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001562
Damien Millerad833b32000-08-23 10:46:23 +10001563AC_CACHE_CHECK([for pw_class field in struct passwd],
1564 ac_cv_have_pw_class_in_struct_passwd, [
1565 AC_TRY_COMPILE(
1566 [
Damien Millerad833b32000-08-23 10:46:23 +10001567#include <pwd.h>
1568 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001569 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001570 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1571 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1572 )
1573])
1574if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1575 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1576fi
1577
Kevin Steves82456952001-06-22 21:14:18 +00001578AC_CACHE_CHECK([for pw_expire field in struct passwd],
1579 ac_cv_have_pw_expire_in_struct_passwd, [
1580 AC_TRY_COMPILE(
1581 [
1582#include <pwd.h>
1583 ],
1584 [ struct passwd p; p.pw_expire = 0; ],
1585 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1586 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1587 )
1588])
1589if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1590 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1591fi
1592
1593AC_CACHE_CHECK([for pw_change field in struct passwd],
1594 ac_cv_have_pw_change_in_struct_passwd, [
1595 AC_TRY_COMPILE(
1596 [
1597#include <pwd.h>
1598 ],
1599 [ struct passwd p; p.pw_change = 0; ],
1600 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1601 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1602 )
1603])
1604if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1605 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1606fi
Damien Miller61e50f12000-05-08 20:49:37 +10001607
Tim Rice28bbb0c2002-05-27 17:37:32 -07001608dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001609AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1610 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001611 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001612 [
Tim Riceae49fe62002-04-12 10:26:21 -07001613#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001614#include <sys/socket.h>
1615#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001616int main() {
1617#ifdef msg_accrights
1618exit(1);
1619#endif
1620struct msghdr m;
1621m.msg_accrights = 0;
1622exit(0);
1623}
Kevin Steves939c9db2002-03-22 17:23:25 +00001624 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001625 [ ac_cv_have_accrights_in_msghdr="yes" ],
1626 [ ac_cv_have_accrights_in_msghdr="no" ]
1627 )
1628])
1629if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1630 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1631fi
1632
Kevin Stevesa44e0352002-04-07 16:18:03 +00001633AC_CACHE_CHECK([for msg_control field in struct msghdr],
1634 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001635 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001636 [
Tim Riceae49fe62002-04-12 10:26:21 -07001637#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001638#include <sys/socket.h>
1639#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001640int main() {
1641#ifdef msg_control
1642exit(1);
1643#endif
1644struct msghdr m;
1645m.msg_control = 0;
1646exit(0);
1647}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001648 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001649 [ ac_cv_have_control_in_msghdr="yes" ],
1650 [ ac_cv_have_control_in_msghdr="no" ]
1651 )
1652])
1653if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1654 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1655fi
1656
Damien Miller61e50f12000-05-08 20:49:37 +10001657AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1658 AC_TRY_LINK([],
1659 [ extern char *__progname; printf("%s", __progname); ],
1660 [ ac_cv_libc_defines___progname="yes" ],
1661 [ ac_cv_libc_defines___progname="no" ]
1662 )
1663])
1664if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1665 AC_DEFINE(HAVE___PROGNAME)
1666fi
1667
Kevin Steves4846f4a2002-03-22 18:19:53 +00001668AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1669 AC_TRY_LINK([
1670#include <stdio.h>
1671],
1672 [ printf("%s", __FUNCTION__); ],
1673 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1674 [ ac_cv_cc_implements___FUNCTION__="no" ]
1675 )
1676])
1677if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1678 AC_DEFINE(HAVE___FUNCTION__)
1679fi
1680
1681AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1682 AC_TRY_LINK([
1683#include <stdio.h>
1684],
1685 [ printf("%s", __func__); ],
1686 [ ac_cv_cc_implements___func__="yes" ],
1687 [ ac_cv_cc_implements___func__="no" ]
1688 )
1689])
1690if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1691 AC_DEFINE(HAVE___func__)
1692fi
1693
Damien Miller4f8e6692001-07-14 13:22:53 +10001694AC_CACHE_CHECK([whether getopt has optreset support],
1695 ac_cv_have_getopt_optreset, [
1696 AC_TRY_LINK(
1697 [
1698#include <getopt.h>
1699 ],
1700 [ extern int optreset; optreset = 0; ],
1701 [ ac_cv_have_getopt_optreset="yes" ],
1702 [ ac_cv_have_getopt_optreset="no" ]
1703 )
1704])
1705if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1706 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1707fi
Damien Millera22ba012000-03-02 23:09:20 +11001708
Damien Millerecbb26d2000-07-15 14:59:14 +10001709AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1710 AC_TRY_LINK([],
1711 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1712 [ ac_cv_libc_defines_sys_errlist="yes" ],
1713 [ ac_cv_libc_defines_sys_errlist="no" ]
1714 )
1715])
1716if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1717 AC_DEFINE(HAVE_SYS_ERRLIST)
1718fi
1719
1720
Damien Miller11fa2cc2000-08-16 10:35:58 +10001721AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1722 AC_TRY_LINK([],
1723 [ extern int sys_nerr; printf("%i", sys_nerr);],
1724 [ ac_cv_libc_defines_sys_nerr="yes" ],
1725 [ ac_cv_libc_defines_sys_nerr="no" ]
1726 )
1727])
1728if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1729 AC_DEFINE(HAVE_SYS_NERR)
1730fi
1731
Damien Miller85de5802001-09-18 14:01:11 +10001732SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001733
1734# Check whether user wants sectok support
1735AC_ARG_WITH(sectok,
1736 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001737 [
1738 if test "x$withval" != "xno" ; then
1739 if test "x$withval" != "xyes" ; then
1740 CPPFLAGS="$CPPFLAGS -I${withval}"
1741 LDFLAGS="$LDFLAGS -L${withval}"
1742 if test ! -z "$need_dash_r" ; then
1743 LDFLAGS="$LDFLAGS -R${withval}"
1744 fi
1745 if test ! -z "$blibpath" ; then
1746 blibpath="$blibpath:${withval}"
1747 fi
1748 fi
1749 AC_CHECK_HEADERS(sectok.h)
1750 if test "$ac_cv_header_sectok_h" != yes; then
1751 AC_MSG_ERROR(Can't find sectok.h)
1752 fi
1753 AC_CHECK_LIB(sectok, sectok_open)
1754 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1755 AC_MSG_ERROR(Can't find libsectok)
1756 fi
1757 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001758 AC_DEFINE(USE_SECTOK)
1759 SCARD_MSG="yes, using sectok"
1760 fi
1761 ]
1762)
1763
1764# Check whether user wants OpenSC support
1765AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001766 AC_HELP_STRING([--with-opensc=PFX],
1767 [Enable smartcard support using OpenSC]),
1768 opensc_config_prefix="$withval", opensc_config_prefix="")
1769if test x$opensc_config_prefix != x ; then
1770 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1771 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1772 if test "$OPENSC_CONFIG" != "no"; then
1773 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1774 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1775 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1776 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1777 AC_DEFINE(SMARTCARD)
1778 AC_DEFINE(USE_OPENSC)
1779 SCARD_MSG="yes, using OpenSC"
1780 fi
1781fi
Damien Miller85de5802001-09-18 14:01:11 +10001782
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001783# Check whether user wants Kerberos 5 support
1784KRB5_MSG="no"
1785AC_ARG_WITH(kerberos5,
1786 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1787 [
1788 if test "x$withval" != "xno" ; then
1789 if test "x$withval" = "xyes" ; then
1790 KRB5ROOT="/usr/local"
1791 else
1792 KRB5ROOT=${withval}
1793 fi
1794 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1795 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1796 AC_DEFINE(KRB5)
1797 KRB5_MSG="yes"
1798 AC_MSG_CHECKING(whether we are using Heimdal)
1799 AC_TRY_COMPILE([ #include <krb5.h> ],
1800 [ char *tmp = heimdal_version; ],
1801 [ AC_MSG_RESULT(yes)
1802 AC_DEFINE(HEIMDAL)
1803 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1804 ],
1805 [ AC_MSG_RESULT(no)
1806 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1807 ]
1808 )
1809 if test ! -z "$need_dash_r" ; then
1810 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1811 fi
1812 if test ! -z "$blibpath" ; then
1813 blibpath="$blibpath:${KRB5ROOT}/lib"
1814 fi
1815 AC_CHECK_LIB(resolv, dn_expand, , )
1816
1817 KRB5=yes
1818 fi
1819 ]
1820)
1821# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001822KRB4_MSG="no"
1823AC_ARG_WITH(kerberos4,
1824 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1825 [
1826 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001827 if test "x$withval" != "xyes" ; then
1828 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1829 LDFLAGS="$LDFLAGS -L${withval}/lib"
1830 if test ! -z "$need_dash_r" ; then
1831 LDFLAGS="$LDFLAGS -R${withval}/lib"
1832 fi
1833 if test ! -z "$blibpath" ; then
1834 blibpath="$blibpath:${withval}/lib"
1835 fi
1836 else
1837 if test -d /usr/include/kerberosIV ; then
1838 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1839 fi
1840 fi
1841
1842 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001843 if test "$ac_cv_header_krb_h" != yes; then
1844 AC_MSG_WARN([Cannot find krb.h, build may fail])
1845 fi
Damien Miller98344742001-03-28 14:37:06 +10001846 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001847 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001848 AC_CHECK_LIB(krb4, main)
1849 if test "$ac_cv_lib_krb4_main" != yes; then
1850 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1851 else
1852 KLIBS="-lkrb4"
1853 fi
1854 else
1855 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001856 fi
Damien Miller98344742001-03-28 14:37:06 +10001857 AC_CHECK_LIB(des, des_cbc_encrypt)
1858 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1859 AC_CHECK_LIB(des425, des_cbc_encrypt)
1860 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1861 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1862 else
1863 KLIBS="-ldes425"
1864 fi
1865 else
1866 KLIBS="-ldes"
1867 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001868 AC_CHECK_LIB(resolv, dn_expand, , )
1869 KRB4=yes
1870 KRB4_MSG="yes"
1871 AC_DEFINE(KRB4)
1872 fi
1873 ]
1874)
1875
1876# Check whether user wants AFS support
1877AFS_MSG="no"
1878AC_ARG_WITH(afs,
1879 [ --with-afs=PATH Enable AFS support],
1880 [
1881 if test "x$withval" != "xno" ; then
1882
1883 if test "x$withval" != "xyes" ; then
1884 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1885 LDFLAGS="$LDFLAGS -L${withval}/lib"
1886 fi
1887
1888 if test -z "$KRB4" ; then
1889 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1890 fi
1891
1892 LIBS="-lkafs $LIBS"
1893 if test ! -z "$AFS_LIBS" ; then
1894 LIBS="$LIBS $AFS_LIBS"
1895 fi
1896 AC_DEFINE(AFS)
1897 AFS_MSG="yes"
1898 fi
1899 ]
1900)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001901LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001902
Damien Millera22ba012000-03-02 23:09:20 +11001903# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001904
Damien Millerf58c6722002-05-13 13:15:42 +10001905PRIVSEP_PATH=/var/empty
1906AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001907 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001908 [
1909 if test "x$withval" != "$no" ; then
1910 PRIVSEP_PATH=$withval
1911 fi
1912 ]
1913)
1914AC_SUBST(PRIVSEP_PATH)
1915
Damien Millera22ba012000-03-02 23:09:20 +11001916AC_ARG_WITH(xauth,
1917 [ --with-xauth=PATH Specify path to xauth program ],
1918 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001919 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001920 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001921 fi
1922 ],
1923 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001924 TestPath="$PATH"
1925 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1926 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1927 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1928 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1929 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001930 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001931 xauth_path="/usr/openwin/bin/xauth"
1932 fi
1933 ]
1934)
1935
Damien Millera19cf472000-11-29 13:28:50 +11001936if test -z "$xauth_path" ; then
1937 XAUTH_PATH="undefined"
1938 AC_SUBST(XAUTH_PATH)
1939else
Damien Millera22ba012000-03-02 23:09:20 +11001940 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001941 XAUTH_PATH=$xauth_path
1942 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001943fi
Damien Millera22ba012000-03-02 23:09:20 +11001944
1945# Check for mail directory (last resort if we cannot get it from headers)
1946if test ! -z "$MAIL" ; then
1947 maildir=`dirname $MAIL`
1948 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1949fi
1950
Damien Millera22ba012000-03-02 23:09:20 +11001951if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001952 if test "x$disable_ptmx_check" != "xyes" ; then
1953 AC_CHECK_FILE("/dev/ptmx",
1954 [
1955 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1956 have_dev_ptmx=1
1957 ]
1958 )
1959 fi
Damien Millera22ba012000-03-02 23:09:20 +11001960fi
Damien Miller204ad072000-03-02 23:56:12 +11001961AC_CHECK_FILE("/dev/ptc",
1962 [
1963 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1964 have_dev_ptc=1
1965 ]
1966)
1967
Damien Millera22ba012000-03-02 23:09:20 +11001968# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001969AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001970 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001971 [
Damien Miller897741e2001-04-16 10:41:46 +10001972 case "$withval" in
1973 man|cat|doc)
1974 MANTYPE=$withval
1975 ;;
1976 *)
1977 AC_MSG_ERROR(invalid man type: $withval)
1978 ;;
1979 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001980 ]
1981)
Ben Lindstrombc709922001-04-18 18:04:21 +00001982if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07001983 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
1984 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00001985 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1986 MANTYPE=doc
1987 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1988 MANTYPE=man
1989 else
1990 MANTYPE=cat
1991 fi
1992fi
Damien Miller670a4b82000-01-22 13:53:11 +11001993AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001994if test "$MANTYPE" = "doc"; then
1995 mansubdir=man;
1996else
1997 mansubdir=$MANTYPE;
1998fi
1999AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002000
Damien Millera22ba012000-03-02 23:09:20 +11002001# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002002MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002003AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002004 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002005 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002006 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002007 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002008 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002009 fi
2010 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002011)
2012
Damien Millera22ba012000-03-02 23:09:20 +11002013# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002014AC_ARG_WITH(shadow,
2015 [ --without-shadow Disable shadow password support],
2016 [
2017 if test "x$withval" = "xno" ; then
2018 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002019 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002020 fi
2021 ]
2022)
2023
Damien Miller1f335fb2000-06-26 11:31:33 +10002024if test -z "$disable_shadow" ; then
2025 AC_MSG_CHECKING([if the systems has expire shadow information])
2026 AC_TRY_COMPILE(
2027 [
2028#include <sys/types.h>
2029#include <shadow.h>
2030 struct spwd sp;
2031 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2032 [ sp_expire_available=yes ], []
2033 )
2034
2035 if test "x$sp_expire_available" = "xyes" ; then
2036 AC_MSG_RESULT(yes)
2037 AC_DEFINE(HAS_SHADOW_EXPIRE)
2038 else
2039 AC_MSG_RESULT(no)
2040 fi
2041fi
2042
Damien Millera22ba012000-03-02 23:09:20 +11002043# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002044if test ! -z "$IPADDR_IN_DISPLAY" ; then
2045 DISPLAY_HACK_MSG="yes"
2046 AC_DEFINE(IPADDR_IN_DISPLAY)
2047else
2048 DISPLAY_HACK_MSG="no"
2049 AC_ARG_WITH(ipaddr-display,
2050 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2051 [
2052 if test "x$withval" != "xno" ; then
2053 AC_DEFINE(IPADDR_IN_DISPLAY)
2054 DISPLAY_HACK_MSG="yes"
2055 fi
2056 ]
2057 )
2058fi
Damien Miller76112de1999-12-21 11:18:08 +11002059
Tim Rice43a1c132002-04-17 21:19:14 -07002060dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2061if test $ac_cv_func_login_getcapbool = "yes" -a \
2062 $ac_cv_header_login_cap_h = "yes" ; then
2063 USES_LOGIN_CONF=yes
2064fi
Damien Millera22ba012000-03-02 23:09:20 +11002065# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002066SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002067AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002068 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002069 [
Tim Rice43a1c132002-04-17 21:19:14 -07002070 if test "$USES_LOGIN_CONF" = "yes" ; then
2071 AC_MSG_WARN([
2072--with-default-path=PATH has no effect on this system.
2073Edit /etc/login.conf instead.])
2074 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002075 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002076 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002077 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002078 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002079 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2080 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2081 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002082 AC_TRY_RUN(
2083 [
2084/* find out what STDPATH is */
2085#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002086#ifdef HAVE_PATHS_H
2087# include <paths.h>
2088#endif
2089#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002090# ifdef _PATH_USERPATH /* Irix */
2091# define _PATH_STDPATH _PATH_USERPATH
2092# else
2093# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2094# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002095#endif
2096#include <sys/types.h>
2097#include <sys/stat.h>
2098#include <fcntl.h>
2099#define DATA "conftest.stdpath"
2100
2101main()
2102{
2103 FILE *fd;
2104 int rc;
2105
2106 fd = fopen(DATA,"w");
2107 if(fd == NULL)
2108 exit(1);
2109
2110 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2111 exit(1);
2112
2113 exit(0);
2114}
2115 ], [ user_path=`cat conftest.stdpath` ],
2116 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2117 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2118 )
2119# make sure $bindir is in USER_PATH so scp will work
2120 t_bindir=`eval echo ${bindir}`
2121 case $t_bindir in
2122 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2123 esac
2124 case $t_bindir in
2125 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2126 esac
2127 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2128 if test $? -ne 0 ; then
2129 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2130 if test $? -ne 0 ; then
2131 user_path=$user_path:$t_bindir
2132 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2133 fi
2134 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002135 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002136)
Tim Rice43a1c132002-04-17 21:19:14 -07002137if test "$USES_LOGIN_CONF" != "yes" ; then
2138 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2139 AC_SUBST(user_path)
2140fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002141
Damien Millera18bbd32002-05-13 10:48:57 +10002142# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002143AC_ARG_WITH(superuser-path,
2144 [ --with-superuser-path= Specify different path for super-user],
2145 [
2146 if test "x$withval" != "xno" ; then
2147 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2148 superuser_path=$withval
2149 fi
2150 ]
2151)
2152
2153
Damien Millera22ba012000-03-02 23:09:20 +11002154# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002155IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002156AC_ARG_WITH(ipv4-default,
2157 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2158 [
2159 if test "x$withval" != "xno" ; then
2160 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002161 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002162 fi
2163 ]
2164)
2165
Damien Miller61e50f12000-05-08 20:49:37 +10002166AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002167IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002168AC_ARG_WITH(4in6,
2169 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2170 [
2171 if test "x$withval" != "xno" ; then
2172 AC_MSG_RESULT(yes)
2173 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002174 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002175 else
2176 AC_MSG_RESULT(no)
2177 fi
2178 ],[
2179 if test "x$inet6_default_4in6" = "xyes"; then
2180 AC_MSG_RESULT([yes (default)])
2181 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002182 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002183 else
2184 AC_MSG_RESULT([no (default)])
2185 fi
2186 ]
2187)
2188
Damien Miller60396b02001-02-18 17:01:00 +11002189# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002190BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002191AC_ARG_WITH(bsd-auth,
2192 [ --with-bsd-auth Enable BSD auth support],
2193 [
2194 if test "x$withval" != "xno" ; then
2195 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002196 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002197 fi
2198 ]
2199)
2200
Damien Millera22ba012000-03-02 23:09:20 +11002201# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002202piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002203# make sure the directory exists
2204if test ! -d $piddir ; then
2205 piddir=`eval echo ${sysconfdir}`
2206 case $piddir in
2207 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2208 esac
2209fi
2210
Tim Rice88f2ab52002-03-17 12:17:34 -08002211AC_ARG_WITH(pid-dir,
2212 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2213 [
2214 if test "x$withval" != "xno" ; then
2215 piddir=$withval
2216 if test ! -d $piddir ; then
2217 AC_MSG_WARN([** no $piddir directory on this system **])
2218 fi
2219 fi
2220 ]
2221)
2222
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002223AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002224AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002225
andre2ff7b5d2000-06-03 14:57:40 +00002226dnl allow user to disable some login recording features
2227AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002228 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002229 [ AC_DEFINE(DISABLE_LASTLOG) ]
2230)
2231AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002232 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002233 [ AC_DEFINE(DISABLE_UTMP) ]
2234)
2235AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002236 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002237 [ AC_DEFINE(DISABLE_UTMPX) ]
2238)
2239AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002240 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002241 [ AC_DEFINE(DISABLE_WTMP) ]
2242)
2243AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002244 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002245 [ AC_DEFINE(DISABLE_WTMPX) ]
2246)
2247AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002248 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002249 [ AC_DEFINE(DISABLE_LOGIN) ]
2250)
2251AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002252 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002253 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2254)
2255AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002256 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002257 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2258)
2259AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002260 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002261 [
2262 if test "x$withval" = "xno" ; then
2263 AC_DEFINE(DISABLE_LASTLOG)
2264 else
2265 conf_lastlog_location=$withval
2266 fi
2267 ]
2268)
andre2ff7b5d2000-06-03 14:57:40 +00002269
2270dnl lastlog, [uw]tmpx? detection
2271dnl NOTE: set the paths in the platform section to avoid the
2272dnl need for command-line parameters
2273dnl lastlog and [uw]tmp are subject to a file search if all else fails
2274
2275dnl lastlog detection
2276dnl NOTE: the code itself will detect if lastlog is a directory
2277AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2278AC_TRY_COMPILE([
2279#include <sys/types.h>
2280#include <utmp.h>
2281#ifdef HAVE_LASTLOG_H
2282# include <lastlog.h>
2283#endif
Damien Miller2994e082000-06-04 15:51:47 +10002284#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002285# include <paths.h>
2286#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002287#ifdef HAVE_LOGIN_H
2288# include <login.h>
2289#endif
andre2ff7b5d2000-06-03 14:57:40 +00002290 ],
2291 [ char *lastlog = LASTLOG_FILE; ],
2292 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002293 [
2294 AC_MSG_RESULT(no)
2295 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2296 AC_TRY_COMPILE([
2297#include <sys/types.h>
2298#include <utmp.h>
2299#ifdef HAVE_LASTLOG_H
2300# include <lastlog.h>
2301#endif
2302#ifdef HAVE_PATHS_H
2303# include <paths.h>
2304#endif
2305 ],
2306 [ char *lastlog = _PATH_LASTLOG; ],
2307 [ AC_MSG_RESULT(yes) ],
2308 [
andree441aa32000-06-12 22:34:38 +00002309 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002310 system_lastlog_path=no
2311 ])
2312 ]
andre2ff7b5d2000-06-03 14:57:40 +00002313)
Damien Miller2994e082000-06-04 15:51:47 +10002314
andre2ff7b5d2000-06-03 14:57:40 +00002315if test -z "$conf_lastlog_location"; then
2316 if test x"$system_lastlog_path" = x"no" ; then
2317 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002318 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002319 conf_lastlog_location=$f
2320 fi
2321 done
2322 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002323 AC_MSG_WARN([** Cannot find lastlog **])
2324 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002325 fi
2326 fi
2327fi
2328
2329if test -n "$conf_lastlog_location"; then
2330 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2331fi
2332
2333dnl utmp detection
2334AC_MSG_CHECKING([if your system defines UTMP_FILE])
2335AC_TRY_COMPILE([
2336#include <sys/types.h>
2337#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002338#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002339# include <paths.h>
2340#endif
2341 ],
2342 [ char *utmp = UTMP_FILE; ],
2343 [ AC_MSG_RESULT(yes) ],
2344 [ AC_MSG_RESULT(no)
2345 system_utmp_path=no ]
2346)
2347if test -z "$conf_utmp_location"; then
2348 if test x"$system_utmp_path" = x"no" ; then
2349 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2350 if test -f $f ; then
2351 conf_utmp_location=$f
2352 fi
2353 done
2354 if test -z "$conf_utmp_location"; then
2355 AC_DEFINE(DISABLE_UTMP)
2356 fi
2357 fi
2358fi
2359if test -n "$conf_utmp_location"; then
2360 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2361fi
2362
2363dnl wtmp detection
2364AC_MSG_CHECKING([if your system defines WTMP_FILE])
2365AC_TRY_COMPILE([
2366#include <sys/types.h>
2367#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002368#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002369# include <paths.h>
2370#endif
2371 ],
2372 [ char *wtmp = WTMP_FILE; ],
2373 [ AC_MSG_RESULT(yes) ],
2374 [ AC_MSG_RESULT(no)
2375 system_wtmp_path=no ]
2376)
2377if test -z "$conf_wtmp_location"; then
2378 if test x"$system_wtmp_path" = x"no" ; then
2379 for f in /usr/adm/wtmp /var/log/wtmp; do
2380 if test -f $f ; then
2381 conf_wtmp_location=$f
2382 fi
2383 done
2384 if test -z "$conf_wtmp_location"; then
2385 AC_DEFINE(DISABLE_WTMP)
2386 fi
2387 fi
2388fi
2389if test -n "$conf_wtmp_location"; then
2390 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2391fi
2392
2393
2394dnl utmpx detection - I don't know any system so perverse as to require
2395dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2396dnl there, though.
2397AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2398AC_TRY_COMPILE([
2399#include <sys/types.h>
2400#include <utmp.h>
2401#ifdef HAVE_UTMPX_H
2402#include <utmpx.h>
2403#endif
Damien Miller2994e082000-06-04 15:51:47 +10002404#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002405# include <paths.h>
2406#endif
2407 ],
2408 [ char *utmpx = UTMPX_FILE; ],
2409 [ AC_MSG_RESULT(yes) ],
2410 [ AC_MSG_RESULT(no)
2411 system_utmpx_path=no ]
2412)
2413if test -z "$conf_utmpx_location"; then
2414 if test x"$system_utmpx_path" = x"no" ; then
2415 AC_DEFINE(DISABLE_UTMPX)
2416 fi
2417else
2418 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2419fi
2420
2421dnl wtmpx detection
2422AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2423AC_TRY_COMPILE([
2424#include <sys/types.h>
2425#include <utmp.h>
2426#ifdef HAVE_UTMPX_H
2427#include <utmpx.h>
2428#endif
Damien Miller2994e082000-06-04 15:51:47 +10002429#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002430# include <paths.h>
2431#endif
2432 ],
2433 [ char *wtmpx = WTMPX_FILE; ],
2434 [ AC_MSG_RESULT(yes) ],
2435 [ AC_MSG_RESULT(no)
2436 system_wtmpx_path=no ]
2437)
2438if test -z "$conf_wtmpx_location"; then
2439 if test x"$system_wtmpx_path" = x"no" ; then
2440 AC_DEFINE(DISABLE_WTMPX)
2441 fi
2442else
2443 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2444fi
2445
Damien Miller4018c192000-04-30 09:30:44 +10002446
Damien Miller29ea30d2000-03-17 10:54:15 +11002447if test ! -z "$blibpath" ; then
2448 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2449 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2450fi
2451
Tim Rice4cec93f2002-02-26 08:40:48 -08002452dnl remove pam and dl because they are in $LIBPAM
2453if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002454 LIBS=`echo $LIBS | sed 's/-lpam //'`
2455fi
2456if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2457 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002458fi
2459
Damien Millerbac2d8a2000-09-05 16:13:06 +11002460AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002461AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2462AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002463
Damien Miller7b22d652000-06-18 14:07:04 +10002464# Print summary of options
2465
Damien Miller7b22d652000-06-18 14:07:04 +10002466# Someone please show me a better way :)
2467A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2468B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2469C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2470D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002471E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002472F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002473G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002474H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2475I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2476J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002477
2478echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002479echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002480echo " User binaries: $B"
2481echo " System binaries: $C"
2482echo " Configuration files: $D"
2483echo " Askpass program: $E"
2484echo " Manual pages: $F"
2485echo " PID file: $G"
2486echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002487if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002488echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002489else
Damien Millerf58c6722002-05-13 13:15:42 +10002490echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002491fi
Damien Millera18bbd32002-05-13 10:48:57 +10002492if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002493echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002494fi
Damien Millerf58c6722002-05-13 13:15:42 +10002495echo " Manpage format: $MANTYPE"
2496echo " PAM support: ${PAM_MSG}"
2497echo " KerberosIV support: $KRB4_MSG"
2498echo " KerberosV support: $KRB5_MSG"
2499echo " Smartcard support: $SCARD_MSG"
2500echo " AFS support: $AFS_MSG"
2501echo " S/KEY support: $SKEY_MSG"
2502echo " TCP Wrappers support: $TCPW_MSG"
2503echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002504echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002505echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2506echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2507echo " BSD Auth support: $BSD_AUTH_MSG"
2508echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002509if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002510echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002511fi
2512
Damien Miller7b22d652000-06-18 14:07:04 +10002513echo ""
2514
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002515echo " Host: ${host}"
2516echo " Compiler: ${CC}"
2517echo " Compiler flags: ${CFLAGS}"
2518echo "Preprocessor flags: ${CPPFLAGS}"
2519echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002520echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002521
2522echo ""
2523
Damien Miller82cf0ce2000-12-20 13:34:48 +11002524if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002525 echo "PAM is enabled. You may need to install a PAM control file "
2526 echo "for sshd, otherwise password authentication may fail. "
2527 echo "Example PAM control files can be found in the contrib/ "
2528 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002529 echo ""
2530fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002531
2532if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002533 echo "sftp-server will be disabled. Your compiler does not "
2534 echo "support 64bit integers."
2535 echo ""
2536fi
2537
2538if test ! -z "$RAND_HELPER_CMDHASH" ; then
2539 echo "WARNING: you are using the builtin random number collection "
2540 echo "service. Please read WARNING.RNG and request that your OS "
2541 echo "vendor includes kernel-based random number collection in "
2542 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002543 echo ""
2544fi
Damien Miller60396b02001-02-18 17:01:00 +11002545