blob: 4ed1eb7c51f46003ddbdafbd3fdd032dadfd9cbd [file] [log] [blame]
Ben Lindstrom8697e082001-02-24 21:41:10 +00001# $Id: configure.in,v 1.253 2001/02/24 21:41:11 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)
Ben Lindstrom38e60932001-02-24 00:55:04 +000074 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110075 no_libsocket=1
76 no_libnsl=1
77 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000078*-*-dgux*)
79 AC_DEFINE(IP_TOS_IS_BROKEN)
80 ;;
Damien Miller76112de1999-12-21 11:18:08 +110081*-*-hpux10*)
82 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100083 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110084 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000085 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110086 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100087 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110088 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110089 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000090 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110091 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110092 MANTYPE='$(CATMAN)'
93 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110094 ;;
Damien Miller1bead332000-04-30 00:47:29 +100095*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000096 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110097 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110098 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110099 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100100 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100101 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100103 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000104 MANTYPE='$(CATMAN)'
105 mansubdir=cat
106 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100107*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000109 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100110 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100111 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100112 no_libsocket=1
113 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000114 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100115 ;;
116*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000117 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000118 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100119 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100120 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000121 AC_DEFINE(WITH_IRIX_ARRAY)
122 AC_DEFINE(WITH_IRIX_PROJECT)
123 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000124 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100125 no_libsocket=1
126 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000127 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000128 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100129 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100130*-*-linux*)
131 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100132 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100133 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000134 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100135 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100136 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000137mips-sony-bsd|mips-sony-newsos4)
138 AC_DEFINE(HAVE_NEWS4)
139 SONY=1
140 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100141 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000142 )
143 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100144*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100145 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100146 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000147*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000148 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100149 conf_utmp_location=/etc/utmp
150 conf_wtmp_location=/usr/adm/wtmp
151 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000152 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000153 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000154 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000156 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000157 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100158*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000159 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000160 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100161 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100162 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000163 # hardwire lastlog location (can't detect it on some versions)
164 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000165 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
166 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
167 if test "$sol2ver" -ge 8; then
168 AC_MSG_RESULT(yes)
169 AC_DEFINE(DISABLE_UTMP)
170 AC_DEFINE(DISABLE_WTMP)
171 else
172 AC_MSG_RESULT(no)
173 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100174 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000175*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000176 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000177 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100178 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100179 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000180 conf_utmp_location=/etc/utmp
181 conf_wtmp_location=/var/adm/wtmp
182 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000183 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000184 MANTYPE='$(CATMAN)'
185 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000186 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000187*-ncr-sysv*)
188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
189 LDFLAGS="$LDFLAGS -L/usr/local/lib"
190 MANTYPE='$(CATMAN)'
191 mansubdir=cat
192 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
193 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000194*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000195 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000196 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
197 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100198 IPADDR_IN_DISPLAY=yes
199 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000200 AC_DEFINE(IP_TOS_IS_BROKEN)
201 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000202 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000203 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100204*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000205 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
207 MANTYPE='$(CATMAN)'
208 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100209 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100210 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100211 ;;
212*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000213 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
215 MANTYPE='$(CATMAN)'
216 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100217 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100218 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100219 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100220*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000221 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100222 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100223 MANTYPE='$(CATMAN)'
224 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100225 LIBS="$LIBS -lgen -lsocket"
226 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100227*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000228 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100229 LDFLAGS="$LDFLAGS -L/usr/local/lib"
230 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000231 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100232 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100233 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 RANLIB=true
235 no_dev_ptmx=1
236 AC_DEFINE(BROKEN_SYS_TERMIO_H)
237 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100238 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000239 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000240 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100241 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100242 ;;
243*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000244 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000245 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100246 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000247 MANTYPE='$(CATMAN)'
248 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000249 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100250 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100251 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100252 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000253 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000254 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100255 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000256 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000257*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000258 if test ! -z "USE_SIA" ; then
259 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
260 if test -f /etc/sia/matrix.conf; then
261 AC_MSG_RESULT(yes)
262 AC_DEFINE(HAVE_OSF_SIA)
263 AC_DEFINE(DISABLE_LOGIN)
264 LIBS="$LIBS -lsecurity -ldb -lm -laud"
265 else
266 AC_MSG_RESULT(no)
267 fi
268 fi
269 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100270esac
271
Damien Millere37bfc12000-06-05 09:37:43 +1000272# Allow user to specify flags
273AC_ARG_WITH(cflags,
274 [ --with-cflags Specify additional flags to pass to compiler],
275 [
276 if test "x$withval" != "xno" ; then
277 CFLAGS="$CFLAGS $withval"
278 fi
279 ]
280)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000281AC_ARG_WITH(cppflags,
282 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
283 [
284 if test "x$withval" != "xno"; then
285 CPPFLAGS="$CPPFLAGS $withval"
286 fi
287 ]
288)
Damien Millere37bfc12000-06-05 09:37:43 +1000289AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000290 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000291 [
292 if test "x$withval" != "xno" ; then
293 LDFLAGS="$LDFLAGS $withval"
294 fi
295 ]
296)
297AC_ARG_WITH(libs,
298 [ --with-libs Specify additional libraries to link with],
299 [
300 if test "x$withval" != "xno" ; then
301 LIBS="$LIBS $withval"
302 fi
303 ]
304)
305
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000306AC_ARG_WITH(pcre,
307 [ --with-pcre Override built in regex library with pcre],
308 [
309
310 AC_CHECK_LIB(pcre, pcre_info,
311 [
312 AC_DEFINE(HAVE_LIBPCRE)
313 LIBS="$LIBS -lpcreposix -lpcre"
314 no_comp_check="yes"
315 ],
316 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
317 )
318 ]
319)
Damien Millere37bfc12000-06-05 09:37:43 +1000320
Damien Millera22ba012000-03-02 23:09:20 +1100321# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100322if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000323 AC_CHECK_LIB(nsl, yp_match, , )
324fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100325if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000326 AC_CHECK_LIB(socket, main, , )
327fi
328
Damien Millerdf288022001-02-18 13:07:07 +1100329dnl SCO OS3 needs this for libwrap
330AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
331
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000332AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100333AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100334AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100335
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000336# We don't want to check if we did an pcre override.
337if test -z "$no_comp_check" ; then
338 AC_CHECK_FUNC(regcomp,
339 [ AC_DEFINE(HAVE_REGCOMP)],
340 [
341 AC_CHECK_LIB(pcre, pcre_info,
342 [
343 AC_DEFINE(HAVE_LIBPCRE)
344 LIBS="$LIBS -lpcreposix -lpcre"
345 ],
346 [
347 AC_MSG_ERROR([*** No regex library found.])
348 ])
349 ]
350 )
351fi
Damien Millerab18c411999-11-11 10:40:23 +1100352
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000353dnl UnixWare 2.x
354AC_CHECK_FUNC(strcasecmp,
355 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
356)
357AC_CHECK_FUNC(utimes,
358 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
359)
Damien Millerab18c411999-11-11 10:40:23 +1100360
Ben Lindstrom8697e082001-02-24 21:41:10 +0000361AC_FUNC_STRFTIME
362
Damien Millera22ba012000-03-02 23:09:20 +1100363# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000364AC_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 +1100365
Damien Millerc547bf12001-02-16 10:18:12 +1100366# Check whether user wants Kerberos support
367KRB4_MSG="no"
368AC_ARG_WITH(kerberos4,
369 [ --with-kerberos4=PATH Enable Kerberos 4 support],
370 [
371 if test "x$withval" != "xno" ; then
372
373 if test "x$withval" != "xyes" ; then
374 CPPFLAGS="$CPPFLAGS -I${withval}/include"
375 LDFLAGS="$LDFLAGS -L${withval}/lib"
376 if test ! -z "$need_dash_r" ; then
377 LDFLAGS="$LDFLAGS -R${withval}/lib"
378 fi
379 if test ! -z "$blibpath" ; then
380 blibpath="$blibpath:${withval}/lib"
381 fi
382 else
383 if test -d /usr/include/kerberosIV ; then
384 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
385 fi
386 fi
387
388 AC_CHECK_HEADERS(krb.h)
389 AC_CHECK_LIB(krb, main)
390 if test "$ac_cv_header_krb_h" != yes; then
391 AC_MSG_WARN([Cannot find krb.h, build may fail])
392 fi
393 if test "$ac_cv_lib_krb_main" != yes; then
394 AC_MSG_WARN([Cannot find libkrb, build may fail])
395 fi
396
397 KLIBS="-lkrb -ldes"
398 AC_CHECK_LIB(resolv, dn_expand, , )
399 KRB4=yes
400 KRB4_MSG="yes"
401 AC_DEFINE(KRB4)
402 fi
403 ]
404)
405
406# Check whether user wants AFS support
407AFS_MSG="no"
408AC_ARG_WITH(afs,
409 [ --with-afs=PATH Enable AFS support],
410 [
411 if test "x$withval" != "xno" ; then
412
413 if test "x$withval" != "xyes" ; then
414 CPPFLAGS="$CPPFLAGS -I${withval}/include"
415 LDFLAGS="$LDFLAGS -L${withval}/lib"
416 fi
417
418 if test -z "$KRB4" ; then
419 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
420 fi
421
422 LIBS="$LIBS -lkafs"
423 if test ! -z "$AFS_LIBS" ; then
424 LIBS="$LIBS $AFS_LIBS"
425 fi
426 AC_DEFINE(AFS)
427 AFS_MSG="yes"
428 fi
429 ]
430)
431LIBS="$LIBS $KLIBS"
432
433# Check whether user wants S/Key support
434SKEY_MSG="no"
435AC_ARG_WITH(skey,
436 [ --with-skey=PATH Enable S/Key support],
437 [
438 if test "x$withval" != "xno" ; then
439
440 if test "x$withval" != "xyes" ; then
441 CPPFLAGS="$CPPFLAGS -I${withval}/include"
442 LDFLAGS="$LDFLAGS -L${withval}/lib"
443 fi
444
445 AC_DEFINE(SKEY)
446 LIBS="-lskey $LIBS"
447 SKEY_MSG="yes"
448
449 AC_CHECK_FUNC(skey_keyinfo,
450 [],
451 [
452 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
453 ])
454 fi
455 ]
456)
457
458# Check whether user wants TCP wrappers support
459TCPW_MSG="no"
460AC_ARG_WITH(tcp-wrappers,
461 [ --with-tcp-wrappers Enable tcpwrappers support],
462 [
463 if test "x$withval" != "xno" ; then
464 saved_LIBS="$LIBS"
465 LIBS="-lwrap $LIBS"
466 AC_MSG_CHECKING(for libwrap)
467 AC_TRY_LINK(
468 [
469#include <tcpd.h>
470 int deny_severity = 0, allow_severity = 0;
471 ],
472 [hosts_access(0);],
473 [
474 AC_MSG_RESULT(yes)
475 AC_DEFINE(LIBWRAP)
476 TCPW_MSG="yes"
477 ],
478 [
479 AC_MSG_ERROR([*** libwrap missing])
480 ]
481 )
482 fi
483 ]
484)
485
Damien Millerad833b32000-08-23 10:46:23 +1000486dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000487AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown 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 +1000488dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000489AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000490dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000491AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000492AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000493dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000494AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000495AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000496dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000497AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000498AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100499
Damien Miller5fc85652000-07-09 23:53:07 +1000500AC_CHECK_FUNC(getuserattr,
501 [AC_DEFINE(HAVE_GETUSERATTR)],
502 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
503)
504
Damien Miller04f80141999-11-19 15:32:34 +1100505AC_CHECK_FUNC(login,
506 [AC_DEFINE(HAVE_LOGIN)],
507 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
508)
509
510AC_CHECK_FUNC(daemon,
511 [AC_DEFINE(HAVE_DAEMON)],
512 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
513)
514
Damien Miller9fb07e42000-03-05 16:22:59 +1100515AC_CHECK_FUNC(getpagesize,
516 [AC_DEFINE(HAVE_GETPAGESIZE)],
517 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
518)
519
Damien Millercb170cb2000-07-01 16:52:55 +1000520# Check for broken snprintf
521if test "x$ac_cv_func_snprintf" = "xyes" ; then
522 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
523 AC_TRY_RUN(
524 [
525#include <stdio.h>
526int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
527 ],
528 [AC_MSG_RESULT(yes)],
529 [
530 AC_MSG_RESULT(no)
531 AC_DEFINE(BROKEN_SNPRINTF)
532 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
533 ]
534 )
535fi
536
Damien Miller606f8802000-09-16 15:39:56 +1100537AC_FUNC_GETPGRP
538
Damien Millera64b57a2001-01-17 10:44:13 +1100539# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000540PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100541AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100542 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100543 [
Damien Millera64b57a2001-01-17 10:44:13 +1100544 if test "x$withval" != "xno" ; then
545 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
546 AC_MSG_ERROR([PAM headers not found])
547 fi
548
549 AC_CHECK_LIB(dl, dlopen, , )
550 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
551 AC_CHECK_FUNCS(pam_getenvlist)
552
553 disable_shadow=yes
554 PAM_MSG="yes"
555
556 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100557 fi
558 ]
559)
Damien Millera22ba012000-03-02 23:09:20 +1100560
Damien Millera64b57a2001-01-17 10:44:13 +1100561# Check for older PAM
562if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100563 # Check PAM strerror arguments (old PAM)
564 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
565 AC_TRY_COMPILE(
566 [
Damien Miller81171112000-04-23 11:14:01 +1000567#include <stdlib.h>
568#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100569 ],
570 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
571 [AC_MSG_RESULT(no)],
572 [
573 AC_DEFINE(HAVE_OLD_PAM)
574 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000575 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100576 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100577 )
Damien Millera22ba012000-03-02 23:09:20 +1100578fi
579
580# The big search for OpenSSL
581AC_ARG_WITH(ssl-dir,
582 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
583 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000584 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100585 tryssldir=$withval
586 fi
587 ]
588)
589
590saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100591saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000592saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100593if test "x$prefix" != "xNONE" ; then
594 tryssldir="$tryssldir $prefix"
595fi
Damien Miller61e50f12000-05-08 20:49:37 +1000596AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100597 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 Millerccdefb62001-02-19 12:56:39 +1100598 CPPFLAGS="$saved_CPPFLAGS"
599 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000600 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100601
602 # Skip directories if they don't exist
603 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
604 continue;
605 fi
606 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
607 # Try to use $ssldir/lib if it exists, otherwise
608 # $ssldir
609 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000610 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100611 if test ! -z "$need_dash_r" ; then
612 LDFLAGS="$LDFLAGS -R$ssldir/lib"
613 fi
614 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000615 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100616 if test ! -z "$need_dash_r" ; then
617 LDFLAGS="$LDFLAGS -R$ssldir"
618 fi
619 fi
620 # Try to use $ssldir/include if it exists, otherwise
621 # $ssldir
622 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000623 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100624 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000625 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100626 fi
627 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000628
Damien Miller3b512e12000-05-17 23:29:18 +1000629 # Basic test to check for compatible version and correct linking
630 # *does not* test for RSA - that comes later.
631 AC_TRY_RUN(
632 [
Damien Millere59ce622000-05-01 20:54:17 +1000633#include <string.h>
634#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000635int main(void)
636{
Damien Miller3b512e12000-05-17 23:29:18 +1000637 char a[2048];
638 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000639 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000640 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000641}
Damien Miller3b512e12000-05-17 23:29:18 +1000642 ],
643 [
644 found_crypto=1
645 break;
646 ], []
647 )
Damien Miller61e50f12000-05-08 20:49:37 +1000648
649 if test ! -z "$found_crypto" ; then
650 break;
651 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100652 done
653
Damien Miller61e50f12000-05-08 20:49:37 +1000654 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100655 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100656 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000657 if test -z "$ssldir" ; then
658 ssldir="(system)"
659 fi
Damien Millera22ba012000-03-02 23:09:20 +1100660
Damien Miller61e50f12000-05-08 20:49:37 +1000661 ac_cv_openssldir=$ssldir
662])
663
Damien Milleredb82922000-06-20 13:25:52 +1000664if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000665 AC_DEFINE(HAVE_OPENSSL)
666 dnl Need to recover ssldir - test above runs in subshell
667 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100668 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100669 # Try to use $ssldir/lib if it exists, otherwise
670 # $ssldir
671 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000672 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100673 if test ! -z "$need_dash_r" ; then
674 LDFLAGS="$LDFLAGS -R$ssldir/lib"
675 fi
676 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000677 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100678 if test ! -z "$need_dash_r" ; then
679 LDFLAGS="$LDFLAGS -R$ssldir"
680 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100681 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100682 # Try to use $ssldir/include if it exists, otherwise
683 # $ssldir
684 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000685 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100686 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000687 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100688 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100689 fi
Damien Millera22ba012000-03-02 23:09:20 +1100690fi
Damien Miller3b512e12000-05-17 23:29:18 +1000691LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000692
Damien Miller3b512e12000-05-17 23:29:18 +1000693# Now test RSA support
694saved_LIBS="$LIBS"
695AC_MSG_CHECKING([for RSA support])
696for WANTS_RSAREF in "" 1 ; do
697 if test -z "$WANTS_RSAREF" ; then
698 LIBS="$saved_LIBS"
699 else
700 LIBS="$saved_LIBS -lRSAglue -lrsaref"
701 fi
702 AC_TRY_RUN([
703#include <string.h>
704#include <openssl/rand.h>
705#include <openssl/rsa.h>
706#include <openssl/bn.h>
707#include <openssl/sha.h>
708int main(void)
709{
710 int num; RSA *key; static unsigned char p_in[] = "blahblah";
711 unsigned char c[256], p[256];
712 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
713 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
714 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
715 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
716}
717 ],
718 [
719 rsa_works=1
720 break;
721 ], [])
722done
723
724if test ! -z "$no_rsa" ; then
725 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000726 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000727else
728 if test -z "$rsa_works" ; then
729 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000730 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000731 else
732 if test -z "$WANTS_RSAREF" ; then
733 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000734 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000735 else
Damien Miller7b22d652000-06-18 14:07:04 +1000736 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000737 AC_MSG_RESULT(using RSAref)
738 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
739 fi
740 fi
741fi
Damien Millera22ba012000-03-02 23:09:20 +1100742
Damien Millera64b57a2001-01-17 10:44:13 +1100743# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
744# version in OpenSSL. Skip this for PAM
745if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
746 AC_CHECK_LIB(crypt, crypt, , )
747fi
748
Ben Lindstromb5628642000-10-18 00:02:25 +0000749# Cheap hack to ensure NEWS-OS libraries are arranged right.
750if test ! -z "$SONY" ; then
751 LIBS="$LIBS -liberty";
752fi
753
Damien Millera22ba012000-03-02 23:09:20 +1100754# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100755AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100756AC_CHECK_SIZEOF(short int, 2)
757AC_CHECK_SIZEOF(int, 4)
758AC_CHECK_SIZEOF(long int, 4)
759AC_CHECK_SIZEOF(long long int, 8)
760
Damien Millera22ba012000-03-02 23:09:20 +1100761# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100762AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
763 AC_TRY_COMPILE(
764 [ #include <sys/types.h> ],
765 [ u_int a; a = 1;],
766 [ ac_cv_have_u_int="yes" ],
767 [ ac_cv_have_u_int="no" ]
768 )
769])
770if test "x$ac_cv_have_u_int" = "xyes" ; then
771 AC_DEFINE(HAVE_U_INT)
772 have_u_int=1
773fi
774
Damien Miller61e50f12000-05-08 20:49:37 +1000775AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
776 AC_TRY_COMPILE(
777 [ #include <sys/types.h> ],
778 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
779 [ ac_cv_have_intxx_t="yes" ],
780 [ ac_cv_have_intxx_t="no" ]
781 )
782])
783if test "x$ac_cv_have_intxx_t" = "xyes" ; then
784 AC_DEFINE(HAVE_INTXX_T)
785 have_intxx_t=1
786fi
787
Damien Miller578783e2000-09-23 14:12:24 +1100788AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
789 AC_TRY_COMPILE(
790 [ #include <sys/types.h> ],
791 [ int64_t a; a = 1;],
792 [ ac_cv_have_int64_t="yes" ],
793 [ ac_cv_have_int64_t="no" ]
794 )
795])
796if test "x$ac_cv_have_int64_t" = "xyes" ; then
797 AC_DEFINE(HAVE_INT64_T)
798 have_int64_t=1
799fi
800
Damien Miller61e50f12000-05-08 20:49:37 +1000801AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
802 AC_TRY_COMPILE(
803 [ #include <sys/types.h> ],
804 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
805 [ ac_cv_have_u_intxx_t="yes" ],
806 [ ac_cv_have_u_intxx_t="no" ]
807 )
808])
809if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
810 AC_DEFINE(HAVE_U_INTXX_T)
811 have_u_intxx_t=1
812fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100813
Damien Miller578783e2000-09-23 14:12:24 +1100814AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
815 AC_TRY_COMPILE(
816 [ #include <sys/types.h> ],
817 [ u_int64_t a; a = 1;],
818 [ ac_cv_have_u_int64_t="yes" ],
819 [ ac_cv_have_u_int64_t="no" ]
820 )
821])
822if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
823 AC_DEFINE(HAVE_U_INT64_T)
824 have_u_int64_t=1
825fi
826
Damien Milleredb82922000-06-20 13:25:52 +1000827if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
828 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100829then
830 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
831 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000832 [
833#include <sys/bitypes.h>
834 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100835 [
Damien Miller70494d12000-04-03 15:57:06 +1000836 int8_t a; int16_t b; int32_t c;
837 u_int8_t e; u_int16_t f; u_int32_t g;
838 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100839 ],
840 [
841 AC_DEFINE(HAVE_U_INTXX_T)
842 AC_DEFINE(HAVE_INTXX_T)
843 AC_MSG_RESULT(yes)
844 ],
845 [AC_MSG_RESULT(no)]
846 )
847fi
848
Damien Millerd6121d22000-03-17 23:26:46 +1100849if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000850 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
851 AC_TRY_COMPILE(
852 [
853#include <sys/types.h>
854 ],
855 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
856 [ ac_cv_have_uintxx_t="yes" ],
857 [ ac_cv_have_uintxx_t="no" ]
858 )
859 ])
860 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
861 AC_DEFINE(HAVE_UINTXX_T)
862 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100863fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100864
Damien Miller61e50f12000-05-08 20:49:37 +1000865AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
866 AC_TRY_COMPILE(
867 [
Damien Miller81171112000-04-23 11:14:01 +1000868#include <sys/types.h>
869#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000870 ],
871 [socklen_t foo; foo = 1235;],
872 [ ac_cv_have_socklen_t="yes" ],
873 [ ac_cv_have_socklen_t="no" ]
874 )
875])
876if test "x$ac_cv_have_socklen_t" = "xyes" ; then
877 AC_DEFINE(HAVE_SOCKLEN_T)
878fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100879
Damien Miller61e50f12000-05-08 20:49:37 +1000880AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
881 AC_TRY_COMPILE(
882 [
883#include <sys/types.h>
884 ],
885 [ size_t foo; foo = 1235; ],
886 [ ac_cv_have_size_t="yes" ],
887 [ ac_cv_have_size_t="no" ]
888 )
889])
890if test "x$ac_cv_have_size_t" = "xyes" ; then
891 AC_DEFINE(HAVE_SIZE_T)
892fi
Damien Miller95058511999-12-29 10:36:45 +1100893
Damien Miller615f9392000-05-17 22:53:33 +1000894AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
895 AC_TRY_COMPILE(
896 [
897#include <sys/types.h>
898 ],
899 [ ssize_t foo; foo = 1235; ],
900 [ ac_cv_have_ssize_t="yes" ],
901 [ ac_cv_have_ssize_t="no" ]
902 )
903])
904if test "x$ac_cv_have_ssize_t" = "xyes" ; then
905 AC_DEFINE(HAVE_SSIZE_T)
906fi
907
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000908AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
909 AC_TRY_COMPILE(
910 [
911#include <time.h>
912 ],
913 [ clock_t foo; foo = 1235; ],
914 [ ac_cv_have_clock_t="yes" ],
915 [ ac_cv_have_clock_t="no" ]
916 )
917])
918if test "x$ac_cv_have_clock_t" = "xyes" ; then
919 AC_DEFINE(HAVE_CLOCK_T)
920fi
921
Damien Millerb54b40e2000-06-23 08:23:34 +1000922AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
923 AC_TRY_COMPILE(
924 [
925#include <sys/types.h>
926#include <sys/socket.h>
927 ],
928 [ sa_family_t foo; foo = 1235; ],
929 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100930 [ AC_TRY_COMPILE(
931 [
932#include <sys/types.h>
933#include <sys/socket.h>
934#include <netinet/in.h>
935 ],
936 [ sa_family_t foo; foo = 1235; ],
937 [ ac_cv_have_sa_family_t="yes" ],
938
Damien Millerb54b40e2000-06-23 08:23:34 +1000939 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100940 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000941 )
942])
943if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
944 AC_DEFINE(HAVE_SA_FAMILY_T)
945fi
946
Damien Miller0f91b4e2000-06-18 15:43:25 +1000947AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
948 AC_TRY_COMPILE(
949 [
950#include <sys/types.h>
951 ],
952 [ pid_t foo; foo = 1235; ],
953 [ ac_cv_have_pid_t="yes" ],
954 [ ac_cv_have_pid_t="no" ]
955 )
956])
957if test "x$ac_cv_have_pid_t" = "xyes" ; then
958 AC_DEFINE(HAVE_PID_T)
959fi
960
961AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
962 AC_TRY_COMPILE(
963 [
964#include <sys/types.h>
965 ],
966 [ mode_t foo; foo = 1235; ],
967 [ ac_cv_have_mode_t="yes" ],
968 [ ac_cv_have_mode_t="no" ]
969 )
970])
971if test "x$ac_cv_have_mode_t" = "xyes" ; then
972 AC_DEFINE(HAVE_MODE_T)
973fi
974
Damien Miller61e50f12000-05-08 20:49:37 +1000975
976AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
977 AC_TRY_COMPILE(
978 [
Damien Miller81171112000-04-23 11:14:01 +1000979#include <sys/types.h>
980#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000981 ],
982 [ struct sockaddr_storage s; ],
983 [ ac_cv_have_struct_sockaddr_storage="yes" ],
984 [ ac_cv_have_struct_sockaddr_storage="no" ]
985 )
986])
987if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
988 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
989fi
Damien Miller34132e52000-01-14 15:45:46 +1100990
Damien Miller61e50f12000-05-08 20:49:37 +1000991AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
992 AC_TRY_COMPILE(
993 [
Damien Miller7b22d652000-06-18 14:07:04 +1000994#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000995#include <netinet/in.h>
996 ],
997 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
998 [ ac_cv_have_struct_sockaddr_in6="yes" ],
999 [ ac_cv_have_struct_sockaddr_in6="no" ]
1000 )
1001])
1002if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1003 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1004fi
Damien Miller34132e52000-01-14 15:45:46 +11001005
Damien Miller61e50f12000-05-08 20:49:37 +10001006AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1007 AC_TRY_COMPILE(
1008 [
Damien Miller7b22d652000-06-18 14:07:04 +10001009#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001010#include <netinet/in.h>
1011 ],
1012 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1013 [ ac_cv_have_struct_in6_addr="yes" ],
1014 [ ac_cv_have_struct_in6_addr="no" ]
1015 )
1016])
1017if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1018 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1019fi
Damien Miller34132e52000-01-14 15:45:46 +11001020
Damien Miller61e50f12000-05-08 20:49:37 +10001021AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1022 AC_TRY_COMPILE(
1023 [
Damien Miller81171112000-04-23 11:14:01 +10001024#include <sys/types.h>
1025#include <sys/socket.h>
1026#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001027 ],
1028 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1029 [ ac_cv_have_struct_addrinfo="yes" ],
1030 [ ac_cv_have_struct_addrinfo="no" ]
1031 )
1032])
1033if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1034 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1035fi
1036
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001037AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1038 AC_TRY_COMPILE(
1039 [ #include <sys/time.h> ],
1040 [ struct timeval tv; tv.tv_sec = 1;],
1041 [ ac_cv_have_struct_timeval="yes" ],
1042 [ ac_cv_have_struct_timeval="no" ]
1043 )
1044])
1045if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1046 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1047 have_struct_timeval=1
1048fi
1049
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001050# If we don't have int64_t then we can't compile sftp-server. So don't
1051# even attempt to do it.
1052if test "x$ac_cv_have_int64_t" = "xno" -a \
1053 "x$ac_cv_sizeof_long_int" != "x8" -a \
1054 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1055 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001056fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001057AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001058
Damien Miller78315eb2000-09-29 23:01:36 +11001059dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001060OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1061OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1062OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1063OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1064OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001065OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001066OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1067OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001068OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001069OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1070OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1071OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1072OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001073OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1074OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1075OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1076OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001077AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001078
Damien Miller942da032000-08-18 13:59:06 +10001079AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1080 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1081 AC_TRY_COMPILE(
1082 [
1083#include <sys/types.h>
1084#include <sys/socket.h>
1085 ],
1086 [ struct sockaddr_un s; s.sun_len = 1; ],
1087 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1088 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1089 )
1090])
1091if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1092 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1093fi
1094
Damien Miller61e50f12000-05-08 20:49:37 +10001095AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1096 ac_cv_have_ss_family_in_struct_ss, [
1097 AC_TRY_COMPILE(
1098 [
Damien Miller81171112000-04-23 11:14:01 +10001099#include <sys/types.h>
1100#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001101 ],
1102 [ struct sockaddr_storage s; s.ss_family = 1; ],
1103 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1104 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1105 )
1106])
1107if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1108 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1109fi
1110
Damien Miller61e50f12000-05-08 20:49:37 +10001111AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1112 ac_cv_have___ss_family_in_struct_ss, [
1113 AC_TRY_COMPILE(
1114 [
Damien Miller81171112000-04-23 11:14:01 +10001115#include <sys/types.h>
1116#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001117 ],
1118 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1119 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1120 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1121 )
1122])
1123if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1124 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1125fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001126
Damien Millerad833b32000-08-23 10:46:23 +10001127AC_CACHE_CHECK([for pw_class field in struct passwd],
1128 ac_cv_have_pw_class_in_struct_passwd, [
1129 AC_TRY_COMPILE(
1130 [
Damien Millerad833b32000-08-23 10:46:23 +10001131#include <pwd.h>
1132 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001133 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001134 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1135 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1136 )
1137])
1138if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1139 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1140fi
1141
Damien Miller61e50f12000-05-08 20:49:37 +10001142
1143AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1144 AC_TRY_LINK([],
1145 [ extern char *__progname; printf("%s", __progname); ],
1146 [ ac_cv_libc_defines___progname="yes" ],
1147 [ ac_cv_libc_defines___progname="no" ]
1148 )
1149])
1150if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1151 AC_DEFINE(HAVE___PROGNAME)
1152fi
1153
Damien Millera22ba012000-03-02 23:09:20 +11001154
Damien Millerecbb26d2000-07-15 14:59:14 +10001155AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1156 AC_TRY_LINK([],
1157 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1158 [ ac_cv_libc_defines_sys_errlist="yes" ],
1159 [ ac_cv_libc_defines_sys_errlist="no" ]
1160 )
1161])
1162if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1163 AC_DEFINE(HAVE_SYS_ERRLIST)
1164fi
1165
1166
Damien Miller11fa2cc2000-08-16 10:35:58 +10001167AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1168 AC_TRY_LINK([],
1169 [ extern int sys_nerr; printf("%i", sys_nerr);],
1170 [ ac_cv_libc_defines_sys_nerr="yes" ],
1171 [ ac_cv_libc_defines_sys_nerr="no" ]
1172 )
1173])
1174if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1175 AC_DEFINE(HAVE_SYS_NERR)
1176fi
1177
1178
Damien Millera22ba012000-03-02 23:09:20 +11001179# Looking for programs, paths and files
1180AC_ARG_WITH(rsh,
1181 [ --with-rsh=PATH Specify path to remote shell program ],
1182 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001183 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001184 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001185 fi
1186 ],
1187 [
1188 AC_PATH_PROG(rsh_path, rsh)
1189 ]
1190)
1191
1192AC_ARG_WITH(xauth,
1193 [ --with-xauth=PATH Specify path to xauth program ],
1194 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001195 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001196 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001197 fi
1198 ],
1199 [
Damien Miller78315eb2000-09-29 23:01:36 +11001200 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 +10001201 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001202 xauth_path="/usr/openwin/bin/xauth"
1203 fi
1204 ]
1205)
1206
Damien Millera19cf472000-11-29 13:28:50 +11001207if test -z "$xauth_path" ; then
1208 XAUTH_PATH="undefined"
1209 AC_SUBST(XAUTH_PATH)
1210else
Damien Millera22ba012000-03-02 23:09:20 +11001211 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001212 XAUTH_PATH=$xauth_path
1213 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001214fi
1215if test ! -z "$rsh_path" ; then
1216 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1217fi
1218
1219# Check for mail directory (last resort if we cannot get it from headers)
1220if test ! -z "$MAIL" ; then
1221 maildir=`dirname $MAIL`
1222 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1223fi
1224
Damien Millera22ba012000-03-02 23:09:20 +11001225if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001226 AC_CHECK_FILE("/dev/ptmx",
1227 [
1228 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1229 have_dev_ptmx=1
1230 ]
1231 )
Damien Millera22ba012000-03-02 23:09:20 +11001232fi
Damien Miller204ad072000-03-02 23:56:12 +11001233AC_CHECK_FILE("/dev/ptc",
1234 [
1235 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1236 have_dev_ptc=1
1237 ]
1238)
1239
Damien Millera22ba012000-03-02 23:09:20 +11001240# Options from here on. Some of these are preset by platform above
1241
Damien Millera22ba012000-03-02 23:09:20 +11001242# Check for user-specified random device, otherwise check /dev/urandom
1243AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001244 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001245 [
Damien Miller040f3832000-04-03 14:50:43 +10001246 if test "x$withval" != "xno" ; then
1247 RANDOM_POOL="$withval";
1248 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1249 fi
Damien Millera22ba012000-03-02 23:09:20 +11001250 ],
1251 [
1252 # Check for random device
1253 AC_CHECK_FILE("/dev/urandom",
1254 [
1255 RANDOM_POOL="/dev/urandom";
1256 AC_SUBST(RANDOM_POOL)
1257 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1258 ]
1259 )
1260 ]
1261)
1262
1263# Check for EGD pool file
1264AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001265 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001266 [
Damien Miller040f3832000-04-03 14:50:43 +10001267 if test "x$withval" != "xno" ; then
1268 EGD_SOCKET="$withval";
1269 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1270 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001271 ],
1272 [
1273 # Check for existing socket only if we don't have a random device already
1274 if test -z "$RANDOM_POOL" ; then
1275 AC_MSG_CHECKING(for PRNGD/EGD socket)
1276 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001277 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
Damien Millerd8ab0d42001-02-13 12:11:17 +11001278 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001279 EGD_SOCKET="$egdsock"
1280 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001281 break;
1282 fi
1283 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001284 if test -x "$EGD_SOCKET" ; then
1285 AC_MSG_RESULT($EGD_SOCKET)
1286 else
1287 AC_MSG_RESULT(not found)
1288 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001289 fi
Damien Millera22ba012000-03-02 23:09:20 +11001290 ]
1291)
1292
Damien Miller0736c4d2001-01-25 10:51:46 +11001293
Damien Miller0437b332000-05-02 09:56:41 +10001294# detect pathnames for entropy gathering commands, if we need them
1295INSTALL_SSH_PRNG_CMDS=""
1296rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001297if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001298 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001299 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1300 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1301 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1302 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1303 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1304 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1305 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1306 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1307 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1308 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1309 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1310 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1311 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1312 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001313
1314 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001315fi
Damien Miller0437b332000-05-02 09:56:41 +10001316AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1317
Damien Miller11e37f62000-04-08 18:23:30 +10001318
Damien Miller670a4b82000-01-22 13:53:11 +11001319AC_ARG_WITH(catman,
1320 [ --with-catman=man|cat Install preformatted manpages[no]],
1321 [
1322 MANTYPE='$(CATMAN)'
1323 if test x"$withval" != x"yes" ; then
1324 mansubdir=$withval
1325 else
1326 mansubdir=cat
1327 fi
1328 ], [
1329 if test -z "$MANTYPE" ; then
1330 MANTYPE='$(TROFFMAN)'
1331 mansubdir=man
1332 fi
1333 ]
1334)
1335AC_SUBST(MANTYPE)
1336AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001337
Damien Millera22ba012000-03-02 23:09:20 +11001338# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001339MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001340AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001341 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001342 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001343 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001344 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001345 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001346 fi
1347 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001348)
1349
Damien Millera22ba012000-03-02 23:09:20 +11001350# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001351AC_ARG_WITH(shadow,
1352 [ --without-shadow Disable shadow password support],
1353 [
1354 if test "x$withval" = "xno" ; then
1355 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001356 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001357 fi
1358 ]
1359)
1360
Damien Miller1f335fb2000-06-26 11:31:33 +10001361if test -z "$disable_shadow" ; then
1362 AC_MSG_CHECKING([if the systems has expire shadow information])
1363 AC_TRY_COMPILE(
1364 [
1365#include <sys/types.h>
1366#include <shadow.h>
1367 struct spwd sp;
1368 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1369 [ sp_expire_available=yes ], []
1370 )
1371
1372 if test "x$sp_expire_available" = "xyes" ; then
1373 AC_MSG_RESULT(yes)
1374 AC_DEFINE(HAS_SHADOW_EXPIRE)
1375 else
1376 AC_MSG_RESULT(no)
1377 fi
1378fi
1379
Damien Millera22ba012000-03-02 23:09:20 +11001380# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001381if test ! -z "$IPADDR_IN_DISPLAY" ; then
1382 DISPLAY_HACK_MSG="yes"
1383 AC_DEFINE(IPADDR_IN_DISPLAY)
1384else
1385 DISPLAY_HACK_MSG="no"
1386 AC_ARG_WITH(ipaddr-display,
1387 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1388 [
1389 if test "x$withval" != "xno" ; then
1390 AC_DEFINE(IPADDR_IN_DISPLAY)
1391 DISPLAY_HACK_MSG="yes"
1392 fi
1393 ]
1394 )
1395fi
Damien Miller76112de1999-12-21 11:18:08 +11001396
Damien Millera22ba012000-03-02 23:09:20 +11001397# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001398SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001399AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001400 [ --with-default-path=PATH Specify default \$PATH environment for server],
1401 [
1402 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001403 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001404 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001405 fi
1406 ]
1407)
1408
Damien Millera22ba012000-03-02 23:09:20 +11001409# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001410IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001411AC_ARG_WITH(ipv4-default,
1412 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1413 [
1414 if test "x$withval" != "xno" ; then
1415 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001416 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001417 fi
1418 ]
1419)
1420
Damien Miller61e50f12000-05-08 20:49:37 +10001421AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001422IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001423AC_ARG_WITH(4in6,
1424 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1425 [
1426 if test "x$withval" != "xno" ; then
1427 AC_MSG_RESULT(yes)
1428 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001429 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001430 else
1431 AC_MSG_RESULT(no)
1432 fi
1433 ],[
1434 if test "x$inet6_default_4in6" = "xyes"; then
1435 AC_MSG_RESULT([yes (default)])
1436 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001437 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001438 else
1439 AC_MSG_RESULT([no (default)])
1440 fi
1441 ]
1442)
1443
Damien Miller60396b02001-02-18 17:01:00 +11001444# Whether to enable BSD auth support
1445AC_ARG_WITH(bsd-auth,
1446 [ --with-bsd-auth Enable BSD auth support],
1447 [
1448 if test "x$withval" != "xno" ; then
1449 AC_DEFINE(BSD_AUTH)
1450 bsd_auth=yes
1451 fi
1452 ]
1453)
1454
Damien Miller78315eb2000-09-29 23:01:36 +11001455AC_MSG_CHECKING(whether to install ssh as suid root)
1456AC_ARG_ENABLE(suid-ssh,
1457[ --enable-suid-ssh Install ssh as suid root (default)
1458 --disable-suid-ssh Install ssh without suid bit],
1459[ case "$enableval" in
1460 no)
1461 AC_MSG_RESULT(no)
1462 SSHMODE=0711
1463 ;;
1464 *) AC_MSG_RESULT(yes)
1465 SSHMODE=04711
1466 ;;
1467 esac ],
1468 AC_MSG_RESULT(yes)
1469 SSHMODE=04711
1470)
1471AC_SUBST(SSHMODE)
1472
1473
Damien Millera22ba012000-03-02 23:09:20 +11001474# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001475piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001476AC_ARG_WITH(pid-dir,
1477 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1478 [
1479 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001480 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001481 fi
1482 ]
1483)
Damien Miller4018c192000-04-30 09:30:44 +10001484
Damien Miller78315eb2000-09-29 23:01:36 +11001485# make sure the directory exists
1486if test ! -d $piddir ; then
1487 piddir=`eval echo ${sysconfdir}`
1488 case $piddir in
1489 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1490 esac
1491fi
1492
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001493AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001494AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001495
andre2ff7b5d2000-06-03 14:57:40 +00001496dnl allow user to disable some login recording features
1497AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001498 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001499 [ AC_DEFINE(DISABLE_LASTLOG) ]
1500)
1501AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001502 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001503 [ AC_DEFINE(DISABLE_UTMP) ]
1504)
1505AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001506 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001507 [ AC_DEFINE(DISABLE_UTMPX) ]
1508)
1509AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001510 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001511 [ AC_DEFINE(DISABLE_WTMP) ]
1512)
1513AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001514 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001515 [ AC_DEFINE(DISABLE_WTMPX) ]
1516)
1517AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001518 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001519 [ AC_DEFINE(DISABLE_LOGIN) ]
1520)
1521AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001522 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001523 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1524)
1525AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001526 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001527 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1528)
1529AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001530 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001531 [
1532 if test "x$withval" = "xno" ; then
1533 AC_DEFINE(DISABLE_LASTLOG)
1534 else
1535 conf_lastlog_location=$withval
1536 fi
1537 ]
1538)
andre2ff7b5d2000-06-03 14:57:40 +00001539
1540dnl lastlog, [uw]tmpx? detection
1541dnl NOTE: set the paths in the platform section to avoid the
1542dnl need for command-line parameters
1543dnl lastlog and [uw]tmp are subject to a file search if all else fails
1544
1545dnl lastlog detection
1546dnl NOTE: the code itself will detect if lastlog is a directory
1547AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1548AC_TRY_COMPILE([
1549#include <sys/types.h>
1550#include <utmp.h>
1551#ifdef HAVE_LASTLOG_H
1552# include <lastlog.h>
1553#endif
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 *lastlog = LASTLOG_FILE; ],
1559 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001560 [
1561 AC_MSG_RESULT(no)
1562 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1563 AC_TRY_COMPILE([
1564#include <sys/types.h>
1565#include <utmp.h>
1566#ifdef HAVE_LASTLOG_H
1567# include <lastlog.h>
1568#endif
1569#ifdef HAVE_PATHS_H
1570# include <paths.h>
1571#endif
1572 ],
1573 [ char *lastlog = _PATH_LASTLOG; ],
1574 [ AC_MSG_RESULT(yes) ],
1575 [
andree441aa32000-06-12 22:34:38 +00001576 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001577 system_lastlog_path=no
1578 ])
1579 ]
andre2ff7b5d2000-06-03 14:57:40 +00001580)
Damien Miller2994e082000-06-04 15:51:47 +10001581
andre2ff7b5d2000-06-03 14:57:40 +00001582if test -z "$conf_lastlog_location"; then
1583 if test x"$system_lastlog_path" = x"no" ; then
1584 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001585 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001586 conf_lastlog_location=$f
1587 fi
1588 done
1589 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001590 AC_MSG_WARN([** Cannot find lastlog **])
1591 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001592 fi
1593 fi
1594fi
1595
1596if test -n "$conf_lastlog_location"; then
1597 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1598fi
1599
1600dnl utmp detection
1601AC_MSG_CHECKING([if your system defines UTMP_FILE])
1602AC_TRY_COMPILE([
1603#include <sys/types.h>
1604#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001605#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001606# include <paths.h>
1607#endif
1608 ],
1609 [ char *utmp = UTMP_FILE; ],
1610 [ AC_MSG_RESULT(yes) ],
1611 [ AC_MSG_RESULT(no)
1612 system_utmp_path=no ]
1613)
1614if test -z "$conf_utmp_location"; then
1615 if test x"$system_utmp_path" = x"no" ; then
1616 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1617 if test -f $f ; then
1618 conf_utmp_location=$f
1619 fi
1620 done
1621 if test -z "$conf_utmp_location"; then
1622 AC_DEFINE(DISABLE_UTMP)
1623 fi
1624 fi
1625fi
1626if test -n "$conf_utmp_location"; then
1627 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1628fi
1629
1630dnl wtmp detection
1631AC_MSG_CHECKING([if your system defines WTMP_FILE])
1632AC_TRY_COMPILE([
1633#include <sys/types.h>
1634#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001635#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001636# include <paths.h>
1637#endif
1638 ],
1639 [ char *wtmp = WTMP_FILE; ],
1640 [ AC_MSG_RESULT(yes) ],
1641 [ AC_MSG_RESULT(no)
1642 system_wtmp_path=no ]
1643)
1644if test -z "$conf_wtmp_location"; then
1645 if test x"$system_wtmp_path" = x"no" ; then
1646 for f in /usr/adm/wtmp /var/log/wtmp; do
1647 if test -f $f ; then
1648 conf_wtmp_location=$f
1649 fi
1650 done
1651 if test -z "$conf_wtmp_location"; then
1652 AC_DEFINE(DISABLE_WTMP)
1653 fi
1654 fi
1655fi
1656if test -n "$conf_wtmp_location"; then
1657 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1658fi
1659
1660
1661dnl utmpx detection - I don't know any system so perverse as to require
1662dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1663dnl there, though.
1664AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1665AC_TRY_COMPILE([
1666#include <sys/types.h>
1667#include <utmp.h>
1668#ifdef HAVE_UTMPX_H
1669#include <utmpx.h>
1670#endif
Damien Miller2994e082000-06-04 15:51:47 +10001671#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001672# include <paths.h>
1673#endif
1674 ],
1675 [ char *utmpx = UTMPX_FILE; ],
1676 [ AC_MSG_RESULT(yes) ],
1677 [ AC_MSG_RESULT(no)
1678 system_utmpx_path=no ]
1679)
1680if test -z "$conf_utmpx_location"; then
1681 if test x"$system_utmpx_path" = x"no" ; then
1682 AC_DEFINE(DISABLE_UTMPX)
1683 fi
1684else
1685 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1686fi
1687
1688dnl wtmpx detection
1689AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1690AC_TRY_COMPILE([
1691#include <sys/types.h>
1692#include <utmp.h>
1693#ifdef HAVE_UTMPX_H
1694#include <utmpx.h>
1695#endif
Damien Miller2994e082000-06-04 15:51:47 +10001696#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001697# include <paths.h>
1698#endif
1699 ],
1700 [ char *wtmpx = WTMPX_FILE; ],
1701 [ AC_MSG_RESULT(yes) ],
1702 [ AC_MSG_RESULT(no)
1703 system_wtmpx_path=no ]
1704)
1705if test -z "$conf_wtmpx_location"; then
1706 if test x"$system_wtmpx_path" = x"no" ; then
1707 AC_DEFINE(DISABLE_WTMPX)
1708 fi
1709else
1710 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1711fi
1712
Damien Miller4018c192000-04-30 09:30:44 +10001713
1714# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001715entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001716AC_ARG_WITH(entropy-timeout,
1717 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1718 [
1719 if test "x$withval" != "xno" ; then
1720 entropy_timeout=$withval
1721 fi
1722 ]
1723)
1724AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1725
1726
Damien Miller29ea30d2000-03-17 10:54:15 +11001727if test ! -z "$blibpath" ; then
1728 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1729 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1730fi
1731
Damien Millerbac2d8a2000-09-05 16:13:06 +11001732AC_EXEEXT
1733
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001734AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001735
Damien Miller7b22d652000-06-18 14:07:04 +10001736# Print summary of options
1737
1738if test x$MANTYPE = x'$(CATMAN)' ; then
1739 MAN_MSG=cat
1740else
1741 MAN_MSG=man
1742fi
1743if test ! -z "$RANDOM_POOL" ; then
1744 RAND_MSG="Device ($RANDOM_POOL)"
1745else
1746 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001747 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001748 else
1749 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001750 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001751 fi
1752fi
1753
1754# Someone please show me a better way :)
1755A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1756B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1757C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1758D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001759E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001760F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1761G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1762
1763echo ""
1764echo "OpenSSH configured has been configured with the following options."
1765echo " User binaries: $B"
1766echo " System binaries: $C"
1767echo " Configuration files: $D"
1768echo " Askpass program: $E"
1769echo " Manual pages: $F"
1770echo " PID file: $G"
1771echo " Random number collection: $RAND_MSG"
1772echo " Manpage format: $MAN_MSG"
1773echo " PAM support: ${PAM_MSG}"
1774echo " KerberosIV support: $KRB4_MSG"
1775echo " AFS support: $AFS_MSG"
1776echo " S/KEY support: $SKEY_MSG"
1777echo " TCP Wrappers support: $TCPW_MSG"
1778echo " MD5 password support: $MD5_MSG"
1779echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1780echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1781echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1782
Damien Miller60396b02001-02-18 17:01:00 +11001783if test ! -z "$bsd_auth"; then
1784 echo " BSD Auth support: yes"
1785fi
1786
Damien Miller7b22d652000-06-18 14:07:04 +10001787echo ""
1788
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001789echo " Host: ${host}"
1790echo " Compiler: ${CC}"
1791echo " Compiler flags: ${CFLAGS}"
1792echo "Preprocessor flags: ${CPPFLAGS}"
1793echo " Linker flags: ${LDFLAGS}"
1794echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001795
1796echo ""
1797
Damien Miller82cf0ce2000-12-20 13:34:48 +11001798if test "x$PAM_MSG" = "xyes" ; then
1799 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1800 echo "otherwise password authentication may fail. Example PAM control files"
1801 echo "can be found in the contrib/ subdirectory"
1802 echo ""
1803fi
1804
Damien Miller6f9c3372000-10-25 10:06:04 +11001805if test ! -z "$BUILTIN_RNG" ; then
1806 echo "WARNING: you are using the builtin random number collection service."
1807 echo "Please read WARNING.RNG and request that your OS vendor includes"
1808 echo "/dev/random in future versions of their OS."
1809 echo ""
1810fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001811
1812if test ! -z "$NO_SFTP"; then
1813 echo "sftp-server will be disabled. Your compiler does not support"
1814 echo "64bit integers."
1815 echo ""
1816fi
Damien Miller60396b02001-02-18 17:01:00 +11001817