blob: 8522d253d5f77e01b4692b2c97861b8d93249f5e [file] [log] [blame]
Damien Millere9cf3572001-02-09 12:55:35 +11001# $Id: configure.in,v 1.234 2001/02/09 01:55:36 djm Exp $
2
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10008
Damien Millera22ba012000-03-02 23:09:20 +11009# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110010AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100011AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110012AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000013AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110014AC_PATH_PROG(PERL, perl)
15AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100016AC_PATH_PROG(ENT, ent)
17AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110018AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110019AC_PATH_PROG(TEST_MINUS_S_SH, bash)
20AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
21AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110022
Damien Miller3f62aba2000-11-29 11:56:35 +110023if test -z "$AR" ; then
24 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
25fi
26
Damien Millerad833b32000-08-23 10:46:23 +100027# Use LOGIN_PROGRAM from environment if possible
28if test ! -z "$LOGIN_PROGRAM" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
30else
31 # Search for login
32 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
33 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
35 fi
36fi
37
Damien Miller166bd442000-03-16 10:48:25 +110038if test -z "$LD" ; then
39 LD=$CC
40fi
41AC_SUBST(LD)
42
43# C Compiler features
44AC_C_INLINE
45if test "$GCC" = "yes"; then
46 CFLAGS="$CFLAGS -Wall"
47fi
48
Damien Millera22ba012000-03-02 23:09:20 +110049# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110050case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110051*-*-aix*)
52 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000053 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110054 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100055 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110056 blibpath="/usr/lib:/lib:/usr/local/lib"
57 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100058 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110059 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000060 MANTYPE='$(CATMAN)'
61 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000062 dnl AIX handles lastlog as part of its login message
63 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100064 MANTYPE='$(CATMAN)'
65 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110066 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110067*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110068 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110070 AC_DEFINE(DISABLE_SHADOW)
71 AC_DEFINE(IPV4_DEFAULT)
72 AC_DEFINE(IP_TOS_IS_BROKEN)
73 AC_DEFINE(BROKEN_VHANGUP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110074 no_libsocket=1
75 no_libnsl=1
76 ;;
Damien Miller76112de1999-12-21 11:18:08 +110077*-*-hpux10*)
78 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100079 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110080 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000081 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110082 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100083 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110084 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110085 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000086 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110087 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110088 MANTYPE='$(CATMAN)'
89 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110090 ;;
Damien Miller1bead332000-04-30 00:47:29 +100091*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000092 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110093 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110094 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110095 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110096 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110097 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000098 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110099 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000100 MANTYPE='$(CATMAN)'
101 mansubdir=cat
102 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100103*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000104 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000105 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100106 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100107 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100108 no_libsocket=1
109 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000110 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100111 ;;
112*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000113 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000114 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100115 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100116 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000117 AC_DEFINE(WITH_IRIX_ARRAY)
118 AC_DEFINE(WITH_IRIX_PROJECT)
119 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000120 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100121 no_libsocket=1
122 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000123 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000124 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100125 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100126*-*-linux*)
127 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100128 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100129 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000130 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100131 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100132 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000133mips-sony-bsd|mips-sony-newsos4)
134 AC_DEFINE(HAVE_NEWS4)
135 SONY=1
136 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
137 AC_MSG_ERROR([*** libiberty missing - please install first ***])
138 )
139 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100140*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100141 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100142 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000143*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000144 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100145 conf_utmp_location=/etc/utmp
146 conf_wtmp_location=/usr/adm/wtmp
147 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000148 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000149 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000150 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000152 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000153 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100154*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100157 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100158 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000159 # hardwire lastlog location (can't detect it on some versions)
160 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000161 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
162 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
163 if test "$sol2ver" -ge 8; then
164 AC_MSG_RESULT(yes)
165 AC_DEFINE(DISABLE_UTMP)
166 AC_DEFINE(DISABLE_WTMP)
167 else
168 AC_MSG_RESULT(no)
169 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100170 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000171*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000172 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000173 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100174 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/var/adm/wtmp
177 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000178 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000179 MANTYPE='$(CATMAN)'
180 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000181 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000182*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000184 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
185 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100186 IPADDR_IN_DISPLAY=yes
187 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000188 AC_DEFINE(IP_TOS_IS_BROKEN)
189 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000190 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000191 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100192*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 MANTYPE='$(CATMAN)'
196 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100197 enable_suid_ssh=no
198 ;;
199*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100201 LDFLAGS="$LDFLAGS -L/usr/local/lib"
202 MANTYPE='$(CATMAN)'
203 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100204 enable_suid_ssh=no
205 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100206*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100208 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100209 MANTYPE='$(CATMAN)'
210 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100211 LIBS="$LIBS -lgen -lsocket"
212 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100213*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100214 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000215 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
217 MANTYPE='$(CATMAN)'
218 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000219 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100220 no_dev_ptmx=1
221 RANLIB=true
222 AC_DEFINE(BROKEN_SYS_TERMIO_H)
223 rsh_path="/usr/bin/rcmd"
224 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000225 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000226 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller78315eb2000-09-29 23:01:36 +1100227 ;;
228*-*-sco3.2v5*)
Ben Lindstrom49af82b2001-01-27 20:43:57 +0000229 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000230 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000231 LDFLAGS="$LDFLAGS -L/usr/local/lib"
232 MANTYPE='$(CATMAN)'
233 mansubdir=cat
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000234 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000235 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100236 rsh_path="/usr/bin/rcmd"
237 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000238 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000239 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millera66626b2000-06-13 18:57:53 +1000240 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000241*-dec-osf*)
242# This is untested
243 if test ! -z "USE_SIA" ; then
244 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
245 if test -f /etc/sia/matrix.conf; then
246 AC_MSG_RESULT(yes)
247 AC_DEFINE(HAVE_OSF_SIA)
248 AC_DEFINE(DISABLE_LOGIN)
249 LIBS="$LIBS -lsecurity -ldb -lm -laud"
250 else
251 AC_MSG_RESULT(no)
252 fi
253 fi
254 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100255esac
256
Damien Millere37bfc12000-06-05 09:37:43 +1000257# Allow user to specify flags
258AC_ARG_WITH(cflags,
259 [ --with-cflags Specify additional flags to pass to compiler],
260 [
261 if test "x$withval" != "xno" ; then
262 CFLAGS="$CFLAGS $withval"
263 fi
264 ]
265)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000266AC_ARG_WITH(cppflags,
267 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
268 [
269 if test "x$withval" != "xno"; then
270 CPPFLAGS="$CPPFLAGS $withval"
271 fi
272 ]
273)
Damien Millere37bfc12000-06-05 09:37:43 +1000274AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000275 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000276 [
277 if test "x$withval" != "xno" ; then
278 LDFLAGS="$LDFLAGS $withval"
279 fi
280 ]
281)
282AC_ARG_WITH(libs,
283 [ --with-libs Specify additional libraries to link with],
284 [
285 if test "x$withval" != "xno" ; then
286 LIBS="$LIBS $withval"
287 fi
288 ]
289)
290
291
Damien Millera22ba012000-03-02 23:09:20 +1100292# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000293if test -z "$no_libsocket" ; then
294 AC_CHECK_LIB(nsl, yp_match, , )
295fi
296if test -z "$no_libnsl" ; then
297 AC_CHECK_LIB(socket, main, , )
298fi
299
300AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Millerab18c411999-11-11 10:40:23 +1100301AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
302AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100303
304AC_CHECK_FUNC(regcomp,
Ben Lindstrom401d58f2001-01-19 17:11:43 +0000305 [ AC_DEFINE(HAVE_REGCOMP)],
Damien Miller6f9c3372000-10-25 10:06:04 +1100306 [
307 AC_CHECK_LIB(pcre, pcre_info,
308 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
309 ]
310)
Damien Millerab18c411999-11-11 10:40:23 +1100311
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000312dnl UnixWare 2.x
313AC_CHECK_FUNC(strcasecmp,
314 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
315)
316AC_CHECK_FUNC(utimes,
317 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
318)
Damien Millerab18c411999-11-11 10:40:23 +1100319
Damien Millera22ba012000-03-02 23:09:20 +1100320# Checks for header files.
Ben Lindstromcb577332001-01-22 21:06:19 +0000321AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Damien Millerab18c411999-11-11 10:40:23 +1100322
Damien Millerad833b32000-08-23 10:46:23 +1000323dnl Checks for library functions.
Ben Lindstromdd5c5a32001-02-02 18:58:33 +0000324AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000325dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000326AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000327dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000328AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000329AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000330dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000331AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000332AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000333dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000334AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000335AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100336
Damien Miller5fc85652000-07-09 23:53:07 +1000337AC_CHECK_FUNC(getuserattr,
338 [AC_DEFINE(HAVE_GETUSERATTR)],
339 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
340)
341
Damien Miller04f80141999-11-19 15:32:34 +1100342AC_CHECK_FUNC(login,
343 [AC_DEFINE(HAVE_LOGIN)],
344 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
345)
346
347AC_CHECK_FUNC(daemon,
348 [AC_DEFINE(HAVE_DAEMON)],
349 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
350)
351
Damien Miller9fb07e42000-03-05 16:22:59 +1100352AC_CHECK_FUNC(getpagesize,
353 [AC_DEFINE(HAVE_GETPAGESIZE)],
354 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
355)
356
Damien Millercb170cb2000-07-01 16:52:55 +1000357# Check for broken snprintf
358if test "x$ac_cv_func_snprintf" = "xyes" ; then
359 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
360 AC_TRY_RUN(
361 [
362#include <stdio.h>
363int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
364 ],
365 [AC_MSG_RESULT(yes)],
366 [
367 AC_MSG_RESULT(no)
368 AC_DEFINE(BROKEN_SNPRINTF)
369 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
370 ]
371 )
372fi
373
Damien Miller606f8802000-09-16 15:39:56 +1100374AC_FUNC_GETPGRP
375
Ben Lindstromec3830a2001-01-25 00:07:33 +0000376AC_FUNC_STRFTIME
377
Damien Millera64b57a2001-01-17 10:44:13 +1100378# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000379PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100380AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100381 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100382 [
Damien Millera64b57a2001-01-17 10:44:13 +1100383 if test "x$withval" != "xno" ; then
384 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
385 AC_MSG_ERROR([PAM headers not found])
386 fi
387
388 AC_CHECK_LIB(dl, dlopen, , )
389 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
390 AC_CHECK_FUNCS(pam_getenvlist)
391
392 disable_shadow=yes
393 PAM_MSG="yes"
394
395 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100396 fi
397 ]
398)
Damien Millera22ba012000-03-02 23:09:20 +1100399
Damien Millera64b57a2001-01-17 10:44:13 +1100400# Check for older PAM
401if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100402 # Check PAM strerror arguments (old PAM)
403 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
404 AC_TRY_COMPILE(
405 [
Damien Miller81171112000-04-23 11:14:01 +1000406#include <stdlib.h>
407#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100408 ],
409 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
410 [AC_MSG_RESULT(no)],
411 [
412 AC_DEFINE(HAVE_OLD_PAM)
413 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000414 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100415 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100416 )
Damien Millera22ba012000-03-02 23:09:20 +1100417fi
418
419# The big search for OpenSSL
420AC_ARG_WITH(ssl-dir,
421 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
422 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000423 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100424 tryssldir=$withval
425 fi
426 ]
427)
428
429saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100430saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000431saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100432if test "x$prefix" != "xNONE" ; then
433 tryssldir="$tryssldir $prefix"
434fi
Damien Miller61e50f12000-05-08 20:49:37 +1000435AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100436
Damien Millera1b61e12000-09-16 17:02:16 +1100437 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
Damien Millera64b57a2001-01-17 10:44:13 +1100438 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000439 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000440 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000441 if test ! -z "$need_dash_r" ; then
442 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
443 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100444 else
Damien Miller61e50f12000-05-08 20:49:37 +1000445 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100446 fi
447
Damien Miller3b512e12000-05-17 23:29:18 +1000448 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000449
Damien Miller3b512e12000-05-17 23:29:18 +1000450 # Basic test to check for compatible version and correct linking
451 # *does not* test for RSA - that comes later.
452 AC_TRY_RUN(
453 [
Damien Millere59ce622000-05-01 20:54:17 +1000454#include <string.h>
455#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000456int main(void)
457{
Damien Miller3b512e12000-05-17 23:29:18 +1000458 char a[2048];
459 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000460 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000461 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000462}
Damien Miller3b512e12000-05-17 23:29:18 +1000463 ],
464 [
465 found_crypto=1
466 break;
467 ], []
468 )
Damien Miller61e50f12000-05-08 20:49:37 +1000469
470 if test ! -z "$found_crypto" ; then
471 break;
472 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100473 done
474
Damien Miller61e50f12000-05-08 20:49:37 +1000475 if test -z "$found_crypto" ; then
476 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100477 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000478 if test -z "$ssldir" ; then
479 ssldir="(system)"
480 fi
Damien Millera22ba012000-03-02 23:09:20 +1100481
Damien Miller61e50f12000-05-08 20:49:37 +1000482 ac_cv_openssldir=$ssldir
483])
484
Damien Milleredb82922000-06-20 13:25:52 +1000485if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000486 AC_DEFINE(HAVE_OPENSSL)
487 dnl Need to recover ssldir - test above runs in subshell
488 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100489
490 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
491 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
492 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
493 if test ! -z "$need_dash_r" ; then
494 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
495 fi
496 if test ! -z "$blibpath" ; then
497 blibpath="$blibpath:$ssldir:$ssldir/lib"
498 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100499 fi
Damien Millera22ba012000-03-02 23:09:20 +1100500fi
Damien Miller3b512e12000-05-17 23:29:18 +1000501LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000502
Damien Miller3b512e12000-05-17 23:29:18 +1000503# Now test RSA support
504saved_LIBS="$LIBS"
505AC_MSG_CHECKING([for RSA support])
506for WANTS_RSAREF in "" 1 ; do
507 if test -z "$WANTS_RSAREF" ; then
508 LIBS="$saved_LIBS"
509 else
510 LIBS="$saved_LIBS -lRSAglue -lrsaref"
511 fi
512 AC_TRY_RUN([
513#include <string.h>
514#include <openssl/rand.h>
515#include <openssl/rsa.h>
516#include <openssl/bn.h>
517#include <openssl/sha.h>
518int main(void)
519{
520 int num; RSA *key; static unsigned char p_in[] = "blahblah";
521 unsigned char c[256], p[256];
522 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
523 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
524 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
525 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
526}
527 ],
528 [
529 rsa_works=1
530 break;
531 ], [])
532done
533
534if test ! -z "$no_rsa" ; then
535 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000536 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000537else
538 if test -z "$rsa_works" ; then
539 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000540 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000541 else
542 if test -z "$WANTS_RSAREF" ; then
543 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000544 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000545 else
Damien Miller7b22d652000-06-18 14:07:04 +1000546 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000547 AC_MSG_RESULT(using RSAref)
548 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
549 fi
550 fi
551fi
Damien Millera22ba012000-03-02 23:09:20 +1100552
Damien Millera64b57a2001-01-17 10:44:13 +1100553# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
554# version in OpenSSL. Skip this for PAM
555if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
556 AC_CHECK_LIB(crypt, crypt, , )
557fi
558
Ben Lindstromb5628642000-10-18 00:02:25 +0000559# Cheap hack to ensure NEWS-OS libraries are arranged right.
560if test ! -z "$SONY" ; then
561 LIBS="$LIBS -liberty";
562fi
563
Damien Millera22ba012000-03-02 23:09:20 +1100564# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100565AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100566AC_CHECK_SIZEOF(short int, 2)
567AC_CHECK_SIZEOF(int, 4)
568AC_CHECK_SIZEOF(long int, 4)
569AC_CHECK_SIZEOF(long long int, 8)
570
Damien Millera22ba012000-03-02 23:09:20 +1100571# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100572AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
573 AC_TRY_COMPILE(
574 [ #include <sys/types.h> ],
575 [ u_int a; a = 1;],
576 [ ac_cv_have_u_int="yes" ],
577 [ ac_cv_have_u_int="no" ]
578 )
579])
580if test "x$ac_cv_have_u_int" = "xyes" ; then
581 AC_DEFINE(HAVE_U_INT)
582 have_u_int=1
583fi
584
Damien Miller61e50f12000-05-08 20:49:37 +1000585AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
586 AC_TRY_COMPILE(
587 [ #include <sys/types.h> ],
588 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
589 [ ac_cv_have_intxx_t="yes" ],
590 [ ac_cv_have_intxx_t="no" ]
591 )
592])
593if test "x$ac_cv_have_intxx_t" = "xyes" ; then
594 AC_DEFINE(HAVE_INTXX_T)
595 have_intxx_t=1
596fi
597
Damien Miller578783e2000-09-23 14:12:24 +1100598AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
599 AC_TRY_COMPILE(
600 [ #include <sys/types.h> ],
601 [ int64_t a; a = 1;],
602 [ ac_cv_have_int64_t="yes" ],
603 [ ac_cv_have_int64_t="no" ]
604 )
605])
606if test "x$ac_cv_have_int64_t" = "xyes" ; then
607 AC_DEFINE(HAVE_INT64_T)
608 have_int64_t=1
609fi
610
Damien Miller61e50f12000-05-08 20:49:37 +1000611AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
612 AC_TRY_COMPILE(
613 [ #include <sys/types.h> ],
614 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
615 [ ac_cv_have_u_intxx_t="yes" ],
616 [ ac_cv_have_u_intxx_t="no" ]
617 )
618])
619if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
620 AC_DEFINE(HAVE_U_INTXX_T)
621 have_u_intxx_t=1
622fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100623
Damien Miller578783e2000-09-23 14:12:24 +1100624AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
625 AC_TRY_COMPILE(
626 [ #include <sys/types.h> ],
627 [ u_int64_t a; a = 1;],
628 [ ac_cv_have_u_int64_t="yes" ],
629 [ ac_cv_have_u_int64_t="no" ]
630 )
631])
632if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
633 AC_DEFINE(HAVE_U_INT64_T)
634 have_u_int64_t=1
635fi
636
Damien Milleredb82922000-06-20 13:25:52 +1000637if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
638 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100639then
640 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
641 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000642 [
643#include <sys/bitypes.h>
644 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100645 [
Damien Miller70494d12000-04-03 15:57:06 +1000646 int8_t a; int16_t b; int32_t c;
647 u_int8_t e; u_int16_t f; u_int32_t g;
648 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100649 ],
650 [
651 AC_DEFINE(HAVE_U_INTXX_T)
652 AC_DEFINE(HAVE_INTXX_T)
653 AC_MSG_RESULT(yes)
654 ],
655 [AC_MSG_RESULT(no)]
656 )
657fi
658
Damien Millerd6121d22000-03-17 23:26:46 +1100659if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000660 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
661 AC_TRY_COMPILE(
662 [
663#include <sys/types.h>
664 ],
665 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
666 [ ac_cv_have_uintxx_t="yes" ],
667 [ ac_cv_have_uintxx_t="no" ]
668 )
669 ])
670 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
671 AC_DEFINE(HAVE_UINTXX_T)
672 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100673fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100674
Damien Miller61e50f12000-05-08 20:49:37 +1000675AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
676 AC_TRY_COMPILE(
677 [
Damien Miller81171112000-04-23 11:14:01 +1000678#include <sys/types.h>
679#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000680 ],
681 [socklen_t foo; foo = 1235;],
682 [ ac_cv_have_socklen_t="yes" ],
683 [ ac_cv_have_socklen_t="no" ]
684 )
685])
686if test "x$ac_cv_have_socklen_t" = "xyes" ; then
687 AC_DEFINE(HAVE_SOCKLEN_T)
688fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100689
Damien Miller61e50f12000-05-08 20:49:37 +1000690AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
691 AC_TRY_COMPILE(
692 [
693#include <sys/types.h>
694 ],
695 [ size_t foo; foo = 1235; ],
696 [ ac_cv_have_size_t="yes" ],
697 [ ac_cv_have_size_t="no" ]
698 )
699])
700if test "x$ac_cv_have_size_t" = "xyes" ; then
701 AC_DEFINE(HAVE_SIZE_T)
702fi
Damien Miller95058511999-12-29 10:36:45 +1100703
Damien Miller615f9392000-05-17 22:53:33 +1000704AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
705 AC_TRY_COMPILE(
706 [
707#include <sys/types.h>
708 ],
709 [ ssize_t foo; foo = 1235; ],
710 [ ac_cv_have_ssize_t="yes" ],
711 [ ac_cv_have_ssize_t="no" ]
712 )
713])
714if test "x$ac_cv_have_ssize_t" = "xyes" ; then
715 AC_DEFINE(HAVE_SSIZE_T)
716fi
717
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000718AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
719 AC_TRY_COMPILE(
720 [
721#include <time.h>
722 ],
723 [ clock_t foo; foo = 1235; ],
724 [ ac_cv_have_clock_t="yes" ],
725 [ ac_cv_have_clock_t="no" ]
726 )
727])
728if test "x$ac_cv_have_clock_t" = "xyes" ; then
729 AC_DEFINE(HAVE_CLOCK_T)
730fi
731
Damien Millerb54b40e2000-06-23 08:23:34 +1000732AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
733 AC_TRY_COMPILE(
734 [
735#include <sys/types.h>
736#include <sys/socket.h>
737 ],
738 [ sa_family_t foo; foo = 1235; ],
739 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100740 [ AC_TRY_COMPILE(
741 [
742#include <sys/types.h>
743#include <sys/socket.h>
744#include <netinet/in.h>
745 ],
746 [ sa_family_t foo; foo = 1235; ],
747 [ ac_cv_have_sa_family_t="yes" ],
748
Damien Millerb54b40e2000-06-23 08:23:34 +1000749 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100750 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000751 )
752])
753if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
754 AC_DEFINE(HAVE_SA_FAMILY_T)
755fi
756
Damien Miller0f91b4e2000-06-18 15:43:25 +1000757AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
758 AC_TRY_COMPILE(
759 [
760#include <sys/types.h>
761 ],
762 [ pid_t foo; foo = 1235; ],
763 [ ac_cv_have_pid_t="yes" ],
764 [ ac_cv_have_pid_t="no" ]
765 )
766])
767if test "x$ac_cv_have_pid_t" = "xyes" ; then
768 AC_DEFINE(HAVE_PID_T)
769fi
770
771AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
772 AC_TRY_COMPILE(
773 [
774#include <sys/types.h>
775 ],
776 [ mode_t foo; foo = 1235; ],
777 [ ac_cv_have_mode_t="yes" ],
778 [ ac_cv_have_mode_t="no" ]
779 )
780])
781if test "x$ac_cv_have_mode_t" = "xyes" ; then
782 AC_DEFINE(HAVE_MODE_T)
783fi
784
Damien Miller61e50f12000-05-08 20:49:37 +1000785
786AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
787 AC_TRY_COMPILE(
788 [
Damien Miller81171112000-04-23 11:14:01 +1000789#include <sys/types.h>
790#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000791 ],
792 [ struct sockaddr_storage s; ],
793 [ ac_cv_have_struct_sockaddr_storage="yes" ],
794 [ ac_cv_have_struct_sockaddr_storage="no" ]
795 )
796])
797if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
798 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
799fi
Damien Miller34132e52000-01-14 15:45:46 +1100800
Damien Miller61e50f12000-05-08 20:49:37 +1000801AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
802 AC_TRY_COMPILE(
803 [
Damien Miller7b22d652000-06-18 14:07:04 +1000804#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000805#include <netinet/in.h>
806 ],
807 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
808 [ ac_cv_have_struct_sockaddr_in6="yes" ],
809 [ ac_cv_have_struct_sockaddr_in6="no" ]
810 )
811])
812if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
813 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
814fi
Damien Miller34132e52000-01-14 15:45:46 +1100815
Damien Miller61e50f12000-05-08 20:49:37 +1000816AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
817 AC_TRY_COMPILE(
818 [
Damien Miller7b22d652000-06-18 14:07:04 +1000819#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000820#include <netinet/in.h>
821 ],
822 [ struct in6_addr s; s.s6_addr[0] = 0; ],
823 [ ac_cv_have_struct_in6_addr="yes" ],
824 [ ac_cv_have_struct_in6_addr="no" ]
825 )
826])
827if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
828 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
829fi
Damien Miller34132e52000-01-14 15:45:46 +1100830
Damien Miller61e50f12000-05-08 20:49:37 +1000831AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
832 AC_TRY_COMPILE(
833 [
Damien Miller81171112000-04-23 11:14:01 +1000834#include <sys/types.h>
835#include <sys/socket.h>
836#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000837 ],
838 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
839 [ ac_cv_have_struct_addrinfo="yes" ],
840 [ ac_cv_have_struct_addrinfo="no" ]
841 )
842])
843if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
844 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
845fi
846
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000847AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
848 AC_TRY_COMPILE(
849 [ #include <sys/time.h> ],
850 [ struct timeval tv; tv.tv_sec = 1;],
851 [ ac_cv_have_struct_timeval="yes" ],
852 [ ac_cv_have_struct_timeval="no" ]
853 )
854])
855if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
856 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
857 have_struct_timeval=1
858fi
859
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000860# If we don't have int64_t then we can't compile sftp-server. So don't
861# even attempt to do it.
862if test "x$ac_cv_have_int64_t" = "xno" -a \
863 "x$ac_cv_sizeof_long_int" != "x8" -a \
864 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
865 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000866fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000867AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000868
Damien Miller78315eb2000-09-29 23:01:36 +1100869dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000870OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
871OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
872OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
873OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
874OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000875OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000876OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
877OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000878OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000879OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
880OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
881OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
882OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000883OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
884OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
885OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
886OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100887AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000888
Damien Miller942da032000-08-18 13:59:06 +1000889AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
890 ac_cv_have_sun_len_in_struct_sockaddr_un, [
891 AC_TRY_COMPILE(
892 [
893#include <sys/types.h>
894#include <sys/socket.h>
895 ],
896 [ struct sockaddr_un s; s.sun_len = 1; ],
897 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
898 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
899 )
900])
901if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
902 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
903fi
904
Damien Miller61e50f12000-05-08 20:49:37 +1000905AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
906 ac_cv_have_ss_family_in_struct_ss, [
907 AC_TRY_COMPILE(
908 [
Damien Miller81171112000-04-23 11:14:01 +1000909#include <sys/types.h>
910#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000911 ],
912 [ struct sockaddr_storage s; s.ss_family = 1; ],
913 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
914 [ ac_cv_have_ss_family_in_struct_ss="no" ],
915 )
916])
917if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
918 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
919fi
920
Damien Miller61e50f12000-05-08 20:49:37 +1000921AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
922 ac_cv_have___ss_family_in_struct_ss, [
923 AC_TRY_COMPILE(
924 [
Damien Miller81171112000-04-23 11:14:01 +1000925#include <sys/types.h>
926#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000927 ],
928 [ struct sockaddr_storage s; s.__ss_family = 1; ],
929 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
930 [ ac_cv_have___ss_family_in_struct_ss="no" ]
931 )
932])
933if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
934 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
935fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100936
Damien Millerad833b32000-08-23 10:46:23 +1000937AC_CACHE_CHECK([for pw_class field in struct passwd],
938 ac_cv_have_pw_class_in_struct_passwd, [
939 AC_TRY_COMPILE(
940 [
Damien Millerad833b32000-08-23 10:46:23 +1000941#include <pwd.h>
942 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000943 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000944 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
945 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
946 )
947])
948if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
949 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
950fi
951
Damien Miller61e50f12000-05-08 20:49:37 +1000952
953AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
954 AC_TRY_LINK([],
955 [ extern char *__progname; printf("%s", __progname); ],
956 [ ac_cv_libc_defines___progname="yes" ],
957 [ ac_cv_libc_defines___progname="no" ]
958 )
959])
960if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
961 AC_DEFINE(HAVE___PROGNAME)
962fi
963
Damien Millera22ba012000-03-02 23:09:20 +1100964
Damien Millerecbb26d2000-07-15 14:59:14 +1000965AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
966 AC_TRY_LINK([],
967 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
968 [ ac_cv_libc_defines_sys_errlist="yes" ],
969 [ ac_cv_libc_defines_sys_errlist="no" ]
970 )
971])
972if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
973 AC_DEFINE(HAVE_SYS_ERRLIST)
974fi
975
976
Damien Miller11fa2cc2000-08-16 10:35:58 +1000977AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
978 AC_TRY_LINK([],
979 [ extern int sys_nerr; printf("%i", sys_nerr);],
980 [ ac_cv_libc_defines_sys_nerr="yes" ],
981 [ ac_cv_libc_defines_sys_nerr="no" ]
982 )
983])
984if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
985 AC_DEFINE(HAVE_SYS_NERR)
986fi
987
988
Damien Millera22ba012000-03-02 23:09:20 +1100989# Looking for programs, paths and files
990AC_ARG_WITH(rsh,
991 [ --with-rsh=PATH Specify path to remote shell program ],
992 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100993 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000994 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100995 fi
996 ],
997 [
998 AC_PATH_PROG(rsh_path, rsh)
999 ]
1000)
1001
1002AC_ARG_WITH(xauth,
1003 [ --with-xauth=PATH Specify path to xauth program ],
1004 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001005 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001006 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001007 fi
1008 ],
1009 [
Damien Miller78315eb2000-09-29 23:01:36 +11001010 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
Damien Milleredb82922000-06-20 13:25:52 +10001011 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001012 xauth_path="/usr/openwin/bin/xauth"
1013 fi
1014 ]
1015)
1016
Damien Millera19cf472000-11-29 13:28:50 +11001017if test -z "$xauth_path" ; then
1018 XAUTH_PATH="undefined"
1019 AC_SUBST(XAUTH_PATH)
1020else
Damien Millera22ba012000-03-02 23:09:20 +11001021 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001022 XAUTH_PATH=$xauth_path
1023 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001024fi
1025if test ! -z "$rsh_path" ; then
1026 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1027fi
1028
1029# Check for mail directory (last resort if we cannot get it from headers)
1030if test ! -z "$MAIL" ; then
1031 maildir=`dirname $MAIL`
1032 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1033fi
1034
Damien Millera22ba012000-03-02 23:09:20 +11001035if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001036 AC_CHECK_FILE("/dev/ptmx",
1037 [
1038 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1039 have_dev_ptmx=1
1040 ]
1041 )
Damien Millera22ba012000-03-02 23:09:20 +11001042fi
Damien Miller204ad072000-03-02 23:56:12 +11001043AC_CHECK_FILE("/dev/ptc",
1044 [
1045 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1046 have_dev_ptc=1
1047 ]
1048)
1049
Damien Millera22ba012000-03-02 23:09:20 +11001050# Options from here on. Some of these are preset by platform above
1051
Damien Millera22ba012000-03-02 23:09:20 +11001052# Check for user-specified random device, otherwise check /dev/urandom
1053AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001054 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001055 [
Damien Miller040f3832000-04-03 14:50:43 +10001056 if test "x$withval" != "xno" ; then
1057 RANDOM_POOL="$withval";
1058 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1059 fi
Damien Millera22ba012000-03-02 23:09:20 +11001060 ],
1061 [
1062 # Check for random device
1063 AC_CHECK_FILE("/dev/urandom",
1064 [
1065 RANDOM_POOL="/dev/urandom";
1066 AC_SUBST(RANDOM_POOL)
1067 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1068 ]
1069 )
1070 ]
1071)
1072
1073# Check for EGD pool file
1074AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001075 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001076 [
Damien Miller040f3832000-04-03 14:50:43 +10001077 if test "x$withval" != "xno" ; then
1078 EGD_SOCKET="$withval";
1079 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1080 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001081 ],
1082 [
1083 # Check for existing socket only if we don't have a random device already
1084 if test -z "$RANDOM_POOL" ; then
1085 AC_MSG_CHECKING(for PRNGD/EGD socket)
1086 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001087 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1088 if $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001089 EGD_SOCKET="$egdsock"
1090 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001091 break;
1092 fi
1093 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001094 if test -x "$EGD_SOCKET" ; then
1095 AC_MSG_RESULT($EGD_SOCKET)
1096 else
1097 AC_MSG_RESULT(not found)
1098 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001099 fi
Damien Millera22ba012000-03-02 23:09:20 +11001100 ]
1101)
1102
Damien Miller0736c4d2001-01-25 10:51:46 +11001103
Damien Miller0437b332000-05-02 09:56:41 +10001104# detect pathnames for entropy gathering commands, if we need them
1105INSTALL_SSH_PRNG_CMDS=""
1106rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001107if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001108 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001109 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1110 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1111 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1112 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1113 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1114 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1115 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1116 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1117 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1118 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1119 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1120 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1121 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1122 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001123
1124 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001125fi
Damien Miller0437b332000-05-02 09:56:41 +10001126AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1127
Damien Miller11e37f62000-04-08 18:23:30 +10001128
Damien Miller670a4b82000-01-22 13:53:11 +11001129AC_ARG_WITH(catman,
1130 [ --with-catman=man|cat Install preformatted manpages[no]],
1131 [
1132 MANTYPE='$(CATMAN)'
1133 if test x"$withval" != x"yes" ; then
1134 mansubdir=$withval
1135 else
1136 mansubdir=cat
1137 fi
1138 ], [
1139 if test -z "$MANTYPE" ; then
1140 MANTYPE='$(TROFFMAN)'
1141 mansubdir=man
1142 fi
1143 ]
1144)
1145AC_SUBST(MANTYPE)
1146AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001147
Damien Millera22ba012000-03-02 23:09:20 +11001148# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001149KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001150AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001151 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001152 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001153 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001154
Ben Lindstrom23e13712000-10-29 22:49:19 +00001155 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001156 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001157 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001158 if test ! -z "$need_dash_r" ; then
1159 LDFLAGS="$LDFLAGS -R${withval}/lib"
1160 fi
1161 if test ! -z "$blibpath" ; then
1162 blibpath="$blibpath:${withval}/lib"
1163 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001164 else
1165 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001166 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001167 fi
1168 fi
1169
1170 AC_CHECK_HEADERS(krb.h)
1171 AC_CHECK_LIB(krb, main)
1172 if test "$ac_cv_header_krb_h" != yes; then
1173 AC_MSG_WARN([Cannot find krb.h, build may fail])
1174 fi
1175 if test "$ac_cv_lib_krb_main" != yes; then
1176 AC_MSG_WARN([Cannot find libkrb, build may fail])
1177 fi
1178
Damien Millerc85f9b42000-01-29 10:20:21 +11001179 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001180 AC_CHECK_LIB(resolv, dn_expand, , )
1181 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001182 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001183 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001184 fi
Damien Miller80297751999-11-19 13:03:25 +11001185 ]
1186)
1187
Damien Millera22ba012000-03-02 23:09:20 +11001188# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001189AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001190AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001191 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001192 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001193 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001194
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001195 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001196 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001197 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001198 fi
1199
1200 if test -z "$KRB4" ; then
1201 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1202 fi
1203
Damien Miller8bdeee21999-12-30 15:50:54 +11001204 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001205 if test ! -z "$AFS_LIBS" ; then
1206 LIBS="$LIBS $AFS_LIBS"
1207 fi
1208 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001209 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001210 fi
Damien Miller80297751999-11-19 13:03:25 +11001211 ]
1212)
Damien Millerc85f9b42000-01-29 10:20:21 +11001213LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001214
Damien Millera22ba012000-03-02 23:09:20 +11001215# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001216SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001217AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001218 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001219 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001220 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001221
1222 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001223 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001224 LDFLAGS="$LDFLAGS -L${withval}/lib"
1225 fi
1226
Damien Miller8bdeee21999-12-30 15:50:54 +11001227 AC_DEFINE(SKEY)
Ben Lindstromb0c2eeb2001-02-03 22:15:00 +00001228 LIBS="-lskey $LIBS"
Damien Miller7b22d652000-06-18 14:07:04 +10001229 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001230
1231 AC_CHECK_FUNC(skey_keyinfo,
1232 [],
1233 [
1234 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1235 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001236 fi
Damien Miller80297751999-11-19 13:03:25 +11001237 ]
1238)
1239
Damien Millera22ba012000-03-02 23:09:20 +11001240# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001241TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001242AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001243 [ --with-tcp-wrappers Enable tcpwrappers support],
1244 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001245 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001246 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001247 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001248 AC_MSG_CHECKING(for libwrap)
1249 AC_TRY_LINK(
1250 [
Damien Miller81171112000-04-23 11:14:01 +10001251#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001252 int deny_severity = 0, allow_severity = 0;
1253 ],
1254 [hosts_access(0);],
1255 [
1256 AC_MSG_RESULT(yes)
1257 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001258 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001259 ],
1260 [
Damien Miller7b22d652000-06-18 14:07:04 +10001261 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001262 ]
1263 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001264 fi
Damien Miller80297751999-11-19 13:03:25 +11001265 ]
1266)
1267
Damien Millera22ba012000-03-02 23:09:20 +11001268# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001269MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001270AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001271 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001272 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001273 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001274 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001275 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001276 fi
1277 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001278)
1279
Damien Millera22ba012000-03-02 23:09:20 +11001280# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001281AC_ARG_WITH(shadow,
1282 [ --without-shadow Disable shadow password support],
1283 [
1284 if test "x$withval" = "xno" ; then
1285 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001286 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001287 fi
1288 ]
1289)
1290
Damien Miller1f335fb2000-06-26 11:31:33 +10001291if test -z "$disable_shadow" ; then
1292 AC_MSG_CHECKING([if the systems has expire shadow information])
1293 AC_TRY_COMPILE(
1294 [
1295#include <sys/types.h>
1296#include <shadow.h>
1297 struct spwd sp;
1298 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1299 [ sp_expire_available=yes ], []
1300 )
1301
1302 if test "x$sp_expire_available" = "xyes" ; then
1303 AC_MSG_RESULT(yes)
1304 AC_DEFINE(HAS_SHADOW_EXPIRE)
1305 else
1306 AC_MSG_RESULT(no)
1307 fi
1308fi
1309
Damien Millera22ba012000-03-02 23:09:20 +11001310# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001311if test ! -z "$IPADDR_IN_DISPLAY" ; then
1312 DISPLAY_HACK_MSG="yes"
1313 AC_DEFINE(IPADDR_IN_DISPLAY)
1314else
1315 DISPLAY_HACK_MSG="no"
1316 AC_ARG_WITH(ipaddr-display,
1317 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1318 [
1319 if test "x$withval" != "xno" ; then
1320 AC_DEFINE(IPADDR_IN_DISPLAY)
1321 DISPLAY_HACK_MSG="yes"
1322 fi
1323 ]
1324 )
1325fi
Damien Miller76112de1999-12-21 11:18:08 +11001326
Damien Millera22ba012000-03-02 23:09:20 +11001327# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001328SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001329AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001330 [ --with-default-path=PATH Specify default \$PATH environment for server],
1331 [
1332 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001333 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001334 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001335 fi
1336 ]
1337)
1338
Damien Millera22ba012000-03-02 23:09:20 +11001339# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001340IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001341AC_ARG_WITH(ipv4-default,
1342 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1343 [
1344 if test "x$withval" != "xno" ; then
1345 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001346 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001347 fi
1348 ]
1349)
1350
Damien Miller61e50f12000-05-08 20:49:37 +10001351AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001352IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001353AC_ARG_WITH(4in6,
1354 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1355 [
1356 if test "x$withval" != "xno" ; then
1357 AC_MSG_RESULT(yes)
1358 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001359 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001360 else
1361 AC_MSG_RESULT(no)
1362 fi
1363 ],[
1364 if test "x$inet6_default_4in6" = "xyes"; then
1365 AC_MSG_RESULT([yes (default)])
1366 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001367 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001368 else
1369 AC_MSG_RESULT([no (default)])
1370 fi
1371 ]
1372)
1373
Damien Miller78315eb2000-09-29 23:01:36 +11001374AC_MSG_CHECKING(whether to install ssh as suid root)
1375AC_ARG_ENABLE(suid-ssh,
1376[ --enable-suid-ssh Install ssh as suid root (default)
1377 --disable-suid-ssh Install ssh without suid bit],
1378[ case "$enableval" in
1379 no)
1380 AC_MSG_RESULT(no)
1381 SSHMODE=0711
1382 ;;
1383 *) AC_MSG_RESULT(yes)
1384 SSHMODE=04711
1385 ;;
1386 esac ],
1387 AC_MSG_RESULT(yes)
1388 SSHMODE=04711
1389)
1390AC_SUBST(SSHMODE)
1391
1392
Damien Millera22ba012000-03-02 23:09:20 +11001393# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001394piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001395AC_ARG_WITH(pid-dir,
1396 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1397 [
1398 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001399 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001400 fi
1401 ]
1402)
Damien Miller4018c192000-04-30 09:30:44 +10001403
Damien Miller78315eb2000-09-29 23:01:36 +11001404# make sure the directory exists
1405if test ! -d $piddir ; then
1406 piddir=`eval echo ${sysconfdir}`
1407 case $piddir in
1408 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1409 esac
1410fi
1411
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001412AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001413AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001414
andre2ff7b5d2000-06-03 14:57:40 +00001415dnl allow user to disable some login recording features
1416AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001417 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001418 [ AC_DEFINE(DISABLE_LASTLOG) ]
1419)
1420AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001421 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001422 [ AC_DEFINE(DISABLE_UTMP) ]
1423)
1424AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001425 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001426 [ AC_DEFINE(DISABLE_UTMPX) ]
1427)
1428AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001429 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001430 [ AC_DEFINE(DISABLE_WTMP) ]
1431)
1432AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001433 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001434 [ AC_DEFINE(DISABLE_WTMPX) ]
1435)
1436AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001437 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001438 [ AC_DEFINE(DISABLE_LOGIN) ]
1439)
1440AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001441 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001442 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1443)
1444AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001445 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001446 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1447)
1448AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001449 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001450 [
1451 if test "x$withval" = "xno" ; then
1452 AC_DEFINE(DISABLE_LASTLOG)
1453 else
1454 conf_lastlog_location=$withval
1455 fi
1456 ]
1457)
andre2ff7b5d2000-06-03 14:57:40 +00001458
1459dnl lastlog, [uw]tmpx? detection
1460dnl NOTE: set the paths in the platform section to avoid the
1461dnl need for command-line parameters
1462dnl lastlog and [uw]tmp are subject to a file search if all else fails
1463
1464dnl lastlog detection
1465dnl NOTE: the code itself will detect if lastlog is a directory
1466AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1467AC_TRY_COMPILE([
1468#include <sys/types.h>
1469#include <utmp.h>
1470#ifdef HAVE_LASTLOG_H
1471# include <lastlog.h>
1472#endif
Damien Miller2994e082000-06-04 15:51:47 +10001473#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001474# include <paths.h>
1475#endif
1476 ],
1477 [ char *lastlog = LASTLOG_FILE; ],
1478 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001479 [
1480 AC_MSG_RESULT(no)
1481 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1482 AC_TRY_COMPILE([
1483#include <sys/types.h>
1484#include <utmp.h>
1485#ifdef HAVE_LASTLOG_H
1486# include <lastlog.h>
1487#endif
1488#ifdef HAVE_PATHS_H
1489# include <paths.h>
1490#endif
1491 ],
1492 [ char *lastlog = _PATH_LASTLOG; ],
1493 [ AC_MSG_RESULT(yes) ],
1494 [
andree441aa32000-06-12 22:34:38 +00001495 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001496 system_lastlog_path=no
1497 ])
1498 ]
andre2ff7b5d2000-06-03 14:57:40 +00001499)
Damien Miller2994e082000-06-04 15:51:47 +10001500
andre2ff7b5d2000-06-03 14:57:40 +00001501if test -z "$conf_lastlog_location"; then
1502 if test x"$system_lastlog_path" = x"no" ; then
1503 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001504 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001505 conf_lastlog_location=$f
1506 fi
1507 done
1508 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001509 AC_MSG_WARN([** Cannot find lastlog **])
1510 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001511 fi
1512 fi
1513fi
1514
1515if test -n "$conf_lastlog_location"; then
1516 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1517fi
1518
1519dnl utmp detection
1520AC_MSG_CHECKING([if your system defines UTMP_FILE])
1521AC_TRY_COMPILE([
1522#include <sys/types.h>
1523#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001524#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001525# include <paths.h>
1526#endif
1527 ],
1528 [ char *utmp = UTMP_FILE; ],
1529 [ AC_MSG_RESULT(yes) ],
1530 [ AC_MSG_RESULT(no)
1531 system_utmp_path=no ]
1532)
1533if test -z "$conf_utmp_location"; then
1534 if test x"$system_utmp_path" = x"no" ; then
1535 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1536 if test -f $f ; then
1537 conf_utmp_location=$f
1538 fi
1539 done
1540 if test -z "$conf_utmp_location"; then
1541 AC_DEFINE(DISABLE_UTMP)
1542 fi
1543 fi
1544fi
1545if test -n "$conf_utmp_location"; then
1546 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1547fi
1548
1549dnl wtmp detection
1550AC_MSG_CHECKING([if your system defines WTMP_FILE])
1551AC_TRY_COMPILE([
1552#include <sys/types.h>
1553#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001554#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001555# include <paths.h>
1556#endif
1557 ],
1558 [ char *wtmp = WTMP_FILE; ],
1559 [ AC_MSG_RESULT(yes) ],
1560 [ AC_MSG_RESULT(no)
1561 system_wtmp_path=no ]
1562)
1563if test -z "$conf_wtmp_location"; then
1564 if test x"$system_wtmp_path" = x"no" ; then
1565 for f in /usr/adm/wtmp /var/log/wtmp; do
1566 if test -f $f ; then
1567 conf_wtmp_location=$f
1568 fi
1569 done
1570 if test -z "$conf_wtmp_location"; then
1571 AC_DEFINE(DISABLE_WTMP)
1572 fi
1573 fi
1574fi
1575if test -n "$conf_wtmp_location"; then
1576 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1577fi
1578
1579
1580dnl utmpx detection - I don't know any system so perverse as to require
1581dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1582dnl there, though.
1583AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1584AC_TRY_COMPILE([
1585#include <sys/types.h>
1586#include <utmp.h>
1587#ifdef HAVE_UTMPX_H
1588#include <utmpx.h>
1589#endif
Damien Miller2994e082000-06-04 15:51:47 +10001590#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001591# include <paths.h>
1592#endif
1593 ],
1594 [ char *utmpx = UTMPX_FILE; ],
1595 [ AC_MSG_RESULT(yes) ],
1596 [ AC_MSG_RESULT(no)
1597 system_utmpx_path=no ]
1598)
1599if test -z "$conf_utmpx_location"; then
1600 if test x"$system_utmpx_path" = x"no" ; then
1601 AC_DEFINE(DISABLE_UTMPX)
1602 fi
1603else
1604 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1605fi
1606
1607dnl wtmpx detection
1608AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1609AC_TRY_COMPILE([
1610#include <sys/types.h>
1611#include <utmp.h>
1612#ifdef HAVE_UTMPX_H
1613#include <utmpx.h>
1614#endif
Damien Miller2994e082000-06-04 15:51:47 +10001615#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001616# include <paths.h>
1617#endif
1618 ],
1619 [ char *wtmpx = WTMPX_FILE; ],
1620 [ AC_MSG_RESULT(yes) ],
1621 [ AC_MSG_RESULT(no)
1622 system_wtmpx_path=no ]
1623)
1624if test -z "$conf_wtmpx_location"; then
1625 if test x"$system_wtmpx_path" = x"no" ; then
1626 AC_DEFINE(DISABLE_WTMPX)
1627 fi
1628else
1629 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1630fi
1631
Damien Miller4018c192000-04-30 09:30:44 +10001632
1633# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001634entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001635AC_ARG_WITH(entropy-timeout,
1636 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1637 [
1638 if test "x$withval" != "xno" ; then
1639 entropy_timeout=$withval
1640 fi
1641 ]
1642)
1643AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1644
1645
Damien Miller29ea30d2000-03-17 10:54:15 +11001646if test ! -z "$blibpath" ; then
1647 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1648 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1649fi
1650
Damien Millerbac2d8a2000-09-05 16:13:06 +11001651AC_EXEEXT
1652
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001653AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001654
Damien Miller7b22d652000-06-18 14:07:04 +10001655# Print summary of options
1656
1657if test x$MANTYPE = x'$(CATMAN)' ; then
1658 MAN_MSG=cat
1659else
1660 MAN_MSG=man
1661fi
1662if test ! -z "$RANDOM_POOL" ; then
1663 RAND_MSG="Device ($RANDOM_POOL)"
1664else
1665 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001666 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001667 else
1668 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001669 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001670 fi
1671fi
1672
1673# Someone please show me a better way :)
1674A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1675B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1676C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1677D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001678E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001679F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1680G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1681
1682echo ""
1683echo "OpenSSH configured has been configured with the following options."
1684echo " User binaries: $B"
1685echo " System binaries: $C"
1686echo " Configuration files: $D"
1687echo " Askpass program: $E"
1688echo " Manual pages: $F"
1689echo " PID file: $G"
1690echo " Random number collection: $RAND_MSG"
1691echo " Manpage format: $MAN_MSG"
1692echo " PAM support: ${PAM_MSG}"
1693echo " KerberosIV support: $KRB4_MSG"
1694echo " AFS support: $AFS_MSG"
1695echo " S/KEY support: $SKEY_MSG"
1696echo " TCP Wrappers support: $TCPW_MSG"
1697echo " MD5 password support: $MD5_MSG"
1698echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1699echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1700echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1701
1702echo ""
1703
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001704echo " Host: ${host}"
1705echo " Compiler: ${CC}"
1706echo " Compiler flags: ${CFLAGS}"
1707echo "Preprocessor flags: ${CPPFLAGS}"
1708echo " Linker flags: ${LDFLAGS}"
1709echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001710
1711echo ""
1712
Damien Miller82cf0ce2000-12-20 13:34:48 +11001713if test "x$PAM_MSG" = "xyes" ; then
1714 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1715 echo "otherwise password authentication may fail. Example PAM control files"
1716 echo "can be found in the contrib/ subdirectory"
1717 echo ""
1718fi
1719
Damien Miller6f9c3372000-10-25 10:06:04 +11001720if test ! -z "$BUILTIN_RNG" ; then
1721 echo "WARNING: you are using the builtin random number collection service."
1722 echo "Please read WARNING.RNG and request that your OS vendor includes"
1723 echo "/dev/random in future versions of their OS."
1724 echo ""
1725fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001726
1727if test ! -z "$NO_SFTP"; then
1728 echo "sftp-server will be disabled. Your compiler does not support"
1729 echo "64bit integers."
1730 echo ""
1731fi