blob: ec0274e702f97c0dede998b8d9443e98ce1f63fd [file] [log] [blame]
Kevin Steves0bd4b342002-01-05 23:24:27 +00001i# $Id: configure.ac,v 1.9 2002/01/05 23:24:28 stevesk Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110020AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110024
Damien Millere8bb4502001-09-25 16:39:35 +100025# System features
26AC_SYS_LARGEFILE
27
Damien Miller3f62aba2000-11-29 11:56:35 +110028if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
30fi
31
Damien Millerad833b32000-08-23 10:46:23 +100032# Use LOGIN_PROGRAM from environment if possible
33if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
35else
36 # Search for login
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
40 fi
41fi
42
Damien Miller166bd442000-03-16 10:48:25 +110043if test -z "$LD" ; then
44 LD=$CC
45fi
46AC_SUBST(LD)
47
Damien Miller166bd442000-03-16 10:48:25 +110048AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100049if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110051fi
52
Damien Millera22ba012000-03-02 23:09:20 +110053# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110054case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110055*-*-aix*)
56 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100059 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110060 blibpath="/usr/lib:/lib:/usr/local/lib"
61 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100062 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110063 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000064 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110066 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110067*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080068 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000070 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000074 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110075 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000076*-*-dgux*)
77 AC_DEFINE(IP_TOS_IS_BROKEN)
78 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000079*-*-darwin*)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 ;;
Damien Miller76112de1999-12-21 11:18:08 +110082*-*-hpux10*)
83 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100084 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110085 fi
Kevin Steves315f8b72001-06-28 00:24:41 +000086 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000091 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +000092 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110093 ;;
Damien Miller1bead332000-04-30 00:47:29 +100094*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +000095 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110096 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110097 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110098 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110099 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100100 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000102 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000103 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100104*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000105 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000106 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100107 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000108 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100109 ;;
110*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000112 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100113 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000118 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100119 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100120*-*-linux*)
121 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100122 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100123 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000124 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100126 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000127mips-sony-bsd|mips-sony-newsos4)
128 AC_DEFINE(HAVE_NEWS4)
129 SONY=1
130 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100131 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000132 )
133 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100134*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100135 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100136 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100137*-*-freebsd*)
138 check_for_libcrypt_later=1
139 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100142 conf_utmp_location=/etc/utmp
143 conf_wtmp_location=/usr/adm/wtmp
144 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000145 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000146 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000147 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100148 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000149 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000150 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100152*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100155 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100156 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
158 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000159 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000160 # hardwire lastlog location (can't detect it on some versions)
161 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000162 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
163 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
164 if test "$sol2ver" -ge 8; then
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(DISABLE_UTMP)
167 AC_DEFINE(DISABLE_WTMP)
168 else
169 AC_MSG_RESULT(no)
170 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100171 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000172*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000173 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000174 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100175 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100176 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/var/adm/wtmp
179 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000180 AC_DEFINE(USE_PIPES)
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"
Tim Rice13aae5e2001-10-21 17:53:58 -0700185 LIBS="$LIBS -lc89"
Ben Lindstrom34328342001-04-23 22:39:42 +0000186 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Kevin Steves0bd4b342002-01-05 23:24:27 +0000187 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000188 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000189*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700191 # /usr/ucblib MUST NOT be searched on ReliantUNIX
192 LDFLAGS="$LDFLAGS -L/usr/local/lib"
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)
Kevin Steves52dd4682001-03-08 18:26:57 +0000196 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700197 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
198 # Attention: always take care to bind libsocket and libnsl before libc,
199 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000200 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100201*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700204# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100205 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100206 ;;
207*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700210# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100211 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100212 ;;
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 Miller75b1d102000-01-07 14:01:41 +1100216 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100217*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000218 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100219 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700220 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100221 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100222 RANLIB=true
223 no_dev_ptmx=1
224 AC_DEFINE(BROKEN_SYS_TERMIO_H)
225 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100226 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000227 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000228 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100229 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100230 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700231 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700232 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100233 ;;
234*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100237 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000238 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100239 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100240 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100241 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000242 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000243 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100244 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700245 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000246 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000247*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700248 no_libsocket=1
249 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000250 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700251 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
252 LIBS="$LIBS -lgen -lrsc"
253 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000254*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000255 AC_MSG_CHECKING(for Digital Unix SIA)
256 no_osfsia=""
257 AC_ARG_WITH(osfsia,
258 [ --with-osfsia Enable Digital Unix SIA],
259 [
260 if test "x$withval" = "xno" ; then
261 AC_MSG_RESULT(disabled)
262 no_osfsia=1
263 fi
264 ],
265 )
266 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000267 if test -f /etc/sia/matrix.conf; then
268 AC_MSG_RESULT(yes)
269 AC_DEFINE(HAVE_OSF_SIA)
270 AC_DEFINE(DISABLE_LOGIN)
271 LIBS="$LIBS -lsecurity -ldb -lm -laud"
272 else
273 AC_MSG_RESULT(no)
274 fi
275 fi
276 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000277
278*-*-nto-qnx)
279 AC_DEFINE(USE_PIPES)
280 AC_DEFINE(NO_X11_UNIX_SOCKETS)
281 AC_DEFINE(MISSING_NFDBITS)
282 AC_DEFINE(MISSING_HOWMANY)
283 AC_DEFINE(MISSING_FD_MASK)
284 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100285esac
286
Damien Millere37bfc12000-06-05 09:37:43 +1000287# Allow user to specify flags
288AC_ARG_WITH(cflags,
289 [ --with-cflags Specify additional flags to pass to compiler],
290 [
291 if test "x$withval" != "xno" ; then
292 CFLAGS="$CFLAGS $withval"
293 fi
294 ]
295)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000296AC_ARG_WITH(cppflags,
297 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
298 [
299 if test "x$withval" != "xno"; then
300 CPPFLAGS="$CPPFLAGS $withval"
301 fi
302 ]
303)
Damien Millere37bfc12000-06-05 09:37:43 +1000304AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000305 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000306 [
307 if test "x$withval" != "xno" ; then
308 LDFLAGS="$LDFLAGS $withval"
309 fi
310 ]
311)
312AC_ARG_WITH(libs,
313 [ --with-libs Specify additional libraries to link with],
314 [
315 if test "x$withval" != "xno" ; then
316 LIBS="$LIBS $withval"
317 fi
318 ]
319)
320
Damien Millera22ba012000-03-02 23:09:20 +1100321# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700322AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
323AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000324
Damien Millerdf288022001-02-18 13:07:07 +1100325dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700326if test "x$with_tcp_wrappers" != "xno" ; then
327 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
328 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
329 fi
330fi
Damien Millerdf288022001-02-18 13:07:07 +1100331
Tim Rice13aae5e2001-10-21 17:53:58 -0700332AC_CHECK_FUNC(getspnam, ,
333 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700334
335dnl zlib is required
336AC_ARG_WITH(zlib,
337 [ --with-zlib=PATH Use zlib in PATH],
338 [
339 if test -d "$withval/lib"; then
340 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700341 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700342 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700343 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700344 fi
345 else
346 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700347 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700348 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700349 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700350 fi
351 fi
352 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700353 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700354 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700355 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700356 fi
357 ]
358)
359
Tim Rice17b93e52001-10-23 22:36:54 -0700360AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100361
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000362dnl UnixWare 2.x
363AC_CHECK_FUNC(strcasecmp,
364 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
365)
366AC_CHECK_FUNC(utimes,
367 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
368)
Damien Millerab18c411999-11-11 10:40:23 +1100369
Tim Ricee589a292001-11-03 11:09:32 -0800370dnl Checks for libutil functions
371AC_CHECK_HEADERS(libutil.h)
372AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
373AC_CHECK_FUNCS(logout updwtmp logwtmp)
374
Ben Lindstrom8697e082001-02-24 21:41:10 +0000375AC_FUNC_STRFTIME
376
Damien Millera22ba012000-03-02 23:09:20 +1100377# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700378AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700379 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700380 login_cap.h maillock.h netdb.h netgroup.h \
Ben Lindstromc97b1af2001-12-07 17:20:47 +0000381 netinet/in_systm.h paths.h poll.h pty.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700382 security/pam_appl.h shadow.h stddef.h stdint.h \
383 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
384 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
385 sys/stropts.h sys/sysmacros.h sys/time.h \
386 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
387 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100388
389# Check for ALTDIRFUNC glob() extension
390AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
391AC_EGREP_CPP(FOUNDIT,
392 [
393 #include <glob.h>
394 #ifdef GLOB_ALTDIRFUNC
395 FOUNDIT
396 #endif
397 ],
398 [
399 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
400 AC_MSG_RESULT(yes)
401 ],
402 [
403 AC_MSG_RESULT(no)
404 ]
405)
Damien Millerab18c411999-11-11 10:40:23 +1100406
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000407# Check for g.gl_matchc glob() extension
408AC_MSG_CHECKING(for gl_matchc field in glob_t)
409AC_EGREP_CPP(FOUNDIT,
410 [
411 #include <glob.h>
412 int main(void){glob_t g; g.gl_matchc = 1;}
413 ],
414 [
415 AC_DEFINE(GLOB_HAS_GL_MATCHC)
416 AC_MSG_RESULT(yes)
417 ],
418 [
419 AC_MSG_RESULT(no)
420 ]
421)
422
Damien Miller18bb4732001-03-28 14:35:30 +1000423AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
424AC_TRY_RUN(
425 [
426#include <sys/types.h>
427#include <dirent.h>
428int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
429 ],
430 [AC_MSG_RESULT(yes)],
431 [
432 AC_MSG_RESULT(no)
433 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
434 ]
435)
436
Damien Millerc547bf12001-02-16 10:18:12 +1100437# Check whether user wants S/Key support
438SKEY_MSG="no"
439AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700440 [ --with-skey[[=PATH]] Enable S/Key support
441 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100442 [
443 if test "x$withval" != "xno" ; then
444
445 if test "x$withval" != "xyes" ; then
446 CPPFLAGS="$CPPFLAGS -I${withval}/include"
447 LDFLAGS="$LDFLAGS -L${withval}/lib"
448 fi
449
450 AC_DEFINE(SKEY)
451 LIBS="-lskey $LIBS"
452 SKEY_MSG="yes"
453
454 AC_CHECK_FUNC(skey_keyinfo,
455 [],
456 [
457 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
458 ])
459 fi
460 ]
461)
462
463# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700464TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100465AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700466 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
467 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100468 [
469 if test "x$withval" != "xno" ; then
470 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700471 saved_LDFLAGS="$LDFLAGS"
472 saved_CPPFLAGS="$CPPFLAGS"
473 if test -n "${withval}" -a "${withval}" != "yes"; then
474 if test -d "${withval}/lib"; then
475 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700476 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700477 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700478 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700479 fi
480 else
481 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700482 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700483 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700484 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700485 fi
486 fi
487 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700488 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700489 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700490 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700491 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700492 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100493 LIBS="-lwrap $LIBS"
494 AC_MSG_CHECKING(for libwrap)
495 AC_TRY_LINK(
496 [
497#include <tcpd.h>
498 int deny_severity = 0, allow_severity = 0;
499 ],
500 [hosts_access(0);],
501 [
502 AC_MSG_RESULT(yes)
503 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700504 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100505 ],
506 [
507 AC_MSG_ERROR([*** libwrap missing])
508 ]
509 )
510 fi
511 ]
512)
513
Damien Millerad833b32000-08-23 10:46:23 +1000514dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700515AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
516 clock fchmod fchown freeaddrinfo futimes gai_strerror \
517 getaddrinfo getcwd getgrouplist getnameinfo getopt \
518 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
519 inet_ntop innetgr login_getcapbool md5_crypt memmove \
520 mkdtemp on_exit openpty readpassphrase realpath \
521 rresvport_af setdtablesize setegid setenv seteuid \
522 setlogin setproctitle setresgid setreuid setrlimit \
523 setsid setvbuf sigaction sigvec snprintf strerror \
524 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
525 vhangup vsnprintf waitpid __b64_ntop _getpty)
526
527dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700528AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700529 AC_CHECK_LIB(gen, dirname,[
530 AC_CACHE_CHECK([for broken dirname],
531 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700532 save_LIBS="$LIBS"
533 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700534 AC_TRY_RUN(
535 [
536#include <libgen.h>
537#include <string.h>
538
539int main(int argc, char **argv) {
540 char *s, buf[32];
541
542 strncpy(buf,"/etc", 32);
543 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700544 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700545 exit(1);
546 } else {
547 exit(0);
548 }
549}
550 ],
551 [ ac_cv_have_broken_dirname="no" ],
552 [ ac_cv_have_broken_dirname="yes" ]
553 )
Tim Rice17b93e52001-10-23 22:36:54 -0700554 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700555 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700556 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700557 LIBS="$LIBS -lgen"
558 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700559 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 fi
561 ])
562])
563
Damien Millerad833b32000-08-23 10:46:23 +1000564dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000565AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000566dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000567AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000568AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000569dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000570AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000571AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100572
Damien Miller5fc85652000-07-09 23:53:07 +1000573AC_CHECK_FUNC(getuserattr,
574 [AC_DEFINE(HAVE_GETUSERATTR)],
575 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
576)
577
Damien Miller04f80141999-11-19 15:32:34 +1100578AC_CHECK_FUNC(daemon,
579 [AC_DEFINE(HAVE_DAEMON)],
580 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
581)
582
Damien Miller9fb07e42000-03-05 16:22:59 +1100583AC_CHECK_FUNC(getpagesize,
584 [AC_DEFINE(HAVE_GETPAGESIZE)],
585 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
586)
587
Damien Millercb170cb2000-07-01 16:52:55 +1000588# Check for broken snprintf
589if test "x$ac_cv_func_snprintf" = "xyes" ; then
590 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
591 AC_TRY_RUN(
592 [
593#include <stdio.h>
594int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
595 ],
596 [AC_MSG_RESULT(yes)],
597 [
598 AC_MSG_RESULT(no)
599 AC_DEFINE(BROKEN_SNPRINTF)
600 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
601 ]
602 )
603fi
604
Damien Miller606f8802000-09-16 15:39:56 +1100605AC_FUNC_GETPGRP
606
Damien Millera64b57a2001-01-17 10:44:13 +1100607# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000608PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100609AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100610 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100611 [
Damien Millera64b57a2001-01-17 10:44:13 +1100612 if test "x$withval" != "xno" ; then
613 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
614 AC_MSG_ERROR([PAM headers not found])
615 fi
616
617 AC_CHECK_LIB(dl, dlopen, , )
618 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
619 AC_CHECK_FUNCS(pam_getenvlist)
620
621 disable_shadow=yes
622 PAM_MSG="yes"
623
624 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100625 fi
626 ]
627)
Damien Millera22ba012000-03-02 23:09:20 +1100628
Damien Millera64b57a2001-01-17 10:44:13 +1100629# Check for older PAM
630if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100631 # Check PAM strerror arguments (old PAM)
632 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
633 AC_TRY_COMPILE(
634 [
Damien Miller81171112000-04-23 11:14:01 +1000635#include <stdlib.h>
636#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100637 ],
638 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
639 [AC_MSG_RESULT(no)],
640 [
641 AC_DEFINE(HAVE_OLD_PAM)
642 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000643 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100644 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100645 )
Damien Millera22ba012000-03-02 23:09:20 +1100646fi
647
648# The big search for OpenSSL
649AC_ARG_WITH(ssl-dir,
650 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
651 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000652 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100653 tryssldir=$withval
654 fi
655 ]
656)
657
658saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100659saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000660saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100661if test "x$prefix" != "xNONE" ; then
662 tryssldir="$tryssldir $prefix"
663fi
Damien Miller61e50f12000-05-08 20:49:37 +1000664AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100665 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 +1100666 CPPFLAGS="$saved_CPPFLAGS"
667 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000668 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100669
670 # Skip directories if they don't exist
671 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
672 continue;
673 fi
674 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
675 # Try to use $ssldir/lib if it exists, otherwise
676 # $ssldir
677 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000678 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100679 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000680 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100681 fi
682 else
Damien Millerb68af622001-03-28 21:05:26 +1000683 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100684 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000685 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100686 fi
687 fi
688 # Try to use $ssldir/include if it exists, otherwise
689 # $ssldir
690 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000691 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100692 else
Damien Millerb68af622001-03-28 21:05:26 +1000693 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100694 fi
695 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000696
Damien Miller3b512e12000-05-17 23:29:18 +1000697 # Basic test to check for compatible version and correct linking
698 # *does not* test for RSA - that comes later.
699 AC_TRY_RUN(
700 [
Damien Millere59ce622000-05-01 20:54:17 +1000701#include <string.h>
702#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000703int main(void)
704{
Damien Miller3b512e12000-05-17 23:29:18 +1000705 char a[2048];
706 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000707 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000708 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000709}
Damien Miller3b512e12000-05-17 23:29:18 +1000710 ],
711 [
712 found_crypto=1
713 break;
714 ], []
715 )
Damien Miller61e50f12000-05-08 20:49:37 +1000716
717 if test ! -z "$found_crypto" ; then
718 break;
719 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100720 done
721
Damien Miller61e50f12000-05-08 20:49:37 +1000722 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100723 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100724 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000725 if test -z "$ssldir" ; then
726 ssldir="(system)"
727 fi
Damien Millera22ba012000-03-02 23:09:20 +1100728
Damien Miller61e50f12000-05-08 20:49:37 +1000729 ac_cv_openssldir=$ssldir
730])
731
Damien Milleredb82922000-06-20 13:25:52 +1000732if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000733 AC_DEFINE(HAVE_OPENSSL)
734 dnl Need to recover ssldir - test above runs in subshell
735 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100736 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100737 # Try to use $ssldir/lib if it exists, otherwise
738 # $ssldir
739 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000740 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100741 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000742 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100743 fi
744 else
Damien Millerb68af622001-03-28 21:05:26 +1000745 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100746 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000747 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100748 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100749 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100750 # Try to use $ssldir/include if it exists, otherwise
751 # $ssldir
752 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000753 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100754 else
Damien Millerb68af622001-03-28 21:05:26 +1000755 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100756 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100757 fi
Damien Millera22ba012000-03-02 23:09:20 +1100758fi
Damien Miller3b512e12000-05-17 23:29:18 +1000759LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000760
Damien Miller3b512e12000-05-17 23:29:18 +1000761# Now test RSA support
762saved_LIBS="$LIBS"
763AC_MSG_CHECKING([for RSA support])
764for WANTS_RSAREF in "" 1 ; do
765 if test -z "$WANTS_RSAREF" ; then
766 LIBS="$saved_LIBS"
767 else
768 LIBS="$saved_LIBS -lRSAglue -lrsaref"
769 fi
770 AC_TRY_RUN([
771#include <string.h>
772#include <openssl/rand.h>
773#include <openssl/rsa.h>
774#include <openssl/bn.h>
775#include <openssl/sha.h>
776int main(void)
777{
778 int num; RSA *key; static unsigned char p_in[] = "blahblah";
779 unsigned char c[256], p[256];
780 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
781 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
782 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
783 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
784}
785 ],
786 [
787 rsa_works=1
788 break;
789 ], [])
790done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000791LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000792
793if test ! -z "$no_rsa" ; then
794 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000795 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000796else
797 if test -z "$rsa_works" ; then
798 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000799 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000800 else
801 if test -z "$WANTS_RSAREF" ; then
802 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000803 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000804 else
Damien Miller7b22d652000-06-18 14:07:04 +1000805 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000806 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000807 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000808 fi
809 fi
810fi
Damien Millera22ba012000-03-02 23:09:20 +1100811
Damien Millera64b57a2001-01-17 10:44:13 +1100812# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
813# version in OpenSSL. Skip this for PAM
814if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100815 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100816fi
817
Ben Lindstromb5628642000-10-18 00:02:25 +0000818# Cheap hack to ensure NEWS-OS libraries are arranged right.
819if test ! -z "$SONY" ; then
820 LIBS="$LIBS -liberty";
821fi
822
Damien Millera22ba012000-03-02 23:09:20 +1100823# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100824AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100825AC_CHECK_SIZEOF(short int, 2)
826AC_CHECK_SIZEOF(int, 4)
827AC_CHECK_SIZEOF(long int, 4)
828AC_CHECK_SIZEOF(long long int, 8)
829
Damien Millera22ba012000-03-02 23:09:20 +1100830# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100831AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
832 AC_TRY_COMPILE(
833 [ #include <sys/types.h> ],
834 [ u_int a; a = 1;],
835 [ ac_cv_have_u_int="yes" ],
836 [ ac_cv_have_u_int="no" ]
837 )
838])
839if test "x$ac_cv_have_u_int" = "xyes" ; then
840 AC_DEFINE(HAVE_U_INT)
841 have_u_int=1
842fi
843
Damien Miller61e50f12000-05-08 20:49:37 +1000844AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
845 AC_TRY_COMPILE(
846 [ #include <sys/types.h> ],
847 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
848 [ ac_cv_have_intxx_t="yes" ],
849 [ ac_cv_have_intxx_t="no" ]
850 )
851])
852if test "x$ac_cv_have_intxx_t" = "xyes" ; then
853 AC_DEFINE(HAVE_INTXX_T)
854 have_intxx_t=1
855fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000856
857if (test -z "$have_intxx_t" && \
858 test "x$ac_cv_header_stdint_h" = "xyes")
859then
860 AC_MSG_CHECKING([for intXX_t types in stdint.h])
861 AC_TRY_COMPILE(
862 [ #include <stdint.h> ],
863 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
864 [
865 AC_DEFINE(HAVE_INTXX_T)
866 AC_MSG_RESULT(yes)
867 ],
868 [ AC_MSG_RESULT(no) ]
869 )
870fi
871
Damien Miller578783e2000-09-23 14:12:24 +1100872AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
873 AC_TRY_COMPILE(
874 [ #include <sys/types.h> ],
875 [ int64_t a; a = 1;],
876 [ ac_cv_have_int64_t="yes" ],
877 [ ac_cv_have_int64_t="no" ]
878 )
879])
880if test "x$ac_cv_have_int64_t" = "xyes" ; then
881 AC_DEFINE(HAVE_INT64_T)
882 have_int64_t=1
883fi
884
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000885if test -z "$have_int64_t" ; then
886 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
887 AC_TRY_COMPILE(
888 [ #include <sys/socket.h> ],
889 [ int64_t a; a = 1],
890 [
891 AC_DEFINE(HAVE_INT64_T)
892 AC_MSG_RESULT(yes)
893 ],
894 [ AC_MSG_RESULT(no) ]
895 )
896fi
897
Damien Miller61e50f12000-05-08 20:49:37 +1000898AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
899 AC_TRY_COMPILE(
900 [ #include <sys/types.h> ],
901 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
902 [ ac_cv_have_u_intxx_t="yes" ],
903 [ ac_cv_have_u_intxx_t="no" ]
904 )
905])
906if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
907 AC_DEFINE(HAVE_U_INTXX_T)
908 have_u_intxx_t=1
909fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100910
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000911if test -z "$have_u_intxx_t" ; then
912 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
913 AC_TRY_COMPILE(
914 [ #include <sys/socket.h> ],
915 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
916 [
917 AC_DEFINE(HAVE_U_INTXX_T)
918 AC_MSG_RESULT(yes)
919 ],
920 [ AC_MSG_RESULT(no) ]
921 )
922fi
923
Damien Miller578783e2000-09-23 14:12:24 +1100924AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
925 AC_TRY_COMPILE(
926 [ #include <sys/types.h> ],
927 [ u_int64_t a; a = 1;],
928 [ ac_cv_have_u_int64_t="yes" ],
929 [ ac_cv_have_u_int64_t="no" ]
930 )
931])
932if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
933 AC_DEFINE(HAVE_U_INT64_T)
934 have_u_int64_t=1
935fi
936
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000937if test -z "$have_u_intxx_t" ; then
938 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
939 AC_TRY_COMPILE(
940 [
941#include <sys/types.h>
942 ],
943 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
944 [ ac_cv_have_uintxx_t="yes" ],
945 [ ac_cv_have_uintxx_t="no" ]
946 )
947 ])
948 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
949 AC_DEFINE(HAVE_UINTXX_T)
950 fi
951fi
952
953if test -z "$have_uintxx_t" ; then
954 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
955 AC_TRY_COMPILE(
956 [ #include <stdint.h> ],
957 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
958 [
959 AC_DEFINE(HAVE_UINTXX_T)
960 AC_MSG_RESULT(yes)
961 ],
962 [ AC_MSG_RESULT(no) ]
963 )
964fi
965
Damien Milleredb82922000-06-20 13:25:52 +1000966if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
967 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100968then
969 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
970 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000971 [
972#include <sys/bitypes.h>
973 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100974 [
Damien Miller70494d12000-04-03 15:57:06 +1000975 int8_t a; int16_t b; int32_t c;
976 u_int8_t e; u_int16_t f; u_int32_t g;
977 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100978 ],
979 [
980 AC_DEFINE(HAVE_U_INTXX_T)
981 AC_DEFINE(HAVE_INTXX_T)
982 AC_MSG_RESULT(yes)
983 ],
984 [AC_MSG_RESULT(no)]
985 )
986fi
987
Damien Miller58be7382001-09-15 21:31:54 +1000988
989AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
990 AC_TRY_COMPILE(
991 [
992#include <sys/types.h>
993 ],
994 [ u_char foo; foo = 125; ],
995 [ ac_cv_have_u_char="yes" ],
996 [ ac_cv_have_u_char="no" ]
997 )
998])
999if test "x$ac_cv_have_u_char" = "xyes" ; then
1000 AC_DEFINE(HAVE_U_CHAR)
1001fi
1002
Tim Rice13aae5e2001-10-21 17:53:58 -07001003TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001004
Damien Miller61e50f12000-05-08 20:49:37 +10001005AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1006 AC_TRY_COMPILE(
1007 [
1008#include <sys/types.h>
1009 ],
1010 [ size_t foo; foo = 1235; ],
1011 [ ac_cv_have_size_t="yes" ],
1012 [ ac_cv_have_size_t="no" ]
1013 )
1014])
1015if test "x$ac_cv_have_size_t" = "xyes" ; then
1016 AC_DEFINE(HAVE_SIZE_T)
1017fi
Damien Miller95058511999-12-29 10:36:45 +11001018
Damien Miller615f9392000-05-17 22:53:33 +10001019AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1020 AC_TRY_COMPILE(
1021 [
1022#include <sys/types.h>
1023 ],
1024 [ ssize_t foo; foo = 1235; ],
1025 [ ac_cv_have_ssize_t="yes" ],
1026 [ ac_cv_have_ssize_t="no" ]
1027 )
1028])
1029if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1030 AC_DEFINE(HAVE_SSIZE_T)
1031fi
1032
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001033AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1034 AC_TRY_COMPILE(
1035 [
1036#include <time.h>
1037 ],
1038 [ clock_t foo; foo = 1235; ],
1039 [ ac_cv_have_clock_t="yes" ],
1040 [ ac_cv_have_clock_t="no" ]
1041 )
1042])
1043if test "x$ac_cv_have_clock_t" = "xyes" ; then
1044 AC_DEFINE(HAVE_CLOCK_T)
1045fi
1046
Damien Millerb54b40e2000-06-23 08:23:34 +10001047AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1048 AC_TRY_COMPILE(
1049 [
1050#include <sys/types.h>
1051#include <sys/socket.h>
1052 ],
1053 [ sa_family_t foo; foo = 1235; ],
1054 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001055 [ AC_TRY_COMPILE(
1056 [
1057#include <sys/types.h>
1058#include <sys/socket.h>
1059#include <netinet/in.h>
1060 ],
1061 [ sa_family_t foo; foo = 1235; ],
1062 [ ac_cv_have_sa_family_t="yes" ],
1063
Damien Millerb54b40e2000-06-23 08:23:34 +10001064 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001065 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001066 )
1067])
1068if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1069 AC_DEFINE(HAVE_SA_FAMILY_T)
1070fi
1071
Damien Miller0f91b4e2000-06-18 15:43:25 +10001072AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1073 AC_TRY_COMPILE(
1074 [
1075#include <sys/types.h>
1076 ],
1077 [ pid_t foo; foo = 1235; ],
1078 [ ac_cv_have_pid_t="yes" ],
1079 [ ac_cv_have_pid_t="no" ]
1080 )
1081])
1082if test "x$ac_cv_have_pid_t" = "xyes" ; then
1083 AC_DEFINE(HAVE_PID_T)
1084fi
1085
1086AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1087 AC_TRY_COMPILE(
1088 [
1089#include <sys/types.h>
1090 ],
1091 [ mode_t foo; foo = 1235; ],
1092 [ ac_cv_have_mode_t="yes" ],
1093 [ ac_cv_have_mode_t="no" ]
1094 )
1095])
1096if test "x$ac_cv_have_mode_t" = "xyes" ; then
1097 AC_DEFINE(HAVE_MODE_T)
1098fi
1099
Damien Miller61e50f12000-05-08 20:49:37 +10001100
1101AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1102 AC_TRY_COMPILE(
1103 [
Damien Miller81171112000-04-23 11:14:01 +10001104#include <sys/types.h>
1105#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001106 ],
1107 [ struct sockaddr_storage s; ],
1108 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1109 [ ac_cv_have_struct_sockaddr_storage="no" ]
1110 )
1111])
1112if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1113 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1114fi
Damien Miller34132e52000-01-14 15:45:46 +11001115
Damien Miller61e50f12000-05-08 20:49:37 +10001116AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1117 AC_TRY_COMPILE(
1118 [
Damien Miller7b22d652000-06-18 14:07:04 +10001119#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001120#include <netinet/in.h>
1121 ],
1122 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1123 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1124 [ ac_cv_have_struct_sockaddr_in6="no" ]
1125 )
1126])
1127if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1128 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1129fi
Damien Miller34132e52000-01-14 15:45:46 +11001130
Damien Miller61e50f12000-05-08 20:49:37 +10001131AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1132 AC_TRY_COMPILE(
1133 [
Damien Miller7b22d652000-06-18 14:07:04 +10001134#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001135#include <netinet/in.h>
1136 ],
1137 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1138 [ ac_cv_have_struct_in6_addr="yes" ],
1139 [ ac_cv_have_struct_in6_addr="no" ]
1140 )
1141])
1142if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1143 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1144fi
Damien Miller34132e52000-01-14 15:45:46 +11001145
Damien Miller61e50f12000-05-08 20:49:37 +10001146AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1147 AC_TRY_COMPILE(
1148 [
Damien Miller81171112000-04-23 11:14:01 +10001149#include <sys/types.h>
1150#include <sys/socket.h>
1151#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001152 ],
1153 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1154 [ ac_cv_have_struct_addrinfo="yes" ],
1155 [ ac_cv_have_struct_addrinfo="no" ]
1156 )
1157])
1158if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1159 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1160fi
1161
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001162AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1163 AC_TRY_COMPILE(
1164 [ #include <sys/time.h> ],
1165 [ struct timeval tv; tv.tv_sec = 1;],
1166 [ ac_cv_have_struct_timeval="yes" ],
1167 [ ac_cv_have_struct_timeval="no" ]
1168 )
1169])
1170if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1171 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1172 have_struct_timeval=1
1173fi
1174
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001175# If we don't have int64_t then we can't compile sftp-server. So don't
1176# even attempt to do it.
1177if test "x$ac_cv_have_int64_t" = "xno" -a \
1178 "x$ac_cv_sizeof_long_int" != "x8" -a \
1179 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1180 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001181else
1182dnl test snprintf (broken on SCO w/gcc)
1183 AC_TRY_RUN(
1184 [
1185#include <stdio.h>
1186#include <string.h>
1187#ifdef HAVE_SNPRINTF
1188main()
1189{
1190 char buf[50];
1191 char expected_out[50];
1192 int mazsize = 50 ;
1193#if (SIZEOF_LONG_INT == 8)
1194 long int num = 0x7fffffffffffffff;
1195#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001196 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001197#endif
1198 strcpy(expected_out, "9223372036854775807");
1199 snprintf(buf, mazsize, "%lld", num);
1200 if(strcmp(buf, expected_out) != 0)
1201 exit(1);
1202 exit(0);
1203}
1204#else
1205main() { exit(0); }
1206#endif
1207 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1208 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001209fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001210AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001211
Damien Miller78315eb2000-09-29 23:01:36 +11001212dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001213OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1214OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1215OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1216OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1217OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001218OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001219OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1220OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001221OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001222OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1223OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1224OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1225OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001226OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1227OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1228OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1229OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001230
1231AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001232
Damien Miller61e50f12000-05-08 20:49:37 +10001233AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1234 ac_cv_have_ss_family_in_struct_ss, [
1235 AC_TRY_COMPILE(
1236 [
Damien Miller81171112000-04-23 11:14:01 +10001237#include <sys/types.h>
1238#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001239 ],
1240 [ struct sockaddr_storage s; s.ss_family = 1; ],
1241 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1242 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1243 )
1244])
1245if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1246 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1247fi
1248
Damien Miller61e50f12000-05-08 20:49:37 +10001249AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1250 ac_cv_have___ss_family_in_struct_ss, [
1251 AC_TRY_COMPILE(
1252 [
Damien Miller81171112000-04-23 11:14:01 +10001253#include <sys/types.h>
1254#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001255 ],
1256 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1257 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1258 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1259 )
1260])
1261if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1262 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1263fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001264
Damien Millerad833b32000-08-23 10:46:23 +10001265AC_CACHE_CHECK([for pw_class field in struct passwd],
1266 ac_cv_have_pw_class_in_struct_passwd, [
1267 AC_TRY_COMPILE(
1268 [
Damien Millerad833b32000-08-23 10:46:23 +10001269#include <pwd.h>
1270 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001271 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001272 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1273 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1274 )
1275])
1276if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1277 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1278fi
1279
Kevin Steves82456952001-06-22 21:14:18 +00001280AC_CACHE_CHECK([for pw_expire field in struct passwd],
1281 ac_cv_have_pw_expire_in_struct_passwd, [
1282 AC_TRY_COMPILE(
1283 [
1284#include <pwd.h>
1285 ],
1286 [ struct passwd p; p.pw_expire = 0; ],
1287 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1288 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1289 )
1290])
1291if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1292 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1293fi
1294
1295AC_CACHE_CHECK([for pw_change field in struct passwd],
1296 ac_cv_have_pw_change_in_struct_passwd, [
1297 AC_TRY_COMPILE(
1298 [
1299#include <pwd.h>
1300 ],
1301 [ struct passwd p; p.pw_change = 0; ],
1302 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1303 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1304 )
1305])
1306if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1307 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1308fi
Damien Miller61e50f12000-05-08 20:49:37 +10001309
1310AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1311 AC_TRY_LINK([],
1312 [ extern char *__progname; printf("%s", __progname); ],
1313 [ ac_cv_libc_defines___progname="yes" ],
1314 [ ac_cv_libc_defines___progname="no" ]
1315 )
1316])
1317if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1318 AC_DEFINE(HAVE___PROGNAME)
1319fi
1320
Damien Miller4f8e6692001-07-14 13:22:53 +10001321AC_CACHE_CHECK([whether getopt has optreset support],
1322 ac_cv_have_getopt_optreset, [
1323 AC_TRY_LINK(
1324 [
1325#include <getopt.h>
1326 ],
1327 [ extern int optreset; optreset = 0; ],
1328 [ ac_cv_have_getopt_optreset="yes" ],
1329 [ ac_cv_have_getopt_optreset="no" ]
1330 )
1331])
1332if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1333 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1334fi
Damien Millera22ba012000-03-02 23:09:20 +11001335
Damien Millerecbb26d2000-07-15 14:59:14 +10001336AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1337 AC_TRY_LINK([],
1338 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1339 [ ac_cv_libc_defines_sys_errlist="yes" ],
1340 [ ac_cv_libc_defines_sys_errlist="no" ]
1341 )
1342])
1343if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1344 AC_DEFINE(HAVE_SYS_ERRLIST)
1345fi
1346
1347
Damien Miller11fa2cc2000-08-16 10:35:58 +10001348AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1349 AC_TRY_LINK([],
1350 [ extern int sys_nerr; printf("%i", sys_nerr);],
1351 [ ac_cv_libc_defines_sys_nerr="yes" ],
1352 [ ac_cv_libc_defines_sys_nerr="no" ]
1353 )
1354])
1355if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1356 AC_DEFINE(HAVE_SYS_NERR)
1357fi
1358
1359
Damien Millerc79bc0d2001-03-28 13:03:42 +10001360# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001361SCARD_MSG="no"
1362AC_ARG_WITH(smartcard,
1363 [ --with-smartcard Enable smartcard support],
1364 [
1365 if test "x$withval" != "xno" ; then
1366 if test "x$withval" != "xyes" ; then
1367 CPPFLAGS="$CPPFLAGS -I${withval}"
1368 LDFLAGS="$LDFLAGS -L${withval}"
1369 if test ! -z "$need_dash_r" ; then
1370 LDFLAGS="$LDFLAGS -R${withval}"
1371 fi
1372 if test ! -z "$blibpath" ; then
1373 blibpath="$blibpath:${withval}"
1374 fi
1375 fi
1376 AC_CHECK_HEADERS(sectok.h)
1377 if test "$ac_cv_header_sectok_h" != yes; then
1378 AC_MSG_ERROR(Can't find sectok.h)
1379 fi
1380 AC_CHECK_LIB(sectok, sectok_open)
1381 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1382 AC_MSG_ERROR(Can't find libsectok)
1383 fi
1384 AC_DEFINE(SMARTCARD)
1385 SCARD_MSG="yes"
1386 fi
1387 ]
1388)
1389
1390# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001391KRB4_MSG="no"
1392AC_ARG_WITH(kerberos4,
1393 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1394 [
1395 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001396 if test "x$withval" != "xyes" ; then
1397 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1398 LDFLAGS="$LDFLAGS -L${withval}/lib"
1399 if test ! -z "$need_dash_r" ; then
1400 LDFLAGS="$LDFLAGS -R${withval}/lib"
1401 fi
1402 if test ! -z "$blibpath" ; then
1403 blibpath="$blibpath:${withval}/lib"
1404 fi
1405 else
1406 if test -d /usr/include/kerberosIV ; then
1407 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1408 fi
1409 fi
1410
1411 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001412 if test "$ac_cv_header_krb_h" != yes; then
1413 AC_MSG_WARN([Cannot find krb.h, build may fail])
1414 fi
Damien Miller98344742001-03-28 14:37:06 +10001415 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001416 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001417 AC_CHECK_LIB(krb4, main)
1418 if test "$ac_cv_lib_krb4_main" != yes; then
1419 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1420 else
1421 KLIBS="-lkrb4"
1422 fi
1423 else
1424 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001425 fi
Damien Miller98344742001-03-28 14:37:06 +10001426 AC_CHECK_LIB(des, des_cbc_encrypt)
1427 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1428 AC_CHECK_LIB(des425, des_cbc_encrypt)
1429 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1430 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1431 else
1432 KLIBS="-ldes425"
1433 fi
1434 else
1435 KLIBS="-ldes"
1436 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001437 AC_CHECK_LIB(resolv, dn_expand, , )
1438 KRB4=yes
1439 KRB4_MSG="yes"
1440 AC_DEFINE(KRB4)
1441 fi
1442 ]
1443)
1444
1445# Check whether user wants AFS support
1446AFS_MSG="no"
1447AC_ARG_WITH(afs,
1448 [ --with-afs=PATH Enable AFS support],
1449 [
1450 if test "x$withval" != "xno" ; then
1451
1452 if test "x$withval" != "xyes" ; then
1453 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1454 LDFLAGS="$LDFLAGS -L${withval}/lib"
1455 fi
1456
1457 if test -z "$KRB4" ; then
1458 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1459 fi
1460
1461 LIBS="-lkafs $LIBS"
1462 if test ! -z "$AFS_LIBS" ; then
1463 LIBS="$LIBS $AFS_LIBS"
1464 fi
1465 AC_DEFINE(AFS)
1466 AFS_MSG="yes"
1467 fi
1468 ]
1469)
1470LIBS="$LIBS $KLIBS"
1471
Damien Millera22ba012000-03-02 23:09:20 +11001472# Looking for programs, paths and files
1473AC_ARG_WITH(rsh,
1474 [ --with-rsh=PATH Specify path to remote shell program ],
1475 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001476 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001477 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001478 fi
1479 ],
1480 [
1481 AC_PATH_PROG(rsh_path, rsh)
1482 ]
1483)
1484
1485AC_ARG_WITH(xauth,
1486 [ --with-xauth=PATH Specify path to xauth program ],
1487 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001488 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001489 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001490 fi
1491 ],
1492 [
Damien Miller78315eb2000-09-29 23:01:36 +11001493 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 +10001494 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001495 xauth_path="/usr/openwin/bin/xauth"
1496 fi
1497 ]
1498)
1499
Damien Millera19cf472000-11-29 13:28:50 +11001500if test -z "$xauth_path" ; then
1501 XAUTH_PATH="undefined"
1502 AC_SUBST(XAUTH_PATH)
1503else
Damien Millera22ba012000-03-02 23:09:20 +11001504 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001505 XAUTH_PATH=$xauth_path
1506 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001507fi
1508if test ! -z "$rsh_path" ; then
1509 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1510fi
1511
1512# Check for mail directory (last resort if we cannot get it from headers)
1513if test ! -z "$MAIL" ; then
1514 maildir=`dirname $MAIL`
1515 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1516fi
1517
Damien Millera22ba012000-03-02 23:09:20 +11001518if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001519 AC_CHECK_FILE("/dev/ptmx",
1520 [
1521 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1522 have_dev_ptmx=1
1523 ]
1524 )
Damien Millera22ba012000-03-02 23:09:20 +11001525fi
Damien Miller204ad072000-03-02 23:56:12 +11001526AC_CHECK_FILE("/dev/ptc",
1527 [
1528 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1529 have_dev_ptc=1
1530 ]
1531)
1532
Damien Millera22ba012000-03-02 23:09:20 +11001533# Options from here on. Some of these are preset by platform above
1534
Damien Millera22ba012000-03-02 23:09:20 +11001535# Check for user-specified random device, otherwise check /dev/urandom
1536AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001537 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001538 [
Damien Miller040f3832000-04-03 14:50:43 +10001539 if test "x$withval" != "xno" ; then
1540 RANDOM_POOL="$withval";
1541 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1542 fi
Damien Millera22ba012000-03-02 23:09:20 +11001543 ],
1544 [
1545 # Check for random device
1546 AC_CHECK_FILE("/dev/urandom",
1547 [
1548 RANDOM_POOL="/dev/urandom";
1549 AC_SUBST(RANDOM_POOL)
1550 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1551 ]
1552 )
1553 ]
1554)
1555
Damien Millerd0ccb982001-03-04 00:29:20 +11001556# Check for PRNGD/EGD pool file
1557AC_ARG_WITH(prngd-port,
1558 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1559 [
1560 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1561 PRNGD_PORT="$withval"
1562 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1563 fi
1564 ]
1565)
1566
1567# Check for PRNGD/EGD pool file
1568AC_ARG_WITH(prngd-socket,
1569 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001570 [
Damien Miller040f3832000-04-03 14:50:43 +10001571 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001572 PRNGD_SOCKET="$withval"
1573 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001574 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001575 ],
1576 [
1577 # Check for existing socket only if we don't have a random device already
1578 if test -z "$RANDOM_POOL" ; then
1579 AC_MSG_CHECKING(for PRNGD/EGD socket)
1580 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001581 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001582 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1583 PRNGD_SOCKET="$sock"
1584 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001585 break;
1586 fi
1587 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001588 if test ! -z "$PRNGD_SOCKET" ; then
1589 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001590 else
1591 AC_MSG_RESULT(not found)
1592 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001593 fi
Damien Millera22ba012000-03-02 23:09:20 +11001594 ]
1595)
1596
Damien Miller0736c4d2001-01-25 10:51:46 +11001597
Damien Miller0437b332000-05-02 09:56:41 +10001598# detect pathnames for entropy gathering commands, if we need them
1599INSTALL_SSH_PRNG_CMDS=""
1600rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001601if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller0437b332000-05-02 09:56:41 +10001602 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001603fi
Damien Miller0437b332000-05-02 09:56:41 +10001604AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1605
Damien Miller62116dc2001-12-24 01:41:47 +11001606# These programs are used to gather entropy from
1607OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1608OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1609OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1610OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1611OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1612OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1613OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1614OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1615OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1616OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1617OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1618OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1619OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1620OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1621OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1622OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1623
Damien Miller11e37f62000-04-08 18:23:30 +10001624
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001625AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001626 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001627 [
Damien Miller897741e2001-04-16 10:41:46 +10001628 case "$withval" in
1629 man|cat|doc)
1630 MANTYPE=$withval
1631 ;;
1632 *)
1633 AC_MSG_ERROR(invalid man type: $withval)
1634 ;;
1635 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001636 ]
1637)
Ben Lindstrombc709922001-04-18 18:04:21 +00001638if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001639 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001640 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1641 MANTYPE=doc
1642 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1643 MANTYPE=man
1644 else
1645 MANTYPE=cat
1646 fi
1647fi
Damien Miller670a4b82000-01-22 13:53:11 +11001648AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001649if test "$MANTYPE" = "doc"; then
1650 mansubdir=man;
1651else
1652 mansubdir=$MANTYPE;
1653fi
1654AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001655
Damien Millera22ba012000-03-02 23:09:20 +11001656# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001657MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001658AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001659 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001660 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001661 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001662 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001663 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001664 fi
1665 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001666)
1667
Damien Millera22ba012000-03-02 23:09:20 +11001668# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001669AC_ARG_WITH(shadow,
1670 [ --without-shadow Disable shadow password support],
1671 [
1672 if test "x$withval" = "xno" ; then
1673 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001674 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001675 fi
1676 ]
1677)
1678
Damien Miller1f335fb2000-06-26 11:31:33 +10001679if test -z "$disable_shadow" ; then
1680 AC_MSG_CHECKING([if the systems has expire shadow information])
1681 AC_TRY_COMPILE(
1682 [
1683#include <sys/types.h>
1684#include <shadow.h>
1685 struct spwd sp;
1686 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1687 [ sp_expire_available=yes ], []
1688 )
1689
1690 if test "x$sp_expire_available" = "xyes" ; then
1691 AC_MSG_RESULT(yes)
1692 AC_DEFINE(HAS_SHADOW_EXPIRE)
1693 else
1694 AC_MSG_RESULT(no)
1695 fi
1696fi
1697
Damien Millera22ba012000-03-02 23:09:20 +11001698# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001699if test ! -z "$IPADDR_IN_DISPLAY" ; then
1700 DISPLAY_HACK_MSG="yes"
1701 AC_DEFINE(IPADDR_IN_DISPLAY)
1702else
1703 DISPLAY_HACK_MSG="no"
1704 AC_ARG_WITH(ipaddr-display,
1705 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1706 [
1707 if test "x$withval" != "xno" ; then
1708 AC_DEFINE(IPADDR_IN_DISPLAY)
1709 DISPLAY_HACK_MSG="yes"
1710 fi
1711 ]
1712 )
1713fi
Damien Miller76112de1999-12-21 11:18:08 +11001714
Damien Millera22ba012000-03-02 23:09:20 +11001715# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001716SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001717AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001718 [ --with-default-path=PATH Specify default \$PATH environment for server],
1719 [
1720 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001721 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001722 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001723 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001724 ],
1725 [
1726 AC_TRY_RUN(
1727 [
1728/* find out what STDPATH is */
1729#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001730#ifdef HAVE_PATHS_H
1731# include <paths.h>
1732#endif
1733#ifndef _PATH_STDPATH
1734# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1735#endif
1736#include <sys/types.h>
1737#include <sys/stat.h>
1738#include <fcntl.h>
1739#define DATA "conftest.stdpath"
1740
1741main()
1742{
1743 FILE *fd;
1744 int rc;
1745
1746 fd = fopen(DATA,"w");
1747 if(fd == NULL)
1748 exit(1);
1749
1750 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1751 exit(1);
1752
1753 exit(0);
1754}
1755 ], [ user_path=`cat conftest.stdpath` ],
1756 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1757 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1758 )
1759# make sure $bindir is in USER_PATH so scp will work
1760 t_bindir=`eval echo ${bindir}`
1761 case $t_bindir in
1762 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1763 esac
1764 case $t_bindir in
1765 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1766 esac
1767 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1768 if test $? -ne 0 ; then
1769 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1770 if test $? -ne 0 ; then
1771 user_path=$user_path:$t_bindir
1772 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1773 fi
1774 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001775 ]
1776)
Tim Rice59ea0a02001-03-10 13:50:45 -08001777AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1778AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001779
Damien Millera22ba012000-03-02 23:09:20 +11001780# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001781IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001782AC_ARG_WITH(ipv4-default,
1783 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1784 [
1785 if test "x$withval" != "xno" ; then
1786 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001787 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001788 fi
1789 ]
1790)
1791
Damien Miller61e50f12000-05-08 20:49:37 +10001792AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001793IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001794AC_ARG_WITH(4in6,
1795 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1796 [
1797 if test "x$withval" != "xno" ; then
1798 AC_MSG_RESULT(yes)
1799 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001800 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001801 else
1802 AC_MSG_RESULT(no)
1803 fi
1804 ],[
1805 if test "x$inet6_default_4in6" = "xyes"; then
1806 AC_MSG_RESULT([yes (default)])
1807 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001808 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001809 else
1810 AC_MSG_RESULT([no (default)])
1811 fi
1812 ]
1813)
1814
Damien Miller60396b02001-02-18 17:01:00 +11001815# Whether to enable BSD auth support
1816AC_ARG_WITH(bsd-auth,
1817 [ --with-bsd-auth Enable BSD auth support],
1818 [
1819 if test "x$withval" != "xno" ; then
1820 AC_DEFINE(BSD_AUTH)
1821 bsd_auth=yes
1822 fi
1823 ]
1824)
1825
Damien Miller78315eb2000-09-29 23:01:36 +11001826AC_MSG_CHECKING(whether to install ssh as suid root)
1827AC_ARG_ENABLE(suid-ssh,
1828[ --enable-suid-ssh Install ssh as suid root (default)
1829 --disable-suid-ssh Install ssh without suid bit],
1830[ case "$enableval" in
1831 no)
1832 AC_MSG_RESULT(no)
1833 SSHMODE=0711
1834 ;;
1835 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001836 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001837 ;;
1838 esac ],
1839 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001840 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001841)
1842AC_SUBST(SSHMODE)
1843
1844
Damien Millera22ba012000-03-02 23:09:20 +11001845# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001846piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001847AC_ARG_WITH(pid-dir,
1848 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1849 [
1850 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001851 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001852 fi
1853 ]
1854)
Damien Miller4018c192000-04-30 09:30:44 +10001855
Damien Miller78315eb2000-09-29 23:01:36 +11001856# make sure the directory exists
1857if test ! -d $piddir ; then
1858 piddir=`eval echo ${sysconfdir}`
1859 case $piddir in
1860 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1861 esac
1862fi
1863
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001864AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001865AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001866
andre2ff7b5d2000-06-03 14:57:40 +00001867dnl allow user to disable some login recording features
1868AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001869 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001870 [ AC_DEFINE(DISABLE_LASTLOG) ]
1871)
1872AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001873 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001874 [ AC_DEFINE(DISABLE_UTMP) ]
1875)
1876AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001877 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001878 [ AC_DEFINE(DISABLE_UTMPX) ]
1879)
1880AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001881 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001882 [ AC_DEFINE(DISABLE_WTMP) ]
1883)
1884AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001885 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001886 [ AC_DEFINE(DISABLE_WTMPX) ]
1887)
1888AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001889 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001890 [ AC_DEFINE(DISABLE_LOGIN) ]
1891)
1892AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001893 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001894 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1895)
1896AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001897 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001898 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1899)
1900AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001901 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001902 [
1903 if test "x$withval" = "xno" ; then
1904 AC_DEFINE(DISABLE_LASTLOG)
1905 else
1906 conf_lastlog_location=$withval
1907 fi
1908 ]
1909)
andre2ff7b5d2000-06-03 14:57:40 +00001910
1911dnl lastlog, [uw]tmpx? detection
1912dnl NOTE: set the paths in the platform section to avoid the
1913dnl need for command-line parameters
1914dnl lastlog and [uw]tmp are subject to a file search if all else fails
1915
1916dnl lastlog detection
1917dnl NOTE: the code itself will detect if lastlog is a directory
1918AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1919AC_TRY_COMPILE([
1920#include <sys/types.h>
1921#include <utmp.h>
1922#ifdef HAVE_LASTLOG_H
1923# include <lastlog.h>
1924#endif
Damien Miller2994e082000-06-04 15:51:47 +10001925#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001926# include <paths.h>
1927#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001928#ifdef HAVE_LOGIN_H
1929# include <login.h>
1930#endif
andre2ff7b5d2000-06-03 14:57:40 +00001931 ],
1932 [ char *lastlog = LASTLOG_FILE; ],
1933 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001934 [
1935 AC_MSG_RESULT(no)
1936 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1937 AC_TRY_COMPILE([
1938#include <sys/types.h>
1939#include <utmp.h>
1940#ifdef HAVE_LASTLOG_H
1941# include <lastlog.h>
1942#endif
1943#ifdef HAVE_PATHS_H
1944# include <paths.h>
1945#endif
1946 ],
1947 [ char *lastlog = _PATH_LASTLOG; ],
1948 [ AC_MSG_RESULT(yes) ],
1949 [
andree441aa32000-06-12 22:34:38 +00001950 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001951 system_lastlog_path=no
1952 ])
1953 ]
andre2ff7b5d2000-06-03 14:57:40 +00001954)
Damien Miller2994e082000-06-04 15:51:47 +10001955
andre2ff7b5d2000-06-03 14:57:40 +00001956if test -z "$conf_lastlog_location"; then
1957 if test x"$system_lastlog_path" = x"no" ; then
1958 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001959 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001960 conf_lastlog_location=$f
1961 fi
1962 done
1963 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001964 AC_MSG_WARN([** Cannot find lastlog **])
1965 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001966 fi
1967 fi
1968fi
1969
1970if test -n "$conf_lastlog_location"; then
1971 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1972fi
1973
1974dnl utmp detection
1975AC_MSG_CHECKING([if your system defines UTMP_FILE])
1976AC_TRY_COMPILE([
1977#include <sys/types.h>
1978#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001979#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001980# include <paths.h>
1981#endif
1982 ],
1983 [ char *utmp = UTMP_FILE; ],
1984 [ AC_MSG_RESULT(yes) ],
1985 [ AC_MSG_RESULT(no)
1986 system_utmp_path=no ]
1987)
1988if test -z "$conf_utmp_location"; then
1989 if test x"$system_utmp_path" = x"no" ; then
1990 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1991 if test -f $f ; then
1992 conf_utmp_location=$f
1993 fi
1994 done
1995 if test -z "$conf_utmp_location"; then
1996 AC_DEFINE(DISABLE_UTMP)
1997 fi
1998 fi
1999fi
2000if test -n "$conf_utmp_location"; then
2001 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2002fi
2003
2004dnl wtmp detection
2005AC_MSG_CHECKING([if your system defines WTMP_FILE])
2006AC_TRY_COMPILE([
2007#include <sys/types.h>
2008#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002009#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002010# include <paths.h>
2011#endif
2012 ],
2013 [ char *wtmp = WTMP_FILE; ],
2014 [ AC_MSG_RESULT(yes) ],
2015 [ AC_MSG_RESULT(no)
2016 system_wtmp_path=no ]
2017)
2018if test -z "$conf_wtmp_location"; then
2019 if test x"$system_wtmp_path" = x"no" ; then
2020 for f in /usr/adm/wtmp /var/log/wtmp; do
2021 if test -f $f ; then
2022 conf_wtmp_location=$f
2023 fi
2024 done
2025 if test -z "$conf_wtmp_location"; then
2026 AC_DEFINE(DISABLE_WTMP)
2027 fi
2028 fi
2029fi
2030if test -n "$conf_wtmp_location"; then
2031 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2032fi
2033
2034
2035dnl utmpx detection - I don't know any system so perverse as to require
2036dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2037dnl there, though.
2038AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2039AC_TRY_COMPILE([
2040#include <sys/types.h>
2041#include <utmp.h>
2042#ifdef HAVE_UTMPX_H
2043#include <utmpx.h>
2044#endif
Damien Miller2994e082000-06-04 15:51:47 +10002045#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002046# include <paths.h>
2047#endif
2048 ],
2049 [ char *utmpx = UTMPX_FILE; ],
2050 [ AC_MSG_RESULT(yes) ],
2051 [ AC_MSG_RESULT(no)
2052 system_utmpx_path=no ]
2053)
2054if test -z "$conf_utmpx_location"; then
2055 if test x"$system_utmpx_path" = x"no" ; then
2056 AC_DEFINE(DISABLE_UTMPX)
2057 fi
2058else
2059 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2060fi
2061
2062dnl wtmpx detection
2063AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2064AC_TRY_COMPILE([
2065#include <sys/types.h>
2066#include <utmp.h>
2067#ifdef HAVE_UTMPX_H
2068#include <utmpx.h>
2069#endif
Damien Miller2994e082000-06-04 15:51:47 +10002070#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002071# include <paths.h>
2072#endif
2073 ],
2074 [ char *wtmpx = WTMPX_FILE; ],
2075 [ AC_MSG_RESULT(yes) ],
2076 [ AC_MSG_RESULT(no)
2077 system_wtmpx_path=no ]
2078)
2079if test -z "$conf_wtmpx_location"; then
2080 if test x"$system_wtmpx_path" = x"no" ; then
2081 AC_DEFINE(DISABLE_WTMPX)
2082 fi
2083else
2084 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2085fi
2086
Damien Miller4018c192000-04-30 09:30:44 +10002087
2088# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10002089entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10002090AC_ARG_WITH(entropy-timeout,
2091 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2092 [
2093 if test "x$withval" != "xno" ; then
2094 entropy_timeout=$withval
2095 fi
2096 ]
2097)
2098AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
2099
2100
Damien Miller29ea30d2000-03-17 10:54:15 +11002101if test ! -z "$blibpath" ; then
2102 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2103 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2104fi
2105
Damien Millerbac2d8a2000-09-05 16:13:06 +11002106AC_EXEEXT
2107
Tim Rice13aae5e2001-10-21 17:53:58 -07002108AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2109AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002110
Damien Miller7b22d652000-06-18 14:07:04 +10002111# Print summary of options
2112
Damien Miller7b22d652000-06-18 14:07:04 +10002113if test ! -z "$RANDOM_POOL" ; then
2114 RAND_MSG="Device ($RANDOM_POOL)"
2115else
Damien Millerd0ccb982001-03-04 00:29:20 +11002116 if test ! -z "$PRNGD_PORT" ; then
2117 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
2118 elif test ! -z "$PRNGD_SOCKET" ; then
2119 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10002120 else
2121 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11002122 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10002123 fi
2124fi
2125
2126# Someone please show me a better way :)
2127A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2128B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2129C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2130D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002131E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002132F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002133G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002134H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002135
2136echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002137echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002138echo " User binaries: $B"
2139echo " System binaries: $C"
2140echo " Configuration files: $D"
2141echo " Askpass program: $E"
2142echo " Manual pages: $F"
2143echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002144echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10002145echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10002146echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002147echo " PAM support: ${PAM_MSG}"
2148echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002149echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002150echo " AFS support: $AFS_MSG"
2151echo " S/KEY support: $SKEY_MSG"
2152echo " TCP Wrappers support: $TCPW_MSG"
2153echo " MD5 password support: $MD5_MSG"
2154echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2155echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2156echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2157
Damien Miller60396b02001-02-18 17:01:00 +11002158if test ! -z "$bsd_auth"; then
2159 echo " BSD Auth support: yes"
2160fi
2161
Damien Miller7b22d652000-06-18 14:07:04 +10002162echo ""
2163
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002164echo " Host: ${host}"
2165echo " Compiler: ${CC}"
2166echo " Compiler flags: ${CFLAGS}"
2167echo "Preprocessor flags: ${CPPFLAGS}"
2168echo " Linker flags: ${LDFLAGS}"
2169echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002170
2171echo ""
2172
Damien Miller82cf0ce2000-12-20 13:34:48 +11002173if test "x$PAM_MSG" = "xyes" ; then
2174 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2175 echo "otherwise password authentication may fail. Example PAM control files"
2176 echo "can be found in the contrib/ subdirectory"
2177 echo ""
2178fi
2179
Damien Miller6f9c3372000-10-25 10:06:04 +11002180if test ! -z "$BUILTIN_RNG" ; then
2181 echo "WARNING: you are using the builtin random number collection service."
2182 echo "Please read WARNING.RNG and request that your OS vendor includes"
2183 echo "/dev/random in future versions of their OS."
2184 echo ""
2185fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002186
2187if test ! -z "$NO_SFTP"; then
2188 echo "sftp-server will be disabled. Your compiler does not support"
2189 echo "64bit integers."
2190 echo ""
2191fi
Damien Miller60396b02001-02-18 17:01:00 +11002192