blob: de1c7f5823730ad7e790de5e786cc0d8be3e56a3 [file] [log] [blame]
Damien Miller28e4d8f2002-01-22 23:51:42 +11001i# $Id: configure.ac,v 1.13 2002/01/22 12:51:43 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 Miller28e4d8f2002-01-22 23:51:42 +1100125 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller7bcb0892000-03-11 20:45:40 +1100126 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100127 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000128mips-sony-bsd|mips-sony-newsos4)
129 AC_DEFINE(HAVE_NEWS4)
130 SONY=1
131 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100132 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000133 )
134 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100135*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100136 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100137 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100138*-*-freebsd*)
139 check_for_libcrypt_later=1
140 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100143 conf_utmp_location=/etc/utmp
144 conf_wtmp_location=/usr/adm/wtmp
145 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000146 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000147 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000148 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100149 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000150 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000151 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000152 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100153*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000154 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000155 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100156 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100157 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
159 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000160 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000161 # hardwire lastlog location (can't detect it on some versions)
162 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000163 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
164 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
165 if test "$sol2ver" -ge 8; then
166 AC_MSG_RESULT(yes)
167 AC_DEFINE(DISABLE_UTMP)
168 AC_DEFINE(DISABLE_WTMP)
169 else
170 AC_MSG_RESULT(no)
171 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100172 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000173*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000174 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000175 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100176 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100177 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000178 conf_utmp_location=/etc/utmp
179 conf_wtmp_location=/var/adm/wtmp
180 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000181 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000182 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000183*-ncr-sysv*)
184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
185 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700186 LIBS="$LIBS -lc89"
Ben Lindstrom34328342001-04-23 22:39:42 +0000187 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Kevin Steves0bd4b342002-01-05 23:24:27 +0000188 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000189 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000190*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000191 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700192 # /usr/ucblib MUST NOT be searched on ReliantUNIX
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100194 IPADDR_IN_DISPLAY=yes
195 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000196 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000197 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700198 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
199 # Attention: always take care to bind libsocket and libnsl before libc,
200 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000201 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100202*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000203 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100204 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700205# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100206 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100207 ;;
208*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000209 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100210 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700211# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100212 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100213 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100214*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000215 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100217 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100218*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000219 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100220 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700221 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100222 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100223 RANLIB=true
224 no_dev_ptmx=1
225 AC_DEFINE(BROKEN_SYS_TERMIO_H)
226 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100227 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000228 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000229 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100230 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100231 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700232 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700233 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100234 ;;
235*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000236 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000237 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100238 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000239 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100240 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100241 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100242 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000243 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000244 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100245 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700246 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000247 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000248*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700249 no_libsocket=1
250 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000251 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700252 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
253 LIBS="$LIBS -lgen -lrsc"
254 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000255*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000256 AC_MSG_CHECKING(for Digital Unix SIA)
257 no_osfsia=""
258 AC_ARG_WITH(osfsia,
259 [ --with-osfsia Enable Digital Unix SIA],
260 [
261 if test "x$withval" = "xno" ; then
262 AC_MSG_RESULT(disabled)
263 no_osfsia=1
264 fi
265 ],
266 )
267 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000268 if test -f /etc/sia/matrix.conf; then
269 AC_MSG_RESULT(yes)
270 AC_DEFINE(HAVE_OSF_SIA)
271 AC_DEFINE(DISABLE_LOGIN)
272 LIBS="$LIBS -lsecurity -ldb -lm -laud"
273 else
274 AC_MSG_RESULT(no)
275 fi
276 fi
277 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000278
279*-*-nto-qnx)
280 AC_DEFINE(USE_PIPES)
281 AC_DEFINE(NO_X11_UNIX_SOCKETS)
282 AC_DEFINE(MISSING_NFDBITS)
283 AC_DEFINE(MISSING_HOWMANY)
284 AC_DEFINE(MISSING_FD_MASK)
285 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100286esac
287
Damien Millere37bfc12000-06-05 09:37:43 +1000288# Allow user to specify flags
289AC_ARG_WITH(cflags,
290 [ --with-cflags Specify additional flags to pass to compiler],
291 [
292 if test "x$withval" != "xno" ; then
293 CFLAGS="$CFLAGS $withval"
294 fi
295 ]
296)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000297AC_ARG_WITH(cppflags,
298 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
299 [
300 if test "x$withval" != "xno"; then
301 CPPFLAGS="$CPPFLAGS $withval"
302 fi
303 ]
304)
Damien Millere37bfc12000-06-05 09:37:43 +1000305AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000306 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000307 [
308 if test "x$withval" != "xno" ; then
309 LDFLAGS="$LDFLAGS $withval"
310 fi
311 ]
312)
313AC_ARG_WITH(libs,
314 [ --with-libs Specify additional libraries to link with],
315 [
316 if test "x$withval" != "xno" ; then
317 LIBS="$LIBS $withval"
318 fi
319 ]
320)
321
Damien Millera22ba012000-03-02 23:09:20 +1100322# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700323AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
324AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000325
Damien Millerdf288022001-02-18 13:07:07 +1100326dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700327if test "x$with_tcp_wrappers" != "xno" ; then
328 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
329 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
330 fi
331fi
Damien Millerdf288022001-02-18 13:07:07 +1100332
Tim Rice13aae5e2001-10-21 17:53:58 -0700333AC_CHECK_FUNC(getspnam, ,
334 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700335
336dnl zlib is required
337AC_ARG_WITH(zlib,
338 [ --with-zlib=PATH Use zlib in PATH],
339 [
Damien Miller6c21c512002-01-22 21:57:53 +1100340 if test "x$withval" != "xno" ; then
341 AC_MSG_ERROR([*** zlib is required ***])
342 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700343 if test -d "$withval/lib"; then
344 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700345 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700346 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700347 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700348 fi
349 else
350 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700351 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700352 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700353 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700354 fi
355 fi
356 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700357 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700358 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700359 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700360 fi
361 ]
362)
363
Tim Rice17b93e52001-10-23 22:36:54 -0700364AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100365
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000366dnl UnixWare 2.x
367AC_CHECK_FUNC(strcasecmp,
368 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
369)
370AC_CHECK_FUNC(utimes,
371 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
372)
Damien Millerab18c411999-11-11 10:40:23 +1100373
Tim Ricee589a292001-11-03 11:09:32 -0800374dnl Checks for libutil functions
375AC_CHECK_HEADERS(libutil.h)
376AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
377AC_CHECK_FUNCS(logout updwtmp logwtmp)
378
Ben Lindstrom8697e082001-02-24 21:41:10 +0000379AC_FUNC_STRFTIME
380
Damien Millera22ba012000-03-02 23:09:20 +1100381# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700382AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700383 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700384 login_cap.h maillock.h netdb.h netgroup.h \
Ben Lindstromc97b1af2001-12-07 17:20:47 +0000385 netinet/in_systm.h paths.h poll.h pty.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700386 security/pam_appl.h shadow.h stddef.h stdint.h \
387 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
388 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
389 sys/stropts.h sys/sysmacros.h sys/time.h \
390 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
391 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100392
393# Check for ALTDIRFUNC glob() extension
394AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
395AC_EGREP_CPP(FOUNDIT,
396 [
397 #include <glob.h>
398 #ifdef GLOB_ALTDIRFUNC
399 FOUNDIT
400 #endif
401 ],
402 [
403 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
404 AC_MSG_RESULT(yes)
405 ],
406 [
407 AC_MSG_RESULT(no)
408 ]
409)
Damien Millerab18c411999-11-11 10:40:23 +1100410
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000411# Check for g.gl_matchc glob() extension
412AC_MSG_CHECKING(for gl_matchc field in glob_t)
413AC_EGREP_CPP(FOUNDIT,
414 [
415 #include <glob.h>
416 int main(void){glob_t g; g.gl_matchc = 1;}
417 ],
418 [
419 AC_DEFINE(GLOB_HAS_GL_MATCHC)
420 AC_MSG_RESULT(yes)
421 ],
422 [
423 AC_MSG_RESULT(no)
424 ]
425)
426
Damien Miller18bb4732001-03-28 14:35:30 +1000427AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
428AC_TRY_RUN(
429 [
430#include <sys/types.h>
431#include <dirent.h>
432int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
433 ],
434 [AC_MSG_RESULT(yes)],
435 [
436 AC_MSG_RESULT(no)
437 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
438 ]
439)
440
Damien Millerc547bf12001-02-16 10:18:12 +1100441# Check whether user wants S/Key support
442SKEY_MSG="no"
443AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700444 [ --with-skey[[=PATH]] Enable S/Key support
445 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100446 [
447 if test "x$withval" != "xno" ; then
448
449 if test "x$withval" != "xyes" ; then
450 CPPFLAGS="$CPPFLAGS -I${withval}/include"
451 LDFLAGS="$LDFLAGS -L${withval}/lib"
452 fi
453
454 AC_DEFINE(SKEY)
455 LIBS="-lskey $LIBS"
456 SKEY_MSG="yes"
457
458 AC_CHECK_FUNC(skey_keyinfo,
459 [],
460 [
461 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
462 ])
463 fi
464 ]
465)
466
467# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700468TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100469AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700470 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
471 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100472 [
473 if test "x$withval" != "xno" ; then
474 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700475 saved_LDFLAGS="$LDFLAGS"
476 saved_CPPFLAGS="$CPPFLAGS"
477 if test -n "${withval}" -a "${withval}" != "yes"; then
478 if test -d "${withval}/lib"; then
479 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700480 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700481 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700482 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700483 fi
484 else
485 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700486 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700487 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700488 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700489 fi
490 fi
491 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700492 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700493 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700494 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700495 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700496 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100497 LIBS="-lwrap $LIBS"
498 AC_MSG_CHECKING(for libwrap)
499 AC_TRY_LINK(
500 [
501#include <tcpd.h>
502 int deny_severity = 0, allow_severity = 0;
503 ],
504 [hosts_access(0);],
505 [
506 AC_MSG_RESULT(yes)
507 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700508 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100509 ],
510 [
511 AC_MSG_ERROR([*** libwrap missing])
512 ]
513 )
514 fi
515 ]
516)
517
Damien Millerad833b32000-08-23 10:46:23 +1000518dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700519AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
520 clock fchmod fchown freeaddrinfo futimes gai_strerror \
521 getaddrinfo getcwd getgrouplist getnameinfo getopt \
522 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
523 inet_ntop innetgr login_getcapbool md5_crypt memmove \
524 mkdtemp on_exit openpty readpassphrase realpath \
525 rresvport_af setdtablesize setegid setenv seteuid \
526 setlogin setproctitle setresgid setreuid setrlimit \
527 setsid setvbuf sigaction sigvec snprintf strerror \
528 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
529 vhangup vsnprintf waitpid __b64_ntop _getpty)
530
531dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700532AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700533 AC_CHECK_LIB(gen, dirname,[
534 AC_CACHE_CHECK([for broken dirname],
535 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700536 save_LIBS="$LIBS"
537 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700538 AC_TRY_RUN(
539 [
540#include <libgen.h>
541#include <string.h>
542
543int main(int argc, char **argv) {
544 char *s, buf[32];
545
546 strncpy(buf,"/etc", 32);
547 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700548 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700549 exit(1);
550 } else {
551 exit(0);
552 }
553}
554 ],
555 [ ac_cv_have_broken_dirname="no" ],
556 [ ac_cv_have_broken_dirname="yes" ]
557 )
Tim Rice17b93e52001-10-23 22:36:54 -0700558 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700559 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700560 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700561 LIBS="$LIBS -lgen"
562 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700563 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700564 fi
565 ])
566])
567
Damien Millerad833b32000-08-23 10:46:23 +1000568dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000569AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000570dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000571AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000572AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000573dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000574AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000575AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100576
Damien Miller5fc85652000-07-09 23:53:07 +1000577AC_CHECK_FUNC(getuserattr,
578 [AC_DEFINE(HAVE_GETUSERATTR)],
579 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
580)
581
Damien Miller04f80141999-11-19 15:32:34 +1100582AC_CHECK_FUNC(daemon,
583 [AC_DEFINE(HAVE_DAEMON)],
584 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
585)
586
Damien Miller9fb07e42000-03-05 16:22:59 +1100587AC_CHECK_FUNC(getpagesize,
588 [AC_DEFINE(HAVE_GETPAGESIZE)],
589 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
590)
591
Damien Millercb170cb2000-07-01 16:52:55 +1000592# Check for broken snprintf
593if test "x$ac_cv_func_snprintf" = "xyes" ; then
594 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
595 AC_TRY_RUN(
596 [
597#include <stdio.h>
598int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
599 ],
600 [AC_MSG_RESULT(yes)],
601 [
602 AC_MSG_RESULT(no)
603 AC_DEFINE(BROKEN_SNPRINTF)
604 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
605 ]
606 )
607fi
608
Damien Miller606f8802000-09-16 15:39:56 +1100609AC_FUNC_GETPGRP
610
Damien Millera64b57a2001-01-17 10:44:13 +1100611# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000612PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100613AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100614 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100615 [
Damien Millera64b57a2001-01-17 10:44:13 +1100616 if test "x$withval" != "xno" ; then
617 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
618 AC_MSG_ERROR([PAM headers not found])
619 fi
620
621 AC_CHECK_LIB(dl, dlopen, , )
622 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
623 AC_CHECK_FUNCS(pam_getenvlist)
624
625 disable_shadow=yes
626 PAM_MSG="yes"
627
628 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100629 fi
630 ]
631)
Damien Millera22ba012000-03-02 23:09:20 +1100632
Damien Millera64b57a2001-01-17 10:44:13 +1100633# Check for older PAM
634if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100635 # Check PAM strerror arguments (old PAM)
636 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
637 AC_TRY_COMPILE(
638 [
Damien Miller81171112000-04-23 11:14:01 +1000639#include <stdlib.h>
640#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100641 ],
642 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
643 [AC_MSG_RESULT(no)],
644 [
645 AC_DEFINE(HAVE_OLD_PAM)
646 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000647 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100648 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100649 )
Damien Millera22ba012000-03-02 23:09:20 +1100650fi
651
652# The big search for OpenSSL
653AC_ARG_WITH(ssl-dir,
654 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
655 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000656 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100657 tryssldir=$withval
658 fi
659 ]
660)
661
662saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100663saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000664saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100665if test "x$prefix" != "xNONE" ; then
666 tryssldir="$tryssldir $prefix"
667fi
Damien Miller61e50f12000-05-08 20:49:37 +1000668AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100669 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 +1100670 CPPFLAGS="$saved_CPPFLAGS"
671 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000672 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100673
674 # Skip directories if they don't exist
675 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
676 continue;
677 fi
678 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
679 # Try to use $ssldir/lib if it exists, otherwise
680 # $ssldir
681 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000682 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100683 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000684 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100685 fi
686 else
Damien Millerb68af622001-03-28 21:05:26 +1000687 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100688 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000689 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100690 fi
691 fi
692 # Try to use $ssldir/include if it exists, otherwise
693 # $ssldir
694 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000695 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100696 else
Damien Millerb68af622001-03-28 21:05:26 +1000697 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100698 fi
699 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000700
Damien Miller3b512e12000-05-17 23:29:18 +1000701 # Basic test to check for compatible version and correct linking
702 # *does not* test for RSA - that comes later.
703 AC_TRY_RUN(
704 [
Damien Millere59ce622000-05-01 20:54:17 +1000705#include <string.h>
706#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000707int main(void)
708{
Damien Miller3b512e12000-05-17 23:29:18 +1000709 char a[2048];
710 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000711 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000712 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000713}
Damien Miller3b512e12000-05-17 23:29:18 +1000714 ],
715 [
716 found_crypto=1
717 break;
718 ], []
719 )
Damien Miller61e50f12000-05-08 20:49:37 +1000720
721 if test ! -z "$found_crypto" ; then
722 break;
723 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100724 done
725
Damien Miller61e50f12000-05-08 20:49:37 +1000726 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100727 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100728 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000729 if test -z "$ssldir" ; then
730 ssldir="(system)"
731 fi
Damien Millera22ba012000-03-02 23:09:20 +1100732
Damien Miller61e50f12000-05-08 20:49:37 +1000733 ac_cv_openssldir=$ssldir
734])
735
Damien Milleredb82922000-06-20 13:25:52 +1000736if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000737 AC_DEFINE(HAVE_OPENSSL)
738 dnl Need to recover ssldir - test above runs in subshell
739 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100740 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100741 # Try to use $ssldir/lib if it exists, otherwise
742 # $ssldir
743 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000744 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100745 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000746 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100747 fi
748 else
Damien Millerb68af622001-03-28 21:05:26 +1000749 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100750 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000751 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100752 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100753 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100754 # Try to use $ssldir/include if it exists, otherwise
755 # $ssldir
756 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000757 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100758 else
Damien Millerb68af622001-03-28 21:05:26 +1000759 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100760 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100761 fi
Damien Millera22ba012000-03-02 23:09:20 +1100762fi
Damien Miller3b512e12000-05-17 23:29:18 +1000763LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000764
Damien Miller3b512e12000-05-17 23:29:18 +1000765# Now test RSA support
766saved_LIBS="$LIBS"
767AC_MSG_CHECKING([for RSA support])
768for WANTS_RSAREF in "" 1 ; do
769 if test -z "$WANTS_RSAREF" ; then
770 LIBS="$saved_LIBS"
771 else
772 LIBS="$saved_LIBS -lRSAglue -lrsaref"
773 fi
774 AC_TRY_RUN([
775#include <string.h>
776#include <openssl/rand.h>
777#include <openssl/rsa.h>
778#include <openssl/bn.h>
779#include <openssl/sha.h>
780int main(void)
781{
782 int num; RSA *key; static unsigned char p_in[] = "blahblah";
783 unsigned char c[256], p[256];
784 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
785 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
786 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
787 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
788}
789 ],
790 [
791 rsa_works=1
792 break;
793 ], [])
794done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000795LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000796
797if test ! -z "$no_rsa" ; then
798 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000799 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000800else
801 if test -z "$rsa_works" ; then
802 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000803 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000804 else
805 if test -z "$WANTS_RSAREF" ; then
806 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000807 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000808 else
Damien Miller7b22d652000-06-18 14:07:04 +1000809 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000810 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000811 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000812 fi
813 fi
814fi
Damien Millera22ba012000-03-02 23:09:20 +1100815
Damien Millerec932372002-01-22 22:16:03 +1100816# Sanity check OpenSSL headers
817AC_MSG_CHECKING([whether OpenSSL's headers match the library])
818AC_TRY_RUN(
819 [
820#include <string.h>
821#include <openssl/opensslv.h>
822int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
823 ],
824 [
825 AC_MSG_RESULT(yes)
826 ],
827 [
828 AC_MSG_RESULT(no)
829 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
830 ]
831)
832
Damien Millera64b57a2001-01-17 10:44:13 +1100833# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
834# version in OpenSSL. Skip this for PAM
835if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100836 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100837fi
838
Damien Miller6c21c512002-01-22 21:57:53 +1100839
840### Configure cryptographic random number support
841
842# Check wheter OpenSSL seeds itself
843AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
844AC_TRY_RUN(
845 [
846#include <string.h>
847#include <openssl/rand.h>
848int main(void) { return(RAND_status() == 1 ? 0 : 1); }
849 ],
850 [
851 OPENSSL_SEEDS_ITSELF=yes
852 AC_MSG_RESULT(yes)
853 ],
854 [
855 AC_MSG_RESULT(no)
856 # Default to use of the rand helper if OpenSSL doesn't
857 # seed itself
858 USE_RAND_HELPER=yes
859 ]
860)
861
862
863# Do we want to force the use of the rand helper?
864AC_ARG_WITH(rand-helper,
865 [ --with-rand-helper Use subprocess to gather strong randomness ],
866 [
867 if test "x$withval" = "xno" ; then
868 # Force use of OpenSSL's internal RNG, even if
869 # the previous test showed it to be unseeded.
870 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
871 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
872 OPENSSL_SEEDS_ITSELF=yes
873 USE_RAND_HELPER=""
874 fi
875 else
876 USE_RAND_HELPER=yes
877 fi
878 ],
879)
880
881# Which randomness source do we use?
882if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
883 # OpenSSL only
884 AC_DEFINE(OPENSSL_PRNG_ONLY)
885 RAND_MSG="OpenSSL internal ONLY"
886 INSTALL_SSH_RAND_HELPER=""
887elif test ! -z "$OPENSSL_SEEDS_ITSELF" -a ! -z "$USE_RAND_HELPER" ; then
888 # OpenSSL with fallback to rand helper
889 RAND_MSG="ssh-rand-helper"
890 INSTALL_SSH_RAND_HELPER="yes"
891fi
892AC_SUBST(INSTALL_SSH_RAND_HELPER)
893
894### Configuration of ssh-rand-helper
895
896# PRNGD TCP socket
897AC_ARG_WITH(prngd-port,
898 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
899 [
900 if test ! -z "$withval" -a "x$withval" != "xno" ; then
901 PRNGD_PORT="$withval"
902 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
903 fi
904 ]
905)
906
907# PRNGD Unix domain socket
908AC_ARG_WITH(prngd-socket,
909 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
910 [
911 if test -z "$withval" ; then
912 withval="/var/run/egd-pool"
913 fi
914 if test "x$withval" != "xno" ; then
915 if test ! -z "$PRNGD_PORT" ; then
916 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
917 fi
918 if ! echo "$withval" | grep -q '^/' ; then
919 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
920 fi
921 if ! test -r "$withval" ; then
922 AC_MSG_WARN(Entropy socket is not readable)
923 fi
924 PRNGD_SOCKET="$withval"
925 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
926 fi
927 ]
928)
929
930# Change default command timeout for hashing entropy source
931entropy_timeout=200
932AC_ARG_WITH(entropy-timeout,
933 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
934 [
935 if test "x$withval" != "xno" ; then
936 entropy_timeout=$withval
937 fi
938 ]
939)
940
941AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
942
943# These programs are used by the command hashing source to gather entropy
944OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
945OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
946OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
947OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
948OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
949OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
950OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
951OSSH_PATH_ENTROPY_PROG(PROG_W, w)
952OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
953OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
954OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
955OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
956OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
957OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
958OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
959OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
960
961# Where does ssh-rand-helper get its randomness from?
962INSTALL_SSH_PRNG_CMDS=""
963if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
964 if test ! -z "$PRNGD_PORT" ; then
965 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
966 elif test ! -z "$PRNGD_SOCKET" ; then
967 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
968 else
969 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
970 RAND_HELPER_CMDHASH=yes
971 INSTALL_SSH_PRNG_CMDS="yes"
972 fi
973fi
974AC_SUBST(INSTALL_SSH_PRNG_CMDS)
975
976
Ben Lindstromb5628642000-10-18 00:02:25 +0000977# Cheap hack to ensure NEWS-OS libraries are arranged right.
978if test ! -z "$SONY" ; then
979 LIBS="$LIBS -liberty";
980fi
981
Damien Millera22ba012000-03-02 23:09:20 +1100982# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100983AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100984AC_CHECK_SIZEOF(short int, 2)
985AC_CHECK_SIZEOF(int, 4)
986AC_CHECK_SIZEOF(long int, 4)
987AC_CHECK_SIZEOF(long long int, 8)
988
Damien Millera22ba012000-03-02 23:09:20 +1100989# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100990AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
991 AC_TRY_COMPILE(
992 [ #include <sys/types.h> ],
993 [ u_int a; a = 1;],
994 [ ac_cv_have_u_int="yes" ],
995 [ ac_cv_have_u_int="no" ]
996 )
997])
998if test "x$ac_cv_have_u_int" = "xyes" ; then
999 AC_DEFINE(HAVE_U_INT)
1000 have_u_int=1
1001fi
1002
Damien Miller61e50f12000-05-08 20:49:37 +10001003AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1004 AC_TRY_COMPILE(
1005 [ #include <sys/types.h> ],
1006 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1007 [ ac_cv_have_intxx_t="yes" ],
1008 [ ac_cv_have_intxx_t="no" ]
1009 )
1010])
1011if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1012 AC_DEFINE(HAVE_INTXX_T)
1013 have_intxx_t=1
1014fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001015
1016if (test -z "$have_intxx_t" && \
1017 test "x$ac_cv_header_stdint_h" = "xyes")
1018then
1019 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1020 AC_TRY_COMPILE(
1021 [ #include <stdint.h> ],
1022 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1023 [
1024 AC_DEFINE(HAVE_INTXX_T)
1025 AC_MSG_RESULT(yes)
1026 ],
1027 [ AC_MSG_RESULT(no) ]
1028 )
1029fi
1030
Damien Miller578783e2000-09-23 14:12:24 +11001031AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1032 AC_TRY_COMPILE(
1033 [ #include <sys/types.h> ],
1034 [ int64_t a; a = 1;],
1035 [ ac_cv_have_int64_t="yes" ],
1036 [ ac_cv_have_int64_t="no" ]
1037 )
1038])
1039if test "x$ac_cv_have_int64_t" = "xyes" ; then
1040 AC_DEFINE(HAVE_INT64_T)
1041 have_int64_t=1
1042fi
1043
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001044if test -z "$have_int64_t" ; then
1045 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1046 AC_TRY_COMPILE(
1047 [ #include <sys/socket.h> ],
1048 [ int64_t a; a = 1],
1049 [
1050 AC_DEFINE(HAVE_INT64_T)
1051 AC_MSG_RESULT(yes)
1052 ],
1053 [ AC_MSG_RESULT(no) ]
1054 )
1055fi
1056
Damien Miller61e50f12000-05-08 20:49:37 +10001057AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1058 AC_TRY_COMPILE(
1059 [ #include <sys/types.h> ],
1060 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1061 [ ac_cv_have_u_intxx_t="yes" ],
1062 [ ac_cv_have_u_intxx_t="no" ]
1063 )
1064])
1065if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1066 AC_DEFINE(HAVE_U_INTXX_T)
1067 have_u_intxx_t=1
1068fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001069
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001070if test -z "$have_u_intxx_t" ; then
1071 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1072 AC_TRY_COMPILE(
1073 [ #include <sys/socket.h> ],
1074 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1075 [
1076 AC_DEFINE(HAVE_U_INTXX_T)
1077 AC_MSG_RESULT(yes)
1078 ],
1079 [ AC_MSG_RESULT(no) ]
1080 )
1081fi
1082
Damien Miller578783e2000-09-23 14:12:24 +11001083AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1084 AC_TRY_COMPILE(
1085 [ #include <sys/types.h> ],
1086 [ u_int64_t a; a = 1;],
1087 [ ac_cv_have_u_int64_t="yes" ],
1088 [ ac_cv_have_u_int64_t="no" ]
1089 )
1090])
1091if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1092 AC_DEFINE(HAVE_U_INT64_T)
1093 have_u_int64_t=1
1094fi
1095
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001096if test -z "$have_u_intxx_t" ; then
1097 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1098 AC_TRY_COMPILE(
1099 [
1100#include <sys/types.h>
1101 ],
1102 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1103 [ ac_cv_have_uintxx_t="yes" ],
1104 [ ac_cv_have_uintxx_t="no" ]
1105 )
1106 ])
1107 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1108 AC_DEFINE(HAVE_UINTXX_T)
1109 fi
1110fi
1111
1112if test -z "$have_uintxx_t" ; then
1113 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1114 AC_TRY_COMPILE(
1115 [ #include <stdint.h> ],
1116 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1117 [
1118 AC_DEFINE(HAVE_UINTXX_T)
1119 AC_MSG_RESULT(yes)
1120 ],
1121 [ AC_MSG_RESULT(no) ]
1122 )
1123fi
1124
Damien Milleredb82922000-06-20 13:25:52 +10001125if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1126 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001127then
1128 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1129 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001130 [
1131#include <sys/bitypes.h>
1132 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001133 [
Damien Miller70494d12000-04-03 15:57:06 +10001134 int8_t a; int16_t b; int32_t c;
1135 u_int8_t e; u_int16_t f; u_int32_t g;
1136 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001137 ],
1138 [
1139 AC_DEFINE(HAVE_U_INTXX_T)
1140 AC_DEFINE(HAVE_INTXX_T)
1141 AC_MSG_RESULT(yes)
1142 ],
1143 [AC_MSG_RESULT(no)]
1144 )
1145fi
1146
Damien Miller58be7382001-09-15 21:31:54 +10001147
1148AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1149 AC_TRY_COMPILE(
1150 [
1151#include <sys/types.h>
1152 ],
1153 [ u_char foo; foo = 125; ],
1154 [ ac_cv_have_u_char="yes" ],
1155 [ ac_cv_have_u_char="no" ]
1156 )
1157])
1158if test "x$ac_cv_have_u_char" = "xyes" ; then
1159 AC_DEFINE(HAVE_U_CHAR)
1160fi
1161
Tim Rice13aae5e2001-10-21 17:53:58 -07001162TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001163
Damien Miller61e50f12000-05-08 20:49:37 +10001164AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1165 AC_TRY_COMPILE(
1166 [
1167#include <sys/types.h>
1168 ],
1169 [ size_t foo; foo = 1235; ],
1170 [ ac_cv_have_size_t="yes" ],
1171 [ ac_cv_have_size_t="no" ]
1172 )
1173])
1174if test "x$ac_cv_have_size_t" = "xyes" ; then
1175 AC_DEFINE(HAVE_SIZE_T)
1176fi
Damien Miller95058511999-12-29 10:36:45 +11001177
Damien Miller615f9392000-05-17 22:53:33 +10001178AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1179 AC_TRY_COMPILE(
1180 [
1181#include <sys/types.h>
1182 ],
1183 [ ssize_t foo; foo = 1235; ],
1184 [ ac_cv_have_ssize_t="yes" ],
1185 [ ac_cv_have_ssize_t="no" ]
1186 )
1187])
1188if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1189 AC_DEFINE(HAVE_SSIZE_T)
1190fi
1191
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001192AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1193 AC_TRY_COMPILE(
1194 [
1195#include <time.h>
1196 ],
1197 [ clock_t foo; foo = 1235; ],
1198 [ ac_cv_have_clock_t="yes" ],
1199 [ ac_cv_have_clock_t="no" ]
1200 )
1201])
1202if test "x$ac_cv_have_clock_t" = "xyes" ; then
1203 AC_DEFINE(HAVE_CLOCK_T)
1204fi
1205
Damien Millerb54b40e2000-06-23 08:23:34 +10001206AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1207 AC_TRY_COMPILE(
1208 [
1209#include <sys/types.h>
1210#include <sys/socket.h>
1211 ],
1212 [ sa_family_t foo; foo = 1235; ],
1213 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001214 [ AC_TRY_COMPILE(
1215 [
1216#include <sys/types.h>
1217#include <sys/socket.h>
1218#include <netinet/in.h>
1219 ],
1220 [ sa_family_t foo; foo = 1235; ],
1221 [ ac_cv_have_sa_family_t="yes" ],
1222
Damien Millerb54b40e2000-06-23 08:23:34 +10001223 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001224 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001225 )
1226])
1227if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1228 AC_DEFINE(HAVE_SA_FAMILY_T)
1229fi
1230
Damien Miller0f91b4e2000-06-18 15:43:25 +10001231AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1232 AC_TRY_COMPILE(
1233 [
1234#include <sys/types.h>
1235 ],
1236 [ pid_t foo; foo = 1235; ],
1237 [ ac_cv_have_pid_t="yes" ],
1238 [ ac_cv_have_pid_t="no" ]
1239 )
1240])
1241if test "x$ac_cv_have_pid_t" = "xyes" ; then
1242 AC_DEFINE(HAVE_PID_T)
1243fi
1244
1245AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1246 AC_TRY_COMPILE(
1247 [
1248#include <sys/types.h>
1249 ],
1250 [ mode_t foo; foo = 1235; ],
1251 [ ac_cv_have_mode_t="yes" ],
1252 [ ac_cv_have_mode_t="no" ]
1253 )
1254])
1255if test "x$ac_cv_have_mode_t" = "xyes" ; then
1256 AC_DEFINE(HAVE_MODE_T)
1257fi
1258
Damien Miller61e50f12000-05-08 20:49:37 +10001259
1260AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1261 AC_TRY_COMPILE(
1262 [
Damien Miller81171112000-04-23 11:14:01 +10001263#include <sys/types.h>
1264#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001265 ],
1266 [ struct sockaddr_storage s; ],
1267 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1268 [ ac_cv_have_struct_sockaddr_storage="no" ]
1269 )
1270])
1271if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1272 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1273fi
Damien Miller34132e52000-01-14 15:45:46 +11001274
Damien Miller61e50f12000-05-08 20:49:37 +10001275AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1276 AC_TRY_COMPILE(
1277 [
Damien Miller7b22d652000-06-18 14:07:04 +10001278#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001279#include <netinet/in.h>
1280 ],
1281 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1282 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1283 [ ac_cv_have_struct_sockaddr_in6="no" ]
1284 )
1285])
1286if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1287 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1288fi
Damien Miller34132e52000-01-14 15:45:46 +11001289
Damien Miller61e50f12000-05-08 20:49:37 +10001290AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1291 AC_TRY_COMPILE(
1292 [
Damien Miller7b22d652000-06-18 14:07:04 +10001293#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001294#include <netinet/in.h>
1295 ],
1296 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1297 [ ac_cv_have_struct_in6_addr="yes" ],
1298 [ ac_cv_have_struct_in6_addr="no" ]
1299 )
1300])
1301if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1302 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1303fi
Damien Miller34132e52000-01-14 15:45:46 +11001304
Damien Miller61e50f12000-05-08 20:49:37 +10001305AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1306 AC_TRY_COMPILE(
1307 [
Damien Miller81171112000-04-23 11:14:01 +10001308#include <sys/types.h>
1309#include <sys/socket.h>
1310#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001311 ],
1312 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1313 [ ac_cv_have_struct_addrinfo="yes" ],
1314 [ ac_cv_have_struct_addrinfo="no" ]
1315 )
1316])
1317if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1318 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1319fi
1320
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001321AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1322 AC_TRY_COMPILE(
1323 [ #include <sys/time.h> ],
1324 [ struct timeval tv; tv.tv_sec = 1;],
1325 [ ac_cv_have_struct_timeval="yes" ],
1326 [ ac_cv_have_struct_timeval="no" ]
1327 )
1328])
1329if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1330 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1331 have_struct_timeval=1
1332fi
1333
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001334# If we don't have int64_t then we can't compile sftp-server. So don't
1335# even attempt to do it.
1336if test "x$ac_cv_have_int64_t" = "xno" -a \
1337 "x$ac_cv_sizeof_long_int" != "x8" -a \
1338 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1339 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001340else
1341dnl test snprintf (broken on SCO w/gcc)
1342 AC_TRY_RUN(
1343 [
1344#include <stdio.h>
1345#include <string.h>
1346#ifdef HAVE_SNPRINTF
1347main()
1348{
1349 char buf[50];
1350 char expected_out[50];
1351 int mazsize = 50 ;
1352#if (SIZEOF_LONG_INT == 8)
1353 long int num = 0x7fffffffffffffff;
1354#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001355 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001356#endif
1357 strcpy(expected_out, "9223372036854775807");
1358 snprintf(buf, mazsize, "%lld", num);
1359 if(strcmp(buf, expected_out) != 0)
1360 exit(1);
1361 exit(0);
1362}
1363#else
1364main() { exit(0); }
1365#endif
1366 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1367 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001368fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001369AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001370
Damien Miller78315eb2000-09-29 23:01:36 +11001371dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001372OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1373OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1374OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1375OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1376OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001377OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001378OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1379OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001380OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001381OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1382OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1383OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1384OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001385OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1386OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1387OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1388OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001389
1390AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001391
Damien Miller61e50f12000-05-08 20:49:37 +10001392AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1393 ac_cv_have_ss_family_in_struct_ss, [
1394 AC_TRY_COMPILE(
1395 [
Damien Miller81171112000-04-23 11:14:01 +10001396#include <sys/types.h>
1397#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001398 ],
1399 [ struct sockaddr_storage s; s.ss_family = 1; ],
1400 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1401 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1402 )
1403])
1404if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1405 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1406fi
1407
Damien Miller61e50f12000-05-08 20:49:37 +10001408AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1409 ac_cv_have___ss_family_in_struct_ss, [
1410 AC_TRY_COMPILE(
1411 [
Damien Miller81171112000-04-23 11:14:01 +10001412#include <sys/types.h>
1413#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001414 ],
1415 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1416 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1417 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1418 )
1419])
1420if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1421 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1422fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001423
Damien Millerad833b32000-08-23 10:46:23 +10001424AC_CACHE_CHECK([for pw_class field in struct passwd],
1425 ac_cv_have_pw_class_in_struct_passwd, [
1426 AC_TRY_COMPILE(
1427 [
Damien Millerad833b32000-08-23 10:46:23 +10001428#include <pwd.h>
1429 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001430 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001431 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1432 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1433 )
1434])
1435if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1436 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1437fi
1438
Kevin Steves82456952001-06-22 21:14:18 +00001439AC_CACHE_CHECK([for pw_expire field in struct passwd],
1440 ac_cv_have_pw_expire_in_struct_passwd, [
1441 AC_TRY_COMPILE(
1442 [
1443#include <pwd.h>
1444 ],
1445 [ struct passwd p; p.pw_expire = 0; ],
1446 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1447 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1448 )
1449])
1450if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1451 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1452fi
1453
1454AC_CACHE_CHECK([for pw_change field in struct passwd],
1455 ac_cv_have_pw_change_in_struct_passwd, [
1456 AC_TRY_COMPILE(
1457 [
1458#include <pwd.h>
1459 ],
1460 [ struct passwd p; p.pw_change = 0; ],
1461 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1462 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1466 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1467fi
Damien Miller61e50f12000-05-08 20:49:37 +10001468
1469AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1470 AC_TRY_LINK([],
1471 [ extern char *__progname; printf("%s", __progname); ],
1472 [ ac_cv_libc_defines___progname="yes" ],
1473 [ ac_cv_libc_defines___progname="no" ]
1474 )
1475])
1476if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1477 AC_DEFINE(HAVE___PROGNAME)
1478fi
1479
Damien Miller4f8e6692001-07-14 13:22:53 +10001480AC_CACHE_CHECK([whether getopt has optreset support],
1481 ac_cv_have_getopt_optreset, [
1482 AC_TRY_LINK(
1483 [
1484#include <getopt.h>
1485 ],
1486 [ extern int optreset; optreset = 0; ],
1487 [ ac_cv_have_getopt_optreset="yes" ],
1488 [ ac_cv_have_getopt_optreset="no" ]
1489 )
1490])
1491if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1492 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1493fi
Damien Millera22ba012000-03-02 23:09:20 +11001494
Damien Millerecbb26d2000-07-15 14:59:14 +10001495AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1496 AC_TRY_LINK([],
1497 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1498 [ ac_cv_libc_defines_sys_errlist="yes" ],
1499 [ ac_cv_libc_defines_sys_errlist="no" ]
1500 )
1501])
1502if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1503 AC_DEFINE(HAVE_SYS_ERRLIST)
1504fi
1505
1506
Damien Miller11fa2cc2000-08-16 10:35:58 +10001507AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1508 AC_TRY_LINK([],
1509 [ extern int sys_nerr; printf("%i", sys_nerr);],
1510 [ ac_cv_libc_defines_sys_nerr="yes" ],
1511 [ ac_cv_libc_defines_sys_nerr="no" ]
1512 )
1513])
1514if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1515 AC_DEFINE(HAVE_SYS_NERR)
1516fi
1517
1518
Damien Millerc79bc0d2001-03-28 13:03:42 +10001519# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001520SCARD_MSG="no"
1521AC_ARG_WITH(smartcard,
1522 [ --with-smartcard Enable smartcard support],
1523 [
1524 if test "x$withval" != "xno" ; then
1525 if test "x$withval" != "xyes" ; then
1526 CPPFLAGS="$CPPFLAGS -I${withval}"
1527 LDFLAGS="$LDFLAGS -L${withval}"
1528 if test ! -z "$need_dash_r" ; then
1529 LDFLAGS="$LDFLAGS -R${withval}"
1530 fi
1531 if test ! -z "$blibpath" ; then
1532 blibpath="$blibpath:${withval}"
1533 fi
1534 fi
1535 AC_CHECK_HEADERS(sectok.h)
1536 if test "$ac_cv_header_sectok_h" != yes; then
1537 AC_MSG_ERROR(Can't find sectok.h)
1538 fi
1539 AC_CHECK_LIB(sectok, sectok_open)
1540 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1541 AC_MSG_ERROR(Can't find libsectok)
1542 fi
1543 AC_DEFINE(SMARTCARD)
1544 SCARD_MSG="yes"
1545 fi
1546 ]
1547)
1548
1549# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001550KRB4_MSG="no"
1551AC_ARG_WITH(kerberos4,
1552 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1553 [
1554 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001555 if test "x$withval" != "xyes" ; then
1556 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1557 LDFLAGS="$LDFLAGS -L${withval}/lib"
1558 if test ! -z "$need_dash_r" ; then
1559 LDFLAGS="$LDFLAGS -R${withval}/lib"
1560 fi
1561 if test ! -z "$blibpath" ; then
1562 blibpath="$blibpath:${withval}/lib"
1563 fi
1564 else
1565 if test -d /usr/include/kerberosIV ; then
1566 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1567 fi
1568 fi
1569
1570 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001571 if test "$ac_cv_header_krb_h" != yes; then
1572 AC_MSG_WARN([Cannot find krb.h, build may fail])
1573 fi
Damien Miller98344742001-03-28 14:37:06 +10001574 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001575 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001576 AC_CHECK_LIB(krb4, main)
1577 if test "$ac_cv_lib_krb4_main" != yes; then
1578 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1579 else
1580 KLIBS="-lkrb4"
1581 fi
1582 else
1583 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001584 fi
Damien Miller98344742001-03-28 14:37:06 +10001585 AC_CHECK_LIB(des, des_cbc_encrypt)
1586 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1587 AC_CHECK_LIB(des425, des_cbc_encrypt)
1588 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1589 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1590 else
1591 KLIBS="-ldes425"
1592 fi
1593 else
1594 KLIBS="-ldes"
1595 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001596 AC_CHECK_LIB(resolv, dn_expand, , )
1597 KRB4=yes
1598 KRB4_MSG="yes"
1599 AC_DEFINE(KRB4)
1600 fi
1601 ]
1602)
1603
1604# Check whether user wants AFS support
1605AFS_MSG="no"
1606AC_ARG_WITH(afs,
1607 [ --with-afs=PATH Enable AFS support],
1608 [
1609 if test "x$withval" != "xno" ; then
1610
1611 if test "x$withval" != "xyes" ; then
1612 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1613 LDFLAGS="$LDFLAGS -L${withval}/lib"
1614 fi
1615
1616 if test -z "$KRB4" ; then
1617 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1618 fi
1619
1620 LIBS="-lkafs $LIBS"
1621 if test ! -z "$AFS_LIBS" ; then
1622 LIBS="$LIBS $AFS_LIBS"
1623 fi
1624 AC_DEFINE(AFS)
1625 AFS_MSG="yes"
1626 fi
1627 ]
1628)
1629LIBS="$LIBS $KLIBS"
1630
Damien Millera22ba012000-03-02 23:09:20 +11001631# Looking for programs, paths and files
1632AC_ARG_WITH(rsh,
1633 [ --with-rsh=PATH Specify path to remote shell program ],
1634 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001635 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001636 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001637 fi
1638 ],
1639 [
1640 AC_PATH_PROG(rsh_path, rsh)
1641 ]
1642)
1643
1644AC_ARG_WITH(xauth,
1645 [ --with-xauth=PATH Specify path to xauth program ],
1646 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001647 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001648 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001649 fi
1650 ],
1651 [
Damien Miller78315eb2000-09-29 23:01:36 +11001652 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 +10001653 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001654 xauth_path="/usr/openwin/bin/xauth"
1655 fi
1656 ]
1657)
1658
Damien Millera19cf472000-11-29 13:28:50 +11001659if test -z "$xauth_path" ; then
1660 XAUTH_PATH="undefined"
1661 AC_SUBST(XAUTH_PATH)
1662else
Damien Millera22ba012000-03-02 23:09:20 +11001663 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001664 XAUTH_PATH=$xauth_path
1665 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001666fi
1667if test ! -z "$rsh_path" ; then
1668 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1669fi
1670
1671# Check for mail directory (last resort if we cannot get it from headers)
1672if test ! -z "$MAIL" ; then
1673 maildir=`dirname $MAIL`
1674 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1675fi
1676
Damien Millera22ba012000-03-02 23:09:20 +11001677if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001678 AC_CHECK_FILE("/dev/ptmx",
1679 [
1680 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1681 have_dev_ptmx=1
1682 ]
1683 )
Damien Millera22ba012000-03-02 23:09:20 +11001684fi
Damien Miller204ad072000-03-02 23:56:12 +11001685AC_CHECK_FILE("/dev/ptc",
1686 [
1687 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1688 have_dev_ptc=1
1689 ]
1690)
1691
Damien Millera22ba012000-03-02 23:09:20 +11001692# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001693AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001694 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001695 [
Damien Miller897741e2001-04-16 10:41:46 +10001696 case "$withval" in
1697 man|cat|doc)
1698 MANTYPE=$withval
1699 ;;
1700 *)
1701 AC_MSG_ERROR(invalid man type: $withval)
1702 ;;
1703 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001704 ]
1705)
Ben Lindstrombc709922001-04-18 18:04:21 +00001706if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001707 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001708 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1709 MANTYPE=doc
1710 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1711 MANTYPE=man
1712 else
1713 MANTYPE=cat
1714 fi
1715fi
Damien Miller670a4b82000-01-22 13:53:11 +11001716AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001717if test "$MANTYPE" = "doc"; then
1718 mansubdir=man;
1719else
1720 mansubdir=$MANTYPE;
1721fi
1722AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001723
Damien Millera22ba012000-03-02 23:09:20 +11001724# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001725MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001726AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001727 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001728 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001729 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001730 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001731 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001732 fi
1733 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001734)
1735
Damien Millera22ba012000-03-02 23:09:20 +11001736# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001737AC_ARG_WITH(shadow,
1738 [ --without-shadow Disable shadow password support],
1739 [
1740 if test "x$withval" = "xno" ; then
1741 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001742 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001743 fi
1744 ]
1745)
1746
Damien Miller1f335fb2000-06-26 11:31:33 +10001747if test -z "$disable_shadow" ; then
1748 AC_MSG_CHECKING([if the systems has expire shadow information])
1749 AC_TRY_COMPILE(
1750 [
1751#include <sys/types.h>
1752#include <shadow.h>
1753 struct spwd sp;
1754 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1755 [ sp_expire_available=yes ], []
1756 )
1757
1758 if test "x$sp_expire_available" = "xyes" ; then
1759 AC_MSG_RESULT(yes)
1760 AC_DEFINE(HAS_SHADOW_EXPIRE)
1761 else
1762 AC_MSG_RESULT(no)
1763 fi
1764fi
1765
Damien Millera22ba012000-03-02 23:09:20 +11001766# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001767if test ! -z "$IPADDR_IN_DISPLAY" ; then
1768 DISPLAY_HACK_MSG="yes"
1769 AC_DEFINE(IPADDR_IN_DISPLAY)
1770else
1771 DISPLAY_HACK_MSG="no"
1772 AC_ARG_WITH(ipaddr-display,
1773 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1774 [
1775 if test "x$withval" != "xno" ; then
1776 AC_DEFINE(IPADDR_IN_DISPLAY)
1777 DISPLAY_HACK_MSG="yes"
1778 fi
1779 ]
1780 )
1781fi
Damien Miller76112de1999-12-21 11:18:08 +11001782
Damien Millera22ba012000-03-02 23:09:20 +11001783# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001784SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001785AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001786 [ --with-default-path=PATH Specify default \$PATH environment for server],
1787 [
1788 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001789 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001790 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001791 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001792 ],
1793 [
1794 AC_TRY_RUN(
1795 [
1796/* find out what STDPATH is */
1797#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001798#ifdef HAVE_PATHS_H
1799# include <paths.h>
1800#endif
1801#ifndef _PATH_STDPATH
1802# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1803#endif
1804#include <sys/types.h>
1805#include <sys/stat.h>
1806#include <fcntl.h>
1807#define DATA "conftest.stdpath"
1808
1809main()
1810{
1811 FILE *fd;
1812 int rc;
1813
1814 fd = fopen(DATA,"w");
1815 if(fd == NULL)
1816 exit(1);
1817
1818 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1819 exit(1);
1820
1821 exit(0);
1822}
1823 ], [ user_path=`cat conftest.stdpath` ],
1824 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1825 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1826 )
1827# make sure $bindir is in USER_PATH so scp will work
1828 t_bindir=`eval echo ${bindir}`
1829 case $t_bindir in
1830 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1831 esac
1832 case $t_bindir in
1833 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1834 esac
1835 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1836 if test $? -ne 0 ; then
1837 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1838 if test $? -ne 0 ; then
1839 user_path=$user_path:$t_bindir
1840 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1841 fi
1842 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001843 ]
1844)
Tim Rice59ea0a02001-03-10 13:50:45 -08001845AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1846AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001847
Damien Millera22ba012000-03-02 23:09:20 +11001848# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001849IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001850AC_ARG_WITH(ipv4-default,
1851 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1852 [
1853 if test "x$withval" != "xno" ; then
1854 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001855 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001856 fi
1857 ]
1858)
1859
Damien Miller61e50f12000-05-08 20:49:37 +10001860AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001861IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001862AC_ARG_WITH(4in6,
1863 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1864 [
1865 if test "x$withval" != "xno" ; then
1866 AC_MSG_RESULT(yes)
1867 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001868 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001869 else
1870 AC_MSG_RESULT(no)
1871 fi
1872 ],[
1873 if test "x$inet6_default_4in6" = "xyes"; then
1874 AC_MSG_RESULT([yes (default)])
1875 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001876 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001877 else
1878 AC_MSG_RESULT([no (default)])
1879 fi
1880 ]
1881)
1882
Damien Miller60396b02001-02-18 17:01:00 +11001883# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11001884BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11001885AC_ARG_WITH(bsd-auth,
1886 [ --with-bsd-auth Enable BSD auth support],
1887 [
1888 if test "x$withval" != "xno" ; then
1889 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11001890 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11001891 fi
1892 ]
1893)
1894
Damien Miller78315eb2000-09-29 23:01:36 +11001895AC_MSG_CHECKING(whether to install ssh as suid root)
1896AC_ARG_ENABLE(suid-ssh,
1897[ --enable-suid-ssh Install ssh as suid root (default)
1898 --disable-suid-ssh Install ssh without suid bit],
1899[ case "$enableval" in
1900 no)
1901 AC_MSG_RESULT(no)
1902 SSHMODE=0711
1903 ;;
1904 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001905 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001906 ;;
1907 esac ],
1908 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001909 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001910)
1911AC_SUBST(SSHMODE)
1912
1913
Damien Millera22ba012000-03-02 23:09:20 +11001914# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001915piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001916AC_ARG_WITH(pid-dir,
1917 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1918 [
1919 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001920 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001921 fi
1922 ]
1923)
Damien Miller4018c192000-04-30 09:30:44 +10001924
Damien Miller78315eb2000-09-29 23:01:36 +11001925# make sure the directory exists
1926if test ! -d $piddir ; then
1927 piddir=`eval echo ${sysconfdir}`
1928 case $piddir in
1929 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1930 esac
1931fi
1932
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001933AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001934AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001935
andre2ff7b5d2000-06-03 14:57:40 +00001936dnl allow user to disable some login recording features
1937AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001938 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001939 [ AC_DEFINE(DISABLE_LASTLOG) ]
1940)
1941AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001942 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001943 [ AC_DEFINE(DISABLE_UTMP) ]
1944)
1945AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001946 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001947 [ AC_DEFINE(DISABLE_UTMPX) ]
1948)
1949AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001950 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001951 [ AC_DEFINE(DISABLE_WTMP) ]
1952)
1953AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001954 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001955 [ AC_DEFINE(DISABLE_WTMPX) ]
1956)
1957AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001958 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001959 [ AC_DEFINE(DISABLE_LOGIN) ]
1960)
1961AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001962 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001963 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1964)
1965AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001966 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001967 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1968)
1969AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001970 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001971 [
1972 if test "x$withval" = "xno" ; then
1973 AC_DEFINE(DISABLE_LASTLOG)
1974 else
1975 conf_lastlog_location=$withval
1976 fi
1977 ]
1978)
andre2ff7b5d2000-06-03 14:57:40 +00001979
1980dnl lastlog, [uw]tmpx? detection
1981dnl NOTE: set the paths in the platform section to avoid the
1982dnl need for command-line parameters
1983dnl lastlog and [uw]tmp are subject to a file search if all else fails
1984
1985dnl lastlog detection
1986dnl NOTE: the code itself will detect if lastlog is a directory
1987AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1988AC_TRY_COMPILE([
1989#include <sys/types.h>
1990#include <utmp.h>
1991#ifdef HAVE_LASTLOG_H
1992# include <lastlog.h>
1993#endif
Damien Miller2994e082000-06-04 15:51:47 +10001994#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001995# include <paths.h>
1996#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001997#ifdef HAVE_LOGIN_H
1998# include <login.h>
1999#endif
andre2ff7b5d2000-06-03 14:57:40 +00002000 ],
2001 [ char *lastlog = LASTLOG_FILE; ],
2002 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002003 [
2004 AC_MSG_RESULT(no)
2005 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2006 AC_TRY_COMPILE([
2007#include <sys/types.h>
2008#include <utmp.h>
2009#ifdef HAVE_LASTLOG_H
2010# include <lastlog.h>
2011#endif
2012#ifdef HAVE_PATHS_H
2013# include <paths.h>
2014#endif
2015 ],
2016 [ char *lastlog = _PATH_LASTLOG; ],
2017 [ AC_MSG_RESULT(yes) ],
2018 [
andree441aa32000-06-12 22:34:38 +00002019 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002020 system_lastlog_path=no
2021 ])
2022 ]
andre2ff7b5d2000-06-03 14:57:40 +00002023)
Damien Miller2994e082000-06-04 15:51:47 +10002024
andre2ff7b5d2000-06-03 14:57:40 +00002025if test -z "$conf_lastlog_location"; then
2026 if test x"$system_lastlog_path" = x"no" ; then
2027 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002028 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002029 conf_lastlog_location=$f
2030 fi
2031 done
2032 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002033 AC_MSG_WARN([** Cannot find lastlog **])
2034 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002035 fi
2036 fi
2037fi
2038
2039if test -n "$conf_lastlog_location"; then
2040 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2041fi
2042
2043dnl utmp detection
2044AC_MSG_CHECKING([if your system defines UTMP_FILE])
2045AC_TRY_COMPILE([
2046#include <sys/types.h>
2047#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002048#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002049# include <paths.h>
2050#endif
2051 ],
2052 [ char *utmp = UTMP_FILE; ],
2053 [ AC_MSG_RESULT(yes) ],
2054 [ AC_MSG_RESULT(no)
2055 system_utmp_path=no ]
2056)
2057if test -z "$conf_utmp_location"; then
2058 if test x"$system_utmp_path" = x"no" ; then
2059 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2060 if test -f $f ; then
2061 conf_utmp_location=$f
2062 fi
2063 done
2064 if test -z "$conf_utmp_location"; then
2065 AC_DEFINE(DISABLE_UTMP)
2066 fi
2067 fi
2068fi
2069if test -n "$conf_utmp_location"; then
2070 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2071fi
2072
2073dnl wtmp detection
2074AC_MSG_CHECKING([if your system defines WTMP_FILE])
2075AC_TRY_COMPILE([
2076#include <sys/types.h>
2077#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002078#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002079# include <paths.h>
2080#endif
2081 ],
2082 [ char *wtmp = WTMP_FILE; ],
2083 [ AC_MSG_RESULT(yes) ],
2084 [ AC_MSG_RESULT(no)
2085 system_wtmp_path=no ]
2086)
2087if test -z "$conf_wtmp_location"; then
2088 if test x"$system_wtmp_path" = x"no" ; then
2089 for f in /usr/adm/wtmp /var/log/wtmp; do
2090 if test -f $f ; then
2091 conf_wtmp_location=$f
2092 fi
2093 done
2094 if test -z "$conf_wtmp_location"; then
2095 AC_DEFINE(DISABLE_WTMP)
2096 fi
2097 fi
2098fi
2099if test -n "$conf_wtmp_location"; then
2100 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2101fi
2102
2103
2104dnl utmpx detection - I don't know any system so perverse as to require
2105dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2106dnl there, though.
2107AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2108AC_TRY_COMPILE([
2109#include <sys/types.h>
2110#include <utmp.h>
2111#ifdef HAVE_UTMPX_H
2112#include <utmpx.h>
2113#endif
Damien Miller2994e082000-06-04 15:51:47 +10002114#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002115# include <paths.h>
2116#endif
2117 ],
2118 [ char *utmpx = UTMPX_FILE; ],
2119 [ AC_MSG_RESULT(yes) ],
2120 [ AC_MSG_RESULT(no)
2121 system_utmpx_path=no ]
2122)
2123if test -z "$conf_utmpx_location"; then
2124 if test x"$system_utmpx_path" = x"no" ; then
2125 AC_DEFINE(DISABLE_UTMPX)
2126 fi
2127else
2128 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2129fi
2130
2131dnl wtmpx detection
2132AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2133AC_TRY_COMPILE([
2134#include <sys/types.h>
2135#include <utmp.h>
2136#ifdef HAVE_UTMPX_H
2137#include <utmpx.h>
2138#endif
Damien Miller2994e082000-06-04 15:51:47 +10002139#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002140# include <paths.h>
2141#endif
2142 ],
2143 [ char *wtmpx = WTMPX_FILE; ],
2144 [ AC_MSG_RESULT(yes) ],
2145 [ AC_MSG_RESULT(no)
2146 system_wtmpx_path=no ]
2147)
2148if test -z "$conf_wtmpx_location"; then
2149 if test x"$system_wtmpx_path" = x"no" ; then
2150 AC_DEFINE(DISABLE_WTMPX)
2151 fi
2152else
2153 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2154fi
2155
Damien Miller4018c192000-04-30 09:30:44 +10002156
Damien Miller29ea30d2000-03-17 10:54:15 +11002157if test ! -z "$blibpath" ; then
2158 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2159 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2160fi
2161
Damien Millerbac2d8a2000-09-05 16:13:06 +11002162AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002163AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2164AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002165
Damien Miller7b22d652000-06-18 14:07:04 +10002166# Print summary of options
2167
Damien Miller7b22d652000-06-18 14:07:04 +10002168# Someone please show me a better way :)
2169A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2170B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2171C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2172D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002173E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002174F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002175G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002176H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002177
2178echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002179echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002180echo " User binaries: $B"
2181echo " System binaries: $C"
2182echo " Configuration files: $D"
2183echo " Askpass program: $E"
2184echo " Manual pages: $F"
2185echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002186echo " sshd default user PATH: $H"
Damien Miller897741e2001-04-16 10:41:46 +10002187echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002188echo " PAM support: ${PAM_MSG}"
2189echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002190echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002191echo " AFS support: $AFS_MSG"
2192echo " S/KEY support: $SKEY_MSG"
2193echo " TCP Wrappers support: $TCPW_MSG"
2194echo " MD5 password support: $MD5_MSG"
2195echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2196echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2197echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002198echo " BSD Auth support: $BSD_AUTH_MSG"
2199echo " Random number source: $RAND_MSG"
2200if test ! -z "$USE_RAND_HELPER" ; then
2201 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002202fi
2203
Damien Miller7b22d652000-06-18 14:07:04 +10002204echo ""
2205
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002206echo " Host: ${host}"
2207echo " Compiler: ${CC}"
2208echo " Compiler flags: ${CFLAGS}"
2209echo "Preprocessor flags: ${CPPFLAGS}"
2210echo " Linker flags: ${LDFLAGS}"
2211echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002212
2213echo ""
2214
Damien Miller82cf0ce2000-12-20 13:34:48 +11002215if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002216 echo "PAM is enabled. You may need to install a PAM control file "
2217 echo "for sshd, otherwise password authentication may fail. "
2218 echo "Example PAM control files can be found in the contrib/ "
2219 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002220 echo ""
2221fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002222
2223if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002224 echo "sftp-server will be disabled. Your compiler does not "
2225 echo "support 64bit integers."
2226 echo ""
2227fi
2228
2229if test ! -z "$RAND_HELPER_CMDHASH" ; then
2230 echo "WARNING: you are using the builtin random number collection "
2231 echo "service. Please read WARNING.RNG and request that your OS "
2232 echo "vendor includes kernel-based random number collection in "
2233 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002234 echo ""
2235fi
Damien Miller60396b02001-02-18 17:01:00 +11002236