blob: 966f8126522e7540cff9d2f4c1b5668622b290ae [file] [log] [blame]
Damien Millerec932372002-01-22 22:16:03 +11001i# $Id: configure.ac,v 1.12 2002/01/22 11:16:05 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110020AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110024
Damien Millere8bb4502001-09-25 16:39:35 +100025# System features
26AC_SYS_LARGEFILE
27
Damien Miller3f62aba2000-11-29 11:56:35 +110028if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
30fi
31
Damien Millerad833b32000-08-23 10:46:23 +100032# Use LOGIN_PROGRAM from environment if possible
33if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
35else
36 # Search for login
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
40 fi
41fi
42
Damien Miller166bd442000-03-16 10:48:25 +110043if test -z "$LD" ; then
44 LD=$CC
45fi
46AC_SUBST(LD)
47
Damien Miller166bd442000-03-16 10:48:25 +110048AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100049if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110051fi
52
Damien Millera22ba012000-03-02 23:09:20 +110053# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110054case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110055*-*-aix*)
56 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100059 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110060 blibpath="/usr/lib:/lib:/usr/local/lib"
61 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100062 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110063 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000064 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110066 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110067*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080068 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000070 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000074 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110075 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000076*-*-dgux*)
77 AC_DEFINE(IP_TOS_IS_BROKEN)
78 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000079*-*-darwin*)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 ;;
Damien Miller76112de1999-12-21 11:18:08 +110082*-*-hpux10*)
83 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100084 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110085 fi
Kevin Steves315f8b72001-06-28 00:24:41 +000086 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000091 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +000092 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110093 ;;
Damien Miller1bead332000-04-30 00:47:29 +100094*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +000095 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110096 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110097 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110098 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110099 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100100 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000102 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000103 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100104*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000105 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000106 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100107 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000108 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100109 ;;
110*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000112 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100113 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000118 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100119 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100120*-*-linux*)
121 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100122 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100123 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000124 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100126 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000127mips-sony-bsd|mips-sony-newsos4)
128 AC_DEFINE(HAVE_NEWS4)
129 SONY=1
130 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100131 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000132 )
133 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100134*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100135 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100136 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100137*-*-freebsd*)
138 check_for_libcrypt_later=1
139 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100142 conf_utmp_location=/etc/utmp
143 conf_wtmp_location=/usr/adm/wtmp
144 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000145 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000146 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000147 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100148 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000149 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000150 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100152*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100155 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100156 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
158 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000159 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000160 # hardwire lastlog location (can't detect it on some versions)
161 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000162 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
163 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
164 if test "$sol2ver" -ge 8; then
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(DISABLE_UTMP)
167 AC_DEFINE(DISABLE_WTMP)
168 else
169 AC_MSG_RESULT(no)
170 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100171 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000172*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000173 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000174 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100175 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100176 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/var/adm/wtmp
179 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000180 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000181 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000182*-ncr-sysv*)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
184 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700185 LIBS="$LIBS -lc89"
Ben Lindstrom34328342001-04-23 22:39:42 +0000186 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Kevin Steves0bd4b342002-01-05 23:24:27 +0000187 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000188 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000189*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700191 # /usr/ucblib MUST NOT be searched on ReliantUNIX
192 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100193 IPADDR_IN_DISPLAY=yes
194 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000195 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000196 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700197 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
198 # Attention: always take care to bind libsocket and libnsl before libc,
199 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000200 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100201*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700204# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100205 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100206 ;;
207*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700210# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100211 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100212 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100213*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100216 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100217*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000218 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100219 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700220 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100221 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100222 RANLIB=true
223 no_dev_ptmx=1
224 AC_DEFINE(BROKEN_SYS_TERMIO_H)
225 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100226 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000227 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000228 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100229 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100230 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700231 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700232 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100233 ;;
234*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000236 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100237 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000238 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100239 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100240 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100241 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000242 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000243 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100244 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700245 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000246 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000247*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700248 no_libsocket=1
249 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000250 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700251 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
252 LIBS="$LIBS -lgen -lrsc"
253 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000254*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000255 AC_MSG_CHECKING(for Digital Unix SIA)
256 no_osfsia=""
257 AC_ARG_WITH(osfsia,
258 [ --with-osfsia Enable Digital Unix SIA],
259 [
260 if test "x$withval" = "xno" ; then
261 AC_MSG_RESULT(disabled)
262 no_osfsia=1
263 fi
264 ],
265 )
266 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000267 if test -f /etc/sia/matrix.conf; then
268 AC_MSG_RESULT(yes)
269 AC_DEFINE(HAVE_OSF_SIA)
270 AC_DEFINE(DISABLE_LOGIN)
271 LIBS="$LIBS -lsecurity -ldb -lm -laud"
272 else
273 AC_MSG_RESULT(no)
274 fi
275 fi
276 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000277
278*-*-nto-qnx)
279 AC_DEFINE(USE_PIPES)
280 AC_DEFINE(NO_X11_UNIX_SOCKETS)
281 AC_DEFINE(MISSING_NFDBITS)
282 AC_DEFINE(MISSING_HOWMANY)
283 AC_DEFINE(MISSING_FD_MASK)
284 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100285esac
286
Damien Millere37bfc12000-06-05 09:37:43 +1000287# Allow user to specify flags
288AC_ARG_WITH(cflags,
289 [ --with-cflags Specify additional flags to pass to compiler],
290 [
291 if test "x$withval" != "xno" ; then
292 CFLAGS="$CFLAGS $withval"
293 fi
294 ]
295)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000296AC_ARG_WITH(cppflags,
297 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
298 [
299 if test "x$withval" != "xno"; then
300 CPPFLAGS="$CPPFLAGS $withval"
301 fi
302 ]
303)
Damien Millere37bfc12000-06-05 09:37:43 +1000304AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000305 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000306 [
307 if test "x$withval" != "xno" ; then
308 LDFLAGS="$LDFLAGS $withval"
309 fi
310 ]
311)
312AC_ARG_WITH(libs,
313 [ --with-libs Specify additional libraries to link with],
314 [
315 if test "x$withval" != "xno" ; then
316 LIBS="$LIBS $withval"
317 fi
318 ]
319)
320
Damien Millera22ba012000-03-02 23:09:20 +1100321# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700322AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
323AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000324
Damien Millerdf288022001-02-18 13:07:07 +1100325dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700326if test "x$with_tcp_wrappers" != "xno" ; then
327 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
328 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
329 fi
330fi
Damien Millerdf288022001-02-18 13:07:07 +1100331
Tim Rice13aae5e2001-10-21 17:53:58 -0700332AC_CHECK_FUNC(getspnam, ,
333 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700334
335dnl zlib is required
336AC_ARG_WITH(zlib,
337 [ --with-zlib=PATH Use zlib in PATH],
338 [
Damien Miller6c21c512002-01-22 21:57:53 +1100339 if test "x$withval" != "xno" ; then
340 AC_MSG_ERROR([*** zlib is required ***])
341 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700342 if test -d "$withval/lib"; then
343 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700344 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700345 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700346 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700347 fi
348 else
349 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700350 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700351 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700352 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700353 fi
354 fi
355 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700356 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700357 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700358 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700359 fi
360 ]
361)
362
Tim Rice17b93e52001-10-23 22:36:54 -0700363AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100364
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000365dnl UnixWare 2.x
366AC_CHECK_FUNC(strcasecmp,
367 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
368)
369AC_CHECK_FUNC(utimes,
370 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
371)
Damien Millerab18c411999-11-11 10:40:23 +1100372
Tim Ricee589a292001-11-03 11:09:32 -0800373dnl Checks for libutil functions
374AC_CHECK_HEADERS(libutil.h)
375AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
376AC_CHECK_FUNCS(logout updwtmp logwtmp)
377
Ben Lindstrom8697e082001-02-24 21:41:10 +0000378AC_FUNC_STRFTIME
379
Damien Millera22ba012000-03-02 23:09:20 +1100380# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700381AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700382 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700383 login_cap.h maillock.h netdb.h netgroup.h \
Ben Lindstromc97b1af2001-12-07 17:20:47 +0000384 netinet/in_systm.h paths.h poll.h pty.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700385 security/pam_appl.h shadow.h stddef.h stdint.h \
386 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
387 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
388 sys/stropts.h sys/sysmacros.h sys/time.h \
389 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
390 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100391
392# Check for ALTDIRFUNC glob() extension
393AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
394AC_EGREP_CPP(FOUNDIT,
395 [
396 #include <glob.h>
397 #ifdef GLOB_ALTDIRFUNC
398 FOUNDIT
399 #endif
400 ],
401 [
402 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
403 AC_MSG_RESULT(yes)
404 ],
405 [
406 AC_MSG_RESULT(no)
407 ]
408)
Damien Millerab18c411999-11-11 10:40:23 +1100409
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000410# Check for g.gl_matchc glob() extension
411AC_MSG_CHECKING(for gl_matchc field in glob_t)
412AC_EGREP_CPP(FOUNDIT,
413 [
414 #include <glob.h>
415 int main(void){glob_t g; g.gl_matchc = 1;}
416 ],
417 [
418 AC_DEFINE(GLOB_HAS_GL_MATCHC)
419 AC_MSG_RESULT(yes)
420 ],
421 [
422 AC_MSG_RESULT(no)
423 ]
424)
425
Damien Miller18bb4732001-03-28 14:35:30 +1000426AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
427AC_TRY_RUN(
428 [
429#include <sys/types.h>
430#include <dirent.h>
431int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
432 ],
433 [AC_MSG_RESULT(yes)],
434 [
435 AC_MSG_RESULT(no)
436 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
437 ]
438)
439
Damien Millerc547bf12001-02-16 10:18:12 +1100440# Check whether user wants S/Key support
441SKEY_MSG="no"
442AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700443 [ --with-skey[[=PATH]] Enable S/Key support
444 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100445 [
446 if test "x$withval" != "xno" ; then
447
448 if test "x$withval" != "xyes" ; then
449 CPPFLAGS="$CPPFLAGS -I${withval}/include"
450 LDFLAGS="$LDFLAGS -L${withval}/lib"
451 fi
452
453 AC_DEFINE(SKEY)
454 LIBS="-lskey $LIBS"
455 SKEY_MSG="yes"
456
457 AC_CHECK_FUNC(skey_keyinfo,
458 [],
459 [
460 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
461 ])
462 fi
463 ]
464)
465
466# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700467TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100468AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700469 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
470 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100471 [
472 if test "x$withval" != "xno" ; then
473 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700474 saved_LDFLAGS="$LDFLAGS"
475 saved_CPPFLAGS="$CPPFLAGS"
476 if test -n "${withval}" -a "${withval}" != "yes"; then
477 if test -d "${withval}/lib"; then
478 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700479 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700480 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700481 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700482 fi
483 else
484 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700485 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700486 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700487 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700488 fi
489 fi
490 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700491 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700492 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700493 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700494 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700495 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100496 LIBS="-lwrap $LIBS"
497 AC_MSG_CHECKING(for libwrap)
498 AC_TRY_LINK(
499 [
500#include <tcpd.h>
501 int deny_severity = 0, allow_severity = 0;
502 ],
503 [hosts_access(0);],
504 [
505 AC_MSG_RESULT(yes)
506 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700507 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100508 ],
509 [
510 AC_MSG_ERROR([*** libwrap missing])
511 ]
512 )
513 fi
514 ]
515)
516
Damien Millerad833b32000-08-23 10:46:23 +1000517dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700518AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
519 clock fchmod fchown freeaddrinfo futimes gai_strerror \
520 getaddrinfo getcwd getgrouplist getnameinfo getopt \
521 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
522 inet_ntop innetgr login_getcapbool md5_crypt memmove \
523 mkdtemp on_exit openpty readpassphrase realpath \
524 rresvport_af setdtablesize setegid setenv seteuid \
525 setlogin setproctitle setresgid setreuid setrlimit \
526 setsid setvbuf sigaction sigvec snprintf strerror \
527 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
528 vhangup vsnprintf waitpid __b64_ntop _getpty)
529
530dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700531AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700532 AC_CHECK_LIB(gen, dirname,[
533 AC_CACHE_CHECK([for broken dirname],
534 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700535 save_LIBS="$LIBS"
536 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700537 AC_TRY_RUN(
538 [
539#include <libgen.h>
540#include <string.h>
541
542int main(int argc, char **argv) {
543 char *s, buf[32];
544
545 strncpy(buf,"/etc", 32);
546 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700547 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700548 exit(1);
549 } else {
550 exit(0);
551 }
552}
553 ],
554 [ ac_cv_have_broken_dirname="no" ],
555 [ ac_cv_have_broken_dirname="yes" ]
556 )
Tim Rice17b93e52001-10-23 22:36:54 -0700557 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700558 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700559 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 LIBS="$LIBS -lgen"
561 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700562 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700563 fi
564 ])
565])
566
Damien Millerad833b32000-08-23 10:46:23 +1000567dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000568AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000569dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000570AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000571AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000572dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000573AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000574AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100575
Damien Miller5fc85652000-07-09 23:53:07 +1000576AC_CHECK_FUNC(getuserattr,
577 [AC_DEFINE(HAVE_GETUSERATTR)],
578 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
579)
580
Damien Miller04f80141999-11-19 15:32:34 +1100581AC_CHECK_FUNC(daemon,
582 [AC_DEFINE(HAVE_DAEMON)],
583 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
584)
585
Damien Miller9fb07e42000-03-05 16:22:59 +1100586AC_CHECK_FUNC(getpagesize,
587 [AC_DEFINE(HAVE_GETPAGESIZE)],
588 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
589)
590
Damien Millercb170cb2000-07-01 16:52:55 +1000591# Check for broken snprintf
592if test "x$ac_cv_func_snprintf" = "xyes" ; then
593 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
594 AC_TRY_RUN(
595 [
596#include <stdio.h>
597int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
598 ],
599 [AC_MSG_RESULT(yes)],
600 [
601 AC_MSG_RESULT(no)
602 AC_DEFINE(BROKEN_SNPRINTF)
603 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
604 ]
605 )
606fi
607
Damien Miller606f8802000-09-16 15:39:56 +1100608AC_FUNC_GETPGRP
609
Damien Millera64b57a2001-01-17 10:44:13 +1100610# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000611PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100612AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100613 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100614 [
Damien Millera64b57a2001-01-17 10:44:13 +1100615 if test "x$withval" != "xno" ; then
616 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
617 AC_MSG_ERROR([PAM headers not found])
618 fi
619
620 AC_CHECK_LIB(dl, dlopen, , )
621 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
622 AC_CHECK_FUNCS(pam_getenvlist)
623
624 disable_shadow=yes
625 PAM_MSG="yes"
626
627 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100628 fi
629 ]
630)
Damien Millera22ba012000-03-02 23:09:20 +1100631
Damien Millera64b57a2001-01-17 10:44:13 +1100632# Check for older PAM
633if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100634 # Check PAM strerror arguments (old PAM)
635 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
636 AC_TRY_COMPILE(
637 [
Damien Miller81171112000-04-23 11:14:01 +1000638#include <stdlib.h>
639#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100640 ],
641 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
642 [AC_MSG_RESULT(no)],
643 [
644 AC_DEFINE(HAVE_OLD_PAM)
645 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000646 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100647 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100648 )
Damien Millera22ba012000-03-02 23:09:20 +1100649fi
650
651# The big search for OpenSSL
652AC_ARG_WITH(ssl-dir,
653 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
654 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000655 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100656 tryssldir=$withval
657 fi
658 ]
659)
660
661saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100662saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000663saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100664if test "x$prefix" != "xNONE" ; then
665 tryssldir="$tryssldir $prefix"
666fi
Damien Miller61e50f12000-05-08 20:49:37 +1000667AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100668 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 +1100669 CPPFLAGS="$saved_CPPFLAGS"
670 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000671 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100672
673 # Skip directories if they don't exist
674 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
675 continue;
676 fi
677 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
678 # Try to use $ssldir/lib if it exists, otherwise
679 # $ssldir
680 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000681 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100682 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000683 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100684 fi
685 else
Damien Millerb68af622001-03-28 21:05:26 +1000686 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100687 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000688 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100689 fi
690 fi
691 # Try to use $ssldir/include if it exists, otherwise
692 # $ssldir
693 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000694 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100695 else
Damien Millerb68af622001-03-28 21:05:26 +1000696 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100697 fi
698 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000699
Damien Miller3b512e12000-05-17 23:29:18 +1000700 # Basic test to check for compatible version and correct linking
701 # *does not* test for RSA - that comes later.
702 AC_TRY_RUN(
703 [
Damien Millere59ce622000-05-01 20:54:17 +1000704#include <string.h>
705#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000706int main(void)
707{
Damien Miller3b512e12000-05-17 23:29:18 +1000708 char a[2048];
709 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000710 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000711 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000712}
Damien Miller3b512e12000-05-17 23:29:18 +1000713 ],
714 [
715 found_crypto=1
716 break;
717 ], []
718 )
Damien Miller61e50f12000-05-08 20:49:37 +1000719
720 if test ! -z "$found_crypto" ; then
721 break;
722 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100723 done
724
Damien Miller61e50f12000-05-08 20:49:37 +1000725 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100726 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100727 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000728 if test -z "$ssldir" ; then
729 ssldir="(system)"
730 fi
Damien Millera22ba012000-03-02 23:09:20 +1100731
Damien Miller61e50f12000-05-08 20:49:37 +1000732 ac_cv_openssldir=$ssldir
733])
734
Damien Milleredb82922000-06-20 13:25:52 +1000735if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000736 AC_DEFINE(HAVE_OPENSSL)
737 dnl Need to recover ssldir - test above runs in subshell
738 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100739 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100740 # Try to use $ssldir/lib if it exists, otherwise
741 # $ssldir
742 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000743 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100744 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000745 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100746 fi
747 else
Damien Millerb68af622001-03-28 21:05:26 +1000748 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100749 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000750 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100751 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100752 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100753 # Try to use $ssldir/include if it exists, otherwise
754 # $ssldir
755 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000756 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100757 else
Damien Millerb68af622001-03-28 21:05:26 +1000758 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100759 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100760 fi
Damien Millera22ba012000-03-02 23:09:20 +1100761fi
Damien Miller3b512e12000-05-17 23:29:18 +1000762LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000763
Damien Miller3b512e12000-05-17 23:29:18 +1000764# Now test RSA support
765saved_LIBS="$LIBS"
766AC_MSG_CHECKING([for RSA support])
767for WANTS_RSAREF in "" 1 ; do
768 if test -z "$WANTS_RSAREF" ; then
769 LIBS="$saved_LIBS"
770 else
771 LIBS="$saved_LIBS -lRSAglue -lrsaref"
772 fi
773 AC_TRY_RUN([
774#include <string.h>
775#include <openssl/rand.h>
776#include <openssl/rsa.h>
777#include <openssl/bn.h>
778#include <openssl/sha.h>
779int main(void)
780{
781 int num; RSA *key; static unsigned char p_in[] = "blahblah";
782 unsigned char c[256], p[256];
783 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
784 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
785 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
786 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
787}
788 ],
789 [
790 rsa_works=1
791 break;
792 ], [])
793done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000794LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000795
796if test ! -z "$no_rsa" ; then
797 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000798 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000799else
800 if test -z "$rsa_works" ; then
801 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000802 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000803 else
804 if test -z "$WANTS_RSAREF" ; then
805 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000806 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000807 else
Damien Miller7b22d652000-06-18 14:07:04 +1000808 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000809 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000810 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000811 fi
812 fi
813fi
Damien Millera22ba012000-03-02 23:09:20 +1100814
Damien Millerec932372002-01-22 22:16:03 +1100815# Sanity check OpenSSL headers
816AC_MSG_CHECKING([whether OpenSSL's headers match the library])
817AC_TRY_RUN(
818 [
819#include <string.h>
820#include <openssl/opensslv.h>
821int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
822 ],
823 [
824 AC_MSG_RESULT(yes)
825 ],
826 [
827 AC_MSG_RESULT(no)
828 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
829 ]
830)
831
Damien Millera64b57a2001-01-17 10:44:13 +1100832# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
833# version in OpenSSL. Skip this for PAM
834if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100835 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100836fi
837
Damien Miller6c21c512002-01-22 21:57:53 +1100838
839### Configure cryptographic random number support
840
841# Check wheter OpenSSL seeds itself
842AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
843AC_TRY_RUN(
844 [
845#include <string.h>
846#include <openssl/rand.h>
847int main(void) { return(RAND_status() == 1 ? 0 : 1); }
848 ],
849 [
850 OPENSSL_SEEDS_ITSELF=yes
851 AC_MSG_RESULT(yes)
852 ],
853 [
854 AC_MSG_RESULT(no)
855 # Default to use of the rand helper if OpenSSL doesn't
856 # seed itself
857 USE_RAND_HELPER=yes
858 ]
859)
860
861
862# Do we want to force the use of the rand helper?
863AC_ARG_WITH(rand-helper,
864 [ --with-rand-helper Use subprocess to gather strong randomness ],
865 [
866 if test "x$withval" = "xno" ; then
867 # Force use of OpenSSL's internal RNG, even if
868 # the previous test showed it to be unseeded.
869 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
870 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
871 OPENSSL_SEEDS_ITSELF=yes
872 USE_RAND_HELPER=""
873 fi
874 else
875 USE_RAND_HELPER=yes
876 fi
877 ],
878)
879
880# Which randomness source do we use?
881if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
882 # OpenSSL only
883 AC_DEFINE(OPENSSL_PRNG_ONLY)
884 RAND_MSG="OpenSSL internal ONLY"
885 INSTALL_SSH_RAND_HELPER=""
886elif test ! -z "$OPENSSL_SEEDS_ITSELF" -a ! -z "$USE_RAND_HELPER" ; then
887 # OpenSSL with fallback to rand helper
888 RAND_MSG="ssh-rand-helper"
889 INSTALL_SSH_RAND_HELPER="yes"
890fi
891AC_SUBST(INSTALL_SSH_RAND_HELPER)
892
893### Configuration of ssh-rand-helper
894
895# PRNGD TCP socket
896AC_ARG_WITH(prngd-port,
897 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
898 [
899 if test ! -z "$withval" -a "x$withval" != "xno" ; then
900 PRNGD_PORT="$withval"
901 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
902 fi
903 ]
904)
905
906# PRNGD Unix domain socket
907AC_ARG_WITH(prngd-socket,
908 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
909 [
910 if test -z "$withval" ; then
911 withval="/var/run/egd-pool"
912 fi
913 if test "x$withval" != "xno" ; then
914 if test ! -z "$PRNGD_PORT" ; then
915 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
916 fi
917 if ! echo "$withval" | grep -q '^/' ; then
918 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
919 fi
920 if ! test -r "$withval" ; then
921 AC_MSG_WARN(Entropy socket is not readable)
922 fi
923 PRNGD_SOCKET="$withval"
924 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
925 fi
926 ]
927)
928
929# Change default command timeout for hashing entropy source
930entropy_timeout=200
931AC_ARG_WITH(entropy-timeout,
932 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
933 [
934 if test "x$withval" != "xno" ; then
935 entropy_timeout=$withval
936 fi
937 ]
938)
939
940AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
941
942# These programs are used by the command hashing source to gather entropy
943OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
944OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
945OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
946OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
947OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
948OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
949OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
950OSSH_PATH_ENTROPY_PROG(PROG_W, w)
951OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
952OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
953OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
954OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
955OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
956OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
957OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
958OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
959
960# Where does ssh-rand-helper get its randomness from?
961INSTALL_SSH_PRNG_CMDS=""
962if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
963 if test ! -z "$PRNGD_PORT" ; then
964 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
965 elif test ! -z "$PRNGD_SOCKET" ; then
966 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
967 else
968 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
969 RAND_HELPER_CMDHASH=yes
970 INSTALL_SSH_PRNG_CMDS="yes"
971 fi
972fi
973AC_SUBST(INSTALL_SSH_PRNG_CMDS)
974
975
Ben Lindstromb5628642000-10-18 00:02:25 +0000976# Cheap hack to ensure NEWS-OS libraries are arranged right.
977if test ! -z "$SONY" ; then
978 LIBS="$LIBS -liberty";
979fi
980
Damien Millera22ba012000-03-02 23:09:20 +1100981# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100982AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100983AC_CHECK_SIZEOF(short int, 2)
984AC_CHECK_SIZEOF(int, 4)
985AC_CHECK_SIZEOF(long int, 4)
986AC_CHECK_SIZEOF(long long int, 8)
987
Damien Millera22ba012000-03-02 23:09:20 +1100988# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100989AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
990 AC_TRY_COMPILE(
991 [ #include <sys/types.h> ],
992 [ u_int a; a = 1;],
993 [ ac_cv_have_u_int="yes" ],
994 [ ac_cv_have_u_int="no" ]
995 )
996])
997if test "x$ac_cv_have_u_int" = "xyes" ; then
998 AC_DEFINE(HAVE_U_INT)
999 have_u_int=1
1000fi
1001
Damien Miller61e50f12000-05-08 20:49:37 +10001002AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1003 AC_TRY_COMPILE(
1004 [ #include <sys/types.h> ],
1005 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1006 [ ac_cv_have_intxx_t="yes" ],
1007 [ ac_cv_have_intxx_t="no" ]
1008 )
1009])
1010if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1011 AC_DEFINE(HAVE_INTXX_T)
1012 have_intxx_t=1
1013fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001014
1015if (test -z "$have_intxx_t" && \
1016 test "x$ac_cv_header_stdint_h" = "xyes")
1017then
1018 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1019 AC_TRY_COMPILE(
1020 [ #include <stdint.h> ],
1021 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1022 [
1023 AC_DEFINE(HAVE_INTXX_T)
1024 AC_MSG_RESULT(yes)
1025 ],
1026 [ AC_MSG_RESULT(no) ]
1027 )
1028fi
1029
Damien Miller578783e2000-09-23 14:12:24 +11001030AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1031 AC_TRY_COMPILE(
1032 [ #include <sys/types.h> ],
1033 [ int64_t a; a = 1;],
1034 [ ac_cv_have_int64_t="yes" ],
1035 [ ac_cv_have_int64_t="no" ]
1036 )
1037])
1038if test "x$ac_cv_have_int64_t" = "xyes" ; then
1039 AC_DEFINE(HAVE_INT64_T)
1040 have_int64_t=1
1041fi
1042
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001043if test -z "$have_int64_t" ; then
1044 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1045 AC_TRY_COMPILE(
1046 [ #include <sys/socket.h> ],
1047 [ int64_t a; a = 1],
1048 [
1049 AC_DEFINE(HAVE_INT64_T)
1050 AC_MSG_RESULT(yes)
1051 ],
1052 [ AC_MSG_RESULT(no) ]
1053 )
1054fi
1055
Damien Miller61e50f12000-05-08 20:49:37 +10001056AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1057 AC_TRY_COMPILE(
1058 [ #include <sys/types.h> ],
1059 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1060 [ ac_cv_have_u_intxx_t="yes" ],
1061 [ ac_cv_have_u_intxx_t="no" ]
1062 )
1063])
1064if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1065 AC_DEFINE(HAVE_U_INTXX_T)
1066 have_u_intxx_t=1
1067fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001068
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001069if test -z "$have_u_intxx_t" ; then
1070 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1071 AC_TRY_COMPILE(
1072 [ #include <sys/socket.h> ],
1073 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1074 [
1075 AC_DEFINE(HAVE_U_INTXX_T)
1076 AC_MSG_RESULT(yes)
1077 ],
1078 [ AC_MSG_RESULT(no) ]
1079 )
1080fi
1081
Damien Miller578783e2000-09-23 14:12:24 +11001082AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1083 AC_TRY_COMPILE(
1084 [ #include <sys/types.h> ],
1085 [ u_int64_t a; a = 1;],
1086 [ ac_cv_have_u_int64_t="yes" ],
1087 [ ac_cv_have_u_int64_t="no" ]
1088 )
1089])
1090if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1091 AC_DEFINE(HAVE_U_INT64_T)
1092 have_u_int64_t=1
1093fi
1094
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001095if test -z "$have_u_intxx_t" ; then
1096 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1097 AC_TRY_COMPILE(
1098 [
1099#include <sys/types.h>
1100 ],
1101 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1102 [ ac_cv_have_uintxx_t="yes" ],
1103 [ ac_cv_have_uintxx_t="no" ]
1104 )
1105 ])
1106 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1107 AC_DEFINE(HAVE_UINTXX_T)
1108 fi
1109fi
1110
1111if test -z "$have_uintxx_t" ; then
1112 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1113 AC_TRY_COMPILE(
1114 [ #include <stdint.h> ],
1115 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1116 [
1117 AC_DEFINE(HAVE_UINTXX_T)
1118 AC_MSG_RESULT(yes)
1119 ],
1120 [ AC_MSG_RESULT(no) ]
1121 )
1122fi
1123
Damien Milleredb82922000-06-20 13:25:52 +10001124if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1125 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001126then
1127 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1128 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001129 [
1130#include <sys/bitypes.h>
1131 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001132 [
Damien Miller70494d12000-04-03 15:57:06 +10001133 int8_t a; int16_t b; int32_t c;
1134 u_int8_t e; u_int16_t f; u_int32_t g;
1135 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001136 ],
1137 [
1138 AC_DEFINE(HAVE_U_INTXX_T)
1139 AC_DEFINE(HAVE_INTXX_T)
1140 AC_MSG_RESULT(yes)
1141 ],
1142 [AC_MSG_RESULT(no)]
1143 )
1144fi
1145
Damien Miller58be7382001-09-15 21:31:54 +10001146
1147AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1148 AC_TRY_COMPILE(
1149 [
1150#include <sys/types.h>
1151 ],
1152 [ u_char foo; foo = 125; ],
1153 [ ac_cv_have_u_char="yes" ],
1154 [ ac_cv_have_u_char="no" ]
1155 )
1156])
1157if test "x$ac_cv_have_u_char" = "xyes" ; then
1158 AC_DEFINE(HAVE_U_CHAR)
1159fi
1160
Tim Rice13aae5e2001-10-21 17:53:58 -07001161TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001162
Damien Miller61e50f12000-05-08 20:49:37 +10001163AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1164 AC_TRY_COMPILE(
1165 [
1166#include <sys/types.h>
1167 ],
1168 [ size_t foo; foo = 1235; ],
1169 [ ac_cv_have_size_t="yes" ],
1170 [ ac_cv_have_size_t="no" ]
1171 )
1172])
1173if test "x$ac_cv_have_size_t" = "xyes" ; then
1174 AC_DEFINE(HAVE_SIZE_T)
1175fi
Damien Miller95058511999-12-29 10:36:45 +11001176
Damien Miller615f9392000-05-17 22:53:33 +10001177AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1178 AC_TRY_COMPILE(
1179 [
1180#include <sys/types.h>
1181 ],
1182 [ ssize_t foo; foo = 1235; ],
1183 [ ac_cv_have_ssize_t="yes" ],
1184 [ ac_cv_have_ssize_t="no" ]
1185 )
1186])
1187if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1188 AC_DEFINE(HAVE_SSIZE_T)
1189fi
1190
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001191AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1192 AC_TRY_COMPILE(
1193 [
1194#include <time.h>
1195 ],
1196 [ clock_t foo; foo = 1235; ],
1197 [ ac_cv_have_clock_t="yes" ],
1198 [ ac_cv_have_clock_t="no" ]
1199 )
1200])
1201if test "x$ac_cv_have_clock_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_CLOCK_T)
1203fi
1204
Damien Millerb54b40e2000-06-23 08:23:34 +10001205AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1206 AC_TRY_COMPILE(
1207 [
1208#include <sys/types.h>
1209#include <sys/socket.h>
1210 ],
1211 [ sa_family_t foo; foo = 1235; ],
1212 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001213 [ AC_TRY_COMPILE(
1214 [
1215#include <sys/types.h>
1216#include <sys/socket.h>
1217#include <netinet/in.h>
1218 ],
1219 [ sa_family_t foo; foo = 1235; ],
1220 [ ac_cv_have_sa_family_t="yes" ],
1221
Damien Millerb54b40e2000-06-23 08:23:34 +10001222 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001223 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001224 )
1225])
1226if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1227 AC_DEFINE(HAVE_SA_FAMILY_T)
1228fi
1229
Damien Miller0f91b4e2000-06-18 15:43:25 +10001230AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1231 AC_TRY_COMPILE(
1232 [
1233#include <sys/types.h>
1234 ],
1235 [ pid_t foo; foo = 1235; ],
1236 [ ac_cv_have_pid_t="yes" ],
1237 [ ac_cv_have_pid_t="no" ]
1238 )
1239])
1240if test "x$ac_cv_have_pid_t" = "xyes" ; then
1241 AC_DEFINE(HAVE_PID_T)
1242fi
1243
1244AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1245 AC_TRY_COMPILE(
1246 [
1247#include <sys/types.h>
1248 ],
1249 [ mode_t foo; foo = 1235; ],
1250 [ ac_cv_have_mode_t="yes" ],
1251 [ ac_cv_have_mode_t="no" ]
1252 )
1253])
1254if test "x$ac_cv_have_mode_t" = "xyes" ; then
1255 AC_DEFINE(HAVE_MODE_T)
1256fi
1257
Damien Miller61e50f12000-05-08 20:49:37 +10001258
1259AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1260 AC_TRY_COMPILE(
1261 [
Damien Miller81171112000-04-23 11:14:01 +10001262#include <sys/types.h>
1263#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001264 ],
1265 [ struct sockaddr_storage s; ],
1266 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1267 [ ac_cv_have_struct_sockaddr_storage="no" ]
1268 )
1269])
1270if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1271 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1272fi
Damien Miller34132e52000-01-14 15:45:46 +11001273
Damien Miller61e50f12000-05-08 20:49:37 +10001274AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1275 AC_TRY_COMPILE(
1276 [
Damien Miller7b22d652000-06-18 14:07:04 +10001277#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001278#include <netinet/in.h>
1279 ],
1280 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1281 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1282 [ ac_cv_have_struct_sockaddr_in6="no" ]
1283 )
1284])
1285if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1286 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1287fi
Damien Miller34132e52000-01-14 15:45:46 +11001288
Damien Miller61e50f12000-05-08 20:49:37 +10001289AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1290 AC_TRY_COMPILE(
1291 [
Damien Miller7b22d652000-06-18 14:07:04 +10001292#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001293#include <netinet/in.h>
1294 ],
1295 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1296 [ ac_cv_have_struct_in6_addr="yes" ],
1297 [ ac_cv_have_struct_in6_addr="no" ]
1298 )
1299])
1300if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1301 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1302fi
Damien Miller34132e52000-01-14 15:45:46 +11001303
Damien Miller61e50f12000-05-08 20:49:37 +10001304AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1305 AC_TRY_COMPILE(
1306 [
Damien Miller81171112000-04-23 11:14:01 +10001307#include <sys/types.h>
1308#include <sys/socket.h>
1309#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001310 ],
1311 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1312 [ ac_cv_have_struct_addrinfo="yes" ],
1313 [ ac_cv_have_struct_addrinfo="no" ]
1314 )
1315])
1316if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1317 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1318fi
1319
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001320AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1321 AC_TRY_COMPILE(
1322 [ #include <sys/time.h> ],
1323 [ struct timeval tv; tv.tv_sec = 1;],
1324 [ ac_cv_have_struct_timeval="yes" ],
1325 [ ac_cv_have_struct_timeval="no" ]
1326 )
1327])
1328if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1329 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1330 have_struct_timeval=1
1331fi
1332
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001333# If we don't have int64_t then we can't compile sftp-server. So don't
1334# even attempt to do it.
1335if test "x$ac_cv_have_int64_t" = "xno" -a \
1336 "x$ac_cv_sizeof_long_int" != "x8" -a \
1337 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1338 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001339else
1340dnl test snprintf (broken on SCO w/gcc)
1341 AC_TRY_RUN(
1342 [
1343#include <stdio.h>
1344#include <string.h>
1345#ifdef HAVE_SNPRINTF
1346main()
1347{
1348 char buf[50];
1349 char expected_out[50];
1350 int mazsize = 50 ;
1351#if (SIZEOF_LONG_INT == 8)
1352 long int num = 0x7fffffffffffffff;
1353#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001354 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001355#endif
1356 strcpy(expected_out, "9223372036854775807");
1357 snprintf(buf, mazsize, "%lld", num);
1358 if(strcmp(buf, expected_out) != 0)
1359 exit(1);
1360 exit(0);
1361}
1362#else
1363main() { exit(0); }
1364#endif
1365 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1366 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001367fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001368AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001369
Damien Miller78315eb2000-09-29 23:01:36 +11001370dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001371OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1372OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1373OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1374OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1375OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001376OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001377OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1378OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001379OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001380OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1381OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1382OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1383OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001384OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1385OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1386OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1387OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001388
1389AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001390
Damien Miller61e50f12000-05-08 20:49:37 +10001391AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1392 ac_cv_have_ss_family_in_struct_ss, [
1393 AC_TRY_COMPILE(
1394 [
Damien Miller81171112000-04-23 11:14:01 +10001395#include <sys/types.h>
1396#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001397 ],
1398 [ struct sockaddr_storage s; s.ss_family = 1; ],
1399 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1400 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1401 )
1402])
1403if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1404 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1405fi
1406
Damien Miller61e50f12000-05-08 20:49:37 +10001407AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1408 ac_cv_have___ss_family_in_struct_ss, [
1409 AC_TRY_COMPILE(
1410 [
Damien Miller81171112000-04-23 11:14:01 +10001411#include <sys/types.h>
1412#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001413 ],
1414 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1415 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1416 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1417 )
1418])
1419if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1420 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1421fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001422
Damien Millerad833b32000-08-23 10:46:23 +10001423AC_CACHE_CHECK([for pw_class field in struct passwd],
1424 ac_cv_have_pw_class_in_struct_passwd, [
1425 AC_TRY_COMPILE(
1426 [
Damien Millerad833b32000-08-23 10:46:23 +10001427#include <pwd.h>
1428 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001429 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001430 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1431 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1432 )
1433])
1434if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1435 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1436fi
1437
Kevin Steves82456952001-06-22 21:14:18 +00001438AC_CACHE_CHECK([for pw_expire field in struct passwd],
1439 ac_cv_have_pw_expire_in_struct_passwd, [
1440 AC_TRY_COMPILE(
1441 [
1442#include <pwd.h>
1443 ],
1444 [ struct passwd p; p.pw_expire = 0; ],
1445 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1446 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1447 )
1448])
1449if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1450 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1451fi
1452
1453AC_CACHE_CHECK([for pw_change field in struct passwd],
1454 ac_cv_have_pw_change_in_struct_passwd, [
1455 AC_TRY_COMPILE(
1456 [
1457#include <pwd.h>
1458 ],
1459 [ struct passwd p; p.pw_change = 0; ],
1460 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1461 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1462 )
1463])
1464if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1465 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1466fi
Damien Miller61e50f12000-05-08 20:49:37 +10001467
1468AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1469 AC_TRY_LINK([],
1470 [ extern char *__progname; printf("%s", __progname); ],
1471 [ ac_cv_libc_defines___progname="yes" ],
1472 [ ac_cv_libc_defines___progname="no" ]
1473 )
1474])
1475if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1476 AC_DEFINE(HAVE___PROGNAME)
1477fi
1478
Damien Miller4f8e6692001-07-14 13:22:53 +10001479AC_CACHE_CHECK([whether getopt has optreset support],
1480 ac_cv_have_getopt_optreset, [
1481 AC_TRY_LINK(
1482 [
1483#include <getopt.h>
1484 ],
1485 [ extern int optreset; optreset = 0; ],
1486 [ ac_cv_have_getopt_optreset="yes" ],
1487 [ ac_cv_have_getopt_optreset="no" ]
1488 )
1489])
1490if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1491 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1492fi
Damien Millera22ba012000-03-02 23:09:20 +11001493
Damien Millerecbb26d2000-07-15 14:59:14 +10001494AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1495 AC_TRY_LINK([],
1496 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1497 [ ac_cv_libc_defines_sys_errlist="yes" ],
1498 [ ac_cv_libc_defines_sys_errlist="no" ]
1499 )
1500])
1501if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1502 AC_DEFINE(HAVE_SYS_ERRLIST)
1503fi
1504
1505
Damien Miller11fa2cc2000-08-16 10:35:58 +10001506AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1507 AC_TRY_LINK([],
1508 [ extern int sys_nerr; printf("%i", sys_nerr);],
1509 [ ac_cv_libc_defines_sys_nerr="yes" ],
1510 [ ac_cv_libc_defines_sys_nerr="no" ]
1511 )
1512])
1513if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1514 AC_DEFINE(HAVE_SYS_NERR)
1515fi
1516
1517
Damien Millerc79bc0d2001-03-28 13:03:42 +10001518# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001519SCARD_MSG="no"
1520AC_ARG_WITH(smartcard,
1521 [ --with-smartcard Enable smartcard support],
1522 [
1523 if test "x$withval" != "xno" ; then
1524 if test "x$withval" != "xyes" ; then
1525 CPPFLAGS="$CPPFLAGS -I${withval}"
1526 LDFLAGS="$LDFLAGS -L${withval}"
1527 if test ! -z "$need_dash_r" ; then
1528 LDFLAGS="$LDFLAGS -R${withval}"
1529 fi
1530 if test ! -z "$blibpath" ; then
1531 blibpath="$blibpath:${withval}"
1532 fi
1533 fi
1534 AC_CHECK_HEADERS(sectok.h)
1535 if test "$ac_cv_header_sectok_h" != yes; then
1536 AC_MSG_ERROR(Can't find sectok.h)
1537 fi
1538 AC_CHECK_LIB(sectok, sectok_open)
1539 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1540 AC_MSG_ERROR(Can't find libsectok)
1541 fi
1542 AC_DEFINE(SMARTCARD)
1543 SCARD_MSG="yes"
1544 fi
1545 ]
1546)
1547
1548# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001549KRB4_MSG="no"
1550AC_ARG_WITH(kerberos4,
1551 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1552 [
1553 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001554 if test "x$withval" != "xyes" ; then
1555 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1556 LDFLAGS="$LDFLAGS -L${withval}/lib"
1557 if test ! -z "$need_dash_r" ; then
1558 LDFLAGS="$LDFLAGS -R${withval}/lib"
1559 fi
1560 if test ! -z "$blibpath" ; then
1561 blibpath="$blibpath:${withval}/lib"
1562 fi
1563 else
1564 if test -d /usr/include/kerberosIV ; then
1565 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1566 fi
1567 fi
1568
1569 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001570 if test "$ac_cv_header_krb_h" != yes; then
1571 AC_MSG_WARN([Cannot find krb.h, build may fail])
1572 fi
Damien Miller98344742001-03-28 14:37:06 +10001573 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001574 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001575 AC_CHECK_LIB(krb4, main)
1576 if test "$ac_cv_lib_krb4_main" != yes; then
1577 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1578 else
1579 KLIBS="-lkrb4"
1580 fi
1581 else
1582 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001583 fi
Damien Miller98344742001-03-28 14:37:06 +10001584 AC_CHECK_LIB(des, des_cbc_encrypt)
1585 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1586 AC_CHECK_LIB(des425, des_cbc_encrypt)
1587 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1588 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1589 else
1590 KLIBS="-ldes425"
1591 fi
1592 else
1593 KLIBS="-ldes"
1594 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001595 AC_CHECK_LIB(resolv, dn_expand, , )
1596 KRB4=yes
1597 KRB4_MSG="yes"
1598 AC_DEFINE(KRB4)
1599 fi
1600 ]
1601)
1602
1603# Check whether user wants AFS support
1604AFS_MSG="no"
1605AC_ARG_WITH(afs,
1606 [ --with-afs=PATH Enable AFS support],
1607 [
1608 if test "x$withval" != "xno" ; then
1609
1610 if test "x$withval" != "xyes" ; then
1611 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1612 LDFLAGS="$LDFLAGS -L${withval}/lib"
1613 fi
1614
1615 if test -z "$KRB4" ; then
1616 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1617 fi
1618
1619 LIBS="-lkafs $LIBS"
1620 if test ! -z "$AFS_LIBS" ; then
1621 LIBS="$LIBS $AFS_LIBS"
1622 fi
1623 AC_DEFINE(AFS)
1624 AFS_MSG="yes"
1625 fi
1626 ]
1627)
1628LIBS="$LIBS $KLIBS"
1629
Damien Millera22ba012000-03-02 23:09:20 +11001630# Looking for programs, paths and files
1631AC_ARG_WITH(rsh,
1632 [ --with-rsh=PATH Specify path to remote shell program ],
1633 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001634 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001635 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001636 fi
1637 ],
1638 [
1639 AC_PATH_PROG(rsh_path, rsh)
1640 ]
1641)
1642
1643AC_ARG_WITH(xauth,
1644 [ --with-xauth=PATH Specify path to xauth program ],
1645 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001646 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001647 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001648 fi
1649 ],
1650 [
Damien Miller78315eb2000-09-29 23:01:36 +11001651 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 +10001652 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001653 xauth_path="/usr/openwin/bin/xauth"
1654 fi
1655 ]
1656)
1657
Damien Millera19cf472000-11-29 13:28:50 +11001658if test -z "$xauth_path" ; then
1659 XAUTH_PATH="undefined"
1660 AC_SUBST(XAUTH_PATH)
1661else
Damien Millera22ba012000-03-02 23:09:20 +11001662 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001663 XAUTH_PATH=$xauth_path
1664 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001665fi
1666if test ! -z "$rsh_path" ; then
1667 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1668fi
1669
1670# Check for mail directory (last resort if we cannot get it from headers)
1671if test ! -z "$MAIL" ; then
1672 maildir=`dirname $MAIL`
1673 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1674fi
1675
Damien Millera22ba012000-03-02 23:09:20 +11001676if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001677 AC_CHECK_FILE("/dev/ptmx",
1678 [
1679 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1680 have_dev_ptmx=1
1681 ]
1682 )
Damien Millera22ba012000-03-02 23:09:20 +11001683fi
Damien Miller204ad072000-03-02 23:56:12 +11001684AC_CHECK_FILE("/dev/ptc",
1685 [
1686 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1687 have_dev_ptc=1
1688 ]
1689)
1690
Damien Millera22ba012000-03-02 23:09:20 +11001691# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001692AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001693 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001694 [
Damien Miller897741e2001-04-16 10:41:46 +10001695 case "$withval" in
1696 man|cat|doc)
1697 MANTYPE=$withval
1698 ;;
1699 *)
1700 AC_MSG_ERROR(invalid man type: $withval)
1701 ;;
1702 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001703 ]
1704)
Ben Lindstrombc709922001-04-18 18:04:21 +00001705if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001706 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001707 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1708 MANTYPE=doc
1709 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1710 MANTYPE=man
1711 else
1712 MANTYPE=cat
1713 fi
1714fi
Damien Miller670a4b82000-01-22 13:53:11 +11001715AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001716if test "$MANTYPE" = "doc"; then
1717 mansubdir=man;
1718else
1719 mansubdir=$MANTYPE;
1720fi
1721AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001722
Damien Millera22ba012000-03-02 23:09:20 +11001723# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001724MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001725AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001726 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001727 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001728 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001729 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001730 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001731 fi
1732 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001733)
1734
Damien Millera22ba012000-03-02 23:09:20 +11001735# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001736AC_ARG_WITH(shadow,
1737 [ --without-shadow Disable shadow password support],
1738 [
1739 if test "x$withval" = "xno" ; then
1740 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001741 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001742 fi
1743 ]
1744)
1745
Damien Miller1f335fb2000-06-26 11:31:33 +10001746if test -z "$disable_shadow" ; then
1747 AC_MSG_CHECKING([if the systems has expire shadow information])
1748 AC_TRY_COMPILE(
1749 [
1750#include <sys/types.h>
1751#include <shadow.h>
1752 struct spwd sp;
1753 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1754 [ sp_expire_available=yes ], []
1755 )
1756
1757 if test "x$sp_expire_available" = "xyes" ; then
1758 AC_MSG_RESULT(yes)
1759 AC_DEFINE(HAS_SHADOW_EXPIRE)
1760 else
1761 AC_MSG_RESULT(no)
1762 fi
1763fi
1764
Damien Millera22ba012000-03-02 23:09:20 +11001765# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001766if test ! -z "$IPADDR_IN_DISPLAY" ; then
1767 DISPLAY_HACK_MSG="yes"
1768 AC_DEFINE(IPADDR_IN_DISPLAY)
1769else
1770 DISPLAY_HACK_MSG="no"
1771 AC_ARG_WITH(ipaddr-display,
1772 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1773 [
1774 if test "x$withval" != "xno" ; then
1775 AC_DEFINE(IPADDR_IN_DISPLAY)
1776 DISPLAY_HACK_MSG="yes"
1777 fi
1778 ]
1779 )
1780fi
Damien Miller76112de1999-12-21 11:18:08 +11001781
Damien Millera22ba012000-03-02 23:09:20 +11001782# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001783SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001784AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001785 [ --with-default-path=PATH Specify default \$PATH environment for server],
1786 [
1787 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001788 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001789 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001790 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001791 ],
1792 [
1793 AC_TRY_RUN(
1794 [
1795/* find out what STDPATH is */
1796#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001797#ifdef HAVE_PATHS_H
1798# include <paths.h>
1799#endif
1800#ifndef _PATH_STDPATH
1801# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1802#endif
1803#include <sys/types.h>
1804#include <sys/stat.h>
1805#include <fcntl.h>
1806#define DATA "conftest.stdpath"
1807
1808main()
1809{
1810 FILE *fd;
1811 int rc;
1812
1813 fd = fopen(DATA,"w");
1814 if(fd == NULL)
1815 exit(1);
1816
1817 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1818 exit(1);
1819
1820 exit(0);
1821}
1822 ], [ user_path=`cat conftest.stdpath` ],
1823 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1824 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1825 )
1826# make sure $bindir is in USER_PATH so scp will work
1827 t_bindir=`eval echo ${bindir}`
1828 case $t_bindir in
1829 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1830 esac
1831 case $t_bindir in
1832 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1833 esac
1834 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1835 if test $? -ne 0 ; then
1836 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1837 if test $? -ne 0 ; then
1838 user_path=$user_path:$t_bindir
1839 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1840 fi
1841 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001842 ]
1843)
Tim Rice59ea0a02001-03-10 13:50:45 -08001844AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1845AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001846
Damien Millera22ba012000-03-02 23:09:20 +11001847# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001848IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001849AC_ARG_WITH(ipv4-default,
1850 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1851 [
1852 if test "x$withval" != "xno" ; then
1853 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001854 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001855 fi
1856 ]
1857)
1858
Damien Miller61e50f12000-05-08 20:49:37 +10001859AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001860IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001861AC_ARG_WITH(4in6,
1862 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1863 [
1864 if test "x$withval" != "xno" ; then
1865 AC_MSG_RESULT(yes)
1866 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001867 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001868 else
1869 AC_MSG_RESULT(no)
1870 fi
1871 ],[
1872 if test "x$inet6_default_4in6" = "xyes"; then
1873 AC_MSG_RESULT([yes (default)])
1874 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001875 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001876 else
1877 AC_MSG_RESULT([no (default)])
1878 fi
1879 ]
1880)
1881
Damien Miller60396b02001-02-18 17:01:00 +11001882# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11001883BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11001884AC_ARG_WITH(bsd-auth,
1885 [ --with-bsd-auth Enable BSD auth support],
1886 [
1887 if test "x$withval" != "xno" ; then
1888 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11001889 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11001890 fi
1891 ]
1892)
1893
Damien Miller78315eb2000-09-29 23:01:36 +11001894AC_MSG_CHECKING(whether to install ssh as suid root)
1895AC_ARG_ENABLE(suid-ssh,
1896[ --enable-suid-ssh Install ssh as suid root (default)
1897 --disable-suid-ssh Install ssh without suid bit],
1898[ case "$enableval" in
1899 no)
1900 AC_MSG_RESULT(no)
1901 SSHMODE=0711
1902 ;;
1903 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001904 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001905 ;;
1906 esac ],
1907 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001908 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001909)
1910AC_SUBST(SSHMODE)
1911
1912
Damien Millera22ba012000-03-02 23:09:20 +11001913# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001914piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001915AC_ARG_WITH(pid-dir,
1916 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1917 [
1918 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001919 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001920 fi
1921 ]
1922)
Damien Miller4018c192000-04-30 09:30:44 +10001923
Damien Miller78315eb2000-09-29 23:01:36 +11001924# make sure the directory exists
1925if test ! -d $piddir ; then
1926 piddir=`eval echo ${sysconfdir}`
1927 case $piddir in
1928 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1929 esac
1930fi
1931
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001932AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001933AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001934
andre2ff7b5d2000-06-03 14:57:40 +00001935dnl allow user to disable some login recording features
1936AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001937 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001938 [ AC_DEFINE(DISABLE_LASTLOG) ]
1939)
1940AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001941 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001942 [ AC_DEFINE(DISABLE_UTMP) ]
1943)
1944AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001945 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001946 [ AC_DEFINE(DISABLE_UTMPX) ]
1947)
1948AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001949 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001950 [ AC_DEFINE(DISABLE_WTMP) ]
1951)
1952AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001953 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001954 [ AC_DEFINE(DISABLE_WTMPX) ]
1955)
1956AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001957 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001958 [ AC_DEFINE(DISABLE_LOGIN) ]
1959)
1960AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001961 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001962 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1963)
1964AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001965 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001966 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1967)
1968AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001969 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001970 [
1971 if test "x$withval" = "xno" ; then
1972 AC_DEFINE(DISABLE_LASTLOG)
1973 else
1974 conf_lastlog_location=$withval
1975 fi
1976 ]
1977)
andre2ff7b5d2000-06-03 14:57:40 +00001978
1979dnl lastlog, [uw]tmpx? detection
1980dnl NOTE: set the paths in the platform section to avoid the
1981dnl need for command-line parameters
1982dnl lastlog and [uw]tmp are subject to a file search if all else fails
1983
1984dnl lastlog detection
1985dnl NOTE: the code itself will detect if lastlog is a directory
1986AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1987AC_TRY_COMPILE([
1988#include <sys/types.h>
1989#include <utmp.h>
1990#ifdef HAVE_LASTLOG_H
1991# include <lastlog.h>
1992#endif
Damien Miller2994e082000-06-04 15:51:47 +10001993#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001994# include <paths.h>
1995#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001996#ifdef HAVE_LOGIN_H
1997# include <login.h>
1998#endif
andre2ff7b5d2000-06-03 14:57:40 +00001999 ],
2000 [ char *lastlog = LASTLOG_FILE; ],
2001 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002002 [
2003 AC_MSG_RESULT(no)
2004 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2005 AC_TRY_COMPILE([
2006#include <sys/types.h>
2007#include <utmp.h>
2008#ifdef HAVE_LASTLOG_H
2009# include <lastlog.h>
2010#endif
2011#ifdef HAVE_PATHS_H
2012# include <paths.h>
2013#endif
2014 ],
2015 [ char *lastlog = _PATH_LASTLOG; ],
2016 [ AC_MSG_RESULT(yes) ],
2017 [
andree441aa32000-06-12 22:34:38 +00002018 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002019 system_lastlog_path=no
2020 ])
2021 ]
andre2ff7b5d2000-06-03 14:57:40 +00002022)
Damien Miller2994e082000-06-04 15:51:47 +10002023
andre2ff7b5d2000-06-03 14:57:40 +00002024if test -z "$conf_lastlog_location"; then
2025 if test x"$system_lastlog_path" = x"no" ; then
2026 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002027 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002028 conf_lastlog_location=$f
2029 fi
2030 done
2031 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002032 AC_MSG_WARN([** Cannot find lastlog **])
2033 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002034 fi
2035 fi
2036fi
2037
2038if test -n "$conf_lastlog_location"; then
2039 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2040fi
2041
2042dnl utmp detection
2043AC_MSG_CHECKING([if your system defines UTMP_FILE])
2044AC_TRY_COMPILE([
2045#include <sys/types.h>
2046#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002047#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002048# include <paths.h>
2049#endif
2050 ],
2051 [ char *utmp = UTMP_FILE; ],
2052 [ AC_MSG_RESULT(yes) ],
2053 [ AC_MSG_RESULT(no)
2054 system_utmp_path=no ]
2055)
2056if test -z "$conf_utmp_location"; then
2057 if test x"$system_utmp_path" = x"no" ; then
2058 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2059 if test -f $f ; then
2060 conf_utmp_location=$f
2061 fi
2062 done
2063 if test -z "$conf_utmp_location"; then
2064 AC_DEFINE(DISABLE_UTMP)
2065 fi
2066 fi
2067fi
2068if test -n "$conf_utmp_location"; then
2069 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2070fi
2071
2072dnl wtmp detection
2073AC_MSG_CHECKING([if your system defines WTMP_FILE])
2074AC_TRY_COMPILE([
2075#include <sys/types.h>
2076#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002077#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002078# include <paths.h>
2079#endif
2080 ],
2081 [ char *wtmp = WTMP_FILE; ],
2082 [ AC_MSG_RESULT(yes) ],
2083 [ AC_MSG_RESULT(no)
2084 system_wtmp_path=no ]
2085)
2086if test -z "$conf_wtmp_location"; then
2087 if test x"$system_wtmp_path" = x"no" ; then
2088 for f in /usr/adm/wtmp /var/log/wtmp; do
2089 if test -f $f ; then
2090 conf_wtmp_location=$f
2091 fi
2092 done
2093 if test -z "$conf_wtmp_location"; then
2094 AC_DEFINE(DISABLE_WTMP)
2095 fi
2096 fi
2097fi
2098if test -n "$conf_wtmp_location"; then
2099 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2100fi
2101
2102
2103dnl utmpx detection - I don't know any system so perverse as to require
2104dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2105dnl there, though.
2106AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2107AC_TRY_COMPILE([
2108#include <sys/types.h>
2109#include <utmp.h>
2110#ifdef HAVE_UTMPX_H
2111#include <utmpx.h>
2112#endif
Damien Miller2994e082000-06-04 15:51:47 +10002113#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002114# include <paths.h>
2115#endif
2116 ],
2117 [ char *utmpx = UTMPX_FILE; ],
2118 [ AC_MSG_RESULT(yes) ],
2119 [ AC_MSG_RESULT(no)
2120 system_utmpx_path=no ]
2121)
2122if test -z "$conf_utmpx_location"; then
2123 if test x"$system_utmpx_path" = x"no" ; then
2124 AC_DEFINE(DISABLE_UTMPX)
2125 fi
2126else
2127 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2128fi
2129
2130dnl wtmpx detection
2131AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2132AC_TRY_COMPILE([
2133#include <sys/types.h>
2134#include <utmp.h>
2135#ifdef HAVE_UTMPX_H
2136#include <utmpx.h>
2137#endif
Damien Miller2994e082000-06-04 15:51:47 +10002138#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002139# include <paths.h>
2140#endif
2141 ],
2142 [ char *wtmpx = WTMPX_FILE; ],
2143 [ AC_MSG_RESULT(yes) ],
2144 [ AC_MSG_RESULT(no)
2145 system_wtmpx_path=no ]
2146)
2147if test -z "$conf_wtmpx_location"; then
2148 if test x"$system_wtmpx_path" = x"no" ; then
2149 AC_DEFINE(DISABLE_WTMPX)
2150 fi
2151else
2152 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2153fi
2154
Damien Miller4018c192000-04-30 09:30:44 +10002155
Damien Miller29ea30d2000-03-17 10:54:15 +11002156if test ! -z "$blibpath" ; then
2157 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2158 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2159fi
2160
Damien Millerbac2d8a2000-09-05 16:13:06 +11002161AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002162AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2163AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002164
Damien Miller7b22d652000-06-18 14:07:04 +10002165# Print summary of options
2166
Damien Miller7b22d652000-06-18 14:07:04 +10002167# Someone please show me a better way :)
2168A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2169B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2170C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2171D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002172E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002173F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002174G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002175H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002176
2177echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002178echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002179echo " User binaries: $B"
2180echo " System binaries: $C"
2181echo " Configuration files: $D"
2182echo " Askpass program: $E"
2183echo " Manual pages: $F"
2184echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002185echo " sshd default user PATH: $H"
Damien Miller897741e2001-04-16 10:41:46 +10002186echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002187echo " PAM support: ${PAM_MSG}"
2188echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002189echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002190echo " AFS support: $AFS_MSG"
2191echo " S/KEY support: $SKEY_MSG"
2192echo " TCP Wrappers support: $TCPW_MSG"
2193echo " MD5 password support: $MD5_MSG"
2194echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2195echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2196echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002197echo " BSD Auth support: $BSD_AUTH_MSG"
2198echo " Random number source: $RAND_MSG"
2199if test ! -z "$USE_RAND_HELPER" ; then
2200 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002201fi
2202
Damien Miller7b22d652000-06-18 14:07:04 +10002203echo ""
2204
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002205echo " Host: ${host}"
2206echo " Compiler: ${CC}"
2207echo " Compiler flags: ${CFLAGS}"
2208echo "Preprocessor flags: ${CPPFLAGS}"
2209echo " Linker flags: ${LDFLAGS}"
2210echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002211
2212echo ""
2213
Damien Miller82cf0ce2000-12-20 13:34:48 +11002214if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002215 echo "PAM is enabled. You may need to install a PAM control file "
2216 echo "for sshd, otherwise password authentication may fail. "
2217 echo "Example PAM control files can be found in the contrib/ "
2218 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002219 echo ""
2220fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002221
2222if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002223 echo "sftp-server will be disabled. Your compiler does not "
2224 echo "support 64bit integers."
2225 echo ""
2226fi
2227
2228if test ! -z "$RAND_HELPER_CMDHASH" ; then
2229 echo "WARNING: you are using the builtin random number collection "
2230 echo "service. Please read WARNING.RNG and request that your OS "
2231 echo "vendor includes kernel-based random number collection in "
2232 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002233 echo ""
2234fi
Damien Miller60396b02001-02-18 17:01:00 +11002235