blob: fcb822840efa778596b89922936b7bbb42b1ec97 [file] [log] [blame]
Ben Lindstrom603bdfd2001-02-12 07:29:45 +00001# $Id: configure.in,v 1.235 2001/02/12 07:29:45 mouring Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
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 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000182*-ncr-sysv*)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
184 LDFLAGS="$LDFLAGS -L/usr/local/lib"
185 MANTYPE='$(CATMAN)'
186 mansubdir=cat
187 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
188 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000189*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000191 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
192 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100193 IPADDR_IN_DISPLAY=yes
194 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000195 AC_DEFINE(IP_TOS_IS_BROKEN)
196 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000197 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000198 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100199*-*-sysv4.2*)
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 ;;
206*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100208 LDFLAGS="$LDFLAGS -L/usr/local/lib"
209 MANTYPE='$(CATMAN)'
210 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100211 enable_suid_ssh=no
212 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100213*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100216 MANTYPE='$(CATMAN)'
217 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100218 LIBS="$LIBS -lgen -lsocket"
219 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100220*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100221 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000222 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100223 LDFLAGS="$LDFLAGS -L/usr/local/lib"
224 MANTYPE='$(CATMAN)'
225 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000226 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100227 no_dev_ptmx=1
228 RANLIB=true
229 AC_DEFINE(BROKEN_SYS_TERMIO_H)
230 rsh_path="/usr/bin/rcmd"
231 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000232 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000233 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller78315eb2000-09-29 23:01:36 +1100234 ;;
235*-*-sco3.2v5*)
Ben Lindstrom49af82b2001-01-27 20:43:57 +0000236 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
239 MANTYPE='$(CATMAN)'
240 mansubdir=cat
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000241 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000242 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100243 rsh_path="/usr/bin/rcmd"
244 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000245 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000246 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millera66626b2000-06-13 18:57:53 +1000247 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000248*-dec-osf*)
249# This is untested
250 if test ! -z "USE_SIA" ; then
251 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
252 if test -f /etc/sia/matrix.conf; then
253 AC_MSG_RESULT(yes)
254 AC_DEFINE(HAVE_OSF_SIA)
255 AC_DEFINE(DISABLE_LOGIN)
256 LIBS="$LIBS -lsecurity -ldb -lm -laud"
257 else
258 AC_MSG_RESULT(no)
259 fi
260 fi
261 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100262esac
263
Damien Millere37bfc12000-06-05 09:37:43 +1000264# Allow user to specify flags
265AC_ARG_WITH(cflags,
266 [ --with-cflags Specify additional flags to pass to compiler],
267 [
268 if test "x$withval" != "xno" ; then
269 CFLAGS="$CFLAGS $withval"
270 fi
271 ]
272)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000273AC_ARG_WITH(cppflags,
274 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
275 [
276 if test "x$withval" != "xno"; then
277 CPPFLAGS="$CPPFLAGS $withval"
278 fi
279 ]
280)
Damien Millere37bfc12000-06-05 09:37:43 +1000281AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000282 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000283 [
284 if test "x$withval" != "xno" ; then
285 LDFLAGS="$LDFLAGS $withval"
286 fi
287 ]
288)
289AC_ARG_WITH(libs,
290 [ --with-libs Specify additional libraries to link with],
291 [
292 if test "x$withval" != "xno" ; then
293 LIBS="$LIBS $withval"
294 fi
295 ]
296)
297
298
Damien Millera22ba012000-03-02 23:09:20 +1100299# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000300if test -z "$no_libsocket" ; then
301 AC_CHECK_LIB(nsl, yp_match, , )
302fi
303if test -z "$no_libnsl" ; then
304 AC_CHECK_LIB(socket, main, , )
305fi
306
307AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Millerab18c411999-11-11 10:40:23 +1100308AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
309AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100310
311AC_CHECK_FUNC(regcomp,
Ben Lindstrom401d58f2001-01-19 17:11:43 +0000312 [ AC_DEFINE(HAVE_REGCOMP)],
Damien Miller6f9c3372000-10-25 10:06:04 +1100313 [
314 AC_CHECK_LIB(pcre, pcre_info,
315 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
316 ]
317)
Damien Millerab18c411999-11-11 10:40:23 +1100318
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000319dnl UnixWare 2.x
320AC_CHECK_FUNC(strcasecmp,
321 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
322)
323AC_CHECK_FUNC(utimes,
324 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
325)
Damien Millerab18c411999-11-11 10:40:23 +1100326
Damien Millera22ba012000-03-02 23:09:20 +1100327# Checks for header files.
Ben Lindstromcb577332001-01-22 21:06:19 +0000328AC_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 +1100329
Damien Millerad833b32000-08-23 10:46:23 +1000330dnl Checks for library functions.
Ben Lindstromdd5c5a32001-02-02 18:58:33 +0000331AC_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 +1000332dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000333AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000334dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000335AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000336AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000337dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000338AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000339AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000340dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000341AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000342AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100343
Damien Miller5fc85652000-07-09 23:53:07 +1000344AC_CHECK_FUNC(getuserattr,
345 [AC_DEFINE(HAVE_GETUSERATTR)],
346 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
347)
348
Damien Miller04f80141999-11-19 15:32:34 +1100349AC_CHECK_FUNC(login,
350 [AC_DEFINE(HAVE_LOGIN)],
351 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
352)
353
354AC_CHECK_FUNC(daemon,
355 [AC_DEFINE(HAVE_DAEMON)],
356 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
357)
358
Damien Miller9fb07e42000-03-05 16:22:59 +1100359AC_CHECK_FUNC(getpagesize,
360 [AC_DEFINE(HAVE_GETPAGESIZE)],
361 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
362)
363
Damien Millercb170cb2000-07-01 16:52:55 +1000364# Check for broken snprintf
365if test "x$ac_cv_func_snprintf" = "xyes" ; then
366 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
367 AC_TRY_RUN(
368 [
369#include <stdio.h>
370int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
371 ],
372 [AC_MSG_RESULT(yes)],
373 [
374 AC_MSG_RESULT(no)
375 AC_DEFINE(BROKEN_SNPRINTF)
376 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
377 ]
378 )
379fi
380
Damien Miller606f8802000-09-16 15:39:56 +1100381AC_FUNC_GETPGRP
382
Ben Lindstromec3830a2001-01-25 00:07:33 +0000383AC_FUNC_STRFTIME
384
Damien Millera64b57a2001-01-17 10:44:13 +1100385# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000386PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100387AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100388 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100389 [
Damien Millera64b57a2001-01-17 10:44:13 +1100390 if test "x$withval" != "xno" ; then
391 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
392 AC_MSG_ERROR([PAM headers not found])
393 fi
394
395 AC_CHECK_LIB(dl, dlopen, , )
396 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
397 AC_CHECK_FUNCS(pam_getenvlist)
398
399 disable_shadow=yes
400 PAM_MSG="yes"
401
402 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100403 fi
404 ]
405)
Damien Millera22ba012000-03-02 23:09:20 +1100406
Damien Millera64b57a2001-01-17 10:44:13 +1100407# Check for older PAM
408if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100409 # Check PAM strerror arguments (old PAM)
410 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
411 AC_TRY_COMPILE(
412 [
Damien Miller81171112000-04-23 11:14:01 +1000413#include <stdlib.h>
414#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100415 ],
416 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
417 [AC_MSG_RESULT(no)],
418 [
419 AC_DEFINE(HAVE_OLD_PAM)
420 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000421 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100422 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100423 )
Damien Millera22ba012000-03-02 23:09:20 +1100424fi
425
426# The big search for OpenSSL
427AC_ARG_WITH(ssl-dir,
428 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
429 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000430 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100431 tryssldir=$withval
432 fi
433 ]
434)
435
436saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100437saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000438saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100439if test "x$prefix" != "xNONE" ; then
440 tryssldir="$tryssldir $prefix"
441fi
Damien Miller61e50f12000-05-08 20:49:37 +1000442AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100443
Damien Millera1b61e12000-09-16 17:02:16 +1100444 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 +1100445 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000446 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000447 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000448 if test ! -z "$need_dash_r" ; then
449 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
450 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100451 else
Damien Miller61e50f12000-05-08 20:49:37 +1000452 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100453 fi
454
Damien Miller3b512e12000-05-17 23:29:18 +1000455 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000456
Damien Miller3b512e12000-05-17 23:29:18 +1000457 # Basic test to check for compatible version and correct linking
458 # *does not* test for RSA - that comes later.
459 AC_TRY_RUN(
460 [
Damien Millere59ce622000-05-01 20:54:17 +1000461#include <string.h>
462#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000463int main(void)
464{
Damien Miller3b512e12000-05-17 23:29:18 +1000465 char a[2048];
466 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000467 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000468 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000469}
Damien Miller3b512e12000-05-17 23:29:18 +1000470 ],
471 [
472 found_crypto=1
473 break;
474 ], []
475 )
Damien Miller61e50f12000-05-08 20:49:37 +1000476
477 if test ! -z "$found_crypto" ; then
478 break;
479 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100480 done
481
Damien Miller61e50f12000-05-08 20:49:37 +1000482 if test -z "$found_crypto" ; then
483 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100484 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000485 if test -z "$ssldir" ; then
486 ssldir="(system)"
487 fi
Damien Millera22ba012000-03-02 23:09:20 +1100488
Damien Miller61e50f12000-05-08 20:49:37 +1000489 ac_cv_openssldir=$ssldir
490])
491
Damien Milleredb82922000-06-20 13:25:52 +1000492if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000493 AC_DEFINE(HAVE_OPENSSL)
494 dnl Need to recover ssldir - test above runs in subshell
495 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100496
497 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
498 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
499 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
500 if test ! -z "$need_dash_r" ; then
501 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
502 fi
503 if test ! -z "$blibpath" ; then
504 blibpath="$blibpath:$ssldir:$ssldir/lib"
505 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100506 fi
Damien Millera22ba012000-03-02 23:09:20 +1100507fi
Damien Miller3b512e12000-05-17 23:29:18 +1000508LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000509
Damien Miller3b512e12000-05-17 23:29:18 +1000510# Now test RSA support
511saved_LIBS="$LIBS"
512AC_MSG_CHECKING([for RSA support])
513for WANTS_RSAREF in "" 1 ; do
514 if test -z "$WANTS_RSAREF" ; then
515 LIBS="$saved_LIBS"
516 else
517 LIBS="$saved_LIBS -lRSAglue -lrsaref"
518 fi
519 AC_TRY_RUN([
520#include <string.h>
521#include <openssl/rand.h>
522#include <openssl/rsa.h>
523#include <openssl/bn.h>
524#include <openssl/sha.h>
525int main(void)
526{
527 int num; RSA *key; static unsigned char p_in[] = "blahblah";
528 unsigned char c[256], p[256];
529 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
530 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
531 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
532 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
533}
534 ],
535 [
536 rsa_works=1
537 break;
538 ], [])
539done
540
541if test ! -z "$no_rsa" ; then
542 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000543 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000544else
545 if test -z "$rsa_works" ; then
546 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000547 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000548 else
549 if test -z "$WANTS_RSAREF" ; then
550 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000551 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000552 else
Damien Miller7b22d652000-06-18 14:07:04 +1000553 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000554 AC_MSG_RESULT(using RSAref)
555 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
556 fi
557 fi
558fi
Damien Millera22ba012000-03-02 23:09:20 +1100559
Damien Millera64b57a2001-01-17 10:44:13 +1100560# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
561# version in OpenSSL. Skip this for PAM
562if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
563 AC_CHECK_LIB(crypt, crypt, , )
564fi
565
Ben Lindstromb5628642000-10-18 00:02:25 +0000566# Cheap hack to ensure NEWS-OS libraries are arranged right.
567if test ! -z "$SONY" ; then
568 LIBS="$LIBS -liberty";
569fi
570
Damien Millera22ba012000-03-02 23:09:20 +1100571# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100572AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100573AC_CHECK_SIZEOF(short int, 2)
574AC_CHECK_SIZEOF(int, 4)
575AC_CHECK_SIZEOF(long int, 4)
576AC_CHECK_SIZEOF(long long int, 8)
577
Damien Millera22ba012000-03-02 23:09:20 +1100578# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100579AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
580 AC_TRY_COMPILE(
581 [ #include <sys/types.h> ],
582 [ u_int a; a = 1;],
583 [ ac_cv_have_u_int="yes" ],
584 [ ac_cv_have_u_int="no" ]
585 )
586])
587if test "x$ac_cv_have_u_int" = "xyes" ; then
588 AC_DEFINE(HAVE_U_INT)
589 have_u_int=1
590fi
591
Damien Miller61e50f12000-05-08 20:49:37 +1000592AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
593 AC_TRY_COMPILE(
594 [ #include <sys/types.h> ],
595 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
596 [ ac_cv_have_intxx_t="yes" ],
597 [ ac_cv_have_intxx_t="no" ]
598 )
599])
600if test "x$ac_cv_have_intxx_t" = "xyes" ; then
601 AC_DEFINE(HAVE_INTXX_T)
602 have_intxx_t=1
603fi
604
Damien Miller578783e2000-09-23 14:12:24 +1100605AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
606 AC_TRY_COMPILE(
607 [ #include <sys/types.h> ],
608 [ int64_t a; a = 1;],
609 [ ac_cv_have_int64_t="yes" ],
610 [ ac_cv_have_int64_t="no" ]
611 )
612])
613if test "x$ac_cv_have_int64_t" = "xyes" ; then
614 AC_DEFINE(HAVE_INT64_T)
615 have_int64_t=1
616fi
617
Damien Miller61e50f12000-05-08 20:49:37 +1000618AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
619 AC_TRY_COMPILE(
620 [ #include <sys/types.h> ],
621 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
622 [ ac_cv_have_u_intxx_t="yes" ],
623 [ ac_cv_have_u_intxx_t="no" ]
624 )
625])
626if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
627 AC_DEFINE(HAVE_U_INTXX_T)
628 have_u_intxx_t=1
629fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100630
Damien Miller578783e2000-09-23 14:12:24 +1100631AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
632 AC_TRY_COMPILE(
633 [ #include <sys/types.h> ],
634 [ u_int64_t a; a = 1;],
635 [ ac_cv_have_u_int64_t="yes" ],
636 [ ac_cv_have_u_int64_t="no" ]
637 )
638])
639if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
640 AC_DEFINE(HAVE_U_INT64_T)
641 have_u_int64_t=1
642fi
643
Damien Milleredb82922000-06-20 13:25:52 +1000644if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
645 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100646then
647 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
648 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000649 [
650#include <sys/bitypes.h>
651 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100652 [
Damien Miller70494d12000-04-03 15:57:06 +1000653 int8_t a; int16_t b; int32_t c;
654 u_int8_t e; u_int16_t f; u_int32_t g;
655 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100656 ],
657 [
658 AC_DEFINE(HAVE_U_INTXX_T)
659 AC_DEFINE(HAVE_INTXX_T)
660 AC_MSG_RESULT(yes)
661 ],
662 [AC_MSG_RESULT(no)]
663 )
664fi
665
Damien Millerd6121d22000-03-17 23:26:46 +1100666if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000667 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
668 AC_TRY_COMPILE(
669 [
670#include <sys/types.h>
671 ],
672 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
673 [ ac_cv_have_uintxx_t="yes" ],
674 [ ac_cv_have_uintxx_t="no" ]
675 )
676 ])
677 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
678 AC_DEFINE(HAVE_UINTXX_T)
679 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100680fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100681
Damien Miller61e50f12000-05-08 20:49:37 +1000682AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
683 AC_TRY_COMPILE(
684 [
Damien Miller81171112000-04-23 11:14:01 +1000685#include <sys/types.h>
686#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000687 ],
688 [socklen_t foo; foo = 1235;],
689 [ ac_cv_have_socklen_t="yes" ],
690 [ ac_cv_have_socklen_t="no" ]
691 )
692])
693if test "x$ac_cv_have_socklen_t" = "xyes" ; then
694 AC_DEFINE(HAVE_SOCKLEN_T)
695fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100696
Damien Miller61e50f12000-05-08 20:49:37 +1000697AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
698 AC_TRY_COMPILE(
699 [
700#include <sys/types.h>
701 ],
702 [ size_t foo; foo = 1235; ],
703 [ ac_cv_have_size_t="yes" ],
704 [ ac_cv_have_size_t="no" ]
705 )
706])
707if test "x$ac_cv_have_size_t" = "xyes" ; then
708 AC_DEFINE(HAVE_SIZE_T)
709fi
Damien Miller95058511999-12-29 10:36:45 +1100710
Damien Miller615f9392000-05-17 22:53:33 +1000711AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
712 AC_TRY_COMPILE(
713 [
714#include <sys/types.h>
715 ],
716 [ ssize_t foo; foo = 1235; ],
717 [ ac_cv_have_ssize_t="yes" ],
718 [ ac_cv_have_ssize_t="no" ]
719 )
720])
721if test "x$ac_cv_have_ssize_t" = "xyes" ; then
722 AC_DEFINE(HAVE_SSIZE_T)
723fi
724
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000725AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
726 AC_TRY_COMPILE(
727 [
728#include <time.h>
729 ],
730 [ clock_t foo; foo = 1235; ],
731 [ ac_cv_have_clock_t="yes" ],
732 [ ac_cv_have_clock_t="no" ]
733 )
734])
735if test "x$ac_cv_have_clock_t" = "xyes" ; then
736 AC_DEFINE(HAVE_CLOCK_T)
737fi
738
Damien Millerb54b40e2000-06-23 08:23:34 +1000739AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
740 AC_TRY_COMPILE(
741 [
742#include <sys/types.h>
743#include <sys/socket.h>
744 ],
745 [ sa_family_t foo; foo = 1235; ],
746 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100747 [ AC_TRY_COMPILE(
748 [
749#include <sys/types.h>
750#include <sys/socket.h>
751#include <netinet/in.h>
752 ],
753 [ sa_family_t foo; foo = 1235; ],
754 [ ac_cv_have_sa_family_t="yes" ],
755
Damien Millerb54b40e2000-06-23 08:23:34 +1000756 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100757 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000758 )
759])
760if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
761 AC_DEFINE(HAVE_SA_FAMILY_T)
762fi
763
Damien Miller0f91b4e2000-06-18 15:43:25 +1000764AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
765 AC_TRY_COMPILE(
766 [
767#include <sys/types.h>
768 ],
769 [ pid_t foo; foo = 1235; ],
770 [ ac_cv_have_pid_t="yes" ],
771 [ ac_cv_have_pid_t="no" ]
772 )
773])
774if test "x$ac_cv_have_pid_t" = "xyes" ; then
775 AC_DEFINE(HAVE_PID_T)
776fi
777
778AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
779 AC_TRY_COMPILE(
780 [
781#include <sys/types.h>
782 ],
783 [ mode_t foo; foo = 1235; ],
784 [ ac_cv_have_mode_t="yes" ],
785 [ ac_cv_have_mode_t="no" ]
786 )
787])
788if test "x$ac_cv_have_mode_t" = "xyes" ; then
789 AC_DEFINE(HAVE_MODE_T)
790fi
791
Damien Miller61e50f12000-05-08 20:49:37 +1000792
793AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
794 AC_TRY_COMPILE(
795 [
Damien Miller81171112000-04-23 11:14:01 +1000796#include <sys/types.h>
797#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000798 ],
799 [ struct sockaddr_storage s; ],
800 [ ac_cv_have_struct_sockaddr_storage="yes" ],
801 [ ac_cv_have_struct_sockaddr_storage="no" ]
802 )
803])
804if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
805 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
806fi
Damien Miller34132e52000-01-14 15:45:46 +1100807
Damien Miller61e50f12000-05-08 20:49:37 +1000808AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
809 AC_TRY_COMPILE(
810 [
Damien Miller7b22d652000-06-18 14:07:04 +1000811#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000812#include <netinet/in.h>
813 ],
814 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
815 [ ac_cv_have_struct_sockaddr_in6="yes" ],
816 [ ac_cv_have_struct_sockaddr_in6="no" ]
817 )
818])
819if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
820 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
821fi
Damien Miller34132e52000-01-14 15:45:46 +1100822
Damien Miller61e50f12000-05-08 20:49:37 +1000823AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
824 AC_TRY_COMPILE(
825 [
Damien Miller7b22d652000-06-18 14:07:04 +1000826#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000827#include <netinet/in.h>
828 ],
829 [ struct in6_addr s; s.s6_addr[0] = 0; ],
830 [ ac_cv_have_struct_in6_addr="yes" ],
831 [ ac_cv_have_struct_in6_addr="no" ]
832 )
833])
834if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
835 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
836fi
Damien Miller34132e52000-01-14 15:45:46 +1100837
Damien Miller61e50f12000-05-08 20:49:37 +1000838AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
839 AC_TRY_COMPILE(
840 [
Damien Miller81171112000-04-23 11:14:01 +1000841#include <sys/types.h>
842#include <sys/socket.h>
843#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000844 ],
845 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
846 [ ac_cv_have_struct_addrinfo="yes" ],
847 [ ac_cv_have_struct_addrinfo="no" ]
848 )
849])
850if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
851 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
852fi
853
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000854AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
855 AC_TRY_COMPILE(
856 [ #include <sys/time.h> ],
857 [ struct timeval tv; tv.tv_sec = 1;],
858 [ ac_cv_have_struct_timeval="yes" ],
859 [ ac_cv_have_struct_timeval="no" ]
860 )
861])
862if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
863 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
864 have_struct_timeval=1
865fi
866
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000867# If we don't have int64_t then we can't compile sftp-server. So don't
868# even attempt to do it.
869if test "x$ac_cv_have_int64_t" = "xno" -a \
870 "x$ac_cv_sizeof_long_int" != "x8" -a \
871 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
872 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000873fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000874AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000875
Damien Miller78315eb2000-09-29 23:01:36 +1100876dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000877OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
878OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
879OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
880OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
881OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000882OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000883OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
884OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000885OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000886OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
887OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
888OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
889OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000890OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
891OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
892OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
893OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100894AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000895
Damien Miller942da032000-08-18 13:59:06 +1000896AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
897 ac_cv_have_sun_len_in_struct_sockaddr_un, [
898 AC_TRY_COMPILE(
899 [
900#include <sys/types.h>
901#include <sys/socket.h>
902 ],
903 [ struct sockaddr_un s; s.sun_len = 1; ],
904 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
905 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
906 )
907])
908if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
909 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
910fi
911
Damien Miller61e50f12000-05-08 20:49:37 +1000912AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
913 ac_cv_have_ss_family_in_struct_ss, [
914 AC_TRY_COMPILE(
915 [
Damien Miller81171112000-04-23 11:14:01 +1000916#include <sys/types.h>
917#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000918 ],
919 [ struct sockaddr_storage s; s.ss_family = 1; ],
920 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
921 [ ac_cv_have_ss_family_in_struct_ss="no" ],
922 )
923])
924if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
925 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
926fi
927
Damien Miller61e50f12000-05-08 20:49:37 +1000928AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
929 ac_cv_have___ss_family_in_struct_ss, [
930 AC_TRY_COMPILE(
931 [
Damien Miller81171112000-04-23 11:14:01 +1000932#include <sys/types.h>
933#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000934 ],
935 [ struct sockaddr_storage s; s.__ss_family = 1; ],
936 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
937 [ ac_cv_have___ss_family_in_struct_ss="no" ]
938 )
939])
940if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
941 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
942fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100943
Damien Millerad833b32000-08-23 10:46:23 +1000944AC_CACHE_CHECK([for pw_class field in struct passwd],
945 ac_cv_have_pw_class_in_struct_passwd, [
946 AC_TRY_COMPILE(
947 [
Damien Millerad833b32000-08-23 10:46:23 +1000948#include <pwd.h>
949 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000950 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000951 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
952 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
953 )
954])
955if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
956 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
957fi
958
Damien Miller61e50f12000-05-08 20:49:37 +1000959
960AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
961 AC_TRY_LINK([],
962 [ extern char *__progname; printf("%s", __progname); ],
963 [ ac_cv_libc_defines___progname="yes" ],
964 [ ac_cv_libc_defines___progname="no" ]
965 )
966])
967if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
968 AC_DEFINE(HAVE___PROGNAME)
969fi
970
Damien Millera22ba012000-03-02 23:09:20 +1100971
Damien Millerecbb26d2000-07-15 14:59:14 +1000972AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
973 AC_TRY_LINK([],
974 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
975 [ ac_cv_libc_defines_sys_errlist="yes" ],
976 [ ac_cv_libc_defines_sys_errlist="no" ]
977 )
978])
979if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
980 AC_DEFINE(HAVE_SYS_ERRLIST)
981fi
982
983
Damien Miller11fa2cc2000-08-16 10:35:58 +1000984AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
985 AC_TRY_LINK([],
986 [ extern int sys_nerr; printf("%i", sys_nerr);],
987 [ ac_cv_libc_defines_sys_nerr="yes" ],
988 [ ac_cv_libc_defines_sys_nerr="no" ]
989 )
990])
991if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
992 AC_DEFINE(HAVE_SYS_NERR)
993fi
994
995
Damien Millera22ba012000-03-02 23:09:20 +1100996# Looking for programs, paths and files
997AC_ARG_WITH(rsh,
998 [ --with-rsh=PATH Specify path to remote shell program ],
999 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001000 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001001 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001002 fi
1003 ],
1004 [
1005 AC_PATH_PROG(rsh_path, rsh)
1006 ]
1007)
1008
1009AC_ARG_WITH(xauth,
1010 [ --with-xauth=PATH Specify path to xauth program ],
1011 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001012 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001013 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001014 fi
1015 ],
1016 [
Damien Miller78315eb2000-09-29 23:01:36 +11001017 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 +10001018 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001019 xauth_path="/usr/openwin/bin/xauth"
1020 fi
1021 ]
1022)
1023
Damien Millera19cf472000-11-29 13:28:50 +11001024if test -z "$xauth_path" ; then
1025 XAUTH_PATH="undefined"
1026 AC_SUBST(XAUTH_PATH)
1027else
Damien Millera22ba012000-03-02 23:09:20 +11001028 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001029 XAUTH_PATH=$xauth_path
1030 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001031fi
1032if test ! -z "$rsh_path" ; then
1033 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1034fi
1035
1036# Check for mail directory (last resort if we cannot get it from headers)
1037if test ! -z "$MAIL" ; then
1038 maildir=`dirname $MAIL`
1039 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1040fi
1041
Damien Millera22ba012000-03-02 23:09:20 +11001042if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001043 AC_CHECK_FILE("/dev/ptmx",
1044 [
1045 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1046 have_dev_ptmx=1
1047 ]
1048 )
Damien Millera22ba012000-03-02 23:09:20 +11001049fi
Damien Miller204ad072000-03-02 23:56:12 +11001050AC_CHECK_FILE("/dev/ptc",
1051 [
1052 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1053 have_dev_ptc=1
1054 ]
1055)
1056
Damien Millera22ba012000-03-02 23:09:20 +11001057# Options from here on. Some of these are preset by platform above
1058
Damien Millera22ba012000-03-02 23:09:20 +11001059# Check for user-specified random device, otherwise check /dev/urandom
1060AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001061 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001062 [
Damien Miller040f3832000-04-03 14:50:43 +10001063 if test "x$withval" != "xno" ; then
1064 RANDOM_POOL="$withval";
1065 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1066 fi
Damien Millera22ba012000-03-02 23:09:20 +11001067 ],
1068 [
1069 # Check for random device
1070 AC_CHECK_FILE("/dev/urandom",
1071 [
1072 RANDOM_POOL="/dev/urandom";
1073 AC_SUBST(RANDOM_POOL)
1074 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1075 ]
1076 )
1077 ]
1078)
1079
1080# Check for EGD pool file
1081AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001082 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001083 [
Damien Miller040f3832000-04-03 14:50:43 +10001084 if test "x$withval" != "xno" ; then
1085 EGD_SOCKET="$withval";
1086 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1087 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001088 ],
1089 [
1090 # Check for existing socket only if we don't have a random device already
1091 if test -z "$RANDOM_POOL" ; then
1092 AC_MSG_CHECKING(for PRNGD/EGD socket)
1093 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001094 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1095 if $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001096 EGD_SOCKET="$egdsock"
1097 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001098 break;
1099 fi
1100 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001101 if test -x "$EGD_SOCKET" ; then
1102 AC_MSG_RESULT($EGD_SOCKET)
1103 else
1104 AC_MSG_RESULT(not found)
1105 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001106 fi
Damien Millera22ba012000-03-02 23:09:20 +11001107 ]
1108)
1109
Damien Miller0736c4d2001-01-25 10:51:46 +11001110
Damien Miller0437b332000-05-02 09:56:41 +10001111# detect pathnames for entropy gathering commands, if we need them
1112INSTALL_SSH_PRNG_CMDS=""
1113rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001114if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001115 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001116 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1117 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1118 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1119 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1120 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1121 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1122 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1123 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1124 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1125 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1126 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1127 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1128 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1129 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001130
1131 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001132fi
Damien Miller0437b332000-05-02 09:56:41 +10001133AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1134
Damien Miller11e37f62000-04-08 18:23:30 +10001135
Damien Miller670a4b82000-01-22 13:53:11 +11001136AC_ARG_WITH(catman,
1137 [ --with-catman=man|cat Install preformatted manpages[no]],
1138 [
1139 MANTYPE='$(CATMAN)'
1140 if test x"$withval" != x"yes" ; then
1141 mansubdir=$withval
1142 else
1143 mansubdir=cat
1144 fi
1145 ], [
1146 if test -z "$MANTYPE" ; then
1147 MANTYPE='$(TROFFMAN)'
1148 mansubdir=man
1149 fi
1150 ]
1151)
1152AC_SUBST(MANTYPE)
1153AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001154
Damien Millera22ba012000-03-02 23:09:20 +11001155# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001156KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001157AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001158 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001159 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001160 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001161
Ben Lindstrom23e13712000-10-29 22:49:19 +00001162 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001163 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001164 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001165 if test ! -z "$need_dash_r" ; then
1166 LDFLAGS="$LDFLAGS -R${withval}/lib"
1167 fi
1168 if test ! -z "$blibpath" ; then
1169 blibpath="$blibpath:${withval}/lib"
1170 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001171 else
1172 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001173 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001174 fi
1175 fi
1176
1177 AC_CHECK_HEADERS(krb.h)
1178 AC_CHECK_LIB(krb, main)
1179 if test "$ac_cv_header_krb_h" != yes; then
1180 AC_MSG_WARN([Cannot find krb.h, build may fail])
1181 fi
1182 if test "$ac_cv_lib_krb_main" != yes; then
1183 AC_MSG_WARN([Cannot find libkrb, build may fail])
1184 fi
1185
Damien Millerc85f9b42000-01-29 10:20:21 +11001186 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001187 AC_CHECK_LIB(resolv, dn_expand, , )
1188 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001189 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001190 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001191 fi
Damien Miller80297751999-11-19 13:03:25 +11001192 ]
1193)
1194
Damien Millera22ba012000-03-02 23:09:20 +11001195# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001196AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001197AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001198 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001199 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001200 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001201
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001202 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001203 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001204 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001205 fi
1206
1207 if test -z "$KRB4" ; then
1208 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1209 fi
1210
Damien Miller8bdeee21999-12-30 15:50:54 +11001211 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001212 if test ! -z "$AFS_LIBS" ; then
1213 LIBS="$LIBS $AFS_LIBS"
1214 fi
1215 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001216 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001217 fi
Damien Miller80297751999-11-19 13:03:25 +11001218 ]
1219)
Damien Millerc85f9b42000-01-29 10:20:21 +11001220LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001221
Damien Millera22ba012000-03-02 23:09:20 +11001222# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001223SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001224AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001225 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001226 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001227 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001228
1229 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001230 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001231 LDFLAGS="$LDFLAGS -L${withval}/lib"
1232 fi
1233
Damien Miller8bdeee21999-12-30 15:50:54 +11001234 AC_DEFINE(SKEY)
Ben Lindstromb0c2eeb2001-02-03 22:15:00 +00001235 LIBS="-lskey $LIBS"
Damien Miller7b22d652000-06-18 14:07:04 +10001236 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001237
1238 AC_CHECK_FUNC(skey_keyinfo,
1239 [],
1240 [
1241 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1242 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001243 fi
Damien Miller80297751999-11-19 13:03:25 +11001244 ]
1245)
1246
Damien Millera22ba012000-03-02 23:09:20 +11001247# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001248TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001249AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001250 [ --with-tcp-wrappers Enable tcpwrappers support],
1251 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001252 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001253 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001254 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001255 AC_MSG_CHECKING(for libwrap)
1256 AC_TRY_LINK(
1257 [
Damien Miller81171112000-04-23 11:14:01 +10001258#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001259 int deny_severity = 0, allow_severity = 0;
1260 ],
1261 [hosts_access(0);],
1262 [
1263 AC_MSG_RESULT(yes)
1264 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001265 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001266 ],
1267 [
Damien Miller7b22d652000-06-18 14:07:04 +10001268 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001269 ]
1270 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001271 fi
Damien Miller80297751999-11-19 13:03:25 +11001272 ]
1273)
1274
Damien Millera22ba012000-03-02 23:09:20 +11001275# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001276MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001277AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001278 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001279 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001280 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001281 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001282 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001283 fi
1284 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001285)
1286
Damien Millera22ba012000-03-02 23:09:20 +11001287# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001288AC_ARG_WITH(shadow,
1289 [ --without-shadow Disable shadow password support],
1290 [
1291 if test "x$withval" = "xno" ; then
1292 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001293 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001294 fi
1295 ]
1296)
1297
Damien Miller1f335fb2000-06-26 11:31:33 +10001298if test -z "$disable_shadow" ; then
1299 AC_MSG_CHECKING([if the systems has expire shadow information])
1300 AC_TRY_COMPILE(
1301 [
1302#include <sys/types.h>
1303#include <shadow.h>
1304 struct spwd sp;
1305 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1306 [ sp_expire_available=yes ], []
1307 )
1308
1309 if test "x$sp_expire_available" = "xyes" ; then
1310 AC_MSG_RESULT(yes)
1311 AC_DEFINE(HAS_SHADOW_EXPIRE)
1312 else
1313 AC_MSG_RESULT(no)
1314 fi
1315fi
1316
Damien Millera22ba012000-03-02 23:09:20 +11001317# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001318if test ! -z "$IPADDR_IN_DISPLAY" ; then
1319 DISPLAY_HACK_MSG="yes"
1320 AC_DEFINE(IPADDR_IN_DISPLAY)
1321else
1322 DISPLAY_HACK_MSG="no"
1323 AC_ARG_WITH(ipaddr-display,
1324 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1325 [
1326 if test "x$withval" != "xno" ; then
1327 AC_DEFINE(IPADDR_IN_DISPLAY)
1328 DISPLAY_HACK_MSG="yes"
1329 fi
1330 ]
1331 )
1332fi
Damien Miller76112de1999-12-21 11:18:08 +11001333
Damien Millera22ba012000-03-02 23:09:20 +11001334# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001335SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001336AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001337 [ --with-default-path=PATH Specify default \$PATH environment for server],
1338 [
1339 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001340 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001341 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001342 fi
1343 ]
1344)
1345
Damien Millera22ba012000-03-02 23:09:20 +11001346# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001347IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001348AC_ARG_WITH(ipv4-default,
1349 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1350 [
1351 if test "x$withval" != "xno" ; then
1352 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001353 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001354 fi
1355 ]
1356)
1357
Damien Miller61e50f12000-05-08 20:49:37 +10001358AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001359IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001360AC_ARG_WITH(4in6,
1361 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1362 [
1363 if test "x$withval" != "xno" ; then
1364 AC_MSG_RESULT(yes)
1365 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001366 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001367 else
1368 AC_MSG_RESULT(no)
1369 fi
1370 ],[
1371 if test "x$inet6_default_4in6" = "xyes"; then
1372 AC_MSG_RESULT([yes (default)])
1373 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001374 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001375 else
1376 AC_MSG_RESULT([no (default)])
1377 fi
1378 ]
1379)
1380
Damien Miller78315eb2000-09-29 23:01:36 +11001381AC_MSG_CHECKING(whether to install ssh as suid root)
1382AC_ARG_ENABLE(suid-ssh,
1383[ --enable-suid-ssh Install ssh as suid root (default)
1384 --disable-suid-ssh Install ssh without suid bit],
1385[ case "$enableval" in
1386 no)
1387 AC_MSG_RESULT(no)
1388 SSHMODE=0711
1389 ;;
1390 *) AC_MSG_RESULT(yes)
1391 SSHMODE=04711
1392 ;;
1393 esac ],
1394 AC_MSG_RESULT(yes)
1395 SSHMODE=04711
1396)
1397AC_SUBST(SSHMODE)
1398
1399
Damien Millera22ba012000-03-02 23:09:20 +11001400# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001401piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001402AC_ARG_WITH(pid-dir,
1403 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1404 [
1405 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001406 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001407 fi
1408 ]
1409)
Damien Miller4018c192000-04-30 09:30:44 +10001410
Damien Miller78315eb2000-09-29 23:01:36 +11001411# make sure the directory exists
1412if test ! -d $piddir ; then
1413 piddir=`eval echo ${sysconfdir}`
1414 case $piddir in
1415 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1416 esac
1417fi
1418
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001419AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001420AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001421
andre2ff7b5d2000-06-03 14:57:40 +00001422dnl allow user to disable some login recording features
1423AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001424 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001425 [ AC_DEFINE(DISABLE_LASTLOG) ]
1426)
1427AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001428 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001429 [ AC_DEFINE(DISABLE_UTMP) ]
1430)
1431AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001432 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001433 [ AC_DEFINE(DISABLE_UTMPX) ]
1434)
1435AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001436 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001437 [ AC_DEFINE(DISABLE_WTMP) ]
1438)
1439AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001440 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001441 [ AC_DEFINE(DISABLE_WTMPX) ]
1442)
1443AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001444 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001445 [ AC_DEFINE(DISABLE_LOGIN) ]
1446)
1447AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001448 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001449 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1450)
1451AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001452 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001453 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1454)
1455AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001456 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001457 [
1458 if test "x$withval" = "xno" ; then
1459 AC_DEFINE(DISABLE_LASTLOG)
1460 else
1461 conf_lastlog_location=$withval
1462 fi
1463 ]
1464)
andre2ff7b5d2000-06-03 14:57:40 +00001465
1466dnl lastlog, [uw]tmpx? detection
1467dnl NOTE: set the paths in the platform section to avoid the
1468dnl need for command-line parameters
1469dnl lastlog and [uw]tmp are subject to a file search if all else fails
1470
1471dnl lastlog detection
1472dnl NOTE: the code itself will detect if lastlog is a directory
1473AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1474AC_TRY_COMPILE([
1475#include <sys/types.h>
1476#include <utmp.h>
1477#ifdef HAVE_LASTLOG_H
1478# include <lastlog.h>
1479#endif
Damien Miller2994e082000-06-04 15:51:47 +10001480#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001481# include <paths.h>
1482#endif
1483 ],
1484 [ char *lastlog = LASTLOG_FILE; ],
1485 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001486 [
1487 AC_MSG_RESULT(no)
1488 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1489 AC_TRY_COMPILE([
1490#include <sys/types.h>
1491#include <utmp.h>
1492#ifdef HAVE_LASTLOG_H
1493# include <lastlog.h>
1494#endif
1495#ifdef HAVE_PATHS_H
1496# include <paths.h>
1497#endif
1498 ],
1499 [ char *lastlog = _PATH_LASTLOG; ],
1500 [ AC_MSG_RESULT(yes) ],
1501 [
andree441aa32000-06-12 22:34:38 +00001502 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001503 system_lastlog_path=no
1504 ])
1505 ]
andre2ff7b5d2000-06-03 14:57:40 +00001506)
Damien Miller2994e082000-06-04 15:51:47 +10001507
andre2ff7b5d2000-06-03 14:57:40 +00001508if test -z "$conf_lastlog_location"; then
1509 if test x"$system_lastlog_path" = x"no" ; then
1510 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001511 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001512 conf_lastlog_location=$f
1513 fi
1514 done
1515 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001516 AC_MSG_WARN([** Cannot find lastlog **])
1517 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001518 fi
1519 fi
1520fi
1521
1522if test -n "$conf_lastlog_location"; then
1523 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1524fi
1525
1526dnl utmp detection
1527AC_MSG_CHECKING([if your system defines UTMP_FILE])
1528AC_TRY_COMPILE([
1529#include <sys/types.h>
1530#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001531#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001532# include <paths.h>
1533#endif
1534 ],
1535 [ char *utmp = UTMP_FILE; ],
1536 [ AC_MSG_RESULT(yes) ],
1537 [ AC_MSG_RESULT(no)
1538 system_utmp_path=no ]
1539)
1540if test -z "$conf_utmp_location"; then
1541 if test x"$system_utmp_path" = x"no" ; then
1542 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1543 if test -f $f ; then
1544 conf_utmp_location=$f
1545 fi
1546 done
1547 if test -z "$conf_utmp_location"; then
1548 AC_DEFINE(DISABLE_UTMP)
1549 fi
1550 fi
1551fi
1552if test -n "$conf_utmp_location"; then
1553 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1554fi
1555
1556dnl wtmp detection
1557AC_MSG_CHECKING([if your system defines WTMP_FILE])
1558AC_TRY_COMPILE([
1559#include <sys/types.h>
1560#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001561#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001562# include <paths.h>
1563#endif
1564 ],
1565 [ char *wtmp = WTMP_FILE; ],
1566 [ AC_MSG_RESULT(yes) ],
1567 [ AC_MSG_RESULT(no)
1568 system_wtmp_path=no ]
1569)
1570if test -z "$conf_wtmp_location"; then
1571 if test x"$system_wtmp_path" = x"no" ; then
1572 for f in /usr/adm/wtmp /var/log/wtmp; do
1573 if test -f $f ; then
1574 conf_wtmp_location=$f
1575 fi
1576 done
1577 if test -z "$conf_wtmp_location"; then
1578 AC_DEFINE(DISABLE_WTMP)
1579 fi
1580 fi
1581fi
1582if test -n "$conf_wtmp_location"; then
1583 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1584fi
1585
1586
1587dnl utmpx detection - I don't know any system so perverse as to require
1588dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1589dnl there, though.
1590AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1591AC_TRY_COMPILE([
1592#include <sys/types.h>
1593#include <utmp.h>
1594#ifdef HAVE_UTMPX_H
1595#include <utmpx.h>
1596#endif
Damien Miller2994e082000-06-04 15:51:47 +10001597#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001598# include <paths.h>
1599#endif
1600 ],
1601 [ char *utmpx = UTMPX_FILE; ],
1602 [ AC_MSG_RESULT(yes) ],
1603 [ AC_MSG_RESULT(no)
1604 system_utmpx_path=no ]
1605)
1606if test -z "$conf_utmpx_location"; then
1607 if test x"$system_utmpx_path" = x"no" ; then
1608 AC_DEFINE(DISABLE_UTMPX)
1609 fi
1610else
1611 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1612fi
1613
1614dnl wtmpx detection
1615AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1616AC_TRY_COMPILE([
1617#include <sys/types.h>
1618#include <utmp.h>
1619#ifdef HAVE_UTMPX_H
1620#include <utmpx.h>
1621#endif
Damien Miller2994e082000-06-04 15:51:47 +10001622#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001623# include <paths.h>
1624#endif
1625 ],
1626 [ char *wtmpx = WTMPX_FILE; ],
1627 [ AC_MSG_RESULT(yes) ],
1628 [ AC_MSG_RESULT(no)
1629 system_wtmpx_path=no ]
1630)
1631if test -z "$conf_wtmpx_location"; then
1632 if test x"$system_wtmpx_path" = x"no" ; then
1633 AC_DEFINE(DISABLE_WTMPX)
1634 fi
1635else
1636 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1637fi
1638
Damien Miller4018c192000-04-30 09:30:44 +10001639
1640# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001641entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001642AC_ARG_WITH(entropy-timeout,
1643 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1644 [
1645 if test "x$withval" != "xno" ; then
1646 entropy_timeout=$withval
1647 fi
1648 ]
1649)
1650AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1651
1652
Damien Miller29ea30d2000-03-17 10:54:15 +11001653if test ! -z "$blibpath" ; then
1654 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1655 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1656fi
1657
Damien Millerbac2d8a2000-09-05 16:13:06 +11001658AC_EXEEXT
1659
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001660AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001661
Damien Miller7b22d652000-06-18 14:07:04 +10001662# Print summary of options
1663
1664if test x$MANTYPE = x'$(CATMAN)' ; then
1665 MAN_MSG=cat
1666else
1667 MAN_MSG=man
1668fi
1669if test ! -z "$RANDOM_POOL" ; then
1670 RAND_MSG="Device ($RANDOM_POOL)"
1671else
1672 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001673 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001674 else
1675 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001676 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001677 fi
1678fi
1679
1680# Someone please show me a better way :)
1681A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1682B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1683C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1684D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001685E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001686F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1687G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1688
1689echo ""
1690echo "OpenSSH configured has been configured with the following options."
1691echo " User binaries: $B"
1692echo " System binaries: $C"
1693echo " Configuration files: $D"
1694echo " Askpass program: $E"
1695echo " Manual pages: $F"
1696echo " PID file: $G"
1697echo " Random number collection: $RAND_MSG"
1698echo " Manpage format: $MAN_MSG"
1699echo " PAM support: ${PAM_MSG}"
1700echo " KerberosIV support: $KRB4_MSG"
1701echo " AFS support: $AFS_MSG"
1702echo " S/KEY support: $SKEY_MSG"
1703echo " TCP Wrappers support: $TCPW_MSG"
1704echo " MD5 password support: $MD5_MSG"
1705echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1706echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1707echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1708
1709echo ""
1710
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001711echo " Host: ${host}"
1712echo " Compiler: ${CC}"
1713echo " Compiler flags: ${CFLAGS}"
1714echo "Preprocessor flags: ${CPPFLAGS}"
1715echo " Linker flags: ${LDFLAGS}"
1716echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001717
1718echo ""
1719
Damien Miller82cf0ce2000-12-20 13:34:48 +11001720if test "x$PAM_MSG" = "xyes" ; then
1721 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1722 echo "otherwise password authentication may fail. Example PAM control files"
1723 echo "can be found in the contrib/ subdirectory"
1724 echo ""
1725fi
1726
Damien Miller6f9c3372000-10-25 10:06:04 +11001727if test ! -z "$BUILTIN_RNG" ; then
1728 echo "WARNING: you are using the builtin random number collection service."
1729 echo "Please read WARNING.RNG and request that your OS vendor includes"
1730 echo "/dev/random in future versions of their OS."
1731 echo ""
1732fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001733
1734if test ! -z "$NO_SFTP"; then
1735 echo "sftp-server will be disabled. Your compiler does not support"
1736 echo "64bit integers."
1737 echo ""
1738fi