blob: ae2b6a7a5308ad16bd2a3806d63c6c64f50cd345 [file] [log] [blame]
Ben Lindstromc97b1af2001-12-07 17:20:47 +00001# $Id: configure.ac,v 1.6 2001/12/07 17:20:48 mouring 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)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000187 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000188*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700190 # /usr/ucblib MUST NOT be searched on ReliantUNIX
191 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100192 IPADDR_IN_DISPLAY=yes
193 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000194 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000195 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700196 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
197 # Attention: always take care to bind libsocket and libnsl before libc,
198 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000199 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100200*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000201 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100202 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700203# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100204 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100205 ;;
206*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100208 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700209# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100210 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100211 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100212*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000213 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100215 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100216*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000217 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700219 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100220 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100221 RANLIB=true
222 no_dev_ptmx=1
223 AC_DEFINE(BROKEN_SYS_TERMIO_H)
224 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100225 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000226 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000227 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100228 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100229 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700230 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700231 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100232 ;;
233*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000234 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100236 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000237 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100238 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100239 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100240 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000241 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000242 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100243 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700244 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000245 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000246*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700247 no_libsocket=1
248 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000249 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700250 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
251 LIBS="$LIBS -lgen -lrsc"
252 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000253*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000254 AC_MSG_CHECKING(for Digital Unix SIA)
255 no_osfsia=""
256 AC_ARG_WITH(osfsia,
257 [ --with-osfsia Enable Digital Unix SIA],
258 [
259 if test "x$withval" = "xno" ; then
260 AC_MSG_RESULT(disabled)
261 no_osfsia=1
262 fi
263 ],
264 )
265 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000266 if test -f /etc/sia/matrix.conf; then
267 AC_MSG_RESULT(yes)
268 AC_DEFINE(HAVE_OSF_SIA)
269 AC_DEFINE(DISABLE_LOGIN)
270 LIBS="$LIBS -lsecurity -ldb -lm -laud"
271 else
272 AC_MSG_RESULT(no)
273 fi
274 fi
275 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000276
277*-*-nto-qnx)
278 AC_DEFINE(USE_PIPES)
279 AC_DEFINE(NO_X11_UNIX_SOCKETS)
280 AC_DEFINE(MISSING_NFDBITS)
281 AC_DEFINE(MISSING_HOWMANY)
282 AC_DEFINE(MISSING_FD_MASK)
283 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100284esac
285
Damien Millere37bfc12000-06-05 09:37:43 +1000286# Allow user to specify flags
287AC_ARG_WITH(cflags,
288 [ --with-cflags Specify additional flags to pass to compiler],
289 [
290 if test "x$withval" != "xno" ; then
291 CFLAGS="$CFLAGS $withval"
292 fi
293 ]
294)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000295AC_ARG_WITH(cppflags,
296 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
297 [
298 if test "x$withval" != "xno"; then
299 CPPFLAGS="$CPPFLAGS $withval"
300 fi
301 ]
302)
Damien Millere37bfc12000-06-05 09:37:43 +1000303AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000304 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000305 [
306 if test "x$withval" != "xno" ; then
307 LDFLAGS="$LDFLAGS $withval"
308 fi
309 ]
310)
311AC_ARG_WITH(libs,
312 [ --with-libs Specify additional libraries to link with],
313 [
314 if test "x$withval" != "xno" ; then
315 LIBS="$LIBS $withval"
316 fi
317 ]
318)
319
Damien Millera22ba012000-03-02 23:09:20 +1100320# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700321AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
322AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000323
Damien Millerdf288022001-02-18 13:07:07 +1100324dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700325if test "x$with_tcp_wrappers" != "xno" ; then
326 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
327 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
328 fi
329fi
Damien Millerdf288022001-02-18 13:07:07 +1100330
Tim Rice13aae5e2001-10-21 17:53:58 -0700331AC_CHECK_FUNC(getspnam, ,
332 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700333
334dnl zlib is required
335AC_ARG_WITH(zlib,
336 [ --with-zlib=PATH Use zlib in PATH],
337 [
338 if test -d "$withval/lib"; then
339 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700340 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700341 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700342 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 fi
344 else
345 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700346 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700347 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700348 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700349 fi
350 fi
351 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700352 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700353 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700354 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700355 fi
356 ]
357)
358
Tim Rice17b93e52001-10-23 22:36:54 -0700359AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100360
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000361dnl UnixWare 2.x
362AC_CHECK_FUNC(strcasecmp,
363 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
364)
365AC_CHECK_FUNC(utimes,
366 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
367)
Damien Millerab18c411999-11-11 10:40:23 +1100368
Tim Ricee589a292001-11-03 11:09:32 -0800369dnl Checks for libutil functions
370AC_CHECK_HEADERS(libutil.h)
371AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
372AC_CHECK_FUNCS(logout updwtmp logwtmp)
373
Ben Lindstrom8697e082001-02-24 21:41:10 +0000374AC_FUNC_STRFTIME
375
Damien Millera22ba012000-03-02 23:09:20 +1100376# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700377AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700378 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700379 login_cap.h maillock.h netdb.h netgroup.h \
Ben Lindstromc97b1af2001-12-07 17:20:47 +0000380 netinet/in_systm.h paths.h poll.h pty.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700381 security/pam_appl.h shadow.h stddef.h stdint.h \
382 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
383 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
384 sys/stropts.h sys/sysmacros.h sys/time.h \
385 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
386 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100387
388# Check for ALTDIRFUNC glob() extension
389AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
390AC_EGREP_CPP(FOUNDIT,
391 [
392 #include <glob.h>
393 #ifdef GLOB_ALTDIRFUNC
394 FOUNDIT
395 #endif
396 ],
397 [
398 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
399 AC_MSG_RESULT(yes)
400 ],
401 [
402 AC_MSG_RESULT(no)
403 ]
404)
Damien Millerab18c411999-11-11 10:40:23 +1100405
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000406# Check for g.gl_matchc glob() extension
407AC_MSG_CHECKING(for gl_matchc field in glob_t)
408AC_EGREP_CPP(FOUNDIT,
409 [
410 #include <glob.h>
411 int main(void){glob_t g; g.gl_matchc = 1;}
412 ],
413 [
414 AC_DEFINE(GLOB_HAS_GL_MATCHC)
415 AC_MSG_RESULT(yes)
416 ],
417 [
418 AC_MSG_RESULT(no)
419 ]
420)
421
Damien Miller18bb4732001-03-28 14:35:30 +1000422AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
423AC_TRY_RUN(
424 [
425#include <sys/types.h>
426#include <dirent.h>
427int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
428 ],
429 [AC_MSG_RESULT(yes)],
430 [
431 AC_MSG_RESULT(no)
432 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
433 ]
434)
435
Damien Millerc547bf12001-02-16 10:18:12 +1100436# Check whether user wants S/Key support
437SKEY_MSG="no"
438AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700439 [ --with-skey[[=PATH]] Enable S/Key support
440 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100441 [
442 if test "x$withval" != "xno" ; then
443
444 if test "x$withval" != "xyes" ; then
445 CPPFLAGS="$CPPFLAGS -I${withval}/include"
446 LDFLAGS="$LDFLAGS -L${withval}/lib"
447 fi
448
449 AC_DEFINE(SKEY)
450 LIBS="-lskey $LIBS"
451 SKEY_MSG="yes"
452
453 AC_CHECK_FUNC(skey_keyinfo,
454 [],
455 [
456 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
457 ])
458 fi
459 ]
460)
461
462# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700463TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100464AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700465 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
466 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100467 [
468 if test "x$withval" != "xno" ; then
469 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700470 saved_LDFLAGS="$LDFLAGS"
471 saved_CPPFLAGS="$CPPFLAGS"
472 if test -n "${withval}" -a "${withval}" != "yes"; then
473 if test -d "${withval}/lib"; then
474 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700475 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700476 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700477 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700478 fi
479 else
480 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700481 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700482 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700483 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700484 fi
485 fi
486 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700487 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700488 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700489 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700490 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700491 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100492 LIBS="-lwrap $LIBS"
493 AC_MSG_CHECKING(for libwrap)
494 AC_TRY_LINK(
495 [
496#include <tcpd.h>
497 int deny_severity = 0, allow_severity = 0;
498 ],
499 [hosts_access(0);],
500 [
501 AC_MSG_RESULT(yes)
502 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700503 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100504 ],
505 [
506 AC_MSG_ERROR([*** libwrap missing])
507 ]
508 )
509 fi
510 ]
511)
512
Damien Millerad833b32000-08-23 10:46:23 +1000513dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700514AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
515 clock fchmod fchown freeaddrinfo futimes gai_strerror \
516 getaddrinfo getcwd getgrouplist getnameinfo getopt \
517 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
518 inet_ntop innetgr login_getcapbool md5_crypt memmove \
519 mkdtemp on_exit openpty readpassphrase realpath \
520 rresvport_af setdtablesize setegid setenv seteuid \
521 setlogin setproctitle setresgid setreuid setrlimit \
522 setsid setvbuf sigaction sigvec snprintf strerror \
523 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
524 vhangup vsnprintf waitpid __b64_ntop _getpty)
525
526dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700527AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700528 AC_CHECK_LIB(gen, dirname,[
529 AC_CACHE_CHECK([for broken dirname],
530 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700531 save_LIBS="$LIBS"
532 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700533 AC_TRY_RUN(
534 [
535#include <libgen.h>
536#include <string.h>
537
538int main(int argc, char **argv) {
539 char *s, buf[32];
540
541 strncpy(buf,"/etc", 32);
542 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700543 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700544 exit(1);
545 } else {
546 exit(0);
547 }
548}
549 ],
550 [ ac_cv_have_broken_dirname="no" ],
551 [ ac_cv_have_broken_dirname="yes" ]
552 )
Tim Rice17b93e52001-10-23 22:36:54 -0700553 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700554 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700555 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700556 LIBS="$LIBS -lgen"
557 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700558 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700559 fi
560 ])
561])
562
Damien Millerad833b32000-08-23 10:46:23 +1000563dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000564AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000565dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000566AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000567AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000568dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000569AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000570AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100571
Damien Miller5fc85652000-07-09 23:53:07 +1000572AC_CHECK_FUNC(getuserattr,
573 [AC_DEFINE(HAVE_GETUSERATTR)],
574 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
575)
576
Damien Miller04f80141999-11-19 15:32:34 +1100577AC_CHECK_FUNC(daemon,
578 [AC_DEFINE(HAVE_DAEMON)],
579 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
580)
581
Damien Miller9fb07e42000-03-05 16:22:59 +1100582AC_CHECK_FUNC(getpagesize,
583 [AC_DEFINE(HAVE_GETPAGESIZE)],
584 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
585)
586
Damien Millercb170cb2000-07-01 16:52:55 +1000587# Check for broken snprintf
588if test "x$ac_cv_func_snprintf" = "xyes" ; then
589 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
590 AC_TRY_RUN(
591 [
592#include <stdio.h>
593int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
594 ],
595 [AC_MSG_RESULT(yes)],
596 [
597 AC_MSG_RESULT(no)
598 AC_DEFINE(BROKEN_SNPRINTF)
599 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
600 ]
601 )
602fi
603
Damien Miller606f8802000-09-16 15:39:56 +1100604AC_FUNC_GETPGRP
605
Damien Millera64b57a2001-01-17 10:44:13 +1100606# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000607PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100608AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100609 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100610 [
Damien Millera64b57a2001-01-17 10:44:13 +1100611 if test "x$withval" != "xno" ; then
612 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
613 AC_MSG_ERROR([PAM headers not found])
614 fi
615
616 AC_CHECK_LIB(dl, dlopen, , )
617 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
618 AC_CHECK_FUNCS(pam_getenvlist)
619
620 disable_shadow=yes
621 PAM_MSG="yes"
622
623 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100624 fi
625 ]
626)
Damien Millera22ba012000-03-02 23:09:20 +1100627
Damien Millera64b57a2001-01-17 10:44:13 +1100628# Check for older PAM
629if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100630 # Check PAM strerror arguments (old PAM)
631 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
632 AC_TRY_COMPILE(
633 [
Damien Miller81171112000-04-23 11:14:01 +1000634#include <stdlib.h>
635#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100636 ],
637 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
638 [AC_MSG_RESULT(no)],
639 [
640 AC_DEFINE(HAVE_OLD_PAM)
641 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000642 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100643 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100644 )
Damien Millera22ba012000-03-02 23:09:20 +1100645fi
646
647# The big search for OpenSSL
648AC_ARG_WITH(ssl-dir,
649 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
650 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000651 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100652 tryssldir=$withval
653 fi
654 ]
655)
656
657saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100658saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000659saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100660if test "x$prefix" != "xNONE" ; then
661 tryssldir="$tryssldir $prefix"
662fi
Damien Miller61e50f12000-05-08 20:49:37 +1000663AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100664 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 +1100665 CPPFLAGS="$saved_CPPFLAGS"
666 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000667 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100668
669 # Skip directories if they don't exist
670 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
671 continue;
672 fi
673 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
674 # Try to use $ssldir/lib if it exists, otherwise
675 # $ssldir
676 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000677 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100678 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000679 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100680 fi
681 else
Damien Millerb68af622001-03-28 21:05:26 +1000682 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100683 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000684 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100685 fi
686 fi
687 # Try to use $ssldir/include if it exists, otherwise
688 # $ssldir
689 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000690 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100691 else
Damien Millerb68af622001-03-28 21:05:26 +1000692 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100693 fi
694 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000695
Damien Miller3b512e12000-05-17 23:29:18 +1000696 # Basic test to check for compatible version and correct linking
697 # *does not* test for RSA - that comes later.
698 AC_TRY_RUN(
699 [
Damien Millere59ce622000-05-01 20:54:17 +1000700#include <string.h>
701#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000702int main(void)
703{
Damien Miller3b512e12000-05-17 23:29:18 +1000704 char a[2048];
705 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000706 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000707 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000708}
Damien Miller3b512e12000-05-17 23:29:18 +1000709 ],
710 [
711 found_crypto=1
712 break;
713 ], []
714 )
Damien Miller61e50f12000-05-08 20:49:37 +1000715
716 if test ! -z "$found_crypto" ; then
717 break;
718 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100719 done
720
Damien Miller61e50f12000-05-08 20:49:37 +1000721 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100722 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100723 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000724 if test -z "$ssldir" ; then
725 ssldir="(system)"
726 fi
Damien Millera22ba012000-03-02 23:09:20 +1100727
Damien Miller61e50f12000-05-08 20:49:37 +1000728 ac_cv_openssldir=$ssldir
729])
730
Damien Milleredb82922000-06-20 13:25:52 +1000731if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000732 AC_DEFINE(HAVE_OPENSSL)
733 dnl Need to recover ssldir - test above runs in subshell
734 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100735 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100736 # Try to use $ssldir/lib if it exists, otherwise
737 # $ssldir
738 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000739 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100740 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000741 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100742 fi
743 else
Damien Millerb68af622001-03-28 21:05:26 +1000744 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100745 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000746 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100747 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100748 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100749 # Try to use $ssldir/include if it exists, otherwise
750 # $ssldir
751 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000752 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100753 else
Damien Millerb68af622001-03-28 21:05:26 +1000754 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100755 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100756 fi
Damien Millera22ba012000-03-02 23:09:20 +1100757fi
Damien Miller3b512e12000-05-17 23:29:18 +1000758LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000759
Damien Miller3b512e12000-05-17 23:29:18 +1000760# Now test RSA support
761saved_LIBS="$LIBS"
762AC_MSG_CHECKING([for RSA support])
763for WANTS_RSAREF in "" 1 ; do
764 if test -z "$WANTS_RSAREF" ; then
765 LIBS="$saved_LIBS"
766 else
767 LIBS="$saved_LIBS -lRSAglue -lrsaref"
768 fi
769 AC_TRY_RUN([
770#include <string.h>
771#include <openssl/rand.h>
772#include <openssl/rsa.h>
773#include <openssl/bn.h>
774#include <openssl/sha.h>
775int main(void)
776{
777 int num; RSA *key; static unsigned char p_in[] = "blahblah";
778 unsigned char c[256], p[256];
779 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
780 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
781 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
782 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
783}
784 ],
785 [
786 rsa_works=1
787 break;
788 ], [])
789done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000790LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000791
792if test ! -z "$no_rsa" ; then
793 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000794 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000795else
796 if test -z "$rsa_works" ; then
797 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000798 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000799 else
800 if test -z "$WANTS_RSAREF" ; then
801 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000802 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000803 else
Damien Miller7b22d652000-06-18 14:07:04 +1000804 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000805 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000806 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000807 fi
808 fi
809fi
Damien Millera22ba012000-03-02 23:09:20 +1100810
Damien Millera64b57a2001-01-17 10:44:13 +1100811# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
812# version in OpenSSL. Skip this for PAM
813if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100814 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100815fi
816
Ben Lindstromb5628642000-10-18 00:02:25 +0000817# Cheap hack to ensure NEWS-OS libraries are arranged right.
818if test ! -z "$SONY" ; then
819 LIBS="$LIBS -liberty";
820fi
821
Damien Millera22ba012000-03-02 23:09:20 +1100822# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100823AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100824AC_CHECK_SIZEOF(short int, 2)
825AC_CHECK_SIZEOF(int, 4)
826AC_CHECK_SIZEOF(long int, 4)
827AC_CHECK_SIZEOF(long long int, 8)
828
Damien Millera22ba012000-03-02 23:09:20 +1100829# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100830AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
831 AC_TRY_COMPILE(
832 [ #include <sys/types.h> ],
833 [ u_int a; a = 1;],
834 [ ac_cv_have_u_int="yes" ],
835 [ ac_cv_have_u_int="no" ]
836 )
837])
838if test "x$ac_cv_have_u_int" = "xyes" ; then
839 AC_DEFINE(HAVE_U_INT)
840 have_u_int=1
841fi
842
Damien Miller61e50f12000-05-08 20:49:37 +1000843AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
844 AC_TRY_COMPILE(
845 [ #include <sys/types.h> ],
846 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
847 [ ac_cv_have_intxx_t="yes" ],
848 [ ac_cv_have_intxx_t="no" ]
849 )
850])
851if test "x$ac_cv_have_intxx_t" = "xyes" ; then
852 AC_DEFINE(HAVE_INTXX_T)
853 have_intxx_t=1
854fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000855
856if (test -z "$have_intxx_t" && \
857 test "x$ac_cv_header_stdint_h" = "xyes")
858then
859 AC_MSG_CHECKING([for intXX_t types in stdint.h])
860 AC_TRY_COMPILE(
861 [ #include <stdint.h> ],
862 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
863 [
864 AC_DEFINE(HAVE_INTXX_T)
865 AC_MSG_RESULT(yes)
866 ],
867 [ AC_MSG_RESULT(no) ]
868 )
869fi
870
Damien Miller578783e2000-09-23 14:12:24 +1100871AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
872 AC_TRY_COMPILE(
873 [ #include <sys/types.h> ],
874 [ int64_t a; a = 1;],
875 [ ac_cv_have_int64_t="yes" ],
876 [ ac_cv_have_int64_t="no" ]
877 )
878])
879if test "x$ac_cv_have_int64_t" = "xyes" ; then
880 AC_DEFINE(HAVE_INT64_T)
881 have_int64_t=1
882fi
883
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000884if test -z "$have_int64_t" ; then
885 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
886 AC_TRY_COMPILE(
887 [ #include <sys/socket.h> ],
888 [ int64_t a; a = 1],
889 [
890 AC_DEFINE(HAVE_INT64_T)
891 AC_MSG_RESULT(yes)
892 ],
893 [ AC_MSG_RESULT(no) ]
894 )
895fi
896
Damien Miller61e50f12000-05-08 20:49:37 +1000897AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
898 AC_TRY_COMPILE(
899 [ #include <sys/types.h> ],
900 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
901 [ ac_cv_have_u_intxx_t="yes" ],
902 [ ac_cv_have_u_intxx_t="no" ]
903 )
904])
905if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
906 AC_DEFINE(HAVE_U_INTXX_T)
907 have_u_intxx_t=1
908fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100909
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000910if test -z "$have_u_intxx_t" ; then
911 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
912 AC_TRY_COMPILE(
913 [ #include <sys/socket.h> ],
914 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
915 [
916 AC_DEFINE(HAVE_U_INTXX_T)
917 AC_MSG_RESULT(yes)
918 ],
919 [ AC_MSG_RESULT(no) ]
920 )
921fi
922
Damien Miller578783e2000-09-23 14:12:24 +1100923AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
924 AC_TRY_COMPILE(
925 [ #include <sys/types.h> ],
926 [ u_int64_t a; a = 1;],
927 [ ac_cv_have_u_int64_t="yes" ],
928 [ ac_cv_have_u_int64_t="no" ]
929 )
930])
931if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
932 AC_DEFINE(HAVE_U_INT64_T)
933 have_u_int64_t=1
934fi
935
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000936if test -z "$have_u_intxx_t" ; then
937 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
938 AC_TRY_COMPILE(
939 [
940#include <sys/types.h>
941 ],
942 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
943 [ ac_cv_have_uintxx_t="yes" ],
944 [ ac_cv_have_uintxx_t="no" ]
945 )
946 ])
947 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
948 AC_DEFINE(HAVE_UINTXX_T)
949 fi
950fi
951
952if test -z "$have_uintxx_t" ; then
953 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
954 AC_TRY_COMPILE(
955 [ #include <stdint.h> ],
956 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
957 [
958 AC_DEFINE(HAVE_UINTXX_T)
959 AC_MSG_RESULT(yes)
960 ],
961 [ AC_MSG_RESULT(no) ]
962 )
963fi
964
Damien Milleredb82922000-06-20 13:25:52 +1000965if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
966 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100967then
968 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
969 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000970 [
971#include <sys/bitypes.h>
972 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100973 [
Damien Miller70494d12000-04-03 15:57:06 +1000974 int8_t a; int16_t b; int32_t c;
975 u_int8_t e; u_int16_t f; u_int32_t g;
976 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100977 ],
978 [
979 AC_DEFINE(HAVE_U_INTXX_T)
980 AC_DEFINE(HAVE_INTXX_T)
981 AC_MSG_RESULT(yes)
982 ],
983 [AC_MSG_RESULT(no)]
984 )
985fi
986
Damien Miller58be7382001-09-15 21:31:54 +1000987
988AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
989 AC_TRY_COMPILE(
990 [
991#include <sys/types.h>
992 ],
993 [ u_char foo; foo = 125; ],
994 [ ac_cv_have_u_char="yes" ],
995 [ ac_cv_have_u_char="no" ]
996 )
997])
998if test "x$ac_cv_have_u_char" = "xyes" ; then
999 AC_DEFINE(HAVE_U_CHAR)
1000fi
1001
Tim Rice13aae5e2001-10-21 17:53:58 -07001002TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001003
Damien Miller61e50f12000-05-08 20:49:37 +10001004AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1005 AC_TRY_COMPILE(
1006 [
1007#include <sys/types.h>
1008 ],
1009 [ size_t foo; foo = 1235; ],
1010 [ ac_cv_have_size_t="yes" ],
1011 [ ac_cv_have_size_t="no" ]
1012 )
1013])
1014if test "x$ac_cv_have_size_t" = "xyes" ; then
1015 AC_DEFINE(HAVE_SIZE_T)
1016fi
Damien Miller95058511999-12-29 10:36:45 +11001017
Damien Miller615f9392000-05-17 22:53:33 +10001018AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1019 AC_TRY_COMPILE(
1020 [
1021#include <sys/types.h>
1022 ],
1023 [ ssize_t foo; foo = 1235; ],
1024 [ ac_cv_have_ssize_t="yes" ],
1025 [ ac_cv_have_ssize_t="no" ]
1026 )
1027])
1028if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1029 AC_DEFINE(HAVE_SSIZE_T)
1030fi
1031
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001032AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1033 AC_TRY_COMPILE(
1034 [
1035#include <time.h>
1036 ],
1037 [ clock_t foo; foo = 1235; ],
1038 [ ac_cv_have_clock_t="yes" ],
1039 [ ac_cv_have_clock_t="no" ]
1040 )
1041])
1042if test "x$ac_cv_have_clock_t" = "xyes" ; then
1043 AC_DEFINE(HAVE_CLOCK_T)
1044fi
1045
Damien Millerb54b40e2000-06-23 08:23:34 +10001046AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1047 AC_TRY_COMPILE(
1048 [
1049#include <sys/types.h>
1050#include <sys/socket.h>
1051 ],
1052 [ sa_family_t foo; foo = 1235; ],
1053 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001054 [ AC_TRY_COMPILE(
1055 [
1056#include <sys/types.h>
1057#include <sys/socket.h>
1058#include <netinet/in.h>
1059 ],
1060 [ sa_family_t foo; foo = 1235; ],
1061 [ ac_cv_have_sa_family_t="yes" ],
1062
Damien Millerb54b40e2000-06-23 08:23:34 +10001063 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001064 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001065 )
1066])
1067if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1068 AC_DEFINE(HAVE_SA_FAMILY_T)
1069fi
1070
Damien Miller0f91b4e2000-06-18 15:43:25 +10001071AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1072 AC_TRY_COMPILE(
1073 [
1074#include <sys/types.h>
1075 ],
1076 [ pid_t foo; foo = 1235; ],
1077 [ ac_cv_have_pid_t="yes" ],
1078 [ ac_cv_have_pid_t="no" ]
1079 )
1080])
1081if test "x$ac_cv_have_pid_t" = "xyes" ; then
1082 AC_DEFINE(HAVE_PID_T)
1083fi
1084
1085AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1086 AC_TRY_COMPILE(
1087 [
1088#include <sys/types.h>
1089 ],
1090 [ mode_t foo; foo = 1235; ],
1091 [ ac_cv_have_mode_t="yes" ],
1092 [ ac_cv_have_mode_t="no" ]
1093 )
1094])
1095if test "x$ac_cv_have_mode_t" = "xyes" ; then
1096 AC_DEFINE(HAVE_MODE_T)
1097fi
1098
Damien Miller61e50f12000-05-08 20:49:37 +10001099
1100AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1101 AC_TRY_COMPILE(
1102 [
Damien Miller81171112000-04-23 11:14:01 +10001103#include <sys/types.h>
1104#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001105 ],
1106 [ struct sockaddr_storage s; ],
1107 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1108 [ ac_cv_have_struct_sockaddr_storage="no" ]
1109 )
1110])
1111if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1112 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1113fi
Damien Miller34132e52000-01-14 15:45:46 +11001114
Damien Miller61e50f12000-05-08 20:49:37 +10001115AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1116 AC_TRY_COMPILE(
1117 [
Damien Miller7b22d652000-06-18 14:07:04 +10001118#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001119#include <netinet/in.h>
1120 ],
1121 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1122 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1123 [ ac_cv_have_struct_sockaddr_in6="no" ]
1124 )
1125])
1126if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1127 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1128fi
Damien Miller34132e52000-01-14 15:45:46 +11001129
Damien Miller61e50f12000-05-08 20:49:37 +10001130AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1131 AC_TRY_COMPILE(
1132 [
Damien Miller7b22d652000-06-18 14:07:04 +10001133#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001134#include <netinet/in.h>
1135 ],
1136 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1137 [ ac_cv_have_struct_in6_addr="yes" ],
1138 [ ac_cv_have_struct_in6_addr="no" ]
1139 )
1140])
1141if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1142 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1143fi
Damien Miller34132e52000-01-14 15:45:46 +11001144
Damien Miller61e50f12000-05-08 20:49:37 +10001145AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1146 AC_TRY_COMPILE(
1147 [
Damien Miller81171112000-04-23 11:14:01 +10001148#include <sys/types.h>
1149#include <sys/socket.h>
1150#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001151 ],
1152 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1153 [ ac_cv_have_struct_addrinfo="yes" ],
1154 [ ac_cv_have_struct_addrinfo="no" ]
1155 )
1156])
1157if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1158 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1159fi
1160
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001161AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1162 AC_TRY_COMPILE(
1163 [ #include <sys/time.h> ],
1164 [ struct timeval tv; tv.tv_sec = 1;],
1165 [ ac_cv_have_struct_timeval="yes" ],
1166 [ ac_cv_have_struct_timeval="no" ]
1167 )
1168])
1169if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1170 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1171 have_struct_timeval=1
1172fi
1173
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001174# If we don't have int64_t then we can't compile sftp-server. So don't
1175# even attempt to do it.
1176if test "x$ac_cv_have_int64_t" = "xno" -a \
1177 "x$ac_cv_sizeof_long_int" != "x8" -a \
1178 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1179 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001180else
1181dnl test snprintf (broken on SCO w/gcc)
1182 AC_TRY_RUN(
1183 [
1184#include <stdio.h>
1185#include <string.h>
1186#ifdef HAVE_SNPRINTF
1187main()
1188{
1189 char buf[50];
1190 char expected_out[50];
1191 int mazsize = 50 ;
1192#if (SIZEOF_LONG_INT == 8)
1193 long int num = 0x7fffffffffffffff;
1194#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001195 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001196#endif
1197 strcpy(expected_out, "9223372036854775807");
1198 snprintf(buf, mazsize, "%lld", num);
1199 if(strcmp(buf, expected_out) != 0)
1200 exit(1);
1201 exit(0);
1202}
1203#else
1204main() { exit(0); }
1205#endif
1206 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1207 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001208fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001209AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001210
Damien Miller78315eb2000-09-29 23:01:36 +11001211dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001212OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1213OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1214OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1215OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1216OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001217OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001218OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1219OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001220OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001221OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1222OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1223OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1224OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001225OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1226OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1227OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1228OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001229
1230AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001231
Damien Miller61e50f12000-05-08 20:49:37 +10001232AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1233 ac_cv_have_ss_family_in_struct_ss, [
1234 AC_TRY_COMPILE(
1235 [
Damien Miller81171112000-04-23 11:14:01 +10001236#include <sys/types.h>
1237#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001238 ],
1239 [ struct sockaddr_storage s; s.ss_family = 1; ],
1240 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1241 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1242 )
1243])
1244if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1245 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1246fi
1247
Damien Miller61e50f12000-05-08 20:49:37 +10001248AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1249 ac_cv_have___ss_family_in_struct_ss, [
1250 AC_TRY_COMPILE(
1251 [
Damien Miller81171112000-04-23 11:14:01 +10001252#include <sys/types.h>
1253#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001254 ],
1255 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1256 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1257 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1258 )
1259])
1260if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1261 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1262fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001263
Damien Millerad833b32000-08-23 10:46:23 +10001264AC_CACHE_CHECK([for pw_class field in struct passwd],
1265 ac_cv_have_pw_class_in_struct_passwd, [
1266 AC_TRY_COMPILE(
1267 [
Damien Millerad833b32000-08-23 10:46:23 +10001268#include <pwd.h>
1269 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001270 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001271 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1272 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1273 )
1274])
1275if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1276 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1277fi
1278
Kevin Steves82456952001-06-22 21:14:18 +00001279AC_CACHE_CHECK([for pw_expire field in struct passwd],
1280 ac_cv_have_pw_expire_in_struct_passwd, [
1281 AC_TRY_COMPILE(
1282 [
1283#include <pwd.h>
1284 ],
1285 [ struct passwd p; p.pw_expire = 0; ],
1286 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1287 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1288 )
1289])
1290if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1291 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1292fi
1293
1294AC_CACHE_CHECK([for pw_change field in struct passwd],
1295 ac_cv_have_pw_change_in_struct_passwd, [
1296 AC_TRY_COMPILE(
1297 [
1298#include <pwd.h>
1299 ],
1300 [ struct passwd p; p.pw_change = 0; ],
1301 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1302 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1303 )
1304])
1305if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1306 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1307fi
Damien Miller61e50f12000-05-08 20:49:37 +10001308
1309AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1310 AC_TRY_LINK([],
1311 [ extern char *__progname; printf("%s", __progname); ],
1312 [ ac_cv_libc_defines___progname="yes" ],
1313 [ ac_cv_libc_defines___progname="no" ]
1314 )
1315])
1316if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1317 AC_DEFINE(HAVE___PROGNAME)
1318fi
1319
Damien Miller4f8e6692001-07-14 13:22:53 +10001320AC_CACHE_CHECK([whether getopt has optreset support],
1321 ac_cv_have_getopt_optreset, [
1322 AC_TRY_LINK(
1323 [
1324#include <getopt.h>
1325 ],
1326 [ extern int optreset; optreset = 0; ],
1327 [ ac_cv_have_getopt_optreset="yes" ],
1328 [ ac_cv_have_getopt_optreset="no" ]
1329 )
1330])
1331if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1332 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1333fi
Damien Millera22ba012000-03-02 23:09:20 +11001334
Damien Millerecbb26d2000-07-15 14:59:14 +10001335AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1336 AC_TRY_LINK([],
1337 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1338 [ ac_cv_libc_defines_sys_errlist="yes" ],
1339 [ ac_cv_libc_defines_sys_errlist="no" ]
1340 )
1341])
1342if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1343 AC_DEFINE(HAVE_SYS_ERRLIST)
1344fi
1345
1346
Damien Miller11fa2cc2000-08-16 10:35:58 +10001347AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1348 AC_TRY_LINK([],
1349 [ extern int sys_nerr; printf("%i", sys_nerr);],
1350 [ ac_cv_libc_defines_sys_nerr="yes" ],
1351 [ ac_cv_libc_defines_sys_nerr="no" ]
1352 )
1353])
1354if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1355 AC_DEFINE(HAVE_SYS_NERR)
1356fi
1357
1358
Damien Millerc79bc0d2001-03-28 13:03:42 +10001359# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001360SCARD_MSG="no"
1361AC_ARG_WITH(smartcard,
1362 [ --with-smartcard Enable smartcard support],
1363 [
1364 if test "x$withval" != "xno" ; then
1365 if test "x$withval" != "xyes" ; then
1366 CPPFLAGS="$CPPFLAGS -I${withval}"
1367 LDFLAGS="$LDFLAGS -L${withval}"
1368 if test ! -z "$need_dash_r" ; then
1369 LDFLAGS="$LDFLAGS -R${withval}"
1370 fi
1371 if test ! -z "$blibpath" ; then
1372 blibpath="$blibpath:${withval}"
1373 fi
1374 fi
1375 AC_CHECK_HEADERS(sectok.h)
1376 if test "$ac_cv_header_sectok_h" != yes; then
1377 AC_MSG_ERROR(Can't find sectok.h)
1378 fi
1379 AC_CHECK_LIB(sectok, sectok_open)
1380 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1381 AC_MSG_ERROR(Can't find libsectok)
1382 fi
1383 AC_DEFINE(SMARTCARD)
1384 SCARD_MSG="yes"
1385 fi
1386 ]
1387)
1388
1389# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001390KRB4_MSG="no"
1391AC_ARG_WITH(kerberos4,
1392 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1393 [
1394 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001395 if test "x$withval" != "xyes" ; then
1396 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1397 LDFLAGS="$LDFLAGS -L${withval}/lib"
1398 if test ! -z "$need_dash_r" ; then
1399 LDFLAGS="$LDFLAGS -R${withval}/lib"
1400 fi
1401 if test ! -z "$blibpath" ; then
1402 blibpath="$blibpath:${withval}/lib"
1403 fi
1404 else
1405 if test -d /usr/include/kerberosIV ; then
1406 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1407 fi
1408 fi
1409
1410 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001411 if test "$ac_cv_header_krb_h" != yes; then
1412 AC_MSG_WARN([Cannot find krb.h, build may fail])
1413 fi
Damien Miller98344742001-03-28 14:37:06 +10001414 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001415 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001416 AC_CHECK_LIB(krb4, main)
1417 if test "$ac_cv_lib_krb4_main" != yes; then
1418 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1419 else
1420 KLIBS="-lkrb4"
1421 fi
1422 else
1423 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001424 fi
Damien Miller98344742001-03-28 14:37:06 +10001425 AC_CHECK_LIB(des, des_cbc_encrypt)
1426 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1427 AC_CHECK_LIB(des425, des_cbc_encrypt)
1428 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1429 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1430 else
1431 KLIBS="-ldes425"
1432 fi
1433 else
1434 KLIBS="-ldes"
1435 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001436 AC_CHECK_LIB(resolv, dn_expand, , )
1437 KRB4=yes
1438 KRB4_MSG="yes"
1439 AC_DEFINE(KRB4)
1440 fi
1441 ]
1442)
1443
1444# Check whether user wants AFS support
1445AFS_MSG="no"
1446AC_ARG_WITH(afs,
1447 [ --with-afs=PATH Enable AFS support],
1448 [
1449 if test "x$withval" != "xno" ; then
1450
1451 if test "x$withval" != "xyes" ; then
1452 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1453 LDFLAGS="$LDFLAGS -L${withval}/lib"
1454 fi
1455
1456 if test -z "$KRB4" ; then
1457 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1458 fi
1459
1460 LIBS="-lkafs $LIBS"
1461 if test ! -z "$AFS_LIBS" ; then
1462 LIBS="$LIBS $AFS_LIBS"
1463 fi
1464 AC_DEFINE(AFS)
1465 AFS_MSG="yes"
1466 fi
1467 ]
1468)
1469LIBS="$LIBS $KLIBS"
1470
Damien Millera22ba012000-03-02 23:09:20 +11001471# Looking for programs, paths and files
1472AC_ARG_WITH(rsh,
1473 [ --with-rsh=PATH Specify path to remote shell program ],
1474 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001475 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001476 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001477 fi
1478 ],
1479 [
1480 AC_PATH_PROG(rsh_path, rsh)
1481 ]
1482)
1483
1484AC_ARG_WITH(xauth,
1485 [ --with-xauth=PATH Specify path to xauth program ],
1486 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001487 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001488 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001489 fi
1490 ],
1491 [
Damien Miller78315eb2000-09-29 23:01:36 +11001492 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 +10001493 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001494 xauth_path="/usr/openwin/bin/xauth"
1495 fi
1496 ]
1497)
1498
Damien Millera19cf472000-11-29 13:28:50 +11001499if test -z "$xauth_path" ; then
1500 XAUTH_PATH="undefined"
1501 AC_SUBST(XAUTH_PATH)
1502else
Damien Millera22ba012000-03-02 23:09:20 +11001503 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001504 XAUTH_PATH=$xauth_path
1505 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001506fi
1507if test ! -z "$rsh_path" ; then
1508 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1509fi
1510
1511# Check for mail directory (last resort if we cannot get it from headers)
1512if test ! -z "$MAIL" ; then
1513 maildir=`dirname $MAIL`
1514 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1515fi
1516
Damien Millera22ba012000-03-02 23:09:20 +11001517if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001518 AC_CHECK_FILE("/dev/ptmx",
1519 [
1520 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1521 have_dev_ptmx=1
1522 ]
1523 )
Damien Millera22ba012000-03-02 23:09:20 +11001524fi
Damien Miller204ad072000-03-02 23:56:12 +11001525AC_CHECK_FILE("/dev/ptc",
1526 [
1527 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1528 have_dev_ptc=1
1529 ]
1530)
1531
Damien Millera22ba012000-03-02 23:09:20 +11001532# Options from here on. Some of these are preset by platform above
1533
Damien Millera22ba012000-03-02 23:09:20 +11001534# Check for user-specified random device, otherwise check /dev/urandom
1535AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001536 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001537 [
Damien Miller040f3832000-04-03 14:50:43 +10001538 if test "x$withval" != "xno" ; then
1539 RANDOM_POOL="$withval";
1540 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1541 fi
Damien Millera22ba012000-03-02 23:09:20 +11001542 ],
1543 [
1544 # Check for random device
1545 AC_CHECK_FILE("/dev/urandom",
1546 [
1547 RANDOM_POOL="/dev/urandom";
1548 AC_SUBST(RANDOM_POOL)
1549 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1550 ]
1551 )
1552 ]
1553)
1554
Damien Millerd0ccb982001-03-04 00:29:20 +11001555# Check for PRNGD/EGD pool file
1556AC_ARG_WITH(prngd-port,
1557 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1558 [
1559 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1560 PRNGD_PORT="$withval"
1561 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1562 fi
1563 ]
1564)
1565
1566# Check for PRNGD/EGD pool file
1567AC_ARG_WITH(prngd-socket,
1568 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001569 [
Damien Miller040f3832000-04-03 14:50:43 +10001570 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001571 PRNGD_SOCKET="$withval"
1572 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001573 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001574 ],
1575 [
1576 # Check for existing socket only if we don't have a random device already
1577 if test -z "$RANDOM_POOL" ; then
1578 AC_MSG_CHECKING(for PRNGD/EGD socket)
1579 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001580 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001581 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1582 PRNGD_SOCKET="$sock"
1583 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001584 break;
1585 fi
1586 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001587 if test ! -z "$PRNGD_SOCKET" ; then
1588 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001589 else
1590 AC_MSG_RESULT(not found)
1591 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001592 fi
Damien Millera22ba012000-03-02 23:09:20 +11001593 ]
1594)
1595
Damien Miller0736c4d2001-01-25 10:51:46 +11001596
Damien Miller0437b332000-05-02 09:56:41 +10001597# detect pathnames for entropy gathering commands, if we need them
1598INSTALL_SSH_PRNG_CMDS=""
1599rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001600if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001601 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001602 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1603 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1604 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1605 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
Ben Lindstromd9e08242001-07-22 19:32:00 +00001606 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
Damien Miller61e50f12000-05-08 20:49:37 +10001607 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
Ben Lindstrom6db66ff2001-08-06 23:29:16 +00001608 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
Damien Miller61e50f12000-05-08 20:49:37 +10001609 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1610 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1611 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1612 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1613 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1614 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1615 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1616 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1617 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001618
1619 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001620fi
Damien Miller0437b332000-05-02 09:56:41 +10001621AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1622
Damien Miller11e37f62000-04-08 18:23:30 +10001623
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001624AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001625 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001626 [
Damien Miller897741e2001-04-16 10:41:46 +10001627 case "$withval" in
1628 man|cat|doc)
1629 MANTYPE=$withval
1630 ;;
1631 *)
1632 AC_MSG_ERROR(invalid man type: $withval)
1633 ;;
1634 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001635 ]
1636)
Ben Lindstrombc709922001-04-18 18:04:21 +00001637if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001638 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001639 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1640 MANTYPE=doc
1641 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1642 MANTYPE=man
1643 else
1644 MANTYPE=cat
1645 fi
1646fi
Damien Miller670a4b82000-01-22 13:53:11 +11001647AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001648if test "$MANTYPE" = "doc"; then
1649 mansubdir=man;
1650else
1651 mansubdir=$MANTYPE;
1652fi
1653AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001654
Damien Millera22ba012000-03-02 23:09:20 +11001655# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001656MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001657AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001658 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001659 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001660 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001661 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001662 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001663 fi
1664 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001665)
1666
Damien Millera22ba012000-03-02 23:09:20 +11001667# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001668AC_ARG_WITH(shadow,
1669 [ --without-shadow Disable shadow password support],
1670 [
1671 if test "x$withval" = "xno" ; then
1672 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001673 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001674 fi
1675 ]
1676)
1677
Damien Miller1f335fb2000-06-26 11:31:33 +10001678if test -z "$disable_shadow" ; then
1679 AC_MSG_CHECKING([if the systems has expire shadow information])
1680 AC_TRY_COMPILE(
1681 [
1682#include <sys/types.h>
1683#include <shadow.h>
1684 struct spwd sp;
1685 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1686 [ sp_expire_available=yes ], []
1687 )
1688
1689 if test "x$sp_expire_available" = "xyes" ; then
1690 AC_MSG_RESULT(yes)
1691 AC_DEFINE(HAS_SHADOW_EXPIRE)
1692 else
1693 AC_MSG_RESULT(no)
1694 fi
1695fi
1696
Damien Millera22ba012000-03-02 23:09:20 +11001697# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001698if test ! -z "$IPADDR_IN_DISPLAY" ; then
1699 DISPLAY_HACK_MSG="yes"
1700 AC_DEFINE(IPADDR_IN_DISPLAY)
1701else
1702 DISPLAY_HACK_MSG="no"
1703 AC_ARG_WITH(ipaddr-display,
1704 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1705 [
1706 if test "x$withval" != "xno" ; then
1707 AC_DEFINE(IPADDR_IN_DISPLAY)
1708 DISPLAY_HACK_MSG="yes"
1709 fi
1710 ]
1711 )
1712fi
Damien Miller76112de1999-12-21 11:18:08 +11001713
Damien Millera22ba012000-03-02 23:09:20 +11001714# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001715SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001716AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001717 [ --with-default-path=PATH Specify default \$PATH environment for server],
1718 [
1719 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001720 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001721 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001722 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001723 ],
1724 [
1725 AC_TRY_RUN(
1726 [
1727/* find out what STDPATH is */
1728#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001729#ifdef HAVE_PATHS_H
1730# include <paths.h>
1731#endif
1732#ifndef _PATH_STDPATH
1733# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1734#endif
1735#include <sys/types.h>
1736#include <sys/stat.h>
1737#include <fcntl.h>
1738#define DATA "conftest.stdpath"
1739
1740main()
1741{
1742 FILE *fd;
1743 int rc;
1744
1745 fd = fopen(DATA,"w");
1746 if(fd == NULL)
1747 exit(1);
1748
1749 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1750 exit(1);
1751
1752 exit(0);
1753}
1754 ], [ user_path=`cat conftest.stdpath` ],
1755 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1756 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1757 )
1758# make sure $bindir is in USER_PATH so scp will work
1759 t_bindir=`eval echo ${bindir}`
1760 case $t_bindir in
1761 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1762 esac
1763 case $t_bindir in
1764 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1765 esac
1766 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1767 if test $? -ne 0 ; then
1768 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1769 if test $? -ne 0 ; then
1770 user_path=$user_path:$t_bindir
1771 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1772 fi
1773 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001774 ]
1775)
Tim Rice59ea0a02001-03-10 13:50:45 -08001776AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1777AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001778
Damien Millera22ba012000-03-02 23:09:20 +11001779# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001780IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001781AC_ARG_WITH(ipv4-default,
1782 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1783 [
1784 if test "x$withval" != "xno" ; then
1785 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001786 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001787 fi
1788 ]
1789)
1790
Damien Miller61e50f12000-05-08 20:49:37 +10001791AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001792IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001793AC_ARG_WITH(4in6,
1794 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1795 [
1796 if test "x$withval" != "xno" ; then
1797 AC_MSG_RESULT(yes)
1798 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001799 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001800 else
1801 AC_MSG_RESULT(no)
1802 fi
1803 ],[
1804 if test "x$inet6_default_4in6" = "xyes"; then
1805 AC_MSG_RESULT([yes (default)])
1806 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001807 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001808 else
1809 AC_MSG_RESULT([no (default)])
1810 fi
1811 ]
1812)
1813
Damien Miller60396b02001-02-18 17:01:00 +11001814# Whether to enable BSD auth support
1815AC_ARG_WITH(bsd-auth,
1816 [ --with-bsd-auth Enable BSD auth support],
1817 [
1818 if test "x$withval" != "xno" ; then
1819 AC_DEFINE(BSD_AUTH)
1820 bsd_auth=yes
1821 fi
1822 ]
1823)
1824
Damien Miller78315eb2000-09-29 23:01:36 +11001825AC_MSG_CHECKING(whether to install ssh as suid root)
1826AC_ARG_ENABLE(suid-ssh,
1827[ --enable-suid-ssh Install ssh as suid root (default)
1828 --disable-suid-ssh Install ssh without suid bit],
1829[ case "$enableval" in
1830 no)
1831 AC_MSG_RESULT(no)
1832 SSHMODE=0711
1833 ;;
1834 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001835 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001836 ;;
1837 esac ],
1838 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001839 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001840)
1841AC_SUBST(SSHMODE)
1842
1843
Damien Millera22ba012000-03-02 23:09:20 +11001844# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001845piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001846AC_ARG_WITH(pid-dir,
1847 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1848 [
1849 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001850 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001851 fi
1852 ]
1853)
Damien Miller4018c192000-04-30 09:30:44 +10001854
Damien Miller78315eb2000-09-29 23:01:36 +11001855# make sure the directory exists
1856if test ! -d $piddir ; then
1857 piddir=`eval echo ${sysconfdir}`
1858 case $piddir in
1859 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1860 esac
1861fi
1862
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001863AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001864AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001865
andre2ff7b5d2000-06-03 14:57:40 +00001866dnl allow user to disable some login recording features
1867AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001868 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001869 [ AC_DEFINE(DISABLE_LASTLOG) ]
1870)
1871AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001872 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001873 [ AC_DEFINE(DISABLE_UTMP) ]
1874)
1875AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001876 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001877 [ AC_DEFINE(DISABLE_UTMPX) ]
1878)
1879AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001880 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001881 [ AC_DEFINE(DISABLE_WTMP) ]
1882)
1883AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001884 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001885 [ AC_DEFINE(DISABLE_WTMPX) ]
1886)
1887AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001888 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001889 [ AC_DEFINE(DISABLE_LOGIN) ]
1890)
1891AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001892 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001893 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1894)
1895AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001896 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001897 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1898)
1899AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001900 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001901 [
1902 if test "x$withval" = "xno" ; then
1903 AC_DEFINE(DISABLE_LASTLOG)
1904 else
1905 conf_lastlog_location=$withval
1906 fi
1907 ]
1908)
andre2ff7b5d2000-06-03 14:57:40 +00001909
1910dnl lastlog, [uw]tmpx? detection
1911dnl NOTE: set the paths in the platform section to avoid the
1912dnl need for command-line parameters
1913dnl lastlog and [uw]tmp are subject to a file search if all else fails
1914
1915dnl lastlog detection
1916dnl NOTE: the code itself will detect if lastlog is a directory
1917AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1918AC_TRY_COMPILE([
1919#include <sys/types.h>
1920#include <utmp.h>
1921#ifdef HAVE_LASTLOG_H
1922# include <lastlog.h>
1923#endif
Damien Miller2994e082000-06-04 15:51:47 +10001924#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001925# include <paths.h>
1926#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001927#ifdef HAVE_LOGIN_H
1928# include <login.h>
1929#endif
andre2ff7b5d2000-06-03 14:57:40 +00001930 ],
1931 [ char *lastlog = LASTLOG_FILE; ],
1932 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001933 [
1934 AC_MSG_RESULT(no)
1935 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1936 AC_TRY_COMPILE([
1937#include <sys/types.h>
1938#include <utmp.h>
1939#ifdef HAVE_LASTLOG_H
1940# include <lastlog.h>
1941#endif
1942#ifdef HAVE_PATHS_H
1943# include <paths.h>
1944#endif
1945 ],
1946 [ char *lastlog = _PATH_LASTLOG; ],
1947 [ AC_MSG_RESULT(yes) ],
1948 [
andree441aa32000-06-12 22:34:38 +00001949 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001950 system_lastlog_path=no
1951 ])
1952 ]
andre2ff7b5d2000-06-03 14:57:40 +00001953)
Damien Miller2994e082000-06-04 15:51:47 +10001954
andre2ff7b5d2000-06-03 14:57:40 +00001955if test -z "$conf_lastlog_location"; then
1956 if test x"$system_lastlog_path" = x"no" ; then
1957 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001958 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001959 conf_lastlog_location=$f
1960 fi
1961 done
1962 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001963 AC_MSG_WARN([** Cannot find lastlog **])
1964 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001965 fi
1966 fi
1967fi
1968
1969if test -n "$conf_lastlog_location"; then
1970 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1971fi
1972
1973dnl utmp detection
1974AC_MSG_CHECKING([if your system defines UTMP_FILE])
1975AC_TRY_COMPILE([
1976#include <sys/types.h>
1977#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001978#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001979# include <paths.h>
1980#endif
1981 ],
1982 [ char *utmp = UTMP_FILE; ],
1983 [ AC_MSG_RESULT(yes) ],
1984 [ AC_MSG_RESULT(no)
1985 system_utmp_path=no ]
1986)
1987if test -z "$conf_utmp_location"; then
1988 if test x"$system_utmp_path" = x"no" ; then
1989 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1990 if test -f $f ; then
1991 conf_utmp_location=$f
1992 fi
1993 done
1994 if test -z "$conf_utmp_location"; then
1995 AC_DEFINE(DISABLE_UTMP)
1996 fi
1997 fi
1998fi
1999if test -n "$conf_utmp_location"; then
2000 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2001fi
2002
2003dnl wtmp detection
2004AC_MSG_CHECKING([if your system defines WTMP_FILE])
2005AC_TRY_COMPILE([
2006#include <sys/types.h>
2007#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002008#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002009# include <paths.h>
2010#endif
2011 ],
2012 [ char *wtmp = WTMP_FILE; ],
2013 [ AC_MSG_RESULT(yes) ],
2014 [ AC_MSG_RESULT(no)
2015 system_wtmp_path=no ]
2016)
2017if test -z "$conf_wtmp_location"; then
2018 if test x"$system_wtmp_path" = x"no" ; then
2019 for f in /usr/adm/wtmp /var/log/wtmp; do
2020 if test -f $f ; then
2021 conf_wtmp_location=$f
2022 fi
2023 done
2024 if test -z "$conf_wtmp_location"; then
2025 AC_DEFINE(DISABLE_WTMP)
2026 fi
2027 fi
2028fi
2029if test -n "$conf_wtmp_location"; then
2030 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2031fi
2032
2033
2034dnl utmpx detection - I don't know any system so perverse as to require
2035dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2036dnl there, though.
2037AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2038AC_TRY_COMPILE([
2039#include <sys/types.h>
2040#include <utmp.h>
2041#ifdef HAVE_UTMPX_H
2042#include <utmpx.h>
2043#endif
Damien Miller2994e082000-06-04 15:51:47 +10002044#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002045# include <paths.h>
2046#endif
2047 ],
2048 [ char *utmpx = UTMPX_FILE; ],
2049 [ AC_MSG_RESULT(yes) ],
2050 [ AC_MSG_RESULT(no)
2051 system_utmpx_path=no ]
2052)
2053if test -z "$conf_utmpx_location"; then
2054 if test x"$system_utmpx_path" = x"no" ; then
2055 AC_DEFINE(DISABLE_UTMPX)
2056 fi
2057else
2058 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2059fi
2060
2061dnl wtmpx detection
2062AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2063AC_TRY_COMPILE([
2064#include <sys/types.h>
2065#include <utmp.h>
2066#ifdef HAVE_UTMPX_H
2067#include <utmpx.h>
2068#endif
Damien Miller2994e082000-06-04 15:51:47 +10002069#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002070# include <paths.h>
2071#endif
2072 ],
2073 [ char *wtmpx = WTMPX_FILE; ],
2074 [ AC_MSG_RESULT(yes) ],
2075 [ AC_MSG_RESULT(no)
2076 system_wtmpx_path=no ]
2077)
2078if test -z "$conf_wtmpx_location"; then
2079 if test x"$system_wtmpx_path" = x"no" ; then
2080 AC_DEFINE(DISABLE_WTMPX)
2081 fi
2082else
2083 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2084fi
2085
Damien Miller4018c192000-04-30 09:30:44 +10002086
2087# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10002088entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10002089AC_ARG_WITH(entropy-timeout,
2090 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2091 [
2092 if test "x$withval" != "xno" ; then
2093 entropy_timeout=$withval
2094 fi
2095 ]
2096)
2097AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
2098
2099
Damien Miller29ea30d2000-03-17 10:54:15 +11002100if test ! -z "$blibpath" ; then
2101 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2102 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2103fi
2104
Damien Millerbac2d8a2000-09-05 16:13:06 +11002105AC_EXEEXT
2106
Tim Rice13aae5e2001-10-21 17:53:58 -07002107AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2108AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002109
Damien Miller7b22d652000-06-18 14:07:04 +10002110# Print summary of options
2111
Damien Miller7b22d652000-06-18 14:07:04 +10002112if test ! -z "$RANDOM_POOL" ; then
2113 RAND_MSG="Device ($RANDOM_POOL)"
2114else
Damien Millerd0ccb982001-03-04 00:29:20 +11002115 if test ! -z "$PRNGD_PORT" ; then
2116 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
2117 elif test ! -z "$PRNGD_SOCKET" ; then
2118 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10002119 else
2120 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11002121 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10002122 fi
2123fi
2124
2125# Someone please show me a better way :)
2126A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2127B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2128C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2129D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002130E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002131F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002132G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002133H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002134
2135echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002136echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002137echo " User binaries: $B"
2138echo " System binaries: $C"
2139echo " Configuration files: $D"
2140echo " Askpass program: $E"
2141echo " Manual pages: $F"
2142echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002143echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10002144echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10002145echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002146echo " PAM support: ${PAM_MSG}"
2147echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002148echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002149echo " AFS support: $AFS_MSG"
2150echo " S/KEY support: $SKEY_MSG"
2151echo " TCP Wrappers support: $TCPW_MSG"
2152echo " MD5 password support: $MD5_MSG"
2153echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2154echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2155echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2156
Damien Miller60396b02001-02-18 17:01:00 +11002157if test ! -z "$bsd_auth"; then
2158 echo " BSD Auth support: yes"
2159fi
2160
Damien Miller7b22d652000-06-18 14:07:04 +10002161echo ""
2162
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002163echo " Host: ${host}"
2164echo " Compiler: ${CC}"
2165echo " Compiler flags: ${CFLAGS}"
2166echo "Preprocessor flags: ${CPPFLAGS}"
2167echo " Linker flags: ${LDFLAGS}"
2168echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002169
2170echo ""
2171
Damien Miller82cf0ce2000-12-20 13:34:48 +11002172if test "x$PAM_MSG" = "xyes" ; then
2173 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2174 echo "otherwise password authentication may fail. Example PAM control files"
2175 echo "can be found in the contrib/ subdirectory"
2176 echo ""
2177fi
2178
Damien Miller6f9c3372000-10-25 10:06:04 +11002179if test ! -z "$BUILTIN_RNG" ; then
2180 echo "WARNING: you are using the builtin random number collection service."
2181 echo "Please read WARNING.RNG and request that your OS vendor includes"
2182 echo "/dev/random in future versions of their OS."
2183 echo ""
2184fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002185
2186if test ! -z "$NO_SFTP"; then
2187 echo "sftp-server will be disabled. Your compiler does not support"
2188 echo "64bit integers."
2189 echo ""
2190fi
Damien Miller60396b02001-02-18 17:01:00 +11002191