blob: fc0d4797e6abf3c742b565bc1f58854ee793ba45 [file] [log] [blame]
Damien Miller58be7382001-09-15 21:31:54 +10001# $Id: configure.in,v 1.308 2001/09/15 11:31:54 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11008AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +10009
Damien Millera22ba012000-03-02 23:09:20 +110010# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110011AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100012AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110013AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000014AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070015AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110016AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100017AC_PATH_PROG(ENT, ent)
18AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110019AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110020AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110023
Damien Miller3f62aba2000-11-29 11:56:35 +110024if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
26fi
27
Damien Millerad833b32000-08-23 10:46:23 +100028# Use LOGIN_PROGRAM from environment if possible
29if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
31else
32 # Search for login
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
36 fi
37fi
38
Damien Miller166bd442000-03-16 10:48:25 +110039if test -z "$LD" ; then
40 LD=$CC
41fi
42AC_SUBST(LD)
43
Damien Miller166bd442000-03-16 10:48:25 +110044AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100045if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
46 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110047fi
48
Damien Millera22ba012000-03-02 23:09:20 +110049# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110050case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110051*-*-aix*)
52 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000053 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110054 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100055 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110056 blibpath="/usr/lib:/lib:/usr/local/lib"
57 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100058 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110059 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000060 dnl AIX handles lastlog as part of its login message
61 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110062 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110063*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110064 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110065 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000066 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110067 AC_DEFINE(DISABLE_SHADOW)
68 AC_DEFINE(IPV4_DEFAULT)
69 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000070 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 no_libsocket=1
72 no_libnsl=1
73 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000074*-*-dgux*)
75 AC_DEFINE(IP_TOS_IS_BROKEN)
76 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000077*-*-darwin*)
78 AC_DEFINE(BROKEN_GETADDRINFO)
79 ;;
Damien Miller76112de1999-12-21 11:18:08 +110080*-*-hpux10*)
81 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100082 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110083 fi
Kevin Steves315f8b72001-06-28 00:24:41 +000084 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110085 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100086 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110087 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110088 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000089 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +000090 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110091 ;;
Damien Miller1bead332000-04-30 00:47:29 +100092*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +000093 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110094 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110095 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110096 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110097 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110098 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000099 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000100 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000101 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100102*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000103 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000104 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100105 PATH="$PATH:/usr/etc"
Damien Miller1808f382000-01-06 12:03:12 +1100106 no_libsocket=1
107 no_libnsl=1
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 Millerbeb4ba51999-12-28 15:09:35 +1100118 no_libsocket=1
119 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000120 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100121 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100122*-*-linux*)
123 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100124 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000126 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100127 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100128 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000129mips-sony-bsd|mips-sony-newsos4)
130 AC_DEFINE(HAVE_NEWS4)
131 SONY=1
132 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100133 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000134 )
135 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100136*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100137 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100138 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100139*-*-freebsd*)
140 check_for_libcrypt_later=1
141 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000143 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100144 conf_utmp_location=/etc/utmp
145 conf_wtmp_location=/usr/adm/wtmp
146 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000147 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000148 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000149 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100150 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000152 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000153 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100154*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100157 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100158 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000159 AC_DEFINE(LOGIN_NEEDS_UTMPX)
160 AC_DEFINE(LOGIN_NEEDS_TERM)
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"
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000186 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
Ben Lindstrom34328342001-04-23 22:39:42 +0000187 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000188 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000189*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000191 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100192 IPADDR_IN_DISPLAY=yes
193 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000194 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000195 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerb2dc28e2000-07-12 09:18:33 +1000196 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000197 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100198*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000199 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100200 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100201 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100202 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100203 ;;
204*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000205 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100207 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100208 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100209 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100210*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100212 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100213 LIBS="$LIBS -lgen -lsocket"
214 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100215*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000216 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Ben Lindstrom980754c2000-11-12 00:04:24 +0000218 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100219 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100220 RANLIB=true
221 no_dev_ptmx=1
222 AC_DEFINE(BROKEN_SYS_TERMIO_H)
223 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100224 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000225 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000226 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100227 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100228 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700229 MANTYPE=man
Damien Miller78315eb2000-09-29 23:01:36 +1100230 ;;
231*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000232 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000235 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100236 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100237 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100238 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000239 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000240 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100241 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700242 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000243 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000244*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700245 no_libsocket=1
246 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000247 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700248 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
249 LIBS="$LIBS -lgen -lrsc"
250 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000251*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000252 AC_MSG_CHECKING(for Digital Unix SIA)
253 no_osfsia=""
254 AC_ARG_WITH(osfsia,
255 [ --with-osfsia Enable Digital Unix SIA],
256 [
257 if test "x$withval" = "xno" ; then
258 AC_MSG_RESULT(disabled)
259 no_osfsia=1
260 fi
261 ],
262 )
263 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000264 if test -f /etc/sia/matrix.conf; then
265 AC_MSG_RESULT(yes)
266 AC_DEFINE(HAVE_OSF_SIA)
267 AC_DEFINE(DISABLE_LOGIN)
268 LIBS="$LIBS -lsecurity -ldb -lm -laud"
269 else
270 AC_MSG_RESULT(no)
271 fi
272 fi
273 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000274
275*-*-nto-qnx)
276 AC_DEFINE(USE_PIPES)
277 AC_DEFINE(NO_X11_UNIX_SOCKETS)
278 AC_DEFINE(MISSING_NFDBITS)
279 AC_DEFINE(MISSING_HOWMANY)
280 AC_DEFINE(MISSING_FD_MASK)
281 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100282esac
283
Damien Millere37bfc12000-06-05 09:37:43 +1000284# Allow user to specify flags
285AC_ARG_WITH(cflags,
286 [ --with-cflags Specify additional flags to pass to compiler],
287 [
288 if test "x$withval" != "xno" ; then
289 CFLAGS="$CFLAGS $withval"
290 fi
291 ]
292)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000293AC_ARG_WITH(cppflags,
294 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
295 [
296 if test "x$withval" != "xno"; then
297 CPPFLAGS="$CPPFLAGS $withval"
298 fi
299 ]
300)
Damien Millere37bfc12000-06-05 09:37:43 +1000301AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000302 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000303 [
304 if test "x$withval" != "xno" ; then
305 LDFLAGS="$LDFLAGS $withval"
306 fi
307 ]
308)
309AC_ARG_WITH(libs,
310 [ --with-libs Specify additional libraries to link with],
311 [
312 if test "x$withval" != "xno" ; then
313 LIBS="$LIBS $withval"
314 fi
315 ]
316)
317
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000318AC_ARG_WITH(pcre,
319 [ --with-pcre Override built in regex library with pcre],
320 [
321
322 AC_CHECK_LIB(pcre, pcre_info,
323 [
324 AC_DEFINE(HAVE_LIBPCRE)
325 LIBS="$LIBS -lpcreposix -lpcre"
326 no_comp_check="yes"
327 ],
328 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
329 )
330 ]
331)
Damien Millere37bfc12000-06-05 09:37:43 +1000332
Damien Millera22ba012000-03-02 23:09:20 +1100333# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100334if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000335 AC_CHECK_LIB(nsl, yp_match, , )
336fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100337if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000338 AC_CHECK_LIB(socket, main, , )
339fi
340
Damien Millerdf288022001-02-18 13:07:07 +1100341dnl SCO OS3 needs this for libwrap
342AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
343
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000344AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100345AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100346AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100347
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000348# We don't want to check if we did an pcre override.
349if test -z "$no_comp_check" ; then
350 AC_CHECK_FUNC(regcomp,
351 [ AC_DEFINE(HAVE_REGCOMP)],
352 [
353 AC_CHECK_LIB(pcre, pcre_info,
354 [
355 AC_DEFINE(HAVE_LIBPCRE)
356 LIBS="$LIBS -lpcreposix -lpcre"
357 ],
358 [
359 AC_MSG_ERROR([*** No regex library found.])
360 ])
361 ]
362 )
363fi
Damien Millerab18c411999-11-11 10:40:23 +1100364
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000365dnl UnixWare 2.x
366AC_CHECK_FUNC(strcasecmp,
367 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
368)
369AC_CHECK_FUNC(utimes,
370 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
371)
Damien Millerab18c411999-11-11 10:40:23 +1100372
Ben Lindstrom8697e082001-02-24 21:41:10 +0000373AC_FUNC_STRFTIME
374
Damien Millera22ba012000-03-02 23:09:20 +1100375# Checks for header files.
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000376AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.h lastlog.h libgen.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h stdint.h strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Damien Miller3c027682001-03-14 11:39:45 +1100377
378# Check for ALTDIRFUNC glob() extension
379AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
380AC_EGREP_CPP(FOUNDIT,
381 [
382 #include <glob.h>
383 #ifdef GLOB_ALTDIRFUNC
384 FOUNDIT
385 #endif
386 ],
387 [
388 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
389 AC_MSG_RESULT(yes)
390 ],
391 [
392 AC_MSG_RESULT(no)
393 ]
394)
Damien Millerab18c411999-11-11 10:40:23 +1100395
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000396# Check for g.gl_matchc glob() extension
397AC_MSG_CHECKING(for gl_matchc field in glob_t)
398AC_EGREP_CPP(FOUNDIT,
399 [
400 #include <glob.h>
401 int main(void){glob_t g; g.gl_matchc = 1;}
402 ],
403 [
404 AC_DEFINE(GLOB_HAS_GL_MATCHC)
405 AC_MSG_RESULT(yes)
406 ],
407 [
408 AC_MSG_RESULT(no)
409 ]
410)
411
Damien Miller18bb4732001-03-28 14:35:30 +1000412AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
413AC_TRY_RUN(
414 [
415#include <sys/types.h>
416#include <dirent.h>
417int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
418 ],
419 [AC_MSG_RESULT(yes)],
420 [
421 AC_MSG_RESULT(no)
422 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
423 ]
424)
425
Damien Millerc547bf12001-02-16 10:18:12 +1100426# Check whether user wants S/Key support
427SKEY_MSG="no"
428AC_ARG_WITH(skey,
429 [ --with-skey=PATH Enable S/Key support],
430 [
431 if test "x$withval" != "xno" ; then
432
433 if test "x$withval" != "xyes" ; then
434 CPPFLAGS="$CPPFLAGS -I${withval}/include"
435 LDFLAGS="$LDFLAGS -L${withval}/lib"
436 fi
437
438 AC_DEFINE(SKEY)
439 LIBS="-lskey $LIBS"
440 SKEY_MSG="yes"
441
442 AC_CHECK_FUNC(skey_keyinfo,
443 [],
444 [
445 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
446 ])
447 fi
448 ]
449)
450
451# Check whether user wants TCP wrappers support
452TCPW_MSG="no"
453AC_ARG_WITH(tcp-wrappers,
454 [ --with-tcp-wrappers Enable tcpwrappers support],
455 [
456 if test "x$withval" != "xno" ; then
457 saved_LIBS="$LIBS"
458 LIBS="-lwrap $LIBS"
459 AC_MSG_CHECKING(for libwrap)
460 AC_TRY_LINK(
461 [
462#include <tcpd.h>
463 int deny_severity = 0, allow_severity = 0;
464 ],
465 [hosts_access(0);],
466 [
467 AC_MSG_RESULT(yes)
468 AC_DEFINE(LIBWRAP)
469 TCPW_MSG="yes"
470 ],
471 [
472 AC_MSG_ERROR([*** libwrap missing])
473 ]
474 )
475 fi
476 ]
477)
478
Damien Millerad833b32000-08-23 10:46:23 +1000479dnl Checks for library functions.
Tim Ricee991e3c2001-08-07 15:29:07 -0700480AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock dirname fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getopt getnameinfo getrlimit getrusage getttyent glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty readpassphrase realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid setvbuf sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000481dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000482AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000483dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000484AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000485AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000486dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000487AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000488AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000489dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000490AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000491AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100492
Damien Miller5fc85652000-07-09 23:53:07 +1000493AC_CHECK_FUNC(getuserattr,
494 [AC_DEFINE(HAVE_GETUSERATTR)],
495 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
496)
497
Damien Miller04f80141999-11-19 15:32:34 +1100498AC_CHECK_FUNC(login,
499 [AC_DEFINE(HAVE_LOGIN)],
500 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
501)
502
503AC_CHECK_FUNC(daemon,
504 [AC_DEFINE(HAVE_DAEMON)],
505 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
506)
507
Damien Miller9fb07e42000-03-05 16:22:59 +1100508AC_CHECK_FUNC(getpagesize,
509 [AC_DEFINE(HAVE_GETPAGESIZE)],
510 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
511)
512
Damien Millercb170cb2000-07-01 16:52:55 +1000513# Check for broken snprintf
514if test "x$ac_cv_func_snprintf" = "xyes" ; then
515 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
516 AC_TRY_RUN(
517 [
518#include <stdio.h>
519int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
520 ],
521 [AC_MSG_RESULT(yes)],
522 [
523 AC_MSG_RESULT(no)
524 AC_DEFINE(BROKEN_SNPRINTF)
525 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
526 ]
527 )
528fi
529
Damien Miller606f8802000-09-16 15:39:56 +1100530AC_FUNC_GETPGRP
531
Damien Millera64b57a2001-01-17 10:44:13 +1100532# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000533PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100534AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100535 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100536 [
Damien Millera64b57a2001-01-17 10:44:13 +1100537 if test "x$withval" != "xno" ; then
538 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
539 AC_MSG_ERROR([PAM headers not found])
540 fi
541
542 AC_CHECK_LIB(dl, dlopen, , )
543 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
544 AC_CHECK_FUNCS(pam_getenvlist)
545
546 disable_shadow=yes
547 PAM_MSG="yes"
548
549 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100550 fi
551 ]
552)
Damien Millera22ba012000-03-02 23:09:20 +1100553
Damien Millera64b57a2001-01-17 10:44:13 +1100554# Check for older PAM
555if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100556 # Check PAM strerror arguments (old PAM)
557 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
558 AC_TRY_COMPILE(
559 [
Damien Miller81171112000-04-23 11:14:01 +1000560#include <stdlib.h>
561#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100562 ],
563 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
564 [AC_MSG_RESULT(no)],
565 [
566 AC_DEFINE(HAVE_OLD_PAM)
567 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000568 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100569 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100570 )
Damien Millera22ba012000-03-02 23:09:20 +1100571fi
572
573# The big search for OpenSSL
574AC_ARG_WITH(ssl-dir,
575 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
576 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000577 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100578 tryssldir=$withval
579 fi
580 ]
581)
582
583saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100584saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000585saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100586if test "x$prefix" != "xNONE" ; then
587 tryssldir="$tryssldir $prefix"
588fi
Damien Miller61e50f12000-05-08 20:49:37 +1000589AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100590 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 +1100591 CPPFLAGS="$saved_CPPFLAGS"
592 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000593 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100594
595 # Skip directories if they don't exist
596 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
597 continue;
598 fi
599 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
600 # Try to use $ssldir/lib if it exists, otherwise
601 # $ssldir
602 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000603 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100604 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000605 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100606 fi
607 else
Damien Millerb68af622001-03-28 21:05:26 +1000608 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100609 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000610 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100611 fi
612 fi
613 # Try to use $ssldir/include if it exists, otherwise
614 # $ssldir
615 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000616 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100617 else
Damien Millerb68af622001-03-28 21:05:26 +1000618 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100619 fi
620 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000621
Damien Miller3b512e12000-05-17 23:29:18 +1000622 # Basic test to check for compatible version and correct linking
623 # *does not* test for RSA - that comes later.
624 AC_TRY_RUN(
625 [
Damien Millere59ce622000-05-01 20:54:17 +1000626#include <string.h>
627#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000628int main(void)
629{
Damien Miller3b512e12000-05-17 23:29:18 +1000630 char a[2048];
631 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000632 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000633 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000634}
Damien Miller3b512e12000-05-17 23:29:18 +1000635 ],
636 [
637 found_crypto=1
638 break;
639 ], []
640 )
Damien Miller61e50f12000-05-08 20:49:37 +1000641
642 if test ! -z "$found_crypto" ; then
643 break;
644 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100645 done
646
Damien Miller61e50f12000-05-08 20:49:37 +1000647 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100648 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100649 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000650 if test -z "$ssldir" ; then
651 ssldir="(system)"
652 fi
Damien Millera22ba012000-03-02 23:09:20 +1100653
Damien Miller61e50f12000-05-08 20:49:37 +1000654 ac_cv_openssldir=$ssldir
655])
656
Damien Milleredb82922000-06-20 13:25:52 +1000657if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000658 AC_DEFINE(HAVE_OPENSSL)
659 dnl Need to recover ssldir - test above runs in subshell
660 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100661 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100662 # Try to use $ssldir/lib if it exists, otherwise
663 # $ssldir
664 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000665 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100666 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000667 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100668 fi
669 else
Damien Millerb68af622001-03-28 21:05:26 +1000670 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100671 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000672 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100673 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100674 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100675 # Try to use $ssldir/include if it exists, otherwise
676 # $ssldir
677 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000678 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100679 else
Damien Millerb68af622001-03-28 21:05:26 +1000680 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100681 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100682 fi
Damien Millera22ba012000-03-02 23:09:20 +1100683fi
Damien Miller3b512e12000-05-17 23:29:18 +1000684LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000685
Damien Miller3b512e12000-05-17 23:29:18 +1000686# Now test RSA support
687saved_LIBS="$LIBS"
688AC_MSG_CHECKING([for RSA support])
689for WANTS_RSAREF in "" 1 ; do
690 if test -z "$WANTS_RSAREF" ; then
691 LIBS="$saved_LIBS"
692 else
693 LIBS="$saved_LIBS -lRSAglue -lrsaref"
694 fi
695 AC_TRY_RUN([
696#include <string.h>
697#include <openssl/rand.h>
698#include <openssl/rsa.h>
699#include <openssl/bn.h>
700#include <openssl/sha.h>
701int main(void)
702{
703 int num; RSA *key; static unsigned char p_in[] = "blahblah";
704 unsigned char c[256], p[256];
705 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
706 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
707 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
708 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
709}
710 ],
711 [
712 rsa_works=1
713 break;
714 ], [])
715done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000716LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000717
718if test ! -z "$no_rsa" ; then
719 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000720 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000721else
722 if test -z "$rsa_works" ; then
723 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000724 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000725 else
726 if test -z "$WANTS_RSAREF" ; then
727 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000728 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000729 else
Damien Miller7b22d652000-06-18 14:07:04 +1000730 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000731 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000732 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000733 fi
734 fi
735fi
Damien Millera22ba012000-03-02 23:09:20 +1100736
Damien Millera64b57a2001-01-17 10:44:13 +1100737# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
738# version in OpenSSL. Skip this for PAM
739if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100740 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100741fi
742
Ben Lindstromb5628642000-10-18 00:02:25 +0000743# Cheap hack to ensure NEWS-OS libraries are arranged right.
744if test ! -z "$SONY" ; then
745 LIBS="$LIBS -liberty";
746fi
747
Damien Millera22ba012000-03-02 23:09:20 +1100748# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100749AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100750AC_CHECK_SIZEOF(short int, 2)
751AC_CHECK_SIZEOF(int, 4)
752AC_CHECK_SIZEOF(long int, 4)
753AC_CHECK_SIZEOF(long long int, 8)
754
Damien Millera22ba012000-03-02 23:09:20 +1100755# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100756AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
757 AC_TRY_COMPILE(
758 [ #include <sys/types.h> ],
759 [ u_int a; a = 1;],
760 [ ac_cv_have_u_int="yes" ],
761 [ ac_cv_have_u_int="no" ]
762 )
763])
764if test "x$ac_cv_have_u_int" = "xyes" ; then
765 AC_DEFINE(HAVE_U_INT)
766 have_u_int=1
767fi
768
Damien Miller61e50f12000-05-08 20:49:37 +1000769AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
770 AC_TRY_COMPILE(
771 [ #include <sys/types.h> ],
772 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
773 [ ac_cv_have_intxx_t="yes" ],
774 [ ac_cv_have_intxx_t="no" ]
775 )
776])
777if test "x$ac_cv_have_intxx_t" = "xyes" ; then
778 AC_DEFINE(HAVE_INTXX_T)
779 have_intxx_t=1
780fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000781
782if (test -z "$have_intxx_t" && \
783 test "x$ac_cv_header_stdint_h" = "xyes")
784then
785 AC_MSG_CHECKING([for intXX_t types in stdint.h])
786 AC_TRY_COMPILE(
787 [ #include <stdint.h> ],
788 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
789 [
790 AC_DEFINE(HAVE_INTXX_T)
791 AC_MSG_RESULT(yes)
792 ],
793 [ AC_MSG_RESULT(no) ]
794 )
795fi
796
Damien Miller578783e2000-09-23 14:12:24 +1100797AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
798 AC_TRY_COMPILE(
799 [ #include <sys/types.h> ],
800 [ int64_t a; a = 1;],
801 [ ac_cv_have_int64_t="yes" ],
802 [ ac_cv_have_int64_t="no" ]
803 )
804])
805if test "x$ac_cv_have_int64_t" = "xyes" ; then
806 AC_DEFINE(HAVE_INT64_T)
807 have_int64_t=1
808fi
809
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000810if test -z "$have_int64_t" ; then
811 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
812 AC_TRY_COMPILE(
813 [ #include <sys/socket.h> ],
814 [ int64_t a; a = 1],
815 [
816 AC_DEFINE(HAVE_INT64_T)
817 AC_MSG_RESULT(yes)
818 ],
819 [ AC_MSG_RESULT(no) ]
820 )
821fi
822
Damien Miller61e50f12000-05-08 20:49:37 +1000823AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
824 AC_TRY_COMPILE(
825 [ #include <sys/types.h> ],
826 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
827 [ ac_cv_have_u_intxx_t="yes" ],
828 [ ac_cv_have_u_intxx_t="no" ]
829 )
830])
831if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
832 AC_DEFINE(HAVE_U_INTXX_T)
833 have_u_intxx_t=1
834fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100835
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000836if test -z "$have_u_intxx_t" ; then
837 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
838 AC_TRY_COMPILE(
839 [ #include <sys/socket.h> ],
840 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
841 [
842 AC_DEFINE(HAVE_U_INTXX_T)
843 AC_MSG_RESULT(yes)
844 ],
845 [ AC_MSG_RESULT(no) ]
846 )
847fi
848
Damien Miller578783e2000-09-23 14:12:24 +1100849AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
850 AC_TRY_COMPILE(
851 [ #include <sys/types.h> ],
852 [ u_int64_t a; a = 1;],
853 [ ac_cv_have_u_int64_t="yes" ],
854 [ ac_cv_have_u_int64_t="no" ]
855 )
856])
857if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
858 AC_DEFINE(HAVE_U_INT64_T)
859 have_u_int64_t=1
860fi
861
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000862if test -z "$have_u_intxx_t" ; then
863 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
864 AC_TRY_COMPILE(
865 [
866#include <sys/types.h>
867 ],
868 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
869 [ ac_cv_have_uintxx_t="yes" ],
870 [ ac_cv_have_uintxx_t="no" ]
871 )
872 ])
873 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
874 AC_DEFINE(HAVE_UINTXX_T)
875 fi
876fi
877
878if test -z "$have_uintxx_t" ; then
879 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
880 AC_TRY_COMPILE(
881 [ #include <stdint.h> ],
882 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
883 [
884 AC_DEFINE(HAVE_UINTXX_T)
885 AC_MSG_RESULT(yes)
886 ],
887 [ AC_MSG_RESULT(no) ]
888 )
889fi
890
Damien Milleredb82922000-06-20 13:25:52 +1000891if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
892 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100893then
894 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
895 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000896 [
897#include <sys/bitypes.h>
898 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100899 [
Damien Miller70494d12000-04-03 15:57:06 +1000900 int8_t a; int16_t b; int32_t c;
901 u_int8_t e; u_int16_t f; u_int32_t g;
902 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100903 ],
904 [
905 AC_DEFINE(HAVE_U_INTXX_T)
906 AC_DEFINE(HAVE_INTXX_T)
907 AC_MSG_RESULT(yes)
908 ],
909 [AC_MSG_RESULT(no)]
910 )
911fi
912
Damien Miller58be7382001-09-15 21:31:54 +1000913
914AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
915 AC_TRY_COMPILE(
916 [
917#include <sys/types.h>
918 ],
919 [ u_char foo; foo = 125; ],
920 [ ac_cv_have_u_char="yes" ],
921 [ ac_cv_have_u_char="no" ]
922 )
923])
924if test "x$ac_cv_have_u_char" = "xyes" ; then
925 AC_DEFINE(HAVE_U_CHAR)
926fi
927
Damien Miller61e50f12000-05-08 20:49:37 +1000928AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
929 AC_TRY_COMPILE(
930 [
Damien Miller81171112000-04-23 11:14:01 +1000931#include <sys/types.h>
932#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000933 ],
934 [socklen_t foo; foo = 1235;],
935 [ ac_cv_have_socklen_t="yes" ],
936 [ ac_cv_have_socklen_t="no" ]
937 )
938])
939if test "x$ac_cv_have_socklen_t" = "xyes" ; then
940 AC_DEFINE(HAVE_SOCKLEN_T)
941fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100942
Damien Miller61e50f12000-05-08 20:49:37 +1000943AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
944 AC_TRY_COMPILE(
945 [
946#include <sys/types.h>
947 ],
948 [ size_t foo; foo = 1235; ],
949 [ ac_cv_have_size_t="yes" ],
950 [ ac_cv_have_size_t="no" ]
951 )
952])
953if test "x$ac_cv_have_size_t" = "xyes" ; then
954 AC_DEFINE(HAVE_SIZE_T)
955fi
Damien Miller95058511999-12-29 10:36:45 +1100956
Damien Miller615f9392000-05-17 22:53:33 +1000957AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
958 AC_TRY_COMPILE(
959 [
960#include <sys/types.h>
961 ],
962 [ ssize_t foo; foo = 1235; ],
963 [ ac_cv_have_ssize_t="yes" ],
964 [ ac_cv_have_ssize_t="no" ]
965 )
966])
967if test "x$ac_cv_have_ssize_t" = "xyes" ; then
968 AC_DEFINE(HAVE_SSIZE_T)
969fi
970
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000971AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
972 AC_TRY_COMPILE(
973 [
974#include <time.h>
975 ],
976 [ clock_t foo; foo = 1235; ],
977 [ ac_cv_have_clock_t="yes" ],
978 [ ac_cv_have_clock_t="no" ]
979 )
980])
981if test "x$ac_cv_have_clock_t" = "xyes" ; then
982 AC_DEFINE(HAVE_CLOCK_T)
983fi
984
Damien Millerb54b40e2000-06-23 08:23:34 +1000985AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
986 AC_TRY_COMPILE(
987 [
988#include <sys/types.h>
989#include <sys/socket.h>
990 ],
991 [ sa_family_t foo; foo = 1235; ],
992 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100993 [ AC_TRY_COMPILE(
994 [
995#include <sys/types.h>
996#include <sys/socket.h>
997#include <netinet/in.h>
998 ],
999 [ sa_family_t foo; foo = 1235; ],
1000 [ ac_cv_have_sa_family_t="yes" ],
1001
Damien Millerb54b40e2000-06-23 08:23:34 +10001002 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001003 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001004 )
1005])
1006if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1007 AC_DEFINE(HAVE_SA_FAMILY_T)
1008fi
1009
Damien Miller0f91b4e2000-06-18 15:43:25 +10001010AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1011 AC_TRY_COMPILE(
1012 [
1013#include <sys/types.h>
1014 ],
1015 [ pid_t foo; foo = 1235; ],
1016 [ ac_cv_have_pid_t="yes" ],
1017 [ ac_cv_have_pid_t="no" ]
1018 )
1019])
1020if test "x$ac_cv_have_pid_t" = "xyes" ; then
1021 AC_DEFINE(HAVE_PID_T)
1022fi
1023
1024AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1025 AC_TRY_COMPILE(
1026 [
1027#include <sys/types.h>
1028 ],
1029 [ mode_t foo; foo = 1235; ],
1030 [ ac_cv_have_mode_t="yes" ],
1031 [ ac_cv_have_mode_t="no" ]
1032 )
1033])
1034if test "x$ac_cv_have_mode_t" = "xyes" ; then
1035 AC_DEFINE(HAVE_MODE_T)
1036fi
1037
Damien Miller61e50f12000-05-08 20:49:37 +10001038
1039AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1040 AC_TRY_COMPILE(
1041 [
Damien Miller81171112000-04-23 11:14:01 +10001042#include <sys/types.h>
1043#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001044 ],
1045 [ struct sockaddr_storage s; ],
1046 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1047 [ ac_cv_have_struct_sockaddr_storage="no" ]
1048 )
1049])
1050if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1051 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1052fi
Damien Miller34132e52000-01-14 15:45:46 +11001053
Damien Miller61e50f12000-05-08 20:49:37 +10001054AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1055 AC_TRY_COMPILE(
1056 [
Damien Miller7b22d652000-06-18 14:07:04 +10001057#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001058#include <netinet/in.h>
1059 ],
1060 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1061 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1062 [ ac_cv_have_struct_sockaddr_in6="no" ]
1063 )
1064])
1065if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1066 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1067fi
Damien Miller34132e52000-01-14 15:45:46 +11001068
Damien Miller61e50f12000-05-08 20:49:37 +10001069AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1070 AC_TRY_COMPILE(
1071 [
Damien Miller7b22d652000-06-18 14:07:04 +10001072#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001073#include <netinet/in.h>
1074 ],
1075 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1076 [ ac_cv_have_struct_in6_addr="yes" ],
1077 [ ac_cv_have_struct_in6_addr="no" ]
1078 )
1079])
1080if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1081 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1082fi
Damien Miller34132e52000-01-14 15:45:46 +11001083
Damien Miller61e50f12000-05-08 20:49:37 +10001084AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1085 AC_TRY_COMPILE(
1086 [
Damien Miller81171112000-04-23 11:14:01 +10001087#include <sys/types.h>
1088#include <sys/socket.h>
1089#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001090 ],
1091 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1092 [ ac_cv_have_struct_addrinfo="yes" ],
1093 [ ac_cv_have_struct_addrinfo="no" ]
1094 )
1095])
1096if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1097 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1098fi
1099
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001100AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1101 AC_TRY_COMPILE(
1102 [ #include <sys/time.h> ],
1103 [ struct timeval tv; tv.tv_sec = 1;],
1104 [ ac_cv_have_struct_timeval="yes" ],
1105 [ ac_cv_have_struct_timeval="no" ]
1106 )
1107])
1108if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1109 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1110 have_struct_timeval=1
1111fi
1112
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001113# If we don't have int64_t then we can't compile sftp-server. So don't
1114# even attempt to do it.
1115if test "x$ac_cv_have_int64_t" = "xno" -a \
1116 "x$ac_cv_sizeof_long_int" != "x8" -a \
1117 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1118 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001119else
1120dnl test snprintf (broken on SCO w/gcc)
1121 AC_TRY_RUN(
1122 [
1123#include <stdio.h>
1124#include <string.h>
1125#ifdef HAVE_SNPRINTF
1126main()
1127{
1128 char buf[50];
1129 char expected_out[50];
1130 int mazsize = 50 ;
1131#if (SIZEOF_LONG_INT == 8)
1132 long int num = 0x7fffffffffffffff;
1133#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001134 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001135#endif
1136 strcpy(expected_out, "9223372036854775807");
1137 snprintf(buf, mazsize, "%lld", num);
1138 if(strcmp(buf, expected_out) != 0)
1139 exit(1);
1140 exit(0);
1141}
1142#else
1143main() { exit(0); }
1144#endif
1145 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1146 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001147fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001148AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001149
Damien Miller78315eb2000-09-29 23:01:36 +11001150dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001151OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1152OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1153OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1154OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1155OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001156OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001157OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1158OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001159OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001160OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1161OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1162OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1163OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001164OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1165OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1166OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1167OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001168AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001169
Damien Miller942da032000-08-18 13:59:06 +10001170AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1171 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1172 AC_TRY_COMPILE(
1173 [
1174#include <sys/types.h>
1175#include <sys/socket.h>
1176 ],
1177 [ struct sockaddr_un s; s.sun_len = 1; ],
1178 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1179 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1180 )
1181])
1182if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1183 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1184fi
1185
Damien Miller61e50f12000-05-08 20:49:37 +10001186AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1187 ac_cv_have_ss_family_in_struct_ss, [
1188 AC_TRY_COMPILE(
1189 [
Damien Miller81171112000-04-23 11:14:01 +10001190#include <sys/types.h>
1191#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001192 ],
1193 [ struct sockaddr_storage s; s.ss_family = 1; ],
1194 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1195 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1196 )
1197])
1198if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1199 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1200fi
1201
Damien Miller61e50f12000-05-08 20:49:37 +10001202AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1203 ac_cv_have___ss_family_in_struct_ss, [
1204 AC_TRY_COMPILE(
1205 [
Damien Miller81171112000-04-23 11:14:01 +10001206#include <sys/types.h>
1207#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001208 ],
1209 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1210 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1211 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1212 )
1213])
1214if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1215 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1216fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001217
Damien Millerad833b32000-08-23 10:46:23 +10001218AC_CACHE_CHECK([for pw_class field in struct passwd],
1219 ac_cv_have_pw_class_in_struct_passwd, [
1220 AC_TRY_COMPILE(
1221 [
Damien Millerad833b32000-08-23 10:46:23 +10001222#include <pwd.h>
1223 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001224 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001225 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1226 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1227 )
1228])
1229if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1230 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1231fi
1232
Kevin Steves82456952001-06-22 21:14:18 +00001233AC_CACHE_CHECK([for pw_expire field in struct passwd],
1234 ac_cv_have_pw_expire_in_struct_passwd, [
1235 AC_TRY_COMPILE(
1236 [
1237#include <pwd.h>
1238 ],
1239 [ struct passwd p; p.pw_expire = 0; ],
1240 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1241 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1242 )
1243])
1244if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1245 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1246fi
1247
1248AC_CACHE_CHECK([for pw_change field in struct passwd],
1249 ac_cv_have_pw_change_in_struct_passwd, [
1250 AC_TRY_COMPILE(
1251 [
1252#include <pwd.h>
1253 ],
1254 [ struct passwd p; p.pw_change = 0; ],
1255 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1256 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1257 )
1258])
1259if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1260 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1261fi
Damien Miller61e50f12000-05-08 20:49:37 +10001262
1263AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1264 AC_TRY_LINK([],
1265 [ extern char *__progname; printf("%s", __progname); ],
1266 [ ac_cv_libc_defines___progname="yes" ],
1267 [ ac_cv_libc_defines___progname="no" ]
1268 )
1269])
1270if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1271 AC_DEFINE(HAVE___PROGNAME)
1272fi
1273
Damien Miller4f8e6692001-07-14 13:22:53 +10001274AC_CACHE_CHECK([whether getopt has optreset support],
1275 ac_cv_have_getopt_optreset, [
1276 AC_TRY_LINK(
1277 [
1278#include <getopt.h>
1279 ],
1280 [ extern int optreset; optreset = 0; ],
1281 [ ac_cv_have_getopt_optreset="yes" ],
1282 [ ac_cv_have_getopt_optreset="no" ]
1283 )
1284])
1285if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1286 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1287fi
Damien Millera22ba012000-03-02 23:09:20 +11001288
Damien Millerecbb26d2000-07-15 14:59:14 +10001289AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1290 AC_TRY_LINK([],
1291 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1292 [ ac_cv_libc_defines_sys_errlist="yes" ],
1293 [ ac_cv_libc_defines_sys_errlist="no" ]
1294 )
1295])
1296if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1297 AC_DEFINE(HAVE_SYS_ERRLIST)
1298fi
1299
1300
Damien Miller11fa2cc2000-08-16 10:35:58 +10001301AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1302 AC_TRY_LINK([],
1303 [ extern int sys_nerr; printf("%i", sys_nerr);],
1304 [ ac_cv_libc_defines_sys_nerr="yes" ],
1305 [ ac_cv_libc_defines_sys_nerr="no" ]
1306 )
1307])
1308if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1309 AC_DEFINE(HAVE_SYS_NERR)
1310fi
1311
1312
Damien Millerc79bc0d2001-03-28 13:03:42 +10001313# Check whether user wants Kerberos support
1314KRB4_MSG="no"
1315AC_ARG_WITH(kerberos4,
1316 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1317 [
1318 if test "x$withval" != "xno" ; then
1319
1320 if test "x$withval" != "xyes" ; then
1321 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1322 LDFLAGS="$LDFLAGS -L${withval}/lib"
1323 if test ! -z "$need_dash_r" ; then
1324 LDFLAGS="$LDFLAGS -R${withval}/lib"
1325 fi
1326 if test ! -z "$blibpath" ; then
1327 blibpath="$blibpath:${withval}/lib"
1328 fi
1329 else
1330 if test -d /usr/include/kerberosIV ; then
1331 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1332 fi
1333 fi
1334
1335 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001336 if test "$ac_cv_header_krb_h" != yes; then
1337 AC_MSG_WARN([Cannot find krb.h, build may fail])
1338 fi
Damien Miller98344742001-03-28 14:37:06 +10001339 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001340 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001341 AC_CHECK_LIB(krb4, main)
1342 if test "$ac_cv_lib_krb4_main" != yes; then
1343 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1344 else
1345 KLIBS="-lkrb4"
1346 fi
1347 else
1348 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001349 fi
Damien Miller98344742001-03-28 14:37:06 +10001350 AC_CHECK_LIB(des, des_cbc_encrypt)
1351 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1352 AC_CHECK_LIB(des425, des_cbc_encrypt)
1353 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1354 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1355 else
1356 KLIBS="-ldes425"
1357 fi
1358 else
1359 KLIBS="-ldes"
1360 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001361 AC_CHECK_LIB(resolv, dn_expand, , )
1362 KRB4=yes
1363 KRB4_MSG="yes"
1364 AC_DEFINE(KRB4)
1365 fi
1366 ]
1367)
1368
1369# Check whether user wants AFS support
1370AFS_MSG="no"
1371AC_ARG_WITH(afs,
1372 [ --with-afs=PATH Enable AFS support],
1373 [
1374 if test "x$withval" != "xno" ; then
1375
1376 if test "x$withval" != "xyes" ; then
1377 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1378 LDFLAGS="$LDFLAGS -L${withval}/lib"
1379 fi
1380
1381 if test -z "$KRB4" ; then
1382 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1383 fi
1384
1385 LIBS="-lkafs $LIBS"
1386 if test ! -z "$AFS_LIBS" ; then
1387 LIBS="$LIBS $AFS_LIBS"
1388 fi
1389 AC_DEFINE(AFS)
1390 AFS_MSG="yes"
1391 fi
1392 ]
1393)
1394LIBS="$LIBS $KLIBS"
1395
Damien Millera22ba012000-03-02 23:09:20 +11001396# Looking for programs, paths and files
1397AC_ARG_WITH(rsh,
1398 [ --with-rsh=PATH Specify path to remote shell program ],
1399 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001400 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001401 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001402 fi
1403 ],
1404 [
1405 AC_PATH_PROG(rsh_path, rsh)
1406 ]
1407)
1408
1409AC_ARG_WITH(xauth,
1410 [ --with-xauth=PATH Specify path to xauth program ],
1411 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001412 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001413 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001414 fi
1415 ],
1416 [
Damien Miller78315eb2000-09-29 23:01:36 +11001417 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 +10001418 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001419 xauth_path="/usr/openwin/bin/xauth"
1420 fi
1421 ]
1422)
1423
Damien Millera19cf472000-11-29 13:28:50 +11001424if test -z "$xauth_path" ; then
1425 XAUTH_PATH="undefined"
1426 AC_SUBST(XAUTH_PATH)
1427else
Damien Millera22ba012000-03-02 23:09:20 +11001428 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001429 XAUTH_PATH=$xauth_path
1430 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001431fi
1432if test ! -z "$rsh_path" ; then
1433 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1434fi
1435
1436# Check for mail directory (last resort if we cannot get it from headers)
1437if test ! -z "$MAIL" ; then
1438 maildir=`dirname $MAIL`
1439 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1440fi
1441
Damien Millera22ba012000-03-02 23:09:20 +11001442if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001443 AC_CHECK_FILE("/dev/ptmx",
1444 [
1445 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1446 have_dev_ptmx=1
1447 ]
1448 )
Damien Millera22ba012000-03-02 23:09:20 +11001449fi
Damien Miller204ad072000-03-02 23:56:12 +11001450AC_CHECK_FILE("/dev/ptc",
1451 [
1452 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1453 have_dev_ptc=1
1454 ]
1455)
1456
Damien Millera22ba012000-03-02 23:09:20 +11001457# Options from here on. Some of these are preset by platform above
1458
Damien Millera22ba012000-03-02 23:09:20 +11001459# Check for user-specified random device, otherwise check /dev/urandom
1460AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001461 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001462 [
Damien Miller040f3832000-04-03 14:50:43 +10001463 if test "x$withval" != "xno" ; then
1464 RANDOM_POOL="$withval";
1465 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1466 fi
Damien Millera22ba012000-03-02 23:09:20 +11001467 ],
1468 [
1469 # Check for random device
1470 AC_CHECK_FILE("/dev/urandom",
1471 [
1472 RANDOM_POOL="/dev/urandom";
1473 AC_SUBST(RANDOM_POOL)
1474 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1475 ]
1476 )
1477 ]
1478)
1479
Damien Millerd0ccb982001-03-04 00:29:20 +11001480# Check for PRNGD/EGD pool file
1481AC_ARG_WITH(prngd-port,
1482 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1483 [
1484 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1485 PRNGD_PORT="$withval"
1486 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1487 fi
1488 ]
1489)
1490
1491# Check for PRNGD/EGD pool file
1492AC_ARG_WITH(prngd-socket,
1493 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001494 [
Damien Miller040f3832000-04-03 14:50:43 +10001495 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001496 PRNGD_SOCKET="$withval"
1497 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001498 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001499 ],
1500 [
1501 # Check for existing socket only if we don't have a random device already
1502 if test -z "$RANDOM_POOL" ; then
1503 AC_MSG_CHECKING(for PRNGD/EGD socket)
1504 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001505 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001506 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1507 PRNGD_SOCKET="$sock"
1508 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001509 break;
1510 fi
1511 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001512 if test ! -z "$PRNGD_SOCKET" ; then
1513 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001514 else
1515 AC_MSG_RESULT(not found)
1516 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001517 fi
Damien Millera22ba012000-03-02 23:09:20 +11001518 ]
1519)
1520
Damien Miller0736c4d2001-01-25 10:51:46 +11001521
Damien Miller0437b332000-05-02 09:56:41 +10001522# detect pathnames for entropy gathering commands, if we need them
1523INSTALL_SSH_PRNG_CMDS=""
1524rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001525if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001526 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001527 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1528 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1529 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1530 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
Ben Lindstromd9e08242001-07-22 19:32:00 +00001531 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
Damien Miller61e50f12000-05-08 20:49:37 +10001532 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
Ben Lindstrom6db66ff2001-08-06 23:29:16 +00001533 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
Damien Miller61e50f12000-05-08 20:49:37 +10001534 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1535 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1536 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1537 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1538 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1539 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1540 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1541 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1542 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001543
1544 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001545fi
Damien Miller0437b332000-05-02 09:56:41 +10001546AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1547
Damien Miller11e37f62000-04-08 18:23:30 +10001548
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001549AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001550 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001551 [
Damien Miller897741e2001-04-16 10:41:46 +10001552 case "$withval" in
1553 man|cat|doc)
1554 MANTYPE=$withval
1555 ;;
1556 *)
1557 AC_MSG_ERROR(invalid man type: $withval)
1558 ;;
1559 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001560 ]
1561)
Ben Lindstrombc709922001-04-18 18:04:21 +00001562if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001563 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001564 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1565 MANTYPE=doc
1566 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1567 MANTYPE=man
1568 else
1569 MANTYPE=cat
1570 fi
1571fi
Damien Miller670a4b82000-01-22 13:53:11 +11001572AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001573if test "$MANTYPE" = "doc"; then
1574 mansubdir=man;
1575else
1576 mansubdir=$MANTYPE;
1577fi
1578AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001579
Damien Millera22ba012000-03-02 23:09:20 +11001580# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001581MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001582AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001583 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001584 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001585 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001586 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001587 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001588 fi
1589 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001590)
1591
Damien Millera22ba012000-03-02 23:09:20 +11001592# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001593AC_ARG_WITH(shadow,
1594 [ --without-shadow Disable shadow password support],
1595 [
1596 if test "x$withval" = "xno" ; then
1597 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001598 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001599 fi
1600 ]
1601)
1602
Damien Miller1f335fb2000-06-26 11:31:33 +10001603if test -z "$disable_shadow" ; then
1604 AC_MSG_CHECKING([if the systems has expire shadow information])
1605 AC_TRY_COMPILE(
1606 [
1607#include <sys/types.h>
1608#include <shadow.h>
1609 struct spwd sp;
1610 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1611 [ sp_expire_available=yes ], []
1612 )
1613
1614 if test "x$sp_expire_available" = "xyes" ; then
1615 AC_MSG_RESULT(yes)
1616 AC_DEFINE(HAS_SHADOW_EXPIRE)
1617 else
1618 AC_MSG_RESULT(no)
1619 fi
1620fi
1621
Damien Millera22ba012000-03-02 23:09:20 +11001622# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001623if test ! -z "$IPADDR_IN_DISPLAY" ; then
1624 DISPLAY_HACK_MSG="yes"
1625 AC_DEFINE(IPADDR_IN_DISPLAY)
1626else
1627 DISPLAY_HACK_MSG="no"
1628 AC_ARG_WITH(ipaddr-display,
1629 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1630 [
1631 if test "x$withval" != "xno" ; then
1632 AC_DEFINE(IPADDR_IN_DISPLAY)
1633 DISPLAY_HACK_MSG="yes"
1634 fi
1635 ]
1636 )
1637fi
Damien Miller76112de1999-12-21 11:18:08 +11001638
Damien Millera22ba012000-03-02 23:09:20 +11001639# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001640SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001641AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001642 [ --with-default-path=PATH Specify default \$PATH environment for server],
1643 [
1644 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001645 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001646 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001647 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001648 ],
1649 [
1650 AC_TRY_RUN(
1651 [
1652/* find out what STDPATH is */
1653#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001654#ifdef HAVE_PATHS_H
1655# include <paths.h>
1656#endif
1657#ifndef _PATH_STDPATH
1658# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1659#endif
1660#include <sys/types.h>
1661#include <sys/stat.h>
1662#include <fcntl.h>
1663#define DATA "conftest.stdpath"
1664
1665main()
1666{
1667 FILE *fd;
1668 int rc;
1669
1670 fd = fopen(DATA,"w");
1671 if(fd == NULL)
1672 exit(1);
1673
1674 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1675 exit(1);
1676
1677 exit(0);
1678}
1679 ], [ user_path=`cat conftest.stdpath` ],
1680 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1681 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1682 )
1683# make sure $bindir is in USER_PATH so scp will work
1684 t_bindir=`eval echo ${bindir}`
1685 case $t_bindir in
1686 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1687 esac
1688 case $t_bindir in
1689 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1690 esac
1691 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1692 if test $? -ne 0 ; then
1693 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1694 if test $? -ne 0 ; then
1695 user_path=$user_path:$t_bindir
1696 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1697 fi
1698 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001699 ]
1700)
Tim Rice59ea0a02001-03-10 13:50:45 -08001701AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1702AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001703
Damien Millera22ba012000-03-02 23:09:20 +11001704# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001705IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001706AC_ARG_WITH(ipv4-default,
1707 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1708 [
1709 if test "x$withval" != "xno" ; then
1710 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001711 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001712 fi
1713 ]
1714)
1715
Damien Miller61e50f12000-05-08 20:49:37 +10001716AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001717IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001718AC_ARG_WITH(4in6,
1719 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1720 [
1721 if test "x$withval" != "xno" ; then
1722 AC_MSG_RESULT(yes)
1723 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001724 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001725 else
1726 AC_MSG_RESULT(no)
1727 fi
1728 ],[
1729 if test "x$inet6_default_4in6" = "xyes"; then
1730 AC_MSG_RESULT([yes (default)])
1731 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001732 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001733 else
1734 AC_MSG_RESULT([no (default)])
1735 fi
1736 ]
1737)
1738
Damien Miller60396b02001-02-18 17:01:00 +11001739# Whether to enable BSD auth support
1740AC_ARG_WITH(bsd-auth,
1741 [ --with-bsd-auth Enable BSD auth support],
1742 [
1743 if test "x$withval" != "xno" ; then
1744 AC_DEFINE(BSD_AUTH)
1745 bsd_auth=yes
1746 fi
1747 ]
1748)
1749
Damien Miller78315eb2000-09-29 23:01:36 +11001750AC_MSG_CHECKING(whether to install ssh as suid root)
1751AC_ARG_ENABLE(suid-ssh,
1752[ --enable-suid-ssh Install ssh as suid root (default)
1753 --disable-suid-ssh Install ssh without suid bit],
1754[ case "$enableval" in
1755 no)
1756 AC_MSG_RESULT(no)
1757 SSHMODE=0711
1758 ;;
1759 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001760 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001761 ;;
1762 esac ],
1763 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001764 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001765)
1766AC_SUBST(SSHMODE)
1767
1768
Damien Millera22ba012000-03-02 23:09:20 +11001769# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001770piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001771AC_ARG_WITH(pid-dir,
1772 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1773 [
1774 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001775 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001776 fi
1777 ]
1778)
Damien Miller4018c192000-04-30 09:30:44 +10001779
Damien Miller78315eb2000-09-29 23:01:36 +11001780# make sure the directory exists
1781if test ! -d $piddir ; then
1782 piddir=`eval echo ${sysconfdir}`
1783 case $piddir in
1784 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1785 esac
1786fi
1787
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001788AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001789AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001790
andre2ff7b5d2000-06-03 14:57:40 +00001791dnl allow user to disable some login recording features
1792AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001793 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001794 [ AC_DEFINE(DISABLE_LASTLOG) ]
1795)
1796AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001797 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001798 [ AC_DEFINE(DISABLE_UTMP) ]
1799)
1800AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001801 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001802 [ AC_DEFINE(DISABLE_UTMPX) ]
1803)
1804AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001805 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001806 [ AC_DEFINE(DISABLE_WTMP) ]
1807)
1808AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001809 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001810 [ AC_DEFINE(DISABLE_WTMPX) ]
1811)
1812AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001813 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001814 [ AC_DEFINE(DISABLE_LOGIN) ]
1815)
1816AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001817 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001818 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1819)
1820AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001821 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001822 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1823)
1824AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001825 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001826 [
1827 if test "x$withval" = "xno" ; then
1828 AC_DEFINE(DISABLE_LASTLOG)
1829 else
1830 conf_lastlog_location=$withval
1831 fi
1832 ]
1833)
andre2ff7b5d2000-06-03 14:57:40 +00001834
1835dnl lastlog, [uw]tmpx? detection
1836dnl NOTE: set the paths in the platform section to avoid the
1837dnl need for command-line parameters
1838dnl lastlog and [uw]tmp are subject to a file search if all else fails
1839
1840dnl lastlog detection
1841dnl NOTE: the code itself will detect if lastlog is a directory
1842AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1843AC_TRY_COMPILE([
1844#include <sys/types.h>
1845#include <utmp.h>
1846#ifdef HAVE_LASTLOG_H
1847# include <lastlog.h>
1848#endif
Damien Miller2994e082000-06-04 15:51:47 +10001849#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001850# include <paths.h>
1851#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001852#ifdef HAVE_LOGIN_H
1853# include <login.h>
1854#endif
andre2ff7b5d2000-06-03 14:57:40 +00001855 ],
1856 [ char *lastlog = LASTLOG_FILE; ],
1857 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001858 [
1859 AC_MSG_RESULT(no)
1860 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1861 AC_TRY_COMPILE([
1862#include <sys/types.h>
1863#include <utmp.h>
1864#ifdef HAVE_LASTLOG_H
1865# include <lastlog.h>
1866#endif
1867#ifdef HAVE_PATHS_H
1868# include <paths.h>
1869#endif
1870 ],
1871 [ char *lastlog = _PATH_LASTLOG; ],
1872 [ AC_MSG_RESULT(yes) ],
1873 [
andree441aa32000-06-12 22:34:38 +00001874 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001875 system_lastlog_path=no
1876 ])
1877 ]
andre2ff7b5d2000-06-03 14:57:40 +00001878)
Damien Miller2994e082000-06-04 15:51:47 +10001879
andre2ff7b5d2000-06-03 14:57:40 +00001880if test -z "$conf_lastlog_location"; then
1881 if test x"$system_lastlog_path" = x"no" ; then
1882 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001883 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001884 conf_lastlog_location=$f
1885 fi
1886 done
1887 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001888 AC_MSG_WARN([** Cannot find lastlog **])
1889 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001890 fi
1891 fi
1892fi
1893
1894if test -n "$conf_lastlog_location"; then
1895 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1896fi
1897
1898dnl utmp detection
1899AC_MSG_CHECKING([if your system defines UTMP_FILE])
1900AC_TRY_COMPILE([
1901#include <sys/types.h>
1902#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001903#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001904# include <paths.h>
1905#endif
1906 ],
1907 [ char *utmp = UTMP_FILE; ],
1908 [ AC_MSG_RESULT(yes) ],
1909 [ AC_MSG_RESULT(no)
1910 system_utmp_path=no ]
1911)
1912if test -z "$conf_utmp_location"; then
1913 if test x"$system_utmp_path" = x"no" ; then
1914 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1915 if test -f $f ; then
1916 conf_utmp_location=$f
1917 fi
1918 done
1919 if test -z "$conf_utmp_location"; then
1920 AC_DEFINE(DISABLE_UTMP)
1921 fi
1922 fi
1923fi
1924if test -n "$conf_utmp_location"; then
1925 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1926fi
1927
1928dnl wtmp detection
1929AC_MSG_CHECKING([if your system defines WTMP_FILE])
1930AC_TRY_COMPILE([
1931#include <sys/types.h>
1932#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001933#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001934# include <paths.h>
1935#endif
1936 ],
1937 [ char *wtmp = WTMP_FILE; ],
1938 [ AC_MSG_RESULT(yes) ],
1939 [ AC_MSG_RESULT(no)
1940 system_wtmp_path=no ]
1941)
1942if test -z "$conf_wtmp_location"; then
1943 if test x"$system_wtmp_path" = x"no" ; then
1944 for f in /usr/adm/wtmp /var/log/wtmp; do
1945 if test -f $f ; then
1946 conf_wtmp_location=$f
1947 fi
1948 done
1949 if test -z "$conf_wtmp_location"; then
1950 AC_DEFINE(DISABLE_WTMP)
1951 fi
1952 fi
1953fi
1954if test -n "$conf_wtmp_location"; then
1955 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1956fi
1957
1958
1959dnl utmpx detection - I don't know any system so perverse as to require
1960dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1961dnl there, though.
1962AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1963AC_TRY_COMPILE([
1964#include <sys/types.h>
1965#include <utmp.h>
1966#ifdef HAVE_UTMPX_H
1967#include <utmpx.h>
1968#endif
Damien Miller2994e082000-06-04 15:51:47 +10001969#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001970# include <paths.h>
1971#endif
1972 ],
1973 [ char *utmpx = UTMPX_FILE; ],
1974 [ AC_MSG_RESULT(yes) ],
1975 [ AC_MSG_RESULT(no)
1976 system_utmpx_path=no ]
1977)
1978if test -z "$conf_utmpx_location"; then
1979 if test x"$system_utmpx_path" = x"no" ; then
1980 AC_DEFINE(DISABLE_UTMPX)
1981 fi
1982else
1983 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1984fi
1985
1986dnl wtmpx detection
1987AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1988AC_TRY_COMPILE([
1989#include <sys/types.h>
1990#include <utmp.h>
1991#ifdef HAVE_UTMPX_H
1992#include <utmpx.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
1997 ],
1998 [ char *wtmpx = WTMPX_FILE; ],
1999 [ AC_MSG_RESULT(yes) ],
2000 [ AC_MSG_RESULT(no)
2001 system_wtmpx_path=no ]
2002)
2003if test -z "$conf_wtmpx_location"; then
2004 if test x"$system_wtmpx_path" = x"no" ; then
2005 AC_DEFINE(DISABLE_WTMPX)
2006 fi
2007else
2008 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2009fi
2010
Damien Miller4018c192000-04-30 09:30:44 +10002011
2012# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10002013entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10002014AC_ARG_WITH(entropy-timeout,
2015 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2016 [
2017 if test "x$withval" != "xno" ; then
2018 entropy_timeout=$withval
2019 fi
2020 ]
2021)
2022AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
2023
2024
Damien Miller29ea30d2000-03-17 10:54:15 +11002025if test ! -z "$blibpath" ; then
2026 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2027 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2028fi
2029
Damien Millerbac2d8a2000-09-05 16:13:06 +11002030AC_EXEEXT
2031
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00002032AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10002033
Damien Miller7b22d652000-06-18 14:07:04 +10002034# Print summary of options
2035
Damien Miller7b22d652000-06-18 14:07:04 +10002036if test ! -z "$RANDOM_POOL" ; then
2037 RAND_MSG="Device ($RANDOM_POOL)"
2038else
Damien Millerd0ccb982001-03-04 00:29:20 +11002039 if test ! -z "$PRNGD_PORT" ; then
2040 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
2041 elif test ! -z "$PRNGD_SOCKET" ; then
2042 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10002043 else
2044 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11002045 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10002046 fi
2047fi
2048
2049# Someone please show me a better way :)
2050A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2051B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2052C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2053D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002054E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002055F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002056G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002057H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002058
2059echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002060echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002061echo " User binaries: $B"
2062echo " System binaries: $C"
2063echo " Configuration files: $D"
2064echo " Askpass program: $E"
2065echo " Manual pages: $F"
2066echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002067echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10002068echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10002069echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002070echo " PAM support: ${PAM_MSG}"
2071echo " KerberosIV support: $KRB4_MSG"
2072echo " AFS support: $AFS_MSG"
2073echo " S/KEY support: $SKEY_MSG"
2074echo " TCP Wrappers support: $TCPW_MSG"
2075echo " MD5 password support: $MD5_MSG"
2076echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2077echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2078echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2079
Damien Miller60396b02001-02-18 17:01:00 +11002080if test ! -z "$bsd_auth"; then
2081 echo " BSD Auth support: yes"
2082fi
2083
Damien Miller7b22d652000-06-18 14:07:04 +10002084echo ""
2085
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002086echo " Host: ${host}"
2087echo " Compiler: ${CC}"
2088echo " Compiler flags: ${CFLAGS}"
2089echo "Preprocessor flags: ${CPPFLAGS}"
2090echo " Linker flags: ${LDFLAGS}"
2091echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002092
2093echo ""
2094
Damien Miller82cf0ce2000-12-20 13:34:48 +11002095if test "x$PAM_MSG" = "xyes" ; then
2096 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2097 echo "otherwise password authentication may fail. Example PAM control files"
2098 echo "can be found in the contrib/ subdirectory"
2099 echo ""
2100fi
2101
Damien Miller6f9c3372000-10-25 10:06:04 +11002102if test ! -z "$BUILTIN_RNG" ; then
2103 echo "WARNING: you are using the builtin random number collection service."
2104 echo "Please read WARNING.RNG and request that your OS vendor includes"
2105 echo "/dev/random in future versions of their OS."
2106 echo ""
2107fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002108
2109if test ! -z "$NO_SFTP"; then
2110 echo "sftp-server will be disabled. Your compiler does not support"
2111 echo "64bit integers."
2112 echo ""
2113fi
Damien Miller60396b02001-02-18 17:01:00 +11002114