blob: 39654a270ed473aa070a8694526c60ecf00954d3 [file] [log] [blame]
Tim Riceffdf4aa2001-10-27 10:45:36 -07001# $Id: configure.ac,v 1.3 2001/10/27 17:45:37 tim 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*)
Damien Milleref767ac2000-10-17 23:14:08 +110068 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 AC_DEFINE(HAVE_CYGWIN)
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
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000320AC_ARG_WITH(pcre,
Tim Rice13aae5e2001-10-21 17:53:58 -0700321 [ --with-pcre[[=PATH]] Override built in regex library with pcre
322 (optionally in PATH)],
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000323 [
Tim Rice13aae5e2001-10-21 17:53:58 -0700324 case "$withval" in
325 no) ;;
326 *)
327 if test "x$withval" != "xyes"; then
328 if test -d "$withval/lib"; then
329 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700330 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700331 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700332 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700333 fi
334 else
335 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700336 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700337 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700338 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700339 fi
340 fi
341 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700342 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700344 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700345 fi
346 fi
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000347
Tim Rice13aae5e2001-10-21 17:53:58 -0700348 AC_CHECK_HEADER(pcreposix.h,
349 AC_CHECK_LIB(pcre, pcre_info,[
350 AC_DEFINE(HAVE_LIBPCRE)
351 LIBS="$LIBS -lpcreposix -lpcre"
352 no_comp_check=yes],
353 AC_MSG_ERROR([*** unable to locate pcre library ***])),
354 AC_MSG_ERROR([*** unable to locate pcreposix.h include file ***]))
355 ;;
356 esac
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000357 ]
358)
Damien Millere37bfc12000-06-05 09:37:43 +1000359
Damien Millera22ba012000-03-02 23:09:20 +1100360# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700361AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
362AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000363
Damien Millerdf288022001-02-18 13:07:07 +1100364dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700365if test "x$with_tcp_wrappers" != "xno" ; then
366 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
367 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
368 fi
369fi
Damien Millerdf288022001-02-18 13:07:07 +1100370
Tim Rice13aae5e2001-10-21 17:53:58 -0700371AC_CHECK_FUNC(getspnam, ,
372 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
373AC_CHECK_FUNC(login, ,
374 AC_CHECK_LIB(util, login,
375 AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil"))
376
377dnl zlib is required
378AC_ARG_WITH(zlib,
379 [ --with-zlib=PATH Use zlib in PATH],
380 [
381 if test -d "$withval/lib"; then
382 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700383 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700384 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700385 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700386 fi
387 else
388 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700389 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700390 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700391 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700392 fi
393 fi
394 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700395 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700396 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700397 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700398 fi
399 ]
400)
401
Tim Rice17b93e52001-10-23 22:36:54 -0700402AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100403
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000404# We don't want to check if we did an pcre override.
405if test -z "$no_comp_check" ; then
406 AC_CHECK_FUNC(regcomp,
407 [ AC_DEFINE(HAVE_REGCOMP)],
408 [
409 AC_CHECK_LIB(pcre, pcre_info,
410 [
411 AC_DEFINE(HAVE_LIBPCRE)
412 LIBS="$LIBS -lpcreposix -lpcre"
413 ],
414 [
415 AC_MSG_ERROR([*** No regex library found.])
416 ])
417 ]
418 )
419fi
Damien Millerab18c411999-11-11 10:40:23 +1100420
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000421dnl UnixWare 2.x
422AC_CHECK_FUNC(strcasecmp,
423 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
424)
425AC_CHECK_FUNC(utimes,
426 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
427)
Damien Millerab18c411999-11-11 10:40:23 +1100428
Ben Lindstrom8697e082001-02-24 21:41:10 +0000429AC_FUNC_STRFTIME
430
Damien Millera22ba012000-03-02 23:09:20 +1100431# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700432AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700433 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700434 login_cap.h maillock.h netdb.h netgroup.h \
435 netinet/in_systm.h paths.h poll.h pty.h regex.h \
436 security/pam_appl.h shadow.h stddef.h stdint.h \
437 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
438 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
439 sys/stropts.h sys/sysmacros.h sys/time.h \
440 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
441 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100442
443# Check for ALTDIRFUNC glob() extension
444AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
445AC_EGREP_CPP(FOUNDIT,
446 [
447 #include <glob.h>
448 #ifdef GLOB_ALTDIRFUNC
449 FOUNDIT
450 #endif
451 ],
452 [
453 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
454 AC_MSG_RESULT(yes)
455 ],
456 [
457 AC_MSG_RESULT(no)
458 ]
459)
Damien Millerab18c411999-11-11 10:40:23 +1100460
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000461# Check for g.gl_matchc glob() extension
462AC_MSG_CHECKING(for gl_matchc field in glob_t)
463AC_EGREP_CPP(FOUNDIT,
464 [
465 #include <glob.h>
466 int main(void){glob_t g; g.gl_matchc = 1;}
467 ],
468 [
469 AC_DEFINE(GLOB_HAS_GL_MATCHC)
470 AC_MSG_RESULT(yes)
471 ],
472 [
473 AC_MSG_RESULT(no)
474 ]
475)
476
Damien Miller18bb4732001-03-28 14:35:30 +1000477AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
478AC_TRY_RUN(
479 [
480#include <sys/types.h>
481#include <dirent.h>
482int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
483 ],
484 [AC_MSG_RESULT(yes)],
485 [
486 AC_MSG_RESULT(no)
487 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
488 ]
489)
490
Damien Millerc547bf12001-02-16 10:18:12 +1100491# Check whether user wants S/Key support
492SKEY_MSG="no"
493AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700494 [ --with-skey[[=PATH]] Enable S/Key support
495 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100496 [
497 if test "x$withval" != "xno" ; then
498
499 if test "x$withval" != "xyes" ; then
500 CPPFLAGS="$CPPFLAGS -I${withval}/include"
501 LDFLAGS="$LDFLAGS -L${withval}/lib"
502 fi
503
504 AC_DEFINE(SKEY)
505 LIBS="-lskey $LIBS"
506 SKEY_MSG="yes"
507
508 AC_CHECK_FUNC(skey_keyinfo,
509 [],
510 [
511 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
512 ])
513 fi
514 ]
515)
516
517# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700518TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100519AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700520 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
521 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100522 [
523 if test "x$withval" != "xno" ; then
524 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700525 saved_LDFLAGS="$LDFLAGS"
526 saved_CPPFLAGS="$CPPFLAGS"
527 if test -n "${withval}" -a "${withval}" != "yes"; then
528 if test -d "${withval}/lib"; then
529 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700530 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700531 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700532 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700533 fi
534 else
535 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700536 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700537 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700538 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700539 fi
540 fi
541 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700542 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700543 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700544 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700545 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700546 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100547 LIBS="-lwrap $LIBS"
548 AC_MSG_CHECKING(for libwrap)
549 AC_TRY_LINK(
550 [
551#include <tcpd.h>
552 int deny_severity = 0, allow_severity = 0;
553 ],
554 [hosts_access(0);],
555 [
556 AC_MSG_RESULT(yes)
557 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100559 ],
560 [
561 AC_MSG_ERROR([*** libwrap missing])
562 ]
563 )
564 fi
565 ]
566)
567
Damien Millerad833b32000-08-23 10:46:23 +1000568dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700569AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
570 clock fchmod fchown freeaddrinfo futimes gai_strerror \
571 getaddrinfo getcwd getgrouplist getnameinfo getopt \
572 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
573 inet_ntop innetgr login_getcapbool md5_crypt memmove \
574 mkdtemp on_exit openpty readpassphrase realpath \
575 rresvport_af setdtablesize setegid setenv seteuid \
576 setlogin setproctitle setresgid setreuid setrlimit \
577 setsid setvbuf sigaction sigvec snprintf strerror \
578 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
579 vhangup vsnprintf waitpid __b64_ntop _getpty)
580
581dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700582AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700583 AC_CHECK_LIB(gen, dirname,[
584 AC_CACHE_CHECK([for broken dirname],
585 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700586 save_LIBS="$LIBS"
587 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700588 AC_TRY_RUN(
589 [
590#include <libgen.h>
591#include <string.h>
592
593int main(int argc, char **argv) {
594 char *s, buf[32];
595
596 strncpy(buf,"/etc", 32);
597 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700598 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700599 exit(1);
600 } else {
601 exit(0);
602 }
603}
604 ],
605 [ ac_cv_have_broken_dirname="no" ],
606 [ ac_cv_have_broken_dirname="yes" ]
607 )
Tim Rice17b93e52001-10-23 22:36:54 -0700608 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700610 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700611 LIBS="$LIBS -lgen"
612 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700613 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 fi
615 ])
616])
617
Damien Millerad833b32000-08-23 10:46:23 +1000618dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000619AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000620dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000621AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000622AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000623dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000624AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000625AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000626dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000627AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000628AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100629
Damien Miller5fc85652000-07-09 23:53:07 +1000630AC_CHECK_FUNC(getuserattr,
631 [AC_DEFINE(HAVE_GETUSERATTR)],
632 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
633)
634
Damien Miller04f80141999-11-19 15:32:34 +1100635AC_CHECK_FUNC(login,
636 [AC_DEFINE(HAVE_LOGIN)],
637 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
638)
639
640AC_CHECK_FUNC(daemon,
641 [AC_DEFINE(HAVE_DAEMON)],
642 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
643)
644
Damien Miller9fb07e42000-03-05 16:22:59 +1100645AC_CHECK_FUNC(getpagesize,
646 [AC_DEFINE(HAVE_GETPAGESIZE)],
647 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
648)
649
Damien Millercb170cb2000-07-01 16:52:55 +1000650# Check for broken snprintf
651if test "x$ac_cv_func_snprintf" = "xyes" ; then
652 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
653 AC_TRY_RUN(
654 [
655#include <stdio.h>
656int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
657 ],
658 [AC_MSG_RESULT(yes)],
659 [
660 AC_MSG_RESULT(no)
661 AC_DEFINE(BROKEN_SNPRINTF)
662 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
663 ]
664 )
665fi
666
Damien Miller606f8802000-09-16 15:39:56 +1100667AC_FUNC_GETPGRP
668
Damien Millera64b57a2001-01-17 10:44:13 +1100669# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000670PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100671AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100672 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100673 [
Damien Millera64b57a2001-01-17 10:44:13 +1100674 if test "x$withval" != "xno" ; then
675 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
676 AC_MSG_ERROR([PAM headers not found])
677 fi
678
679 AC_CHECK_LIB(dl, dlopen, , )
680 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
681 AC_CHECK_FUNCS(pam_getenvlist)
682
683 disable_shadow=yes
684 PAM_MSG="yes"
685
686 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100687 fi
688 ]
689)
Damien Millera22ba012000-03-02 23:09:20 +1100690
Damien Millera64b57a2001-01-17 10:44:13 +1100691# Check for older PAM
692if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100693 # Check PAM strerror arguments (old PAM)
694 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
695 AC_TRY_COMPILE(
696 [
Damien Miller81171112000-04-23 11:14:01 +1000697#include <stdlib.h>
698#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100699 ],
700 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
701 [AC_MSG_RESULT(no)],
702 [
703 AC_DEFINE(HAVE_OLD_PAM)
704 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000705 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100706 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100707 )
Damien Millera22ba012000-03-02 23:09:20 +1100708fi
709
710# The big search for OpenSSL
711AC_ARG_WITH(ssl-dir,
712 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
713 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000714 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100715 tryssldir=$withval
716 fi
717 ]
718)
719
720saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100721saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000722saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100723if test "x$prefix" != "xNONE" ; then
724 tryssldir="$tryssldir $prefix"
725fi
Damien Miller61e50f12000-05-08 20:49:37 +1000726AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100727 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 +1100728 CPPFLAGS="$saved_CPPFLAGS"
729 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000730 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100731
732 # Skip directories if they don't exist
733 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
734 continue;
735 fi
736 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
737 # 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
749 fi
750 # 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 Millerccdefb62001-02-19 12:56:39 +1100756 fi
757 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000758
Damien Miller3b512e12000-05-17 23:29:18 +1000759 # Basic test to check for compatible version and correct linking
760 # *does not* test for RSA - that comes later.
761 AC_TRY_RUN(
762 [
Damien Millere59ce622000-05-01 20:54:17 +1000763#include <string.h>
764#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000765int main(void)
766{
Damien Miller3b512e12000-05-17 23:29:18 +1000767 char a[2048];
768 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000769 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000770 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000771}
Damien Miller3b512e12000-05-17 23:29:18 +1000772 ],
773 [
774 found_crypto=1
775 break;
776 ], []
777 )
Damien Miller61e50f12000-05-08 20:49:37 +1000778
779 if test ! -z "$found_crypto" ; then
780 break;
781 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100782 done
783
Damien Miller61e50f12000-05-08 20:49:37 +1000784 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100785 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100786 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000787 if test -z "$ssldir" ; then
788 ssldir="(system)"
789 fi
Damien Millera22ba012000-03-02 23:09:20 +1100790
Damien Miller61e50f12000-05-08 20:49:37 +1000791 ac_cv_openssldir=$ssldir
792])
793
Damien Milleredb82922000-06-20 13:25:52 +1000794if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000795 AC_DEFINE(HAVE_OPENSSL)
796 dnl Need to recover ssldir - test above runs in subshell
797 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100798 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100799 # Try to use $ssldir/lib if it exists, otherwise
800 # $ssldir
801 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000802 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100803 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000804 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100805 fi
806 else
Damien Millerb68af622001-03-28 21:05:26 +1000807 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100808 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000809 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100810 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100811 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100812 # Try to use $ssldir/include if it exists, otherwise
813 # $ssldir
814 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000815 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100816 else
Damien Millerb68af622001-03-28 21:05:26 +1000817 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100818 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100819 fi
Damien Millera22ba012000-03-02 23:09:20 +1100820fi
Damien Miller3b512e12000-05-17 23:29:18 +1000821LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000822
Damien Miller3b512e12000-05-17 23:29:18 +1000823# Now test RSA support
824saved_LIBS="$LIBS"
825AC_MSG_CHECKING([for RSA support])
826for WANTS_RSAREF in "" 1 ; do
827 if test -z "$WANTS_RSAREF" ; then
828 LIBS="$saved_LIBS"
829 else
830 LIBS="$saved_LIBS -lRSAglue -lrsaref"
831 fi
832 AC_TRY_RUN([
833#include <string.h>
834#include <openssl/rand.h>
835#include <openssl/rsa.h>
836#include <openssl/bn.h>
837#include <openssl/sha.h>
838int main(void)
839{
840 int num; RSA *key; static unsigned char p_in[] = "blahblah";
841 unsigned char c[256], p[256];
842 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
843 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
844 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
845 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
846}
847 ],
848 [
849 rsa_works=1
850 break;
851 ], [])
852done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000853LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000854
855if test ! -z "$no_rsa" ; then
856 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000857 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000858else
859 if test -z "$rsa_works" ; then
860 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000861 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000862 else
863 if test -z "$WANTS_RSAREF" ; then
864 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000865 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000866 else
Damien Miller7b22d652000-06-18 14:07:04 +1000867 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000868 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000869 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000870 fi
871 fi
872fi
Damien Millera22ba012000-03-02 23:09:20 +1100873
Damien Millera64b57a2001-01-17 10:44:13 +1100874# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
875# version in OpenSSL. Skip this for PAM
876if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100877 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100878fi
879
Ben Lindstromb5628642000-10-18 00:02:25 +0000880# Cheap hack to ensure NEWS-OS libraries are arranged right.
881if test ! -z "$SONY" ; then
882 LIBS="$LIBS -liberty";
883fi
884
Damien Millera22ba012000-03-02 23:09:20 +1100885# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100886AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100887AC_CHECK_SIZEOF(short int, 2)
888AC_CHECK_SIZEOF(int, 4)
889AC_CHECK_SIZEOF(long int, 4)
890AC_CHECK_SIZEOF(long long int, 8)
891
Damien Millera22ba012000-03-02 23:09:20 +1100892# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100893AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
894 AC_TRY_COMPILE(
895 [ #include <sys/types.h> ],
896 [ u_int a; a = 1;],
897 [ ac_cv_have_u_int="yes" ],
898 [ ac_cv_have_u_int="no" ]
899 )
900])
901if test "x$ac_cv_have_u_int" = "xyes" ; then
902 AC_DEFINE(HAVE_U_INT)
903 have_u_int=1
904fi
905
Damien Miller61e50f12000-05-08 20:49:37 +1000906AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
907 AC_TRY_COMPILE(
908 [ #include <sys/types.h> ],
909 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
910 [ ac_cv_have_intxx_t="yes" ],
911 [ ac_cv_have_intxx_t="no" ]
912 )
913])
914if test "x$ac_cv_have_intxx_t" = "xyes" ; then
915 AC_DEFINE(HAVE_INTXX_T)
916 have_intxx_t=1
917fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000918
919if (test -z "$have_intxx_t" && \
920 test "x$ac_cv_header_stdint_h" = "xyes")
921then
922 AC_MSG_CHECKING([for intXX_t types in stdint.h])
923 AC_TRY_COMPILE(
924 [ #include <stdint.h> ],
925 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
926 [
927 AC_DEFINE(HAVE_INTXX_T)
928 AC_MSG_RESULT(yes)
929 ],
930 [ AC_MSG_RESULT(no) ]
931 )
932fi
933
Damien Miller578783e2000-09-23 14:12:24 +1100934AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
935 AC_TRY_COMPILE(
936 [ #include <sys/types.h> ],
937 [ int64_t a; a = 1;],
938 [ ac_cv_have_int64_t="yes" ],
939 [ ac_cv_have_int64_t="no" ]
940 )
941])
942if test "x$ac_cv_have_int64_t" = "xyes" ; then
943 AC_DEFINE(HAVE_INT64_T)
944 have_int64_t=1
945fi
946
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000947if test -z "$have_int64_t" ; then
948 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
949 AC_TRY_COMPILE(
950 [ #include <sys/socket.h> ],
951 [ int64_t a; a = 1],
952 [
953 AC_DEFINE(HAVE_INT64_T)
954 AC_MSG_RESULT(yes)
955 ],
956 [ AC_MSG_RESULT(no) ]
957 )
958fi
959
Damien Miller61e50f12000-05-08 20:49:37 +1000960AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
961 AC_TRY_COMPILE(
962 [ #include <sys/types.h> ],
963 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
964 [ ac_cv_have_u_intxx_t="yes" ],
965 [ ac_cv_have_u_intxx_t="no" ]
966 )
967])
968if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
969 AC_DEFINE(HAVE_U_INTXX_T)
970 have_u_intxx_t=1
971fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100972
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000973if test -z "$have_u_intxx_t" ; then
974 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
975 AC_TRY_COMPILE(
976 [ #include <sys/socket.h> ],
977 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
978 [
979 AC_DEFINE(HAVE_U_INTXX_T)
980 AC_MSG_RESULT(yes)
981 ],
982 [ AC_MSG_RESULT(no) ]
983 )
984fi
985
Damien Miller578783e2000-09-23 14:12:24 +1100986AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
987 AC_TRY_COMPILE(
988 [ #include <sys/types.h> ],
989 [ u_int64_t a; a = 1;],
990 [ ac_cv_have_u_int64_t="yes" ],
991 [ ac_cv_have_u_int64_t="no" ]
992 )
993])
994if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
995 AC_DEFINE(HAVE_U_INT64_T)
996 have_u_int64_t=1
997fi
998
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000999if test -z "$have_u_intxx_t" ; then
1000 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1001 AC_TRY_COMPILE(
1002 [
1003#include <sys/types.h>
1004 ],
1005 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1006 [ ac_cv_have_uintxx_t="yes" ],
1007 [ ac_cv_have_uintxx_t="no" ]
1008 )
1009 ])
1010 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1011 AC_DEFINE(HAVE_UINTXX_T)
1012 fi
1013fi
1014
1015if test -z "$have_uintxx_t" ; then
1016 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1017 AC_TRY_COMPILE(
1018 [ #include <stdint.h> ],
1019 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1020 [
1021 AC_DEFINE(HAVE_UINTXX_T)
1022 AC_MSG_RESULT(yes)
1023 ],
1024 [ AC_MSG_RESULT(no) ]
1025 )
1026fi
1027
Damien Milleredb82922000-06-20 13:25:52 +10001028if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1029 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001030then
1031 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1032 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001033 [
1034#include <sys/bitypes.h>
1035 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001036 [
Damien Miller70494d12000-04-03 15:57:06 +10001037 int8_t a; int16_t b; int32_t c;
1038 u_int8_t e; u_int16_t f; u_int32_t g;
1039 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001040 ],
1041 [
1042 AC_DEFINE(HAVE_U_INTXX_T)
1043 AC_DEFINE(HAVE_INTXX_T)
1044 AC_MSG_RESULT(yes)
1045 ],
1046 [AC_MSG_RESULT(no)]
1047 )
1048fi
1049
Damien Miller58be7382001-09-15 21:31:54 +10001050
1051AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1052 AC_TRY_COMPILE(
1053 [
1054#include <sys/types.h>
1055 ],
1056 [ u_char foo; foo = 125; ],
1057 [ ac_cv_have_u_char="yes" ],
1058 [ ac_cv_have_u_char="no" ]
1059 )
1060])
1061if test "x$ac_cv_have_u_char" = "xyes" ; then
1062 AC_DEFINE(HAVE_U_CHAR)
1063fi
1064
Tim Rice13aae5e2001-10-21 17:53:58 -07001065TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001066
Damien Miller61e50f12000-05-08 20:49:37 +10001067AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1068 AC_TRY_COMPILE(
1069 [
1070#include <sys/types.h>
1071 ],
1072 [ size_t foo; foo = 1235; ],
1073 [ ac_cv_have_size_t="yes" ],
1074 [ ac_cv_have_size_t="no" ]
1075 )
1076])
1077if test "x$ac_cv_have_size_t" = "xyes" ; then
1078 AC_DEFINE(HAVE_SIZE_T)
1079fi
Damien Miller95058511999-12-29 10:36:45 +11001080
Damien Miller615f9392000-05-17 22:53:33 +10001081AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1082 AC_TRY_COMPILE(
1083 [
1084#include <sys/types.h>
1085 ],
1086 [ ssize_t foo; foo = 1235; ],
1087 [ ac_cv_have_ssize_t="yes" ],
1088 [ ac_cv_have_ssize_t="no" ]
1089 )
1090])
1091if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1092 AC_DEFINE(HAVE_SSIZE_T)
1093fi
1094
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001095AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1096 AC_TRY_COMPILE(
1097 [
1098#include <time.h>
1099 ],
1100 [ clock_t foo; foo = 1235; ],
1101 [ ac_cv_have_clock_t="yes" ],
1102 [ ac_cv_have_clock_t="no" ]
1103 )
1104])
1105if test "x$ac_cv_have_clock_t" = "xyes" ; then
1106 AC_DEFINE(HAVE_CLOCK_T)
1107fi
1108
Damien Millerb54b40e2000-06-23 08:23:34 +10001109AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1110 AC_TRY_COMPILE(
1111 [
1112#include <sys/types.h>
1113#include <sys/socket.h>
1114 ],
1115 [ sa_family_t foo; foo = 1235; ],
1116 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001117 [ AC_TRY_COMPILE(
1118 [
1119#include <sys/types.h>
1120#include <sys/socket.h>
1121#include <netinet/in.h>
1122 ],
1123 [ sa_family_t foo; foo = 1235; ],
1124 [ ac_cv_have_sa_family_t="yes" ],
1125
Damien Millerb54b40e2000-06-23 08:23:34 +10001126 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001127 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001128 )
1129])
1130if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1131 AC_DEFINE(HAVE_SA_FAMILY_T)
1132fi
1133
Damien Miller0f91b4e2000-06-18 15:43:25 +10001134AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1135 AC_TRY_COMPILE(
1136 [
1137#include <sys/types.h>
1138 ],
1139 [ pid_t foo; foo = 1235; ],
1140 [ ac_cv_have_pid_t="yes" ],
1141 [ ac_cv_have_pid_t="no" ]
1142 )
1143])
1144if test "x$ac_cv_have_pid_t" = "xyes" ; then
1145 AC_DEFINE(HAVE_PID_T)
1146fi
1147
1148AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1149 AC_TRY_COMPILE(
1150 [
1151#include <sys/types.h>
1152 ],
1153 [ mode_t foo; foo = 1235; ],
1154 [ ac_cv_have_mode_t="yes" ],
1155 [ ac_cv_have_mode_t="no" ]
1156 )
1157])
1158if test "x$ac_cv_have_mode_t" = "xyes" ; then
1159 AC_DEFINE(HAVE_MODE_T)
1160fi
1161
Damien Miller61e50f12000-05-08 20:49:37 +10001162
1163AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1164 AC_TRY_COMPILE(
1165 [
Damien Miller81171112000-04-23 11:14:01 +10001166#include <sys/types.h>
1167#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001168 ],
1169 [ struct sockaddr_storage s; ],
1170 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1171 [ ac_cv_have_struct_sockaddr_storage="no" ]
1172 )
1173])
1174if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1175 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1176fi
Damien Miller34132e52000-01-14 15:45:46 +11001177
Damien Miller61e50f12000-05-08 20:49:37 +10001178AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1179 AC_TRY_COMPILE(
1180 [
Damien Miller7b22d652000-06-18 14:07:04 +10001181#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001182#include <netinet/in.h>
1183 ],
1184 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1185 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1186 [ ac_cv_have_struct_sockaddr_in6="no" ]
1187 )
1188])
1189if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1190 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1191fi
Damien Miller34132e52000-01-14 15:45:46 +11001192
Damien Miller61e50f12000-05-08 20:49:37 +10001193AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1194 AC_TRY_COMPILE(
1195 [
Damien Miller7b22d652000-06-18 14:07:04 +10001196#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001197#include <netinet/in.h>
1198 ],
1199 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1200 [ ac_cv_have_struct_in6_addr="yes" ],
1201 [ ac_cv_have_struct_in6_addr="no" ]
1202 )
1203])
1204if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1205 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1206fi
Damien Miller34132e52000-01-14 15:45:46 +11001207
Damien Miller61e50f12000-05-08 20:49:37 +10001208AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1209 AC_TRY_COMPILE(
1210 [
Damien Miller81171112000-04-23 11:14:01 +10001211#include <sys/types.h>
1212#include <sys/socket.h>
1213#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001214 ],
1215 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1216 [ ac_cv_have_struct_addrinfo="yes" ],
1217 [ ac_cv_have_struct_addrinfo="no" ]
1218 )
1219])
1220if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1221 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1222fi
1223
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001224AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1225 AC_TRY_COMPILE(
1226 [ #include <sys/time.h> ],
1227 [ struct timeval tv; tv.tv_sec = 1;],
1228 [ ac_cv_have_struct_timeval="yes" ],
1229 [ ac_cv_have_struct_timeval="no" ]
1230 )
1231])
1232if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1233 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1234 have_struct_timeval=1
1235fi
1236
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001237# If we don't have int64_t then we can't compile sftp-server. So don't
1238# even attempt to do it.
1239if test "x$ac_cv_have_int64_t" = "xno" -a \
1240 "x$ac_cv_sizeof_long_int" != "x8" -a \
1241 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1242 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001243else
1244dnl test snprintf (broken on SCO w/gcc)
1245 AC_TRY_RUN(
1246 [
1247#include <stdio.h>
1248#include <string.h>
1249#ifdef HAVE_SNPRINTF
1250main()
1251{
1252 char buf[50];
1253 char expected_out[50];
1254 int mazsize = 50 ;
1255#if (SIZEOF_LONG_INT == 8)
1256 long int num = 0x7fffffffffffffff;
1257#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001258 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001259#endif
1260 strcpy(expected_out, "9223372036854775807");
1261 snprintf(buf, mazsize, "%lld", num);
1262 if(strcmp(buf, expected_out) != 0)
1263 exit(1);
1264 exit(0);
1265}
1266#else
1267main() { exit(0); }
1268#endif
1269 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1270 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001271fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001272AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001273
Damien Miller78315eb2000-09-29 23:01:36 +11001274dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001275OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1276OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1277OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1278OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1279OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001280OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001281OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1282OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001283OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001284OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1285OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1286OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1287OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001288OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1289OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1290OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1291OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001292
1293AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001294
Damien Miller61e50f12000-05-08 20:49:37 +10001295AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1296 ac_cv_have_ss_family_in_struct_ss, [
1297 AC_TRY_COMPILE(
1298 [
Damien Miller81171112000-04-23 11:14:01 +10001299#include <sys/types.h>
1300#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001301 ],
1302 [ struct sockaddr_storage s; s.ss_family = 1; ],
1303 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1304 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1305 )
1306])
1307if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1308 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1309fi
1310
Damien Miller61e50f12000-05-08 20:49:37 +10001311AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1312 ac_cv_have___ss_family_in_struct_ss, [
1313 AC_TRY_COMPILE(
1314 [
Damien Miller81171112000-04-23 11:14:01 +10001315#include <sys/types.h>
1316#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001317 ],
1318 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1319 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1320 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1321 )
1322])
1323if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1324 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1325fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001326
Damien Millerad833b32000-08-23 10:46:23 +10001327AC_CACHE_CHECK([for pw_class field in struct passwd],
1328 ac_cv_have_pw_class_in_struct_passwd, [
1329 AC_TRY_COMPILE(
1330 [
Damien Millerad833b32000-08-23 10:46:23 +10001331#include <pwd.h>
1332 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001333 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001334 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1335 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1336 )
1337])
1338if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1339 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1340fi
1341
Kevin Steves82456952001-06-22 21:14:18 +00001342AC_CACHE_CHECK([for pw_expire field in struct passwd],
1343 ac_cv_have_pw_expire_in_struct_passwd, [
1344 AC_TRY_COMPILE(
1345 [
1346#include <pwd.h>
1347 ],
1348 [ struct passwd p; p.pw_expire = 0; ],
1349 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1350 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1351 )
1352])
1353if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1354 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1355fi
1356
1357AC_CACHE_CHECK([for pw_change field in struct passwd],
1358 ac_cv_have_pw_change_in_struct_passwd, [
1359 AC_TRY_COMPILE(
1360 [
1361#include <pwd.h>
1362 ],
1363 [ struct passwd p; p.pw_change = 0; ],
1364 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1365 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1366 )
1367])
1368if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1369 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1370fi
Damien Miller61e50f12000-05-08 20:49:37 +10001371
1372AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1373 AC_TRY_LINK([],
1374 [ extern char *__progname; printf("%s", __progname); ],
1375 [ ac_cv_libc_defines___progname="yes" ],
1376 [ ac_cv_libc_defines___progname="no" ]
1377 )
1378])
1379if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1380 AC_DEFINE(HAVE___PROGNAME)
1381fi
1382
Damien Miller4f8e6692001-07-14 13:22:53 +10001383AC_CACHE_CHECK([whether getopt has optreset support],
1384 ac_cv_have_getopt_optreset, [
1385 AC_TRY_LINK(
1386 [
1387#include <getopt.h>
1388 ],
1389 [ extern int optreset; optreset = 0; ],
1390 [ ac_cv_have_getopt_optreset="yes" ],
1391 [ ac_cv_have_getopt_optreset="no" ]
1392 )
1393])
1394if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1395 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1396fi
Damien Millera22ba012000-03-02 23:09:20 +11001397
Damien Millerecbb26d2000-07-15 14:59:14 +10001398AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1399 AC_TRY_LINK([],
1400 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1401 [ ac_cv_libc_defines_sys_errlist="yes" ],
1402 [ ac_cv_libc_defines_sys_errlist="no" ]
1403 )
1404])
1405if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1406 AC_DEFINE(HAVE_SYS_ERRLIST)
1407fi
1408
1409
Damien Miller11fa2cc2000-08-16 10:35:58 +10001410AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1411 AC_TRY_LINK([],
1412 [ extern int sys_nerr; printf("%i", sys_nerr);],
1413 [ ac_cv_libc_defines_sys_nerr="yes" ],
1414 [ ac_cv_libc_defines_sys_nerr="no" ]
1415 )
1416])
1417if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1418 AC_DEFINE(HAVE_SYS_NERR)
1419fi
1420
1421
Damien Millerc79bc0d2001-03-28 13:03:42 +10001422# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001423SCARD_MSG="no"
1424AC_ARG_WITH(smartcard,
1425 [ --with-smartcard Enable smartcard support],
1426 [
1427 if test "x$withval" != "xno" ; then
1428 if test "x$withval" != "xyes" ; then
1429 CPPFLAGS="$CPPFLAGS -I${withval}"
1430 LDFLAGS="$LDFLAGS -L${withval}"
1431 if test ! -z "$need_dash_r" ; then
1432 LDFLAGS="$LDFLAGS -R${withval}"
1433 fi
1434 if test ! -z "$blibpath" ; then
1435 blibpath="$blibpath:${withval}"
1436 fi
1437 fi
1438 AC_CHECK_HEADERS(sectok.h)
1439 if test "$ac_cv_header_sectok_h" != yes; then
1440 AC_MSG_ERROR(Can't find sectok.h)
1441 fi
1442 AC_CHECK_LIB(sectok, sectok_open)
1443 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1444 AC_MSG_ERROR(Can't find libsectok)
1445 fi
1446 AC_DEFINE(SMARTCARD)
1447 SCARD_MSG="yes"
1448 fi
1449 ]
1450)
1451
1452# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001453KRB4_MSG="no"
1454AC_ARG_WITH(kerberos4,
1455 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1456 [
1457 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001458 if test "x$withval" != "xyes" ; then
1459 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1460 LDFLAGS="$LDFLAGS -L${withval}/lib"
1461 if test ! -z "$need_dash_r" ; then
1462 LDFLAGS="$LDFLAGS -R${withval}/lib"
1463 fi
1464 if test ! -z "$blibpath" ; then
1465 blibpath="$blibpath:${withval}/lib"
1466 fi
1467 else
1468 if test -d /usr/include/kerberosIV ; then
1469 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1470 fi
1471 fi
1472
1473 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001474 if test "$ac_cv_header_krb_h" != yes; then
1475 AC_MSG_WARN([Cannot find krb.h, build may fail])
1476 fi
Damien Miller98344742001-03-28 14:37:06 +10001477 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001478 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001479 AC_CHECK_LIB(krb4, main)
1480 if test "$ac_cv_lib_krb4_main" != yes; then
1481 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1482 else
1483 KLIBS="-lkrb4"
1484 fi
1485 else
1486 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001487 fi
Damien Miller98344742001-03-28 14:37:06 +10001488 AC_CHECK_LIB(des, des_cbc_encrypt)
1489 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1490 AC_CHECK_LIB(des425, des_cbc_encrypt)
1491 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1492 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1493 else
1494 KLIBS="-ldes425"
1495 fi
1496 else
1497 KLIBS="-ldes"
1498 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001499 AC_CHECK_LIB(resolv, dn_expand, , )
1500 KRB4=yes
1501 KRB4_MSG="yes"
1502 AC_DEFINE(KRB4)
1503 fi
1504 ]
1505)
1506
1507# Check whether user wants AFS support
1508AFS_MSG="no"
1509AC_ARG_WITH(afs,
1510 [ --with-afs=PATH Enable AFS support],
1511 [
1512 if test "x$withval" != "xno" ; then
1513
1514 if test "x$withval" != "xyes" ; then
1515 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1516 LDFLAGS="$LDFLAGS -L${withval}/lib"
1517 fi
1518
1519 if test -z "$KRB4" ; then
1520 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1521 fi
1522
1523 LIBS="-lkafs $LIBS"
1524 if test ! -z "$AFS_LIBS" ; then
1525 LIBS="$LIBS $AFS_LIBS"
1526 fi
1527 AC_DEFINE(AFS)
1528 AFS_MSG="yes"
1529 fi
1530 ]
1531)
1532LIBS="$LIBS $KLIBS"
1533
Damien Millera22ba012000-03-02 23:09:20 +11001534# Looking for programs, paths and files
1535AC_ARG_WITH(rsh,
1536 [ --with-rsh=PATH Specify path to remote shell program ],
1537 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001538 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001539 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001540 fi
1541 ],
1542 [
1543 AC_PATH_PROG(rsh_path, rsh)
1544 ]
1545)
1546
1547AC_ARG_WITH(xauth,
1548 [ --with-xauth=PATH Specify path to xauth program ],
1549 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001550 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001551 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001552 fi
1553 ],
1554 [
Damien Miller78315eb2000-09-29 23:01:36 +11001555 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 +10001556 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001557 xauth_path="/usr/openwin/bin/xauth"
1558 fi
1559 ]
1560)
1561
Damien Millera19cf472000-11-29 13:28:50 +11001562if test -z "$xauth_path" ; then
1563 XAUTH_PATH="undefined"
1564 AC_SUBST(XAUTH_PATH)
1565else
Damien Millera22ba012000-03-02 23:09:20 +11001566 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001567 XAUTH_PATH=$xauth_path
1568 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001569fi
1570if test ! -z "$rsh_path" ; then
1571 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1572fi
1573
1574# Check for mail directory (last resort if we cannot get it from headers)
1575if test ! -z "$MAIL" ; then
1576 maildir=`dirname $MAIL`
1577 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1578fi
1579
Damien Millera22ba012000-03-02 23:09:20 +11001580if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001581 AC_CHECK_FILE("/dev/ptmx",
1582 [
1583 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1584 have_dev_ptmx=1
1585 ]
1586 )
Damien Millera22ba012000-03-02 23:09:20 +11001587fi
Damien Miller204ad072000-03-02 23:56:12 +11001588AC_CHECK_FILE("/dev/ptc",
1589 [
1590 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1591 have_dev_ptc=1
1592 ]
1593)
1594
Damien Millera22ba012000-03-02 23:09:20 +11001595# Options from here on. Some of these are preset by platform above
1596
Damien Millera22ba012000-03-02 23:09:20 +11001597# Check for user-specified random device, otherwise check /dev/urandom
1598AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001599 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001600 [
Damien Miller040f3832000-04-03 14:50:43 +10001601 if test "x$withval" != "xno" ; then
1602 RANDOM_POOL="$withval";
1603 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1604 fi
Damien Millera22ba012000-03-02 23:09:20 +11001605 ],
1606 [
1607 # Check for random device
1608 AC_CHECK_FILE("/dev/urandom",
1609 [
1610 RANDOM_POOL="/dev/urandom";
1611 AC_SUBST(RANDOM_POOL)
1612 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1613 ]
1614 )
1615 ]
1616)
1617
Damien Millerd0ccb982001-03-04 00:29:20 +11001618# Check for PRNGD/EGD pool file
1619AC_ARG_WITH(prngd-port,
1620 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1621 [
1622 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1623 PRNGD_PORT="$withval"
1624 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1625 fi
1626 ]
1627)
1628
1629# Check for PRNGD/EGD pool file
1630AC_ARG_WITH(prngd-socket,
1631 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001632 [
Damien Miller040f3832000-04-03 14:50:43 +10001633 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001634 PRNGD_SOCKET="$withval"
1635 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001636 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001637 ],
1638 [
1639 # Check for existing socket only if we don't have a random device already
1640 if test -z "$RANDOM_POOL" ; then
1641 AC_MSG_CHECKING(for PRNGD/EGD socket)
1642 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001643 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001644 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1645 PRNGD_SOCKET="$sock"
1646 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001647 break;
1648 fi
1649 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001650 if test ! -z "$PRNGD_SOCKET" ; then
1651 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001652 else
1653 AC_MSG_RESULT(not found)
1654 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001655 fi
Damien Millera22ba012000-03-02 23:09:20 +11001656 ]
1657)
1658
Damien Miller0736c4d2001-01-25 10:51:46 +11001659
Damien Miller0437b332000-05-02 09:56:41 +10001660# detect pathnames for entropy gathering commands, if we need them
1661INSTALL_SSH_PRNG_CMDS=""
1662rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001663if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001664 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001665 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1666 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1667 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1668 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
Ben Lindstromd9e08242001-07-22 19:32:00 +00001669 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
Damien Miller61e50f12000-05-08 20:49:37 +10001670 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
Ben Lindstrom6db66ff2001-08-06 23:29:16 +00001671 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
Damien Miller61e50f12000-05-08 20:49:37 +10001672 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1673 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1674 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1675 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1676 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1677 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1678 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1679 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1680 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001681
1682 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001683fi
Damien Miller0437b332000-05-02 09:56:41 +10001684AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1685
Damien Miller11e37f62000-04-08 18:23:30 +10001686
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001687AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001688 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001689 [
Damien Miller897741e2001-04-16 10:41:46 +10001690 case "$withval" in
1691 man|cat|doc)
1692 MANTYPE=$withval
1693 ;;
1694 *)
1695 AC_MSG_ERROR(invalid man type: $withval)
1696 ;;
1697 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001698 ]
1699)
Ben Lindstrombc709922001-04-18 18:04:21 +00001700if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001701 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001702 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1703 MANTYPE=doc
1704 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1705 MANTYPE=man
1706 else
1707 MANTYPE=cat
1708 fi
1709fi
Damien Miller670a4b82000-01-22 13:53:11 +11001710AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001711if test "$MANTYPE" = "doc"; then
1712 mansubdir=man;
1713else
1714 mansubdir=$MANTYPE;
1715fi
1716AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001717
Damien Millera22ba012000-03-02 23:09:20 +11001718# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001719MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001720AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001721 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001722 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001723 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001724 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001725 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001726 fi
1727 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001728)
1729
Damien Millera22ba012000-03-02 23:09:20 +11001730# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001731AC_ARG_WITH(shadow,
1732 [ --without-shadow Disable shadow password support],
1733 [
1734 if test "x$withval" = "xno" ; then
1735 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001736 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001737 fi
1738 ]
1739)
1740
Damien Miller1f335fb2000-06-26 11:31:33 +10001741if test -z "$disable_shadow" ; then
1742 AC_MSG_CHECKING([if the systems has expire shadow information])
1743 AC_TRY_COMPILE(
1744 [
1745#include <sys/types.h>
1746#include <shadow.h>
1747 struct spwd sp;
1748 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1749 [ sp_expire_available=yes ], []
1750 )
1751
1752 if test "x$sp_expire_available" = "xyes" ; then
1753 AC_MSG_RESULT(yes)
1754 AC_DEFINE(HAS_SHADOW_EXPIRE)
1755 else
1756 AC_MSG_RESULT(no)
1757 fi
1758fi
1759
Damien Millera22ba012000-03-02 23:09:20 +11001760# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001761if test ! -z "$IPADDR_IN_DISPLAY" ; then
1762 DISPLAY_HACK_MSG="yes"
1763 AC_DEFINE(IPADDR_IN_DISPLAY)
1764else
1765 DISPLAY_HACK_MSG="no"
1766 AC_ARG_WITH(ipaddr-display,
1767 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1768 [
1769 if test "x$withval" != "xno" ; then
1770 AC_DEFINE(IPADDR_IN_DISPLAY)
1771 DISPLAY_HACK_MSG="yes"
1772 fi
1773 ]
1774 )
1775fi
Damien Miller76112de1999-12-21 11:18:08 +11001776
Damien Millera22ba012000-03-02 23:09:20 +11001777# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001778SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001779AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001780 [ --with-default-path=PATH Specify default \$PATH environment for server],
1781 [
1782 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001783 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001784 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001785 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001786 ],
1787 [
1788 AC_TRY_RUN(
1789 [
1790/* find out what STDPATH is */
1791#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001792#ifdef HAVE_PATHS_H
1793# include <paths.h>
1794#endif
1795#ifndef _PATH_STDPATH
1796# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1797#endif
1798#include <sys/types.h>
1799#include <sys/stat.h>
1800#include <fcntl.h>
1801#define DATA "conftest.stdpath"
1802
1803main()
1804{
1805 FILE *fd;
1806 int rc;
1807
1808 fd = fopen(DATA,"w");
1809 if(fd == NULL)
1810 exit(1);
1811
1812 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1813 exit(1);
1814
1815 exit(0);
1816}
1817 ], [ user_path=`cat conftest.stdpath` ],
1818 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1819 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1820 )
1821# make sure $bindir is in USER_PATH so scp will work
1822 t_bindir=`eval echo ${bindir}`
1823 case $t_bindir in
1824 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1825 esac
1826 case $t_bindir in
1827 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1828 esac
1829 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1830 if test $? -ne 0 ; then
1831 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1832 if test $? -ne 0 ; then
1833 user_path=$user_path:$t_bindir
1834 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1835 fi
1836 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001837 ]
1838)
Tim Rice59ea0a02001-03-10 13:50:45 -08001839AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1840AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001841
Damien Millera22ba012000-03-02 23:09:20 +11001842# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001843IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001844AC_ARG_WITH(ipv4-default,
1845 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1846 [
1847 if test "x$withval" != "xno" ; then
1848 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001849 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001850 fi
1851 ]
1852)
1853
Damien Miller61e50f12000-05-08 20:49:37 +10001854AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001855IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001856AC_ARG_WITH(4in6,
1857 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1858 [
1859 if test "x$withval" != "xno" ; then
1860 AC_MSG_RESULT(yes)
1861 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001862 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001863 else
1864 AC_MSG_RESULT(no)
1865 fi
1866 ],[
1867 if test "x$inet6_default_4in6" = "xyes"; then
1868 AC_MSG_RESULT([yes (default)])
1869 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001870 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001871 else
1872 AC_MSG_RESULT([no (default)])
1873 fi
1874 ]
1875)
1876
Damien Miller60396b02001-02-18 17:01:00 +11001877# Whether to enable BSD auth support
1878AC_ARG_WITH(bsd-auth,
1879 [ --with-bsd-auth Enable BSD auth support],
1880 [
1881 if test "x$withval" != "xno" ; then
1882 AC_DEFINE(BSD_AUTH)
1883 bsd_auth=yes
1884 fi
1885 ]
1886)
1887
Damien Miller78315eb2000-09-29 23:01:36 +11001888AC_MSG_CHECKING(whether to install ssh as suid root)
1889AC_ARG_ENABLE(suid-ssh,
1890[ --enable-suid-ssh Install ssh as suid root (default)
1891 --disable-suid-ssh Install ssh without suid bit],
1892[ case "$enableval" in
1893 no)
1894 AC_MSG_RESULT(no)
1895 SSHMODE=0711
1896 ;;
1897 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001898 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001899 ;;
1900 esac ],
1901 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001902 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001903)
1904AC_SUBST(SSHMODE)
1905
1906
Damien Millera22ba012000-03-02 23:09:20 +11001907# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001908piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001909AC_ARG_WITH(pid-dir,
1910 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1911 [
1912 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001913 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001914 fi
1915 ]
1916)
Damien Miller4018c192000-04-30 09:30:44 +10001917
Damien Miller78315eb2000-09-29 23:01:36 +11001918# make sure the directory exists
1919if test ! -d $piddir ; then
1920 piddir=`eval echo ${sysconfdir}`
1921 case $piddir in
1922 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1923 esac
1924fi
1925
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001926AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001927AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001928
andre2ff7b5d2000-06-03 14:57:40 +00001929dnl allow user to disable some login recording features
1930AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001931 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001932 [ AC_DEFINE(DISABLE_LASTLOG) ]
1933)
1934AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001935 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001936 [ AC_DEFINE(DISABLE_UTMP) ]
1937)
1938AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001939 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001940 [ AC_DEFINE(DISABLE_UTMPX) ]
1941)
1942AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001943 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001944 [ AC_DEFINE(DISABLE_WTMP) ]
1945)
1946AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001947 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001948 [ AC_DEFINE(DISABLE_WTMPX) ]
1949)
1950AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001951 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001952 [ AC_DEFINE(DISABLE_LOGIN) ]
1953)
1954AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001955 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001956 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1957)
1958AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001959 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001960 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1961)
1962AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001963 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001964 [
1965 if test "x$withval" = "xno" ; then
1966 AC_DEFINE(DISABLE_LASTLOG)
1967 else
1968 conf_lastlog_location=$withval
1969 fi
1970 ]
1971)
andre2ff7b5d2000-06-03 14:57:40 +00001972
1973dnl lastlog, [uw]tmpx? detection
1974dnl NOTE: set the paths in the platform section to avoid the
1975dnl need for command-line parameters
1976dnl lastlog and [uw]tmp are subject to a file search if all else fails
1977
1978dnl lastlog detection
1979dnl NOTE: the code itself will detect if lastlog is a directory
1980AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1981AC_TRY_COMPILE([
1982#include <sys/types.h>
1983#include <utmp.h>
1984#ifdef HAVE_LASTLOG_H
1985# include <lastlog.h>
1986#endif
Damien Miller2994e082000-06-04 15:51:47 +10001987#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001988# include <paths.h>
1989#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001990#ifdef HAVE_LOGIN_H
1991# include <login.h>
1992#endif
andre2ff7b5d2000-06-03 14:57:40 +00001993 ],
1994 [ char *lastlog = LASTLOG_FILE; ],
1995 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001996 [
1997 AC_MSG_RESULT(no)
1998 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1999 AC_TRY_COMPILE([
2000#include <sys/types.h>
2001#include <utmp.h>
2002#ifdef HAVE_LASTLOG_H
2003# include <lastlog.h>
2004#endif
2005#ifdef HAVE_PATHS_H
2006# include <paths.h>
2007#endif
2008 ],
2009 [ char *lastlog = _PATH_LASTLOG; ],
2010 [ AC_MSG_RESULT(yes) ],
2011 [
andree441aa32000-06-12 22:34:38 +00002012 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002013 system_lastlog_path=no
2014 ])
2015 ]
andre2ff7b5d2000-06-03 14:57:40 +00002016)
Damien Miller2994e082000-06-04 15:51:47 +10002017
andre2ff7b5d2000-06-03 14:57:40 +00002018if test -z "$conf_lastlog_location"; then
2019 if test x"$system_lastlog_path" = x"no" ; then
2020 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002021 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002022 conf_lastlog_location=$f
2023 fi
2024 done
2025 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002026 AC_MSG_WARN([** Cannot find lastlog **])
2027 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002028 fi
2029 fi
2030fi
2031
2032if test -n "$conf_lastlog_location"; then
2033 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2034fi
2035
2036dnl utmp detection
2037AC_MSG_CHECKING([if your system defines UTMP_FILE])
2038AC_TRY_COMPILE([
2039#include <sys/types.h>
2040#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002041#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002042# include <paths.h>
2043#endif
2044 ],
2045 [ char *utmp = UTMP_FILE; ],
2046 [ AC_MSG_RESULT(yes) ],
2047 [ AC_MSG_RESULT(no)
2048 system_utmp_path=no ]
2049)
2050if test -z "$conf_utmp_location"; then
2051 if test x"$system_utmp_path" = x"no" ; then
2052 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2053 if test -f $f ; then
2054 conf_utmp_location=$f
2055 fi
2056 done
2057 if test -z "$conf_utmp_location"; then
2058 AC_DEFINE(DISABLE_UTMP)
2059 fi
2060 fi
2061fi
2062if test -n "$conf_utmp_location"; then
2063 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2064fi
2065
2066dnl wtmp detection
2067AC_MSG_CHECKING([if your system defines WTMP_FILE])
2068AC_TRY_COMPILE([
2069#include <sys/types.h>
2070#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002071#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002072# include <paths.h>
2073#endif
2074 ],
2075 [ char *wtmp = WTMP_FILE; ],
2076 [ AC_MSG_RESULT(yes) ],
2077 [ AC_MSG_RESULT(no)
2078 system_wtmp_path=no ]
2079)
2080if test -z "$conf_wtmp_location"; then
2081 if test x"$system_wtmp_path" = x"no" ; then
2082 for f in /usr/adm/wtmp /var/log/wtmp; do
2083 if test -f $f ; then
2084 conf_wtmp_location=$f
2085 fi
2086 done
2087 if test -z "$conf_wtmp_location"; then
2088 AC_DEFINE(DISABLE_WTMP)
2089 fi
2090 fi
2091fi
2092if test -n "$conf_wtmp_location"; then
2093 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2094fi
2095
2096
2097dnl utmpx detection - I don't know any system so perverse as to require
2098dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2099dnl there, though.
2100AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2101AC_TRY_COMPILE([
2102#include <sys/types.h>
2103#include <utmp.h>
2104#ifdef HAVE_UTMPX_H
2105#include <utmpx.h>
2106#endif
Damien Miller2994e082000-06-04 15:51:47 +10002107#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002108# include <paths.h>
2109#endif
2110 ],
2111 [ char *utmpx = UTMPX_FILE; ],
2112 [ AC_MSG_RESULT(yes) ],
2113 [ AC_MSG_RESULT(no)
2114 system_utmpx_path=no ]
2115)
2116if test -z "$conf_utmpx_location"; then
2117 if test x"$system_utmpx_path" = x"no" ; then
2118 AC_DEFINE(DISABLE_UTMPX)
2119 fi
2120else
2121 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2122fi
2123
2124dnl wtmpx detection
2125AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2126AC_TRY_COMPILE([
2127#include <sys/types.h>
2128#include <utmp.h>
2129#ifdef HAVE_UTMPX_H
2130#include <utmpx.h>
2131#endif
Damien Miller2994e082000-06-04 15:51:47 +10002132#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002133# include <paths.h>
2134#endif
2135 ],
2136 [ char *wtmpx = WTMPX_FILE; ],
2137 [ AC_MSG_RESULT(yes) ],
2138 [ AC_MSG_RESULT(no)
2139 system_wtmpx_path=no ]
2140)
2141if test -z "$conf_wtmpx_location"; then
2142 if test x"$system_wtmpx_path" = x"no" ; then
2143 AC_DEFINE(DISABLE_WTMPX)
2144 fi
2145else
2146 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2147fi
2148
Damien Miller4018c192000-04-30 09:30:44 +10002149
2150# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10002151entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10002152AC_ARG_WITH(entropy-timeout,
2153 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2154 [
2155 if test "x$withval" != "xno" ; then
2156 entropy_timeout=$withval
2157 fi
2158 ]
2159)
2160AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
2161
2162
Damien Miller29ea30d2000-03-17 10:54:15 +11002163if test ! -z "$blibpath" ; then
2164 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2165 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2166fi
2167
Damien Millerbac2d8a2000-09-05 16:13:06 +11002168AC_EXEEXT
2169
Tim Rice13aae5e2001-10-21 17:53:58 -07002170AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2171AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002172
Damien Miller7b22d652000-06-18 14:07:04 +10002173# Print summary of options
2174
Damien Miller7b22d652000-06-18 14:07:04 +10002175if test ! -z "$RANDOM_POOL" ; then
2176 RAND_MSG="Device ($RANDOM_POOL)"
2177else
Damien Millerd0ccb982001-03-04 00:29:20 +11002178 if test ! -z "$PRNGD_PORT" ; then
2179 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
2180 elif test ! -z "$PRNGD_SOCKET" ; then
2181 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10002182 else
2183 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11002184 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10002185 fi
2186fi
2187
2188# Someone please show me a better way :)
2189A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2190B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2191C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2192D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002193E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002194F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002195G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002196H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002197
2198echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002199echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002200echo " User binaries: $B"
2201echo " System binaries: $C"
2202echo " Configuration files: $D"
2203echo " Askpass program: $E"
2204echo " Manual pages: $F"
2205echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002206echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10002207echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10002208echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002209echo " PAM support: ${PAM_MSG}"
2210echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002211echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002212echo " AFS support: $AFS_MSG"
2213echo " S/KEY support: $SKEY_MSG"
2214echo " TCP Wrappers support: $TCPW_MSG"
2215echo " MD5 password support: $MD5_MSG"
2216echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2217echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2218echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2219
Damien Miller60396b02001-02-18 17:01:00 +11002220if test ! -z "$bsd_auth"; then
2221 echo " BSD Auth support: yes"
2222fi
2223
Damien Miller7b22d652000-06-18 14:07:04 +10002224echo ""
2225
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002226echo " Host: ${host}"
2227echo " Compiler: ${CC}"
2228echo " Compiler flags: ${CFLAGS}"
2229echo "Preprocessor flags: ${CPPFLAGS}"
2230echo " Linker flags: ${LDFLAGS}"
2231echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002232
2233echo ""
2234
Damien Miller82cf0ce2000-12-20 13:34:48 +11002235if test "x$PAM_MSG" = "xyes" ; then
2236 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2237 echo "otherwise password authentication may fail. Example PAM control files"
2238 echo "can be found in the contrib/ subdirectory"
2239 echo ""
2240fi
2241
Damien Miller6f9c3372000-10-25 10:06:04 +11002242if test ! -z "$BUILTIN_RNG" ; then
2243 echo "WARNING: you are using the builtin random number collection service."
2244 echo "Please read WARNING.RNG and request that your OS vendor includes"
2245 echo "/dev/random in future versions of their OS."
2246 echo ""
2247fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002248
2249if test ! -z "$NO_SFTP"; then
2250 echo "sftp-server will be disabled. Your compiler does not support"
2251 echo "64bit integers."
2252 echo ""
2253fi
Damien Miller60396b02001-02-18 17:01:00 +11002254