blob: 62eeac0b6eca4b1713cba239e959fa99e6bae528 [file] [log] [blame]
Damien Miller150c8b52002-02-13 23:06:56 +11001# $Id: configure.ac,v 1.18 2002/02/13 12:06:57 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
Damien Miller150c8b52002-02-13 23:06:56 +1100336AC_ARG_WITH(rpath,
337 [ --without-rpath Disable auto-added -R linker paths],
338 [
339 if test "x$withval" = "xno" ; then
340 need_dash_r=""
341 fi
342 if test "x$withval" = "xyes" ; then
343 need_dash_r=1
344 fi
345 ]
346)
347
Tim Rice13aae5e2001-10-21 17:53:58 -0700348dnl zlib is required
349AC_ARG_WITH(zlib,
350 [ --with-zlib=PATH Use zlib in PATH],
351 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000352 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100353 AC_MSG_ERROR([*** zlib is required ***])
354 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700355 if test -d "$withval/lib"; then
356 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700357 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700358 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700359 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700360 fi
361 else
362 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700363 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700364 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700365 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700366 fi
367 fi
368 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700369 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700370 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700371 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700372 fi
373 ]
374)
375
Tim Rice17b93e52001-10-23 22:36:54 -0700376AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100377
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000378dnl UnixWare 2.x
379AC_CHECK_FUNC(strcasecmp,
380 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
381)
382AC_CHECK_FUNC(utimes,
383 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
384)
Damien Millerab18c411999-11-11 10:40:23 +1100385
Tim Ricee589a292001-11-03 11:09:32 -0800386dnl Checks for libutil functions
387AC_CHECK_HEADERS(libutil.h)
388AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
389AC_CHECK_FUNCS(logout updwtmp logwtmp)
390
Ben Lindstrom8697e082001-02-24 21:41:10 +0000391AC_FUNC_STRFTIME
392
Damien Millera22ba012000-03-02 23:09:20 +1100393# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700394AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
Tim Rice17b93e52001-10-23 22:36:54 -0700395 getopt.h glob.h lastlog.h limits.h login.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700396 login_cap.h maillock.h netdb.h netgroup.h \
Ben Lindstromc97b1af2001-12-07 17:20:47 +0000397 netinet/in_systm.h paths.h poll.h pty.h \
Tim Rice13aae5e2001-10-21 17:53:58 -0700398 security/pam_appl.h shadow.h stddef.h stdint.h \
399 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
400 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
401 sys/stropts.h sys/sysmacros.h sys/time.h \
402 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
403 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100404
405# Check for ALTDIRFUNC glob() extension
406AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
407AC_EGREP_CPP(FOUNDIT,
408 [
409 #include <glob.h>
410 #ifdef GLOB_ALTDIRFUNC
411 FOUNDIT
412 #endif
413 ],
414 [
415 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
416 AC_MSG_RESULT(yes)
417 ],
418 [
419 AC_MSG_RESULT(no)
420 ]
421)
Damien Millerab18c411999-11-11 10:40:23 +1100422
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000423# Check for g.gl_matchc glob() extension
424AC_MSG_CHECKING(for gl_matchc field in glob_t)
425AC_EGREP_CPP(FOUNDIT,
426 [
427 #include <glob.h>
428 int main(void){glob_t g; g.gl_matchc = 1;}
429 ],
430 [
431 AC_DEFINE(GLOB_HAS_GL_MATCHC)
432 AC_MSG_RESULT(yes)
433 ],
434 [
435 AC_MSG_RESULT(no)
436 ]
437)
438
Damien Miller18bb4732001-03-28 14:35:30 +1000439AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
440AC_TRY_RUN(
441 [
442#include <sys/types.h>
443#include <dirent.h>
444int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
445 ],
446 [AC_MSG_RESULT(yes)],
447 [
448 AC_MSG_RESULT(no)
449 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
450 ]
451)
452
Damien Millerc547bf12001-02-16 10:18:12 +1100453# Check whether user wants S/Key support
454SKEY_MSG="no"
455AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700456 [ --with-skey[[=PATH]] Enable S/Key support
457 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100458 [
459 if test "x$withval" != "xno" ; then
460
461 if test "x$withval" != "xyes" ; then
462 CPPFLAGS="$CPPFLAGS -I${withval}/include"
463 LDFLAGS="$LDFLAGS -L${withval}/lib"
464 fi
465
466 AC_DEFINE(SKEY)
467 LIBS="-lskey $LIBS"
468 SKEY_MSG="yes"
469
470 AC_CHECK_FUNC(skey_keyinfo,
471 [],
472 [
473 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
474 ])
475 fi
476 ]
477)
478
479# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700480TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100481AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700482 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
483 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100484 [
485 if test "x$withval" != "xno" ; then
486 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700487 saved_LDFLAGS="$LDFLAGS"
488 saved_CPPFLAGS="$CPPFLAGS"
489 if test -n "${withval}" -a "${withval}" != "yes"; then
490 if test -d "${withval}/lib"; then
491 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700492 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700493 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700494 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700495 fi
496 else
497 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700498 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700499 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700500 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700501 fi
502 fi
503 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700504 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700505 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700506 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700507 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700508 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100509 LIBS="-lwrap $LIBS"
510 AC_MSG_CHECKING(for libwrap)
511 AC_TRY_LINK(
512 [
513#include <tcpd.h>
514 int deny_severity = 0, allow_severity = 0;
515 ],
516 [hosts_access(0);],
517 [
518 AC_MSG_RESULT(yes)
519 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700520 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100521 ],
522 [
523 AC_MSG_ERROR([*** libwrap missing])
524 ]
525 )
526 fi
527 ]
528)
529
Damien Millerad833b32000-08-23 10:46:23 +1000530dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700531AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
532 clock fchmod fchown freeaddrinfo futimes gai_strerror \
533 getaddrinfo getcwd getgrouplist getnameinfo getopt \
534 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
535 inet_ntop innetgr login_getcapbool md5_crypt memmove \
536 mkdtemp on_exit openpty readpassphrase realpath \
537 rresvport_af setdtablesize setegid setenv seteuid \
538 setlogin setproctitle setresgid setreuid setrlimit \
539 setsid setvbuf sigaction sigvec snprintf strerror \
540 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
541 vhangup vsnprintf waitpid __b64_ntop _getpty)
542
543dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700544AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700545 AC_CHECK_LIB(gen, dirname,[
546 AC_CACHE_CHECK([for broken dirname],
547 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700548 save_LIBS="$LIBS"
549 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700550 AC_TRY_RUN(
551 [
552#include <libgen.h>
553#include <string.h>
554
555int main(int argc, char **argv) {
556 char *s, buf[32];
557
558 strncpy(buf,"/etc", 32);
559 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700560 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700561 exit(1);
562 } else {
563 exit(0);
564 }
565}
566 ],
567 [ ac_cv_have_broken_dirname="no" ],
568 [ ac_cv_have_broken_dirname="yes" ]
569 )
Tim Rice17b93e52001-10-23 22:36:54 -0700570 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700571 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700572 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700573 LIBS="$LIBS -lgen"
574 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700575 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700576 fi
577 ])
578])
579
Damien Millerad833b32000-08-23 10:46:23 +1000580dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000581AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000582dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000583AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000584AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000585dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000586AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000587AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100588
Damien Miller5fc85652000-07-09 23:53:07 +1000589AC_CHECK_FUNC(getuserattr,
590 [AC_DEFINE(HAVE_GETUSERATTR)],
591 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
592)
593
Damien Miller04f80141999-11-19 15:32:34 +1100594AC_CHECK_FUNC(daemon,
595 [AC_DEFINE(HAVE_DAEMON)],
596 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
597)
598
Damien Miller9fb07e42000-03-05 16:22:59 +1100599AC_CHECK_FUNC(getpagesize,
600 [AC_DEFINE(HAVE_GETPAGESIZE)],
601 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
602)
603
Damien Millercb170cb2000-07-01 16:52:55 +1000604# Check for broken snprintf
605if test "x$ac_cv_func_snprintf" = "xyes" ; then
606 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
607 AC_TRY_RUN(
608 [
609#include <stdio.h>
610int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
611 ],
612 [AC_MSG_RESULT(yes)],
613 [
614 AC_MSG_RESULT(no)
615 AC_DEFINE(BROKEN_SNPRINTF)
616 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
617 ]
618 )
619fi
620
Damien Miller606f8802000-09-16 15:39:56 +1100621AC_FUNC_GETPGRP
622
Damien Millera64b57a2001-01-17 10:44:13 +1100623# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000624PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100625AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100626 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100627 [
Damien Millera64b57a2001-01-17 10:44:13 +1100628 if test "x$withval" != "xno" ; then
629 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
630 AC_MSG_ERROR([PAM headers not found])
631 fi
632
633 AC_CHECK_LIB(dl, dlopen, , )
634 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
635 AC_CHECK_FUNCS(pam_getenvlist)
636
637 disable_shadow=yes
638 PAM_MSG="yes"
639
640 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100641 fi
642 ]
643)
Damien Millera22ba012000-03-02 23:09:20 +1100644
Damien Millera64b57a2001-01-17 10:44:13 +1100645# Check for older PAM
646if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100647 # Check PAM strerror arguments (old PAM)
648 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
649 AC_TRY_COMPILE(
650 [
Damien Miller81171112000-04-23 11:14:01 +1000651#include <stdlib.h>
652#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100653 ],
654 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
655 [AC_MSG_RESULT(no)],
656 [
657 AC_DEFINE(HAVE_OLD_PAM)
658 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000659 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100660 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100661 )
Damien Millera22ba012000-03-02 23:09:20 +1100662fi
663
664# The big search for OpenSSL
665AC_ARG_WITH(ssl-dir,
666 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
667 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000668 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100669 tryssldir=$withval
670 fi
671 ]
672)
673
674saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100675saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000676saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100677if test "x$prefix" != "xNONE" ; then
678 tryssldir="$tryssldir $prefix"
679fi
Damien Miller61e50f12000-05-08 20:49:37 +1000680AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100681 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 +1100682 CPPFLAGS="$saved_CPPFLAGS"
683 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000684 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100685
686 # Skip directories if they don't exist
687 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
688 continue;
689 fi
690 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
691 # Try to use $ssldir/lib if it exists, otherwise
692 # $ssldir
693 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000694 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100695 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000696 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100697 fi
698 else
Damien Millerb68af622001-03-28 21:05:26 +1000699 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100700 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000701 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100702 fi
703 fi
704 # Try to use $ssldir/include if it exists, otherwise
705 # $ssldir
706 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000707 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100708 else
Damien Millerb68af622001-03-28 21:05:26 +1000709 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100710 fi
711 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000712
Damien Miller3b512e12000-05-17 23:29:18 +1000713 # Basic test to check for compatible version and correct linking
714 # *does not* test for RSA - that comes later.
715 AC_TRY_RUN(
716 [
Damien Millere59ce622000-05-01 20:54:17 +1000717#include <string.h>
718#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000719int main(void)
720{
Damien Miller3b512e12000-05-17 23:29:18 +1000721 char a[2048];
722 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000723 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000724 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000725}
Damien Miller3b512e12000-05-17 23:29:18 +1000726 ],
727 [
728 found_crypto=1
729 break;
730 ], []
731 )
Damien Miller61e50f12000-05-08 20:49:37 +1000732
733 if test ! -z "$found_crypto" ; then
734 break;
735 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100736 done
737
Damien Miller61e50f12000-05-08 20:49:37 +1000738 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100739 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100740 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000741 if test -z "$ssldir" ; then
742 ssldir="(system)"
743 fi
Damien Millera22ba012000-03-02 23:09:20 +1100744
Damien Miller61e50f12000-05-08 20:49:37 +1000745 ac_cv_openssldir=$ssldir
746])
747
Damien Milleredb82922000-06-20 13:25:52 +1000748if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000749 AC_DEFINE(HAVE_OPENSSL)
750 dnl Need to recover ssldir - test above runs in subshell
751 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100752 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100753 # Try to use $ssldir/lib if it exists, otherwise
754 # $ssldir
755 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000756 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100757 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000758 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100759 fi
760 else
Damien Millerb68af622001-03-28 21:05:26 +1000761 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100762 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000763 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100764 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100765 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100766 # Try to use $ssldir/include if it exists, otherwise
767 # $ssldir
768 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000769 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100770 else
Damien Millerb68af622001-03-28 21:05:26 +1000771 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100772 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100773 fi
Damien Millera22ba012000-03-02 23:09:20 +1100774fi
Damien Miller3b512e12000-05-17 23:29:18 +1000775LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000776
Damien Miller3b512e12000-05-17 23:29:18 +1000777# Now test RSA support
778saved_LIBS="$LIBS"
779AC_MSG_CHECKING([for RSA support])
780for WANTS_RSAREF in "" 1 ; do
781 if test -z "$WANTS_RSAREF" ; then
782 LIBS="$saved_LIBS"
783 else
784 LIBS="$saved_LIBS -lRSAglue -lrsaref"
785 fi
786 AC_TRY_RUN([
787#include <string.h>
788#include <openssl/rand.h>
789#include <openssl/rsa.h>
790#include <openssl/bn.h>
791#include <openssl/sha.h>
792int main(void)
793{
794 int num; RSA *key; static unsigned char p_in[] = "blahblah";
795 unsigned char c[256], p[256];
796 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
797 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
798 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
799 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
800}
801 ],
802 [
803 rsa_works=1
804 break;
805 ], [])
806done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000807LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000808
809if test ! -z "$no_rsa" ; then
810 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000811 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000812else
813 if test -z "$rsa_works" ; then
814 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000815 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000816 else
817 if test -z "$WANTS_RSAREF" ; then
818 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000819 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000820 else
Damien Miller7b22d652000-06-18 14:07:04 +1000821 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000822 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000823 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000824 fi
825 fi
826fi
Damien Millera22ba012000-03-02 23:09:20 +1100827
Damien Millerec932372002-01-22 22:16:03 +1100828# Sanity check OpenSSL headers
829AC_MSG_CHECKING([whether OpenSSL's headers match the library])
830AC_TRY_RUN(
831 [
832#include <string.h>
833#include <openssl/opensslv.h>
834int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
835 ],
836 [
837 AC_MSG_RESULT(yes)
838 ],
839 [
840 AC_MSG_RESULT(no)
841 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
842 ]
843)
844
Damien Millera64b57a2001-01-17 10:44:13 +1100845# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
846# version in OpenSSL. Skip this for PAM
847if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100848 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100849fi
850
Damien Miller6c21c512002-01-22 21:57:53 +1100851
852### Configure cryptographic random number support
853
854# Check wheter OpenSSL seeds itself
855AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
856AC_TRY_RUN(
857 [
858#include <string.h>
859#include <openssl/rand.h>
860int main(void) { return(RAND_status() == 1 ? 0 : 1); }
861 ],
862 [
863 OPENSSL_SEEDS_ITSELF=yes
864 AC_MSG_RESULT(yes)
865 ],
866 [
867 AC_MSG_RESULT(no)
868 # Default to use of the rand helper if OpenSSL doesn't
869 # seed itself
870 USE_RAND_HELPER=yes
871 ]
872)
873
874
875# Do we want to force the use of the rand helper?
876AC_ARG_WITH(rand-helper,
877 [ --with-rand-helper Use subprocess to gather strong randomness ],
878 [
879 if test "x$withval" = "xno" ; then
880 # Force use of OpenSSL's internal RNG, even if
881 # the previous test showed it to be unseeded.
882 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
883 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
884 OPENSSL_SEEDS_ITSELF=yes
885 USE_RAND_HELPER=""
886 fi
887 else
888 USE_RAND_HELPER=yes
889 fi
890 ],
891)
892
893# Which randomness source do we use?
894if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
895 # OpenSSL only
896 AC_DEFINE(OPENSSL_PRNG_ONLY)
897 RAND_MSG="OpenSSL internal ONLY"
898 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800899elif test ! -z "$USE_RAND_HELPER" ; then
900 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100901 RAND_MSG="ssh-rand-helper"
902 INSTALL_SSH_RAND_HELPER="yes"
903fi
904AC_SUBST(INSTALL_SSH_RAND_HELPER)
905
906### Configuration of ssh-rand-helper
907
908# PRNGD TCP socket
909AC_ARG_WITH(prngd-port,
910 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
911 [
Damien Millere996d722002-01-23 11:20:59 +1100912 case "$withval" in
913 no)
914 withval=""
915 ;;
916 [[0-9]]*)
917 ;;
918 *)
919 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
920 ;;
921 esac
922 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100923 PRNGD_PORT="$withval"
924 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
925 fi
926 ]
927)
928
929# PRNGD Unix domain socket
930AC_ARG_WITH(prngd-socket,
931 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
932 [
Damien Millere996d722002-01-23 11:20:59 +1100933 case "$withval" in
934 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100935 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100936 ;;
937 no)
938 withval=""
939 ;;
940 /*)
941 ;;
942 *)
943 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
944 ;;
945 esac
946
947 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100948 if test ! -z "$PRNGD_PORT" ; then
949 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
950 fi
Damien Miller6385ba02002-01-23 08:12:36 +1100951 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100952 AC_MSG_WARN(Entropy socket is not readable)
953 fi
954 PRNGD_SOCKET="$withval"
955 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
956 fi
957 ]
958)
959
960# Change default command timeout for hashing entropy source
961entropy_timeout=200
962AC_ARG_WITH(entropy-timeout,
963 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
964 [
965 if test "x$withval" != "xno" ; then
966 entropy_timeout=$withval
967 fi
968 ]
969)
970
971AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
972
973# These programs are used by the command hashing source to gather entropy
974OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
975OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
976OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
977OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
978OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
979OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
980OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
981OSSH_PATH_ENTROPY_PROG(PROG_W, w)
982OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
983OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
984OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
985OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
986OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
987OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
988OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
989OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
990
991# Where does ssh-rand-helper get its randomness from?
992INSTALL_SSH_PRNG_CMDS=""
993if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
994 if test ! -z "$PRNGD_PORT" ; then
995 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
996 elif test ! -z "$PRNGD_SOCKET" ; then
997 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
998 else
999 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1000 RAND_HELPER_CMDHASH=yes
1001 INSTALL_SSH_PRNG_CMDS="yes"
1002 fi
1003fi
1004AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1005
1006
Ben Lindstromb5628642000-10-18 00:02:25 +00001007# Cheap hack to ensure NEWS-OS libraries are arranged right.
1008if test ! -z "$SONY" ; then
1009 LIBS="$LIBS -liberty";
1010fi
1011
Damien Millera22ba012000-03-02 23:09:20 +11001012# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001013AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001014AC_CHECK_SIZEOF(short int, 2)
1015AC_CHECK_SIZEOF(int, 4)
1016AC_CHECK_SIZEOF(long int, 4)
1017AC_CHECK_SIZEOF(long long int, 8)
1018
Damien Millera22ba012000-03-02 23:09:20 +11001019# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001020AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1021 AC_TRY_COMPILE(
1022 [ #include <sys/types.h> ],
1023 [ u_int a; a = 1;],
1024 [ ac_cv_have_u_int="yes" ],
1025 [ ac_cv_have_u_int="no" ]
1026 )
1027])
1028if test "x$ac_cv_have_u_int" = "xyes" ; then
1029 AC_DEFINE(HAVE_U_INT)
1030 have_u_int=1
1031fi
1032
Damien Miller61e50f12000-05-08 20:49:37 +10001033AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1034 AC_TRY_COMPILE(
1035 [ #include <sys/types.h> ],
1036 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1037 [ ac_cv_have_intxx_t="yes" ],
1038 [ ac_cv_have_intxx_t="no" ]
1039 )
1040])
1041if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1042 AC_DEFINE(HAVE_INTXX_T)
1043 have_intxx_t=1
1044fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001045
1046if (test -z "$have_intxx_t" && \
1047 test "x$ac_cv_header_stdint_h" = "xyes")
1048then
1049 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1050 AC_TRY_COMPILE(
1051 [ #include <stdint.h> ],
1052 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1053 [
1054 AC_DEFINE(HAVE_INTXX_T)
1055 AC_MSG_RESULT(yes)
1056 ],
1057 [ AC_MSG_RESULT(no) ]
1058 )
1059fi
1060
Damien Miller578783e2000-09-23 14:12:24 +11001061AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1062 AC_TRY_COMPILE(
1063 [ #include <sys/types.h> ],
1064 [ int64_t a; a = 1;],
1065 [ ac_cv_have_int64_t="yes" ],
1066 [ ac_cv_have_int64_t="no" ]
1067 )
1068])
1069if test "x$ac_cv_have_int64_t" = "xyes" ; then
1070 AC_DEFINE(HAVE_INT64_T)
1071 have_int64_t=1
1072fi
1073
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001074if test -z "$have_int64_t" ; then
1075 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1076 AC_TRY_COMPILE(
1077 [ #include <sys/socket.h> ],
1078 [ int64_t a; a = 1],
1079 [
1080 AC_DEFINE(HAVE_INT64_T)
1081 AC_MSG_RESULT(yes)
1082 ],
1083 [ AC_MSG_RESULT(no) ]
1084 )
1085fi
1086
Damien Miller61e50f12000-05-08 20:49:37 +10001087AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1088 AC_TRY_COMPILE(
1089 [ #include <sys/types.h> ],
1090 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1091 [ ac_cv_have_u_intxx_t="yes" ],
1092 [ ac_cv_have_u_intxx_t="no" ]
1093 )
1094])
1095if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1096 AC_DEFINE(HAVE_U_INTXX_T)
1097 have_u_intxx_t=1
1098fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001099
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001100if test -z "$have_u_intxx_t" ; then
1101 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1102 AC_TRY_COMPILE(
1103 [ #include <sys/socket.h> ],
1104 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1105 [
1106 AC_DEFINE(HAVE_U_INTXX_T)
1107 AC_MSG_RESULT(yes)
1108 ],
1109 [ AC_MSG_RESULT(no) ]
1110 )
1111fi
1112
Damien Miller578783e2000-09-23 14:12:24 +11001113AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1114 AC_TRY_COMPILE(
1115 [ #include <sys/types.h> ],
1116 [ u_int64_t a; a = 1;],
1117 [ ac_cv_have_u_int64_t="yes" ],
1118 [ ac_cv_have_u_int64_t="no" ]
1119 )
1120])
1121if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1122 AC_DEFINE(HAVE_U_INT64_T)
1123 have_u_int64_t=1
1124fi
1125
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001126if test -z "$have_u_intxx_t" ; then
1127 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1128 AC_TRY_COMPILE(
1129 [
1130#include <sys/types.h>
1131 ],
1132 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1133 [ ac_cv_have_uintxx_t="yes" ],
1134 [ ac_cv_have_uintxx_t="no" ]
1135 )
1136 ])
1137 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1138 AC_DEFINE(HAVE_UINTXX_T)
1139 fi
1140fi
1141
1142if test -z "$have_uintxx_t" ; then
1143 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1144 AC_TRY_COMPILE(
1145 [ #include <stdint.h> ],
1146 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1147 [
1148 AC_DEFINE(HAVE_UINTXX_T)
1149 AC_MSG_RESULT(yes)
1150 ],
1151 [ AC_MSG_RESULT(no) ]
1152 )
1153fi
1154
Damien Milleredb82922000-06-20 13:25:52 +10001155if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1156 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001157then
1158 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1159 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001160 [
1161#include <sys/bitypes.h>
1162 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001163 [
Damien Miller70494d12000-04-03 15:57:06 +10001164 int8_t a; int16_t b; int32_t c;
1165 u_int8_t e; u_int16_t f; u_int32_t g;
1166 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001167 ],
1168 [
1169 AC_DEFINE(HAVE_U_INTXX_T)
1170 AC_DEFINE(HAVE_INTXX_T)
1171 AC_MSG_RESULT(yes)
1172 ],
1173 [AC_MSG_RESULT(no)]
1174 )
1175fi
1176
Damien Miller58be7382001-09-15 21:31:54 +10001177
1178AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1179 AC_TRY_COMPILE(
1180 [
1181#include <sys/types.h>
1182 ],
1183 [ u_char foo; foo = 125; ],
1184 [ ac_cv_have_u_char="yes" ],
1185 [ ac_cv_have_u_char="no" ]
1186 )
1187])
1188if test "x$ac_cv_have_u_char" = "xyes" ; then
1189 AC_DEFINE(HAVE_U_CHAR)
1190fi
1191
Tim Rice13aae5e2001-10-21 17:53:58 -07001192TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001193
Damien Miller61e50f12000-05-08 20:49:37 +10001194AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1195 AC_TRY_COMPILE(
1196 [
1197#include <sys/types.h>
1198 ],
1199 [ size_t foo; foo = 1235; ],
1200 [ ac_cv_have_size_t="yes" ],
1201 [ ac_cv_have_size_t="no" ]
1202 )
1203])
1204if test "x$ac_cv_have_size_t" = "xyes" ; then
1205 AC_DEFINE(HAVE_SIZE_T)
1206fi
Damien Miller95058511999-12-29 10:36:45 +11001207
Damien Miller615f9392000-05-17 22:53:33 +10001208AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1209 AC_TRY_COMPILE(
1210 [
1211#include <sys/types.h>
1212 ],
1213 [ ssize_t foo; foo = 1235; ],
1214 [ ac_cv_have_ssize_t="yes" ],
1215 [ ac_cv_have_ssize_t="no" ]
1216 )
1217])
1218if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1219 AC_DEFINE(HAVE_SSIZE_T)
1220fi
1221
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001222AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1223 AC_TRY_COMPILE(
1224 [
1225#include <time.h>
1226 ],
1227 [ clock_t foo; foo = 1235; ],
1228 [ ac_cv_have_clock_t="yes" ],
1229 [ ac_cv_have_clock_t="no" ]
1230 )
1231])
1232if test "x$ac_cv_have_clock_t" = "xyes" ; then
1233 AC_DEFINE(HAVE_CLOCK_T)
1234fi
1235
Damien Millerb54b40e2000-06-23 08:23:34 +10001236AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1237 AC_TRY_COMPILE(
1238 [
1239#include <sys/types.h>
1240#include <sys/socket.h>
1241 ],
1242 [ sa_family_t foo; foo = 1235; ],
1243 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001244 [ AC_TRY_COMPILE(
1245 [
1246#include <sys/types.h>
1247#include <sys/socket.h>
1248#include <netinet/in.h>
1249 ],
1250 [ sa_family_t foo; foo = 1235; ],
1251 [ ac_cv_have_sa_family_t="yes" ],
1252
Damien Millerb54b40e2000-06-23 08:23:34 +10001253 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001254 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001255 )
1256])
1257if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1258 AC_DEFINE(HAVE_SA_FAMILY_T)
1259fi
1260
Damien Miller0f91b4e2000-06-18 15:43:25 +10001261AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1262 AC_TRY_COMPILE(
1263 [
1264#include <sys/types.h>
1265 ],
1266 [ pid_t foo; foo = 1235; ],
1267 [ ac_cv_have_pid_t="yes" ],
1268 [ ac_cv_have_pid_t="no" ]
1269 )
1270])
1271if test "x$ac_cv_have_pid_t" = "xyes" ; then
1272 AC_DEFINE(HAVE_PID_T)
1273fi
1274
1275AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1276 AC_TRY_COMPILE(
1277 [
1278#include <sys/types.h>
1279 ],
1280 [ mode_t foo; foo = 1235; ],
1281 [ ac_cv_have_mode_t="yes" ],
1282 [ ac_cv_have_mode_t="no" ]
1283 )
1284])
1285if test "x$ac_cv_have_mode_t" = "xyes" ; then
1286 AC_DEFINE(HAVE_MODE_T)
1287fi
1288
Damien Miller61e50f12000-05-08 20:49:37 +10001289
1290AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1291 AC_TRY_COMPILE(
1292 [
Damien Miller81171112000-04-23 11:14:01 +10001293#include <sys/types.h>
1294#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001295 ],
1296 [ struct sockaddr_storage s; ],
1297 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1298 [ ac_cv_have_struct_sockaddr_storage="no" ]
1299 )
1300])
1301if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1302 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1303fi
Damien Miller34132e52000-01-14 15:45:46 +11001304
Damien Miller61e50f12000-05-08 20:49:37 +10001305AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1306 AC_TRY_COMPILE(
1307 [
Damien Miller7b22d652000-06-18 14:07:04 +10001308#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001309#include <netinet/in.h>
1310 ],
1311 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1312 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1313 [ ac_cv_have_struct_sockaddr_in6="no" ]
1314 )
1315])
1316if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1317 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1318fi
Damien Miller34132e52000-01-14 15:45:46 +11001319
Damien Miller61e50f12000-05-08 20:49:37 +10001320AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1321 AC_TRY_COMPILE(
1322 [
Damien Miller7b22d652000-06-18 14:07:04 +10001323#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001324#include <netinet/in.h>
1325 ],
1326 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1327 [ ac_cv_have_struct_in6_addr="yes" ],
1328 [ ac_cv_have_struct_in6_addr="no" ]
1329 )
1330])
1331if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1332 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1333fi
Damien Miller34132e52000-01-14 15:45:46 +11001334
Damien Miller61e50f12000-05-08 20:49:37 +10001335AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1336 AC_TRY_COMPILE(
1337 [
Damien Miller81171112000-04-23 11:14:01 +10001338#include <sys/types.h>
1339#include <sys/socket.h>
1340#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001341 ],
1342 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1343 [ ac_cv_have_struct_addrinfo="yes" ],
1344 [ ac_cv_have_struct_addrinfo="no" ]
1345 )
1346])
1347if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1348 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1349fi
1350
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001351AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1352 AC_TRY_COMPILE(
1353 [ #include <sys/time.h> ],
1354 [ struct timeval tv; tv.tv_sec = 1;],
1355 [ ac_cv_have_struct_timeval="yes" ],
1356 [ ac_cv_have_struct_timeval="no" ]
1357 )
1358])
1359if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1360 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1361 have_struct_timeval=1
1362fi
1363
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001364# If we don't have int64_t then we can't compile sftp-server. So don't
1365# even attempt to do it.
1366if test "x$ac_cv_have_int64_t" = "xno" -a \
1367 "x$ac_cv_sizeof_long_int" != "x8" -a \
1368 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1369 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001370else
1371dnl test snprintf (broken on SCO w/gcc)
1372 AC_TRY_RUN(
1373 [
1374#include <stdio.h>
1375#include <string.h>
1376#ifdef HAVE_SNPRINTF
1377main()
1378{
1379 char buf[50];
1380 char expected_out[50];
1381 int mazsize = 50 ;
1382#if (SIZEOF_LONG_INT == 8)
1383 long int num = 0x7fffffffffffffff;
1384#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001385 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001386#endif
1387 strcpy(expected_out, "9223372036854775807");
1388 snprintf(buf, mazsize, "%lld", num);
1389 if(strcmp(buf, expected_out) != 0)
1390 exit(1);
1391 exit(0);
1392}
1393#else
1394main() { exit(0); }
1395#endif
1396 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1397 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001398fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001399AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001400
Damien Miller78315eb2000-09-29 23:01:36 +11001401dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001402OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1403OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1404OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1405OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1406OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001407OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001408OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1409OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001410OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001411OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1412OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1413OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1414OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001415OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1416OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1417OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1418OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001419
1420AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001421
Damien Miller61e50f12000-05-08 20:49:37 +10001422AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1423 ac_cv_have_ss_family_in_struct_ss, [
1424 AC_TRY_COMPILE(
1425 [
Damien Miller81171112000-04-23 11:14:01 +10001426#include <sys/types.h>
1427#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001428 ],
1429 [ struct sockaddr_storage s; s.ss_family = 1; ],
1430 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1431 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1432 )
1433])
1434if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1435 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1436fi
1437
Damien Miller61e50f12000-05-08 20:49:37 +10001438AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1439 ac_cv_have___ss_family_in_struct_ss, [
1440 AC_TRY_COMPILE(
1441 [
Damien Miller81171112000-04-23 11:14:01 +10001442#include <sys/types.h>
1443#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001444 ],
1445 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1446 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1447 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1448 )
1449])
1450if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1451 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1452fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001453
Damien Millerad833b32000-08-23 10:46:23 +10001454AC_CACHE_CHECK([for pw_class field in struct passwd],
1455 ac_cv_have_pw_class_in_struct_passwd, [
1456 AC_TRY_COMPILE(
1457 [
Damien Millerad833b32000-08-23 10:46:23 +10001458#include <pwd.h>
1459 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001460 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001461 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1462 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1463 )
1464])
1465if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1466 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1467fi
1468
Kevin Steves82456952001-06-22 21:14:18 +00001469AC_CACHE_CHECK([for pw_expire field in struct passwd],
1470 ac_cv_have_pw_expire_in_struct_passwd, [
1471 AC_TRY_COMPILE(
1472 [
1473#include <pwd.h>
1474 ],
1475 [ struct passwd p; p.pw_expire = 0; ],
1476 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1477 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1478 )
1479])
1480if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1481 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1482fi
1483
1484AC_CACHE_CHECK([for pw_change field in struct passwd],
1485 ac_cv_have_pw_change_in_struct_passwd, [
1486 AC_TRY_COMPILE(
1487 [
1488#include <pwd.h>
1489 ],
1490 [ struct passwd p; p.pw_change = 0; ],
1491 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1492 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1493 )
1494])
1495if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1496 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1497fi
Damien Miller61e50f12000-05-08 20:49:37 +10001498
1499AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1500 AC_TRY_LINK([],
1501 [ extern char *__progname; printf("%s", __progname); ],
1502 [ ac_cv_libc_defines___progname="yes" ],
1503 [ ac_cv_libc_defines___progname="no" ]
1504 )
1505])
1506if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1507 AC_DEFINE(HAVE___PROGNAME)
1508fi
1509
Damien Miller4f8e6692001-07-14 13:22:53 +10001510AC_CACHE_CHECK([whether getopt has optreset support],
1511 ac_cv_have_getopt_optreset, [
1512 AC_TRY_LINK(
1513 [
1514#include <getopt.h>
1515 ],
1516 [ extern int optreset; optreset = 0; ],
1517 [ ac_cv_have_getopt_optreset="yes" ],
1518 [ ac_cv_have_getopt_optreset="no" ]
1519 )
1520])
1521if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1522 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1523fi
Damien Millera22ba012000-03-02 23:09:20 +11001524
Damien Millerecbb26d2000-07-15 14:59:14 +10001525AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1526 AC_TRY_LINK([],
1527 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1528 [ ac_cv_libc_defines_sys_errlist="yes" ],
1529 [ ac_cv_libc_defines_sys_errlist="no" ]
1530 )
1531])
1532if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1533 AC_DEFINE(HAVE_SYS_ERRLIST)
1534fi
1535
1536
Damien Miller11fa2cc2000-08-16 10:35:58 +10001537AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1538 AC_TRY_LINK([],
1539 [ extern int sys_nerr; printf("%i", sys_nerr);],
1540 [ ac_cv_libc_defines_sys_nerr="yes" ],
1541 [ ac_cv_libc_defines_sys_nerr="no" ]
1542 )
1543])
1544if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1545 AC_DEFINE(HAVE_SYS_NERR)
1546fi
1547
1548
Damien Millerc79bc0d2001-03-28 13:03:42 +10001549# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001550SCARD_MSG="no"
1551AC_ARG_WITH(smartcard,
1552 [ --with-smartcard Enable smartcard support],
1553 [
1554 if test "x$withval" != "xno" ; then
1555 if test "x$withval" != "xyes" ; then
1556 CPPFLAGS="$CPPFLAGS -I${withval}"
1557 LDFLAGS="$LDFLAGS -L${withval}"
1558 if test ! -z "$need_dash_r" ; then
1559 LDFLAGS="$LDFLAGS -R${withval}"
1560 fi
1561 if test ! -z "$blibpath" ; then
1562 blibpath="$blibpath:${withval}"
1563 fi
1564 fi
1565 AC_CHECK_HEADERS(sectok.h)
1566 if test "$ac_cv_header_sectok_h" != yes; then
1567 AC_MSG_ERROR(Can't find sectok.h)
1568 fi
1569 AC_CHECK_LIB(sectok, sectok_open)
1570 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1571 AC_MSG_ERROR(Can't find libsectok)
1572 fi
1573 AC_DEFINE(SMARTCARD)
1574 SCARD_MSG="yes"
1575 fi
1576 ]
1577)
1578
1579# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001580KRB4_MSG="no"
1581AC_ARG_WITH(kerberos4,
1582 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1583 [
1584 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001585 if test "x$withval" != "xyes" ; then
1586 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1587 LDFLAGS="$LDFLAGS -L${withval}/lib"
1588 if test ! -z "$need_dash_r" ; then
1589 LDFLAGS="$LDFLAGS -R${withval}/lib"
1590 fi
1591 if test ! -z "$blibpath" ; then
1592 blibpath="$blibpath:${withval}/lib"
1593 fi
1594 else
1595 if test -d /usr/include/kerberosIV ; then
1596 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1597 fi
1598 fi
1599
1600 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001601 if test "$ac_cv_header_krb_h" != yes; then
1602 AC_MSG_WARN([Cannot find krb.h, build may fail])
1603 fi
Damien Miller98344742001-03-28 14:37:06 +10001604 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001605 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001606 AC_CHECK_LIB(krb4, main)
1607 if test "$ac_cv_lib_krb4_main" != yes; then
1608 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1609 else
1610 KLIBS="-lkrb4"
1611 fi
1612 else
1613 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001614 fi
Damien Miller98344742001-03-28 14:37:06 +10001615 AC_CHECK_LIB(des, des_cbc_encrypt)
1616 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1617 AC_CHECK_LIB(des425, des_cbc_encrypt)
1618 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1619 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1620 else
1621 KLIBS="-ldes425"
1622 fi
1623 else
1624 KLIBS="-ldes"
1625 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001626 AC_CHECK_LIB(resolv, dn_expand, , )
1627 KRB4=yes
1628 KRB4_MSG="yes"
1629 AC_DEFINE(KRB4)
1630 fi
1631 ]
1632)
1633
1634# Check whether user wants AFS support
1635AFS_MSG="no"
1636AC_ARG_WITH(afs,
1637 [ --with-afs=PATH Enable AFS support],
1638 [
1639 if test "x$withval" != "xno" ; then
1640
1641 if test "x$withval" != "xyes" ; then
1642 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1643 LDFLAGS="$LDFLAGS -L${withval}/lib"
1644 fi
1645
1646 if test -z "$KRB4" ; then
1647 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1648 fi
1649
1650 LIBS="-lkafs $LIBS"
1651 if test ! -z "$AFS_LIBS" ; then
1652 LIBS="$LIBS $AFS_LIBS"
1653 fi
1654 AC_DEFINE(AFS)
1655 AFS_MSG="yes"
1656 fi
1657 ]
1658)
1659LIBS="$LIBS $KLIBS"
1660
Damien Millera22ba012000-03-02 23:09:20 +11001661# Looking for programs, paths and files
1662AC_ARG_WITH(rsh,
1663 [ --with-rsh=PATH Specify path to remote shell program ],
1664 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001665 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001666 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001667 fi
1668 ],
1669 [
1670 AC_PATH_PROG(rsh_path, rsh)
1671 ]
1672)
1673
1674AC_ARG_WITH(xauth,
1675 [ --with-xauth=PATH Specify path to xauth program ],
1676 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001677 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001678 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001679 fi
1680 ],
1681 [
Damien Miller78315eb2000-09-29 23:01:36 +11001682 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 +10001683 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001684 xauth_path="/usr/openwin/bin/xauth"
1685 fi
1686 ]
1687)
1688
Damien Millera19cf472000-11-29 13:28:50 +11001689if test -z "$xauth_path" ; then
1690 XAUTH_PATH="undefined"
1691 AC_SUBST(XAUTH_PATH)
1692else
Damien Millera22ba012000-03-02 23:09:20 +11001693 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001694 XAUTH_PATH=$xauth_path
1695 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001696fi
1697if test ! -z "$rsh_path" ; then
1698 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1699fi
1700
1701# Check for mail directory (last resort if we cannot get it from headers)
1702if test ! -z "$MAIL" ; then
1703 maildir=`dirname $MAIL`
1704 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1705fi
1706
Damien Millera22ba012000-03-02 23:09:20 +11001707if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001708 AC_CHECK_FILE("/dev/ptmx",
1709 [
1710 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1711 have_dev_ptmx=1
1712 ]
1713 )
Damien Millera22ba012000-03-02 23:09:20 +11001714fi
Damien Miller204ad072000-03-02 23:56:12 +11001715AC_CHECK_FILE("/dev/ptc",
1716 [
1717 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1718 have_dev_ptc=1
1719 ]
1720)
1721
Damien Millera22ba012000-03-02 23:09:20 +11001722# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001723AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001724 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001725 [
Damien Miller897741e2001-04-16 10:41:46 +10001726 case "$withval" in
1727 man|cat|doc)
1728 MANTYPE=$withval
1729 ;;
1730 *)
1731 AC_MSG_ERROR(invalid man type: $withval)
1732 ;;
1733 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001734 ]
1735)
Ben Lindstrombc709922001-04-18 18:04:21 +00001736if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001737 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001738 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1739 MANTYPE=doc
1740 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1741 MANTYPE=man
1742 else
1743 MANTYPE=cat
1744 fi
1745fi
Damien Miller670a4b82000-01-22 13:53:11 +11001746AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001747if test "$MANTYPE" = "doc"; then
1748 mansubdir=man;
1749else
1750 mansubdir=$MANTYPE;
1751fi
1752AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001753
Damien Millera22ba012000-03-02 23:09:20 +11001754# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001755MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001756AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001757 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001758 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001759 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001760 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001761 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001762 fi
1763 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001764)
1765
Damien Millera22ba012000-03-02 23:09:20 +11001766# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001767AC_ARG_WITH(shadow,
1768 [ --without-shadow Disable shadow password support],
1769 [
1770 if test "x$withval" = "xno" ; then
1771 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001772 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001773 fi
1774 ]
1775)
1776
Damien Miller1f335fb2000-06-26 11:31:33 +10001777if test -z "$disable_shadow" ; then
1778 AC_MSG_CHECKING([if the systems has expire shadow information])
1779 AC_TRY_COMPILE(
1780 [
1781#include <sys/types.h>
1782#include <shadow.h>
1783 struct spwd sp;
1784 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1785 [ sp_expire_available=yes ], []
1786 )
1787
1788 if test "x$sp_expire_available" = "xyes" ; then
1789 AC_MSG_RESULT(yes)
1790 AC_DEFINE(HAS_SHADOW_EXPIRE)
1791 else
1792 AC_MSG_RESULT(no)
1793 fi
1794fi
1795
Damien Millera22ba012000-03-02 23:09:20 +11001796# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001797if test ! -z "$IPADDR_IN_DISPLAY" ; then
1798 DISPLAY_HACK_MSG="yes"
1799 AC_DEFINE(IPADDR_IN_DISPLAY)
1800else
1801 DISPLAY_HACK_MSG="no"
1802 AC_ARG_WITH(ipaddr-display,
1803 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1804 [
1805 if test "x$withval" != "xno" ; then
1806 AC_DEFINE(IPADDR_IN_DISPLAY)
1807 DISPLAY_HACK_MSG="yes"
1808 fi
1809 ]
1810 )
1811fi
Damien Miller76112de1999-12-21 11:18:08 +11001812
Damien Millera22ba012000-03-02 23:09:20 +11001813# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001814SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001815AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001816 [ --with-default-path=PATH Specify default \$PATH environment for server],
1817 [
1818 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001819 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001820 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001821 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001822 ],
1823 [
1824 AC_TRY_RUN(
1825 [
1826/* find out what STDPATH is */
1827#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001828#ifdef HAVE_PATHS_H
1829# include <paths.h>
1830#endif
1831#ifndef _PATH_STDPATH
1832# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1833#endif
1834#include <sys/types.h>
1835#include <sys/stat.h>
1836#include <fcntl.h>
1837#define DATA "conftest.stdpath"
1838
1839main()
1840{
1841 FILE *fd;
1842 int rc;
1843
1844 fd = fopen(DATA,"w");
1845 if(fd == NULL)
1846 exit(1);
1847
1848 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1849 exit(1);
1850
1851 exit(0);
1852}
1853 ], [ user_path=`cat conftest.stdpath` ],
1854 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1855 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1856 )
1857# make sure $bindir is in USER_PATH so scp will work
1858 t_bindir=`eval echo ${bindir}`
1859 case $t_bindir in
1860 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1861 esac
1862 case $t_bindir in
1863 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1864 esac
1865 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1866 if test $? -ne 0 ; then
1867 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1868 if test $? -ne 0 ; then
1869 user_path=$user_path:$t_bindir
1870 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1871 fi
1872 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001873 ]
1874)
Tim Rice59ea0a02001-03-10 13:50:45 -08001875AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1876AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001877
Damien Millera22ba012000-03-02 23:09:20 +11001878# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001879IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001880AC_ARG_WITH(ipv4-default,
1881 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1882 [
1883 if test "x$withval" != "xno" ; then
1884 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001885 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001886 fi
1887 ]
1888)
1889
Damien Miller61e50f12000-05-08 20:49:37 +10001890AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001891IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001892AC_ARG_WITH(4in6,
1893 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1894 [
1895 if test "x$withval" != "xno" ; then
1896 AC_MSG_RESULT(yes)
1897 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001898 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001899 else
1900 AC_MSG_RESULT(no)
1901 fi
1902 ],[
1903 if test "x$inet6_default_4in6" = "xyes"; then
1904 AC_MSG_RESULT([yes (default)])
1905 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001906 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001907 else
1908 AC_MSG_RESULT([no (default)])
1909 fi
1910 ]
1911)
1912
Damien Miller60396b02001-02-18 17:01:00 +11001913# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11001914BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11001915AC_ARG_WITH(bsd-auth,
1916 [ --with-bsd-auth Enable BSD auth support],
1917 [
1918 if test "x$withval" != "xno" ; then
1919 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11001920 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11001921 fi
1922 ]
1923)
1924
Damien Miller78315eb2000-09-29 23:01:36 +11001925AC_MSG_CHECKING(whether to install ssh as suid root)
1926AC_ARG_ENABLE(suid-ssh,
1927[ --enable-suid-ssh Install ssh as suid root (default)
1928 --disable-suid-ssh Install ssh without suid bit],
1929[ case "$enableval" in
1930 no)
1931 AC_MSG_RESULT(no)
1932 SSHMODE=0711
1933 ;;
1934 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001935 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001936 ;;
1937 esac ],
1938 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001939 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001940)
1941AC_SUBST(SSHMODE)
1942
1943
Damien Millera22ba012000-03-02 23:09:20 +11001944# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001945piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001946AC_ARG_WITH(pid-dir,
1947 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1948 [
1949 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001950 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001951 fi
1952 ]
1953)
Damien Miller4018c192000-04-30 09:30:44 +10001954
Damien Miller78315eb2000-09-29 23:01:36 +11001955# make sure the directory exists
1956if test ! -d $piddir ; then
1957 piddir=`eval echo ${sysconfdir}`
1958 case $piddir in
1959 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1960 esac
1961fi
1962
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001963AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001964AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001965
andre2ff7b5d2000-06-03 14:57:40 +00001966dnl allow user to disable some login recording features
1967AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001968 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001969 [ AC_DEFINE(DISABLE_LASTLOG) ]
1970)
1971AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001972 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001973 [ AC_DEFINE(DISABLE_UTMP) ]
1974)
1975AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001976 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001977 [ AC_DEFINE(DISABLE_UTMPX) ]
1978)
1979AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001980 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001981 [ AC_DEFINE(DISABLE_WTMP) ]
1982)
1983AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001984 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001985 [ AC_DEFINE(DISABLE_WTMPX) ]
1986)
1987AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001988 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001989 [ AC_DEFINE(DISABLE_LOGIN) ]
1990)
1991AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001992 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001993 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1994)
1995AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001996 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001997 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1998)
1999AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002000 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002001 [
2002 if test "x$withval" = "xno" ; then
2003 AC_DEFINE(DISABLE_LASTLOG)
2004 else
2005 conf_lastlog_location=$withval
2006 fi
2007 ]
2008)
andre2ff7b5d2000-06-03 14:57:40 +00002009
2010dnl lastlog, [uw]tmpx? detection
2011dnl NOTE: set the paths in the platform section to avoid the
2012dnl need for command-line parameters
2013dnl lastlog and [uw]tmp are subject to a file search if all else fails
2014
2015dnl lastlog detection
2016dnl NOTE: the code itself will detect if lastlog is a directory
2017AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2018AC_TRY_COMPILE([
2019#include <sys/types.h>
2020#include <utmp.h>
2021#ifdef HAVE_LASTLOG_H
2022# include <lastlog.h>
2023#endif
Damien Miller2994e082000-06-04 15:51:47 +10002024#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002025# include <paths.h>
2026#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002027#ifdef HAVE_LOGIN_H
2028# include <login.h>
2029#endif
andre2ff7b5d2000-06-03 14:57:40 +00002030 ],
2031 [ char *lastlog = LASTLOG_FILE; ],
2032 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002033 [
2034 AC_MSG_RESULT(no)
2035 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2036 AC_TRY_COMPILE([
2037#include <sys/types.h>
2038#include <utmp.h>
2039#ifdef HAVE_LASTLOG_H
2040# include <lastlog.h>
2041#endif
2042#ifdef HAVE_PATHS_H
2043# include <paths.h>
2044#endif
2045 ],
2046 [ char *lastlog = _PATH_LASTLOG; ],
2047 [ AC_MSG_RESULT(yes) ],
2048 [
andree441aa32000-06-12 22:34:38 +00002049 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002050 system_lastlog_path=no
2051 ])
2052 ]
andre2ff7b5d2000-06-03 14:57:40 +00002053)
Damien Miller2994e082000-06-04 15:51:47 +10002054
andre2ff7b5d2000-06-03 14:57:40 +00002055if test -z "$conf_lastlog_location"; then
2056 if test x"$system_lastlog_path" = x"no" ; then
2057 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002058 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002059 conf_lastlog_location=$f
2060 fi
2061 done
2062 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002063 AC_MSG_WARN([** Cannot find lastlog **])
2064 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002065 fi
2066 fi
2067fi
2068
2069if test -n "$conf_lastlog_location"; then
2070 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2071fi
2072
2073dnl utmp detection
2074AC_MSG_CHECKING([if your system defines UTMP_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 *utmp = UTMP_FILE; ],
2083 [ AC_MSG_RESULT(yes) ],
2084 [ AC_MSG_RESULT(no)
2085 system_utmp_path=no ]
2086)
2087if test -z "$conf_utmp_location"; then
2088 if test x"$system_utmp_path" = x"no" ; then
2089 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2090 if test -f $f ; then
2091 conf_utmp_location=$f
2092 fi
2093 done
2094 if test -z "$conf_utmp_location"; then
2095 AC_DEFINE(DISABLE_UTMP)
2096 fi
2097 fi
2098fi
2099if test -n "$conf_utmp_location"; then
2100 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2101fi
2102
2103dnl wtmp detection
2104AC_MSG_CHECKING([if your system defines WTMP_FILE])
2105AC_TRY_COMPILE([
2106#include <sys/types.h>
2107#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002108#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002109# include <paths.h>
2110#endif
2111 ],
2112 [ char *wtmp = WTMP_FILE; ],
2113 [ AC_MSG_RESULT(yes) ],
2114 [ AC_MSG_RESULT(no)
2115 system_wtmp_path=no ]
2116)
2117if test -z "$conf_wtmp_location"; then
2118 if test x"$system_wtmp_path" = x"no" ; then
2119 for f in /usr/adm/wtmp /var/log/wtmp; do
2120 if test -f $f ; then
2121 conf_wtmp_location=$f
2122 fi
2123 done
2124 if test -z "$conf_wtmp_location"; then
2125 AC_DEFINE(DISABLE_WTMP)
2126 fi
2127 fi
2128fi
2129if test -n "$conf_wtmp_location"; then
2130 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2131fi
2132
2133
2134dnl utmpx detection - I don't know any system so perverse as to require
2135dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2136dnl there, though.
2137AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2138AC_TRY_COMPILE([
2139#include <sys/types.h>
2140#include <utmp.h>
2141#ifdef HAVE_UTMPX_H
2142#include <utmpx.h>
2143#endif
Damien Miller2994e082000-06-04 15:51:47 +10002144#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002145# include <paths.h>
2146#endif
2147 ],
2148 [ char *utmpx = UTMPX_FILE; ],
2149 [ AC_MSG_RESULT(yes) ],
2150 [ AC_MSG_RESULT(no)
2151 system_utmpx_path=no ]
2152)
2153if test -z "$conf_utmpx_location"; then
2154 if test x"$system_utmpx_path" = x"no" ; then
2155 AC_DEFINE(DISABLE_UTMPX)
2156 fi
2157else
2158 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2159fi
2160
2161dnl wtmpx detection
2162AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2163AC_TRY_COMPILE([
2164#include <sys/types.h>
2165#include <utmp.h>
2166#ifdef HAVE_UTMPX_H
2167#include <utmpx.h>
2168#endif
Damien Miller2994e082000-06-04 15:51:47 +10002169#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002170# include <paths.h>
2171#endif
2172 ],
2173 [ char *wtmpx = WTMPX_FILE; ],
2174 [ AC_MSG_RESULT(yes) ],
2175 [ AC_MSG_RESULT(no)
2176 system_wtmpx_path=no ]
2177)
2178if test -z "$conf_wtmpx_location"; then
2179 if test x"$system_wtmpx_path" = x"no" ; then
2180 AC_DEFINE(DISABLE_WTMPX)
2181 fi
2182else
2183 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2184fi
2185
Damien Miller4018c192000-04-30 09:30:44 +10002186
Damien Miller29ea30d2000-03-17 10:54:15 +11002187if test ! -z "$blibpath" ; then
2188 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2189 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2190fi
2191
Damien Millerbac2d8a2000-09-05 16:13:06 +11002192AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002193AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2194AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002195
Damien Miller7b22d652000-06-18 14:07:04 +10002196# Print summary of options
2197
Damien Miller7b22d652000-06-18 14:07:04 +10002198# Someone please show me a better way :)
2199A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2200B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2201C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2202D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002203E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002204F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002205G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002206H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002207
2208echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002209echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002210echo " User binaries: $B"
2211echo " System binaries: $C"
2212echo " Configuration files: $D"
2213echo " Askpass program: $E"
2214echo " Manual pages: $F"
2215echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002216echo " sshd default user PATH: $H"
Damien Miller897741e2001-04-16 10:41:46 +10002217echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002218echo " PAM support: ${PAM_MSG}"
2219echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002220echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002221echo " AFS support: $AFS_MSG"
2222echo " S/KEY support: $SKEY_MSG"
2223echo " TCP Wrappers support: $TCPW_MSG"
2224echo " MD5 password support: $MD5_MSG"
2225echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2226echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2227echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002228echo " BSD Auth support: $BSD_AUTH_MSG"
2229echo " Random number source: $RAND_MSG"
2230if test ! -z "$USE_RAND_HELPER" ; then
2231 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002232fi
2233
Damien Miller7b22d652000-06-18 14:07:04 +10002234echo ""
2235
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002236echo " Host: ${host}"
2237echo " Compiler: ${CC}"
2238echo " Compiler flags: ${CFLAGS}"
2239echo "Preprocessor flags: ${CPPFLAGS}"
2240echo " Linker flags: ${LDFLAGS}"
2241echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002242
2243echo ""
2244
Damien Miller82cf0ce2000-12-20 13:34:48 +11002245if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002246 echo "PAM is enabled. You may need to install a PAM control file "
2247 echo "for sshd, otherwise password authentication may fail. "
2248 echo "Example PAM control files can be found in the contrib/ "
2249 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002250 echo ""
2251fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002252
2253if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002254 echo "sftp-server will be disabled. Your compiler does not "
2255 echo "support 64bit integers."
2256 echo ""
2257fi
2258
2259if test ! -z "$RAND_HELPER_CMDHASH" ; then
2260 echo "WARNING: you are using the builtin random number collection "
2261 echo "service. Please read WARNING.RNG and request that your OS "
2262 echo "vendor includes kernel-based random number collection in "
2263 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002264 echo ""
2265fi
Damien Miller60396b02001-02-18 17:01:00 +11002266