blob: 6f2f9baf83b25e9b8b1eb5640588b3ec69be46f2 [file] [log] [blame]
Tim Rice0502a472002-05-08 16:04:14 -07001# $Id: configure.ac,v 1.55 2002/05/08 23:04:14 tim Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110020AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100060 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Millerfa2bb692002-04-23 23:22:25 +100061 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
64 AC_TRY_LINK([],
65 [],
66 [
67 AC_MSG_RESULT(yes)
68 blibpath="/usr/lib:/lib:/usr/local/lib"
69 ],
70 [ AC_MSG_RESULT(no) ]
71 )
72 LDFLAGS="$saved_LDFLAGS"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100074 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110075 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100076 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000077 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110079 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110080*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080081 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110082 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000083 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110084 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(IPV4_DEFAULT)
86 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000087 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110088 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000089*-*-dgux*)
90 AC_DEFINE(IP_TOS_IS_BROKEN)
91 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000092*-*-darwin*)
93 AC_DEFINE(BROKEN_GETADDRINFO)
94 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +000095*-*-hpux10.26)
96 if test -z "$GCC"; then
97 CFLAGS="$CFLAGS -Ae"
98 fi
99 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
100 IPADDR_IN_DISPLAY=yes
101 AC_DEFINE(HAVE_SECUREWARE)
102 AC_DEFINE(USE_PIPES)
103 AC_DEFINE(LOGIN_NO_ENDOPT)
104 AC_DEFINE(LOGIN_NEEDS_UTMPX)
105 AC_DEFINE(DISABLE_SHADOW)
106 AC_DEFINE(DISABLE_UTMP)
107 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
108 LIBS="$LIBS -lxnet -lsec -lsecpw"
109 disable_ptmx_check=yes
110 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100111*-*-hpux10*)
112 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000113 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100114 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000115 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100116 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000117 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000118 AC_DEFINE(LOGIN_NO_ENDOPT)
119 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100120 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100121 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000122 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +0000123 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +1100124 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000125*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000126 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100127 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100128 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100129 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000130 AC_DEFINE(LOGIN_NO_ENDOPT)
131 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100132 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100133 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000134 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000135 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000136 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100137*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000138 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000139 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100140 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000141 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000142 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100143 ;;
144*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000145 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000146 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100147 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000148 AC_DEFINE(WITH_IRIX_ARRAY)
149 AC_DEFINE(WITH_IRIX_PROJECT)
150 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000151 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000152 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000153 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100154 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100155*-*-linux*)
156 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100157 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100158 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000159 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100160 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100161 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000162mips-sony-bsd|mips-sony-newsos4)
163 AC_DEFINE(HAVE_NEWS4)
164 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000165 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100166*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100167 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100168 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100169*-*-freebsd*)
170 check_for_libcrypt_later=1
171 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000172*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000173 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100174 conf_utmp_location=/etc/utmp
175 conf_wtmp_location=/usr/adm/wtmp
176 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000177 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000178 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000179 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100180 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000182 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000183 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100184*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000186 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100187 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100188 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000189 AC_DEFINE(LOGIN_NEEDS_UTMPX)
190 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000191 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000192 # hardwire lastlog location (can't detect it on some versions)
193 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000194 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
195 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
196 if test "$sol2ver" -ge 8; then
197 AC_MSG_RESULT(yes)
198 AC_DEFINE(DISABLE_UTMP)
199 AC_DEFINE(DISABLE_WTMP)
200 else
201 AC_MSG_RESULT(no)
202 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100203 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000204*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000205 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000206 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100207 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000208 conf_utmp_location=/etc/utmp
209 conf_wtmp_location=/var/adm/wtmp
210 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000211 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000212 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000213*-ncr-sysv*)
214 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700216 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000217 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000218 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000219*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000220 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700221 # /usr/ucblib MUST NOT be searched on ReliantUNIX
222 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100223 IPADDR_IN_DISPLAY=yes
224 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000225 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700226 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
227 # Attention: always take care to bind libsocket and libnsl before libc,
228 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000229 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100230*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000231 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100232 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700233# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100235 ;;
236*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700239# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100240 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100241 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100242*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100245 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100246*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000247 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100248 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700249 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100250 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100251 RANLIB=true
252 no_dev_ptmx=1
253 AC_DEFINE(BROKEN_SYS_TERMIO_H)
254 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000255 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000256 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100257 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100258 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700259 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700260 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100261 ;;
262*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000263 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000264 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100265 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000266 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100267 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100268 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000269 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000270 AC_DEFINE(DISABLE_SHADOW)
Damien Miller217f5672001-02-16 12:12:41 +1100271 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700272 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000273 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000274*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700275 no_libsocket=1
276 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000277 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700278 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
279 LIBS="$LIBS -lgen -lrsc"
280 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000281*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000282 AC_MSG_CHECKING(for Digital Unix SIA)
283 no_osfsia=""
284 AC_ARG_WITH(osfsia,
285 [ --with-osfsia Enable Digital Unix SIA],
286 [
287 if test "x$withval" = "xno" ; then
288 AC_MSG_RESULT(disabled)
289 no_osfsia=1
290 fi
291 ],
292 )
293 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000294 if test -f /etc/sia/matrix.conf; then
295 AC_MSG_RESULT(yes)
296 AC_DEFINE(HAVE_OSF_SIA)
297 AC_DEFINE(DISABLE_LOGIN)
298 LIBS="$LIBS -lsecurity -ldb -lm -laud"
299 else
300 AC_MSG_RESULT(no)
301 fi
302 fi
303 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000304
305*-*-nto-qnx)
306 AC_DEFINE(USE_PIPES)
307 AC_DEFINE(NO_X11_UNIX_SOCKETS)
308 AC_DEFINE(MISSING_NFDBITS)
309 AC_DEFINE(MISSING_HOWMANY)
310 AC_DEFINE(MISSING_FD_MASK)
311 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100312esac
313
Damien Millere37bfc12000-06-05 09:37:43 +1000314# Allow user to specify flags
315AC_ARG_WITH(cflags,
316 [ --with-cflags Specify additional flags to pass to compiler],
317 [
318 if test "x$withval" != "xno" ; then
319 CFLAGS="$CFLAGS $withval"
320 fi
321 ]
322)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000323AC_ARG_WITH(cppflags,
324 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
325 [
326 if test "x$withval" != "xno"; then
327 CPPFLAGS="$CPPFLAGS $withval"
328 fi
329 ]
330)
Damien Millere37bfc12000-06-05 09:37:43 +1000331AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000332 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000333 [
334 if test "x$withval" != "xno" ; then
335 LDFLAGS="$LDFLAGS $withval"
336 fi
337 ]
338)
339AC_ARG_WITH(libs,
340 [ --with-libs Specify additional libraries to link with],
341 [
342 if test "x$withval" != "xno" ; then
343 LIBS="$LIBS $withval"
344 fi
345 ]
346)
347
Tim Rice4cec93f2002-02-26 08:40:48 -0800348# Checks for header files.
349AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
350 getopt.h glob.h lastlog.h limits.h login.h \
351 login_cap.h maillock.h netdb.h netgroup.h \
Kevin Stevesb1184bb2002-04-07 18:12:03 +0000352 netinet/in_systm.h paths.h pty.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000353 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800354 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Kevin Stevesb1184bb2002-04-07 18:12:03 +0000355 sys/mman.h sys/select.h sys/stat.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800356 sys/stropts.h sys/sysmacros.h sys/time.h \
Kevin Steves117b06d2002-03-30 17:55:21 +0000357 sys/un.h time.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800358 util.h utime.h utmp.h utmpx.h)
359
Damien Millera22ba012000-03-02 23:09:20 +1100360# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700361AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
362AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000363
Damien Millerdf288022001-02-18 13:07:07 +1100364dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700365if test "x$with_tcp_wrappers" != "xno" ; then
366 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
367 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
368 fi
369fi
Damien Millerdf288022001-02-18 13:07:07 +1100370
Tim Rice13aae5e2001-10-21 17:53:58 -0700371AC_CHECK_FUNC(getspnam, ,
372 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700373
Damien Miller150c8b52002-02-13 23:06:56 +1100374AC_ARG_WITH(rpath,
375 [ --without-rpath Disable auto-added -R linker paths],
376 [
377 if test "x$withval" = "xno" ; then
378 need_dash_r=""
379 fi
380 if test "x$withval" = "xyes" ; then
381 need_dash_r=1
382 fi
383 ]
384)
385
Tim Rice13aae5e2001-10-21 17:53:58 -0700386dnl zlib is required
387AC_ARG_WITH(zlib,
388 [ --with-zlib=PATH Use zlib in PATH],
389 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000390 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100391 AC_MSG_ERROR([*** zlib is required ***])
392 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700393 if test -d "$withval/lib"; then
394 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700395 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700396 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700397 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700398 fi
399 else
400 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700401 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700402 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700403 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700404 fi
405 fi
406 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700407 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700408 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700409 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700410 fi
411 ]
412)
413
Tim Rice17b93e52001-10-23 22:36:54 -0700414AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100415
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000416dnl UnixWare 2.x
417AC_CHECK_FUNC(strcasecmp,
418 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
419)
420AC_CHECK_FUNC(utimes,
421 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
422)
Damien Millerab18c411999-11-11 10:40:23 +1100423
Tim Ricee589a292001-11-03 11:09:32 -0800424dnl Checks for libutil functions
425AC_CHECK_HEADERS(libutil.h)
426AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
427AC_CHECK_FUNCS(logout updwtmp logwtmp)
428
Ben Lindstrom8697e082001-02-24 21:41:10 +0000429AC_FUNC_STRFTIME
430
Damien Miller3c027682001-03-14 11:39:45 +1100431# Check for ALTDIRFUNC glob() extension
432AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
433AC_EGREP_CPP(FOUNDIT,
434 [
435 #include <glob.h>
436 #ifdef GLOB_ALTDIRFUNC
437 FOUNDIT
438 #endif
439 ],
440 [
441 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
442 AC_MSG_RESULT(yes)
443 ],
444 [
445 AC_MSG_RESULT(no)
446 ]
447)
Damien Millerab18c411999-11-11 10:40:23 +1100448
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000449# Check for g.gl_matchc glob() extension
450AC_MSG_CHECKING(for gl_matchc field in glob_t)
451AC_EGREP_CPP(FOUNDIT,
452 [
453 #include <glob.h>
454 int main(void){glob_t g; g.gl_matchc = 1;}
455 ],
456 [
457 AC_DEFINE(GLOB_HAS_GL_MATCHC)
458 AC_MSG_RESULT(yes)
459 ],
460 [
461 AC_MSG_RESULT(no)
462 ]
463)
464
Damien Miller18bb4732001-03-28 14:35:30 +1000465AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
466AC_TRY_RUN(
467 [
468#include <sys/types.h>
469#include <dirent.h>
470int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
471 ],
472 [AC_MSG_RESULT(yes)],
473 [
474 AC_MSG_RESULT(no)
475 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
476 ]
477)
478
Damien Millerc547bf12001-02-16 10:18:12 +1100479# Check whether user wants S/Key support
480SKEY_MSG="no"
481AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700482 [ --with-skey[[=PATH]] Enable S/Key support
483 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100484 [
485 if test "x$withval" != "xno" ; then
486
487 if test "x$withval" != "xyes" ; then
488 CPPFLAGS="$CPPFLAGS -I${withval}/include"
489 LDFLAGS="$LDFLAGS -L${withval}/lib"
490 fi
491
492 AC_DEFINE(SKEY)
493 LIBS="-lskey $LIBS"
494 SKEY_MSG="yes"
495
Tim Rice4cec93f2002-02-26 08:40:48 -0800496 AC_MSG_CHECKING([for s/key support])
497 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100498 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800499#include <stdio.h>
500#include <skey.h>
501int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
502 ],
503 [AC_MSG_RESULT(yes)],
504 [
505 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100506 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
507 ])
508 fi
509 ]
510)
511
512# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700513TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100514AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700515 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
516 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100517 [
518 if test "x$withval" != "xno" ; then
519 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700520 saved_LDFLAGS="$LDFLAGS"
521 saved_CPPFLAGS="$CPPFLAGS"
522 if test -n "${withval}" -a "${withval}" != "yes"; then
523 if test -d "${withval}/lib"; then
524 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700525 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700526 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700527 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700528 fi
529 else
530 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700531 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700532 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700533 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700534 fi
535 fi
536 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700537 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700538 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700539 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700540 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700541 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800542 LIBWRAP="-lwrap"
543 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100544 AC_MSG_CHECKING(for libwrap)
545 AC_TRY_LINK(
546 [
547#include <tcpd.h>
548 int deny_severity = 0, allow_severity = 0;
549 ],
550 [hosts_access(0);],
551 [
552 AC_MSG_RESULT(yes)
553 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800554 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700555 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100556 ],
557 [
558 AC_MSG_ERROR([*** libwrap missing])
559 ]
560 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800561 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100562 fi
563 ]
564)
565
Damien Millerad833b32000-08-23 10:46:23 +1000566dnl Checks for library functions.
Ben Lindstromfdee8ef2002-04-06 23:52:02 +0000567AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
Tim Rice13aae5e2001-10-21 17:53:58 -0700568 clock fchmod fchown freeaddrinfo futimes gai_strerror \
569 getaddrinfo getcwd getgrouplist getnameinfo getopt \
570 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
571 inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller594a71b2002-04-23 20:22:59 +1000572 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
573 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
574 setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \
Kevin Stevese0f2ca42002-04-10 23:17:05 +0000575 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Tim Rice4bd2a192002-05-07 19:51:31 -0700576 strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \
Tim Rice13aae5e2001-10-21 17:53:58 -0700577 vhangup vsnprintf waitpid __b64_ntop _getpty)
578
579dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700580AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700581 AC_CHECK_LIB(gen, dirname,[
582 AC_CACHE_CHECK([for broken dirname],
583 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700584 save_LIBS="$LIBS"
585 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700586 AC_TRY_RUN(
587 [
588#include <libgen.h>
589#include <string.h>
590
591int main(int argc, char **argv) {
592 char *s, buf[32];
593
594 strncpy(buf,"/etc", 32);
595 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700596 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700597 exit(1);
598 } else {
599 exit(0);
600 }
601}
602 ],
603 [ ac_cv_have_broken_dirname="no" ],
604 [ ac_cv_have_broken_dirname="yes" ]
605 )
Tim Rice17b93e52001-10-23 22:36:54 -0700606 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700607 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700608 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 LIBS="$LIBS -lgen"
610 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700611 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700612 fi
613 ])
614])
615
Damien Millerad833b32000-08-23 10:46:23 +1000616dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000617AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000618dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000619AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000620AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000621dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000622AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000623AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100624
Damien Miller5fc85652000-07-09 23:53:07 +1000625AC_CHECK_FUNC(getuserattr,
626 [AC_DEFINE(HAVE_GETUSERATTR)],
627 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
628)
629
Damien Miller04f80141999-11-19 15:32:34 +1100630AC_CHECK_FUNC(daemon,
631 [AC_DEFINE(HAVE_DAEMON)],
632 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
633)
634
Damien Miller9fb07e42000-03-05 16:22:59 +1100635AC_CHECK_FUNC(getpagesize,
636 [AC_DEFINE(HAVE_GETPAGESIZE)],
637 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
638)
639
Damien Millercb170cb2000-07-01 16:52:55 +1000640# Check for broken snprintf
641if test "x$ac_cv_func_snprintf" = "xyes" ; then
642 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
643 AC_TRY_RUN(
644 [
645#include <stdio.h>
646int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
647 ],
648 [AC_MSG_RESULT(yes)],
649 [
650 AC_MSG_RESULT(no)
651 AC_DEFINE(BROKEN_SNPRINTF)
652 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
653 ]
654 )
655fi
656
Damien Miller606f8802000-09-16 15:39:56 +1100657AC_FUNC_GETPGRP
658
Damien Millera64b57a2001-01-17 10:44:13 +1100659# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000660PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100661AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100662 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100663 [
Damien Millera64b57a2001-01-17 10:44:13 +1100664 if test "x$withval" != "xno" ; then
665 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
666 AC_MSG_ERROR([PAM headers not found])
667 fi
668
669 AC_CHECK_LIB(dl, dlopen, , )
670 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
671 AC_CHECK_FUNCS(pam_getenvlist)
672
673 disable_shadow=yes
674 PAM_MSG="yes"
675
676 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800677 if test $ac_cv_lib_dl_dlopen = yes; then
678 LIBPAM="-lpam -ldl"
679 else
680 LIBPAM="-lpam"
681 fi
682 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100683 fi
684 ]
685)
Damien Millera22ba012000-03-02 23:09:20 +1100686
Damien Millera64b57a2001-01-17 10:44:13 +1100687# Check for older PAM
688if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100689 # Check PAM strerror arguments (old PAM)
690 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
691 AC_TRY_COMPILE(
692 [
Damien Miller81171112000-04-23 11:14:01 +1000693#include <stdlib.h>
694#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100695 ],
696 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
697 [AC_MSG_RESULT(no)],
698 [
699 AC_DEFINE(HAVE_OLD_PAM)
700 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000701 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100702 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100703 )
Damien Millera22ba012000-03-02 23:09:20 +1100704fi
705
706# The big search for OpenSSL
707AC_ARG_WITH(ssl-dir,
708 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
709 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000710 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100711 tryssldir=$withval
712 fi
713 ]
714)
715
716saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100717saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000718saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100719if test "x$prefix" != "xNONE" ; then
720 tryssldir="$tryssldir $prefix"
721fi
Damien Miller61e50f12000-05-08 20:49:37 +1000722AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100723 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 +1100724 CPPFLAGS="$saved_CPPFLAGS"
725 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000726 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100727
728 # Skip directories if they don't exist
729 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
730 continue;
731 fi
732 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
733 # Try to use $ssldir/lib if it exists, otherwise
734 # $ssldir
735 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000736 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100737 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000738 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100739 fi
740 else
Damien Millerb68af622001-03-28 21:05:26 +1000741 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100742 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000743 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100744 fi
745 fi
746 # Try to use $ssldir/include if it exists, otherwise
747 # $ssldir
748 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000749 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100750 else
Damien Millerb68af622001-03-28 21:05:26 +1000751 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100752 fi
753 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000754
Damien Miller3b512e12000-05-17 23:29:18 +1000755 # Basic test to check for compatible version and correct linking
756 # *does not* test for RSA - that comes later.
757 AC_TRY_RUN(
758 [
Damien Millere59ce622000-05-01 20:54:17 +1000759#include <string.h>
760#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000761int main(void)
762{
Damien Miller3b512e12000-05-17 23:29:18 +1000763 char a[2048];
764 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000765 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000766 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000767}
Damien Miller3b512e12000-05-17 23:29:18 +1000768 ],
769 [
770 found_crypto=1
771 break;
772 ], []
773 )
Damien Miller61e50f12000-05-08 20:49:37 +1000774
775 if test ! -z "$found_crypto" ; then
776 break;
777 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100778 done
779
Damien Miller61e50f12000-05-08 20:49:37 +1000780 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100781 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100782 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000783 if test -z "$ssldir" ; then
784 ssldir="(system)"
785 fi
Damien Millera22ba012000-03-02 23:09:20 +1100786
Damien Miller61e50f12000-05-08 20:49:37 +1000787 ac_cv_openssldir=$ssldir
788])
789
Damien Milleredb82922000-06-20 13:25:52 +1000790if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000791 AC_DEFINE(HAVE_OPENSSL)
792 dnl Need to recover ssldir - test above runs in subshell
793 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100794 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100795 # Try to use $ssldir/lib if it exists, otherwise
796 # $ssldir
797 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000798 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100799 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000800 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100801 fi
802 else
Damien Millerb68af622001-03-28 21:05:26 +1000803 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100804 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000805 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100806 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100807 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100808 # Try to use $ssldir/include if it exists, otherwise
809 # $ssldir
810 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000811 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100812 else
Damien Millerb68af622001-03-28 21:05:26 +1000813 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100814 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100815 fi
Damien Millera22ba012000-03-02 23:09:20 +1100816fi
Damien Miller3b512e12000-05-17 23:29:18 +1000817LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000818
Damien Miller3b512e12000-05-17 23:29:18 +1000819# Now test RSA support
820saved_LIBS="$LIBS"
821AC_MSG_CHECKING([for RSA support])
822for WANTS_RSAREF in "" 1 ; do
823 if test -z "$WANTS_RSAREF" ; then
824 LIBS="$saved_LIBS"
825 else
826 LIBS="$saved_LIBS -lRSAglue -lrsaref"
827 fi
828 AC_TRY_RUN([
829#include <string.h>
830#include <openssl/rand.h>
831#include <openssl/rsa.h>
832#include <openssl/bn.h>
833#include <openssl/sha.h>
834int main(void)
835{
836 int num; RSA *key; static unsigned char p_in[] = "blahblah";
837 unsigned char c[256], p[256];
838 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
839 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
840 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
841 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
842}
843 ],
844 [
845 rsa_works=1
846 break;
847 ], [])
848done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000849LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000850
851if test ! -z "$no_rsa" ; then
852 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000853 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000854else
855 if test -z "$rsa_works" ; then
856 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000857 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000858 else
859 if test -z "$WANTS_RSAREF" ; then
860 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000861 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000862 else
Damien Miller7b22d652000-06-18 14:07:04 +1000863 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000864 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000865 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000866 fi
867 fi
868fi
Damien Millera22ba012000-03-02 23:09:20 +1100869
Damien Millerec932372002-01-22 22:16:03 +1100870# Sanity check OpenSSL headers
871AC_MSG_CHECKING([whether OpenSSL's headers match the library])
872AC_TRY_RUN(
873 [
874#include <string.h>
875#include <openssl/opensslv.h>
876int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
877 ],
878 [
879 AC_MSG_RESULT(yes)
880 ],
881 [
882 AC_MSG_RESULT(no)
883 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
884 ]
885)
886
Damien Millera64b57a2001-01-17 10:44:13 +1100887# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
888# version in OpenSSL. Skip this for PAM
889if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100890 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100891fi
892
Damien Miller6c21c512002-01-22 21:57:53 +1100893
894### Configure cryptographic random number support
895
896# Check wheter OpenSSL seeds itself
897AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
898AC_TRY_RUN(
899 [
900#include <string.h>
901#include <openssl/rand.h>
902int main(void) { return(RAND_status() == 1 ? 0 : 1); }
903 ],
904 [
905 OPENSSL_SEEDS_ITSELF=yes
906 AC_MSG_RESULT(yes)
907 ],
908 [
909 AC_MSG_RESULT(no)
910 # Default to use of the rand helper if OpenSSL doesn't
911 # seed itself
912 USE_RAND_HELPER=yes
913 ]
914)
915
916
917# Do we want to force the use of the rand helper?
918AC_ARG_WITH(rand-helper,
919 [ --with-rand-helper Use subprocess to gather strong randomness ],
920 [
921 if test "x$withval" = "xno" ; then
922 # Force use of OpenSSL's internal RNG, even if
923 # the previous test showed it to be unseeded.
924 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
925 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
926 OPENSSL_SEEDS_ITSELF=yes
927 USE_RAND_HELPER=""
928 fi
929 else
930 USE_RAND_HELPER=yes
931 fi
932 ],
933)
934
935# Which randomness source do we use?
936if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
937 # OpenSSL only
938 AC_DEFINE(OPENSSL_PRNG_ONLY)
939 RAND_MSG="OpenSSL internal ONLY"
940 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800941elif test ! -z "$USE_RAND_HELPER" ; then
942 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100943 RAND_MSG="ssh-rand-helper"
944 INSTALL_SSH_RAND_HELPER="yes"
945fi
946AC_SUBST(INSTALL_SSH_RAND_HELPER)
947
948### Configuration of ssh-rand-helper
949
950# PRNGD TCP socket
951AC_ARG_WITH(prngd-port,
952 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
953 [
Damien Millere996d722002-01-23 11:20:59 +1100954 case "$withval" in
955 no)
956 withval=""
957 ;;
958 [[0-9]]*)
959 ;;
960 *)
961 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
962 ;;
963 esac
964 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100965 PRNGD_PORT="$withval"
966 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
967 fi
968 ]
969)
970
971# PRNGD Unix domain socket
972AC_ARG_WITH(prngd-socket,
973 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
974 [
Damien Millere996d722002-01-23 11:20:59 +1100975 case "$withval" in
976 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100977 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100978 ;;
979 no)
980 withval=""
981 ;;
982 /*)
983 ;;
984 *)
985 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
986 ;;
987 esac
988
989 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100990 if test ! -z "$PRNGD_PORT" ; then
991 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
992 fi
Damien Miller6385ba02002-01-23 08:12:36 +1100993 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100994 AC_MSG_WARN(Entropy socket is not readable)
995 fi
996 PRNGD_SOCKET="$withval"
997 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
998 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800999 ],
1000 [
1001 # Check for existing socket only if we don't have a random device already
1002 if test "$USE_RAND_HELPER" = yes ; then
1003 AC_MSG_CHECKING(for PRNGD/EGD socket)
1004 # Insert other locations here
1005 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1006 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1007 PRNGD_SOCKET="$sock"
1008 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1009 break;
1010 fi
1011 done
1012 if test ! -z "$PRNGD_SOCKET" ; then
1013 AC_MSG_RESULT($PRNGD_SOCKET)
1014 else
1015 AC_MSG_RESULT(not found)
1016 fi
1017 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001018 ]
1019)
1020
1021# Change default command timeout for hashing entropy source
1022entropy_timeout=200
1023AC_ARG_WITH(entropy-timeout,
1024 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1025 [
1026 if test "x$withval" != "xno" ; then
1027 entropy_timeout=$withval
1028 fi
1029 ]
1030)
Damien Miller6c21c512002-01-22 21:57:53 +11001031AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1032
Kevin Steves7ff91122002-04-07 19:22:54 +00001033ssh_privsep_user=sshd
1034AC_ARG_WITH(privsep-user,
1035 [ --with-privsep-user Specify non-privileged user for privilege separation],
1036 [
1037 if test -n "$withval"; then
1038 ssh_privsep_user=$withval
1039 fi
1040 ]
1041)
Kevin Steves4e0bb522002-04-07 19:44:14 +00001042AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
Kevin Steves7ff91122002-04-07 19:22:54 +00001043
Tim Rice88f2ab52002-03-17 12:17:34 -08001044# We do this little dance with the search path to insure
1045# that programs that we select for use by installed programs
1046# (which may be run by the super-user) come from trusted
1047# locations before they come from the user's private area.
1048# This should help avoid accidentally configuring some
1049# random version of a program in someone's personal bin.
1050
1051OPATH=$PATH
1052PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001053test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001054test -d /sbin && PATH=$PATH:/sbin
1055test -d /usr/sbin && PATH=$PATH:/usr/sbin
1056PATH=$PATH:/etc:$OPATH
1057
Damien Miller6c21c512002-01-22 21:57:53 +11001058# These programs are used by the command hashing source to gather entropy
1059OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1060OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1061OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1062OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1063OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1064OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1065OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1066OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1067OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1068OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1069OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1070OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1071OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1072OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1073OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1074OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001075# restore PATH
1076PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001077
1078# Where does ssh-rand-helper get its randomness from?
1079INSTALL_SSH_PRNG_CMDS=""
1080if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1081 if test ! -z "$PRNGD_PORT" ; then
1082 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1083 elif test ! -z "$PRNGD_SOCKET" ; then
1084 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1085 else
1086 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1087 RAND_HELPER_CMDHASH=yes
1088 INSTALL_SSH_PRNG_CMDS="yes"
1089 fi
1090fi
1091AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1092
1093
Ben Lindstromb5628642000-10-18 00:02:25 +00001094# Cheap hack to ensure NEWS-OS libraries are arranged right.
1095if test ! -z "$SONY" ; then
1096 LIBS="$LIBS -liberty";
1097fi
1098
Damien Millera22ba012000-03-02 23:09:20 +11001099# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001100AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001101AC_CHECK_SIZEOF(short int, 2)
1102AC_CHECK_SIZEOF(int, 4)
1103AC_CHECK_SIZEOF(long int, 4)
1104AC_CHECK_SIZEOF(long long int, 8)
1105
Damien Millerfa2bb692002-04-23 23:22:25 +10001106# Sanity check long long for some platforms (AIX)
1107if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1108 ac_cv_sizeof_long_long_int=0
1109fi
1110
Damien Millera22ba012000-03-02 23:09:20 +11001111# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001112AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1113 AC_TRY_COMPILE(
1114 [ #include <sys/types.h> ],
1115 [ u_int a; a = 1;],
1116 [ ac_cv_have_u_int="yes" ],
1117 [ ac_cv_have_u_int="no" ]
1118 )
1119])
1120if test "x$ac_cv_have_u_int" = "xyes" ; then
1121 AC_DEFINE(HAVE_U_INT)
1122 have_u_int=1
1123fi
1124
Damien Miller61e50f12000-05-08 20:49:37 +10001125AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1126 AC_TRY_COMPILE(
1127 [ #include <sys/types.h> ],
1128 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1129 [ ac_cv_have_intxx_t="yes" ],
1130 [ ac_cv_have_intxx_t="no" ]
1131 )
1132])
1133if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1134 AC_DEFINE(HAVE_INTXX_T)
1135 have_intxx_t=1
1136fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001137
1138if (test -z "$have_intxx_t" && \
1139 test "x$ac_cv_header_stdint_h" = "xyes")
1140then
1141 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1142 AC_TRY_COMPILE(
1143 [ #include <stdint.h> ],
1144 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1145 [
1146 AC_DEFINE(HAVE_INTXX_T)
1147 AC_MSG_RESULT(yes)
1148 ],
1149 [ AC_MSG_RESULT(no) ]
1150 )
1151fi
1152
Damien Miller578783e2000-09-23 14:12:24 +11001153AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1154 AC_TRY_COMPILE(
1155 [ #include <sys/types.h> ],
1156 [ int64_t a; a = 1;],
1157 [ ac_cv_have_int64_t="yes" ],
1158 [ ac_cv_have_int64_t="no" ]
1159 )
1160])
1161if test "x$ac_cv_have_int64_t" = "xyes" ; then
1162 AC_DEFINE(HAVE_INT64_T)
1163 have_int64_t=1
1164fi
1165
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001166if test -z "$have_int64_t" ; then
1167 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1168 AC_TRY_COMPILE(
1169 [ #include <sys/socket.h> ],
1170 [ int64_t a; a = 1],
1171 [
1172 AC_DEFINE(HAVE_INT64_T)
1173 AC_MSG_RESULT(yes)
1174 ],
1175 [ AC_MSG_RESULT(no) ]
1176 )
1177fi
1178
Tim Rice4cec93f2002-02-26 08:40:48 -08001179if test -z "$have_int64_t" ; then
1180 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1181 AC_TRY_COMPILE(
1182 [ #include <sys/bitypes.h> ],
1183 [ int64_t a; a = 1],
1184 [
1185 AC_DEFINE(HAVE_INT64_T)
1186 AC_MSG_RESULT(yes)
1187 ],
1188 [ AC_MSG_RESULT(no) ]
1189 )
1190fi
1191
Damien Miller61e50f12000-05-08 20:49:37 +10001192AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1193 AC_TRY_COMPILE(
1194 [ #include <sys/types.h> ],
1195 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1196 [ ac_cv_have_u_intxx_t="yes" ],
1197 [ ac_cv_have_u_intxx_t="no" ]
1198 )
1199])
1200if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1201 AC_DEFINE(HAVE_U_INTXX_T)
1202 have_u_intxx_t=1
1203fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001204
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001205if test -z "$have_u_intxx_t" ; then
1206 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1207 AC_TRY_COMPILE(
1208 [ #include <sys/socket.h> ],
1209 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1210 [
1211 AC_DEFINE(HAVE_U_INTXX_T)
1212 AC_MSG_RESULT(yes)
1213 ],
1214 [ AC_MSG_RESULT(no) ]
1215 )
1216fi
1217
Damien Miller578783e2000-09-23 14:12:24 +11001218AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1219 AC_TRY_COMPILE(
1220 [ #include <sys/types.h> ],
1221 [ u_int64_t a; a = 1;],
1222 [ ac_cv_have_u_int64_t="yes" ],
1223 [ ac_cv_have_u_int64_t="no" ]
1224 )
1225])
1226if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1227 AC_DEFINE(HAVE_U_INT64_T)
1228 have_u_int64_t=1
1229fi
1230
Tim Rice4cec93f2002-02-26 08:40:48 -08001231if test -z "$have_u_int64_t" ; then
1232 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1233 AC_TRY_COMPILE(
1234 [ #include <sys/bitypes.h> ],
1235 [ u_int64_t a; a = 1],
1236 [
1237 AC_DEFINE(HAVE_U_INT64_T)
1238 AC_MSG_RESULT(yes)
1239 ],
1240 [ AC_MSG_RESULT(no) ]
1241 )
1242fi
1243
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001244if test -z "$have_u_intxx_t" ; then
1245 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1246 AC_TRY_COMPILE(
1247 [
1248#include <sys/types.h>
1249 ],
1250 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1251 [ ac_cv_have_uintxx_t="yes" ],
1252 [ ac_cv_have_uintxx_t="no" ]
1253 )
1254 ])
1255 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1256 AC_DEFINE(HAVE_UINTXX_T)
1257 fi
1258fi
1259
1260if test -z "$have_uintxx_t" ; then
1261 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1262 AC_TRY_COMPILE(
1263 [ #include <stdint.h> ],
1264 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1265 [
1266 AC_DEFINE(HAVE_UINTXX_T)
1267 AC_MSG_RESULT(yes)
1268 ],
1269 [ AC_MSG_RESULT(no) ]
1270 )
1271fi
1272
Damien Milleredb82922000-06-20 13:25:52 +10001273if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1274 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001275then
1276 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1277 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001278 [
1279#include <sys/bitypes.h>
1280 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001281 [
Damien Miller70494d12000-04-03 15:57:06 +10001282 int8_t a; int16_t b; int32_t c;
1283 u_int8_t e; u_int16_t f; u_int32_t g;
1284 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001285 ],
1286 [
1287 AC_DEFINE(HAVE_U_INTXX_T)
1288 AC_DEFINE(HAVE_INTXX_T)
1289 AC_MSG_RESULT(yes)
1290 ],
1291 [AC_MSG_RESULT(no)]
1292 )
1293fi
1294
Damien Miller58be7382001-09-15 21:31:54 +10001295
1296AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1297 AC_TRY_COMPILE(
1298 [
1299#include <sys/types.h>
1300 ],
1301 [ u_char foo; foo = 125; ],
1302 [ ac_cv_have_u_char="yes" ],
1303 [ ac_cv_have_u_char="no" ]
1304 )
1305])
1306if test "x$ac_cv_have_u_char" = "xyes" ; then
1307 AC_DEFINE(HAVE_U_CHAR)
1308fi
1309
Tim Rice13aae5e2001-10-21 17:53:58 -07001310TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001311
Tim Rice200a5c02002-02-26 22:12:34 -08001312AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001313
Damien Miller61e50f12000-05-08 20:49:37 +10001314AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1315 AC_TRY_COMPILE(
1316 [
1317#include <sys/types.h>
1318 ],
1319 [ size_t foo; foo = 1235; ],
1320 [ ac_cv_have_size_t="yes" ],
1321 [ ac_cv_have_size_t="no" ]
1322 )
1323])
1324if test "x$ac_cv_have_size_t" = "xyes" ; then
1325 AC_DEFINE(HAVE_SIZE_T)
1326fi
Damien Miller95058511999-12-29 10:36:45 +11001327
Damien Miller615f9392000-05-17 22:53:33 +10001328AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1329 AC_TRY_COMPILE(
1330 [
1331#include <sys/types.h>
1332 ],
1333 [ ssize_t foo; foo = 1235; ],
1334 [ ac_cv_have_ssize_t="yes" ],
1335 [ ac_cv_have_ssize_t="no" ]
1336 )
1337])
1338if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1339 AC_DEFINE(HAVE_SSIZE_T)
1340fi
1341
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001342AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1343 AC_TRY_COMPILE(
1344 [
1345#include <time.h>
1346 ],
1347 [ clock_t foo; foo = 1235; ],
1348 [ ac_cv_have_clock_t="yes" ],
1349 [ ac_cv_have_clock_t="no" ]
1350 )
1351])
1352if test "x$ac_cv_have_clock_t" = "xyes" ; then
1353 AC_DEFINE(HAVE_CLOCK_T)
1354fi
1355
Damien Millerb54b40e2000-06-23 08:23:34 +10001356AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1357 AC_TRY_COMPILE(
1358 [
1359#include <sys/types.h>
1360#include <sys/socket.h>
1361 ],
1362 [ sa_family_t foo; foo = 1235; ],
1363 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001364 [ AC_TRY_COMPILE(
1365 [
1366#include <sys/types.h>
1367#include <sys/socket.h>
1368#include <netinet/in.h>
1369 ],
1370 [ sa_family_t foo; foo = 1235; ],
1371 [ ac_cv_have_sa_family_t="yes" ],
1372
Damien Millerb54b40e2000-06-23 08:23:34 +10001373 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001374 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001375 )
1376])
1377if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1378 AC_DEFINE(HAVE_SA_FAMILY_T)
1379fi
1380
Damien Miller0f91b4e2000-06-18 15:43:25 +10001381AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1382 AC_TRY_COMPILE(
1383 [
1384#include <sys/types.h>
1385 ],
1386 [ pid_t foo; foo = 1235; ],
1387 [ ac_cv_have_pid_t="yes" ],
1388 [ ac_cv_have_pid_t="no" ]
1389 )
1390])
1391if test "x$ac_cv_have_pid_t" = "xyes" ; then
1392 AC_DEFINE(HAVE_PID_T)
1393fi
1394
1395AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1396 AC_TRY_COMPILE(
1397 [
1398#include <sys/types.h>
1399 ],
1400 [ mode_t foo; foo = 1235; ],
1401 [ ac_cv_have_mode_t="yes" ],
1402 [ ac_cv_have_mode_t="no" ]
1403 )
1404])
1405if test "x$ac_cv_have_mode_t" = "xyes" ; then
1406 AC_DEFINE(HAVE_MODE_T)
1407fi
1408
Damien Miller61e50f12000-05-08 20:49:37 +10001409
1410AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1411 AC_TRY_COMPILE(
1412 [
Damien Miller81171112000-04-23 11:14:01 +10001413#include <sys/types.h>
1414#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001415 ],
1416 [ struct sockaddr_storage s; ],
1417 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1418 [ ac_cv_have_struct_sockaddr_storage="no" ]
1419 )
1420])
1421if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1422 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1423fi
Damien Miller34132e52000-01-14 15:45:46 +11001424
Damien Miller61e50f12000-05-08 20:49:37 +10001425AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1426 AC_TRY_COMPILE(
1427 [
Damien Miller7b22d652000-06-18 14:07:04 +10001428#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001429#include <netinet/in.h>
1430 ],
1431 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1432 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1433 [ ac_cv_have_struct_sockaddr_in6="no" ]
1434 )
1435])
1436if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1437 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1438fi
Damien Miller34132e52000-01-14 15:45:46 +11001439
Damien Miller61e50f12000-05-08 20:49:37 +10001440AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1441 AC_TRY_COMPILE(
1442 [
Damien Miller7b22d652000-06-18 14:07:04 +10001443#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001444#include <netinet/in.h>
1445 ],
1446 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1447 [ ac_cv_have_struct_in6_addr="yes" ],
1448 [ ac_cv_have_struct_in6_addr="no" ]
1449 )
1450])
1451if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1452 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1453fi
Damien Miller34132e52000-01-14 15:45:46 +11001454
Damien Miller61e50f12000-05-08 20:49:37 +10001455AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1456 AC_TRY_COMPILE(
1457 [
Damien Miller81171112000-04-23 11:14:01 +10001458#include <sys/types.h>
1459#include <sys/socket.h>
1460#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001461 ],
1462 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1463 [ ac_cv_have_struct_addrinfo="yes" ],
1464 [ ac_cv_have_struct_addrinfo="no" ]
1465 )
1466])
1467if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1468 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1469fi
1470
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001471AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1472 AC_TRY_COMPILE(
1473 [ #include <sys/time.h> ],
1474 [ struct timeval tv; tv.tv_sec = 1;],
1475 [ ac_cv_have_struct_timeval="yes" ],
1476 [ ac_cv_have_struct_timeval="no" ]
1477 )
1478])
1479if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1480 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1481 have_struct_timeval=1
1482fi
1483
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001484# If we don't have int64_t then we can't compile sftp-server. So don't
1485# even attempt to do it.
1486if test "x$ac_cv_have_int64_t" = "xno" -a \
1487 "x$ac_cv_sizeof_long_int" != "x8" -a \
1488 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1489 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001490else
1491dnl test snprintf (broken on SCO w/gcc)
1492 AC_TRY_RUN(
1493 [
1494#include <stdio.h>
1495#include <string.h>
1496#ifdef HAVE_SNPRINTF
1497main()
1498{
1499 char buf[50];
1500 char expected_out[50];
1501 int mazsize = 50 ;
1502#if (SIZEOF_LONG_INT == 8)
1503 long int num = 0x7fffffffffffffff;
1504#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001505 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001506#endif
1507 strcpy(expected_out, "9223372036854775807");
1508 snprintf(buf, mazsize, "%lld", num);
1509 if(strcmp(buf, expected_out) != 0)
1510 exit(1);
1511 exit(0);
1512}
1513#else
1514main() { exit(0); }
1515#endif
1516 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1517 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001518fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001519AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001520
Damien Miller78315eb2000-09-29 23:01:36 +11001521dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001522OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1523OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1524OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1525OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1526OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001527OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001528OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1529OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001530OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001531OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1532OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1533OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1534OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001535OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1536OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1537OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1538OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001539
1540AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001541
Damien Miller61e50f12000-05-08 20:49:37 +10001542AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1543 ac_cv_have_ss_family_in_struct_ss, [
1544 AC_TRY_COMPILE(
1545 [
Damien Miller81171112000-04-23 11:14:01 +10001546#include <sys/types.h>
1547#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001548 ],
1549 [ struct sockaddr_storage s; s.ss_family = 1; ],
1550 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1551 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1552 )
1553])
1554if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1555 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1556fi
1557
Damien Miller61e50f12000-05-08 20:49:37 +10001558AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1559 ac_cv_have___ss_family_in_struct_ss, [
1560 AC_TRY_COMPILE(
1561 [
Damien Miller81171112000-04-23 11:14:01 +10001562#include <sys/types.h>
1563#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001564 ],
1565 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1566 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1567 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1568 )
1569])
1570if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1571 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1572fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001573
Damien Millerad833b32000-08-23 10:46:23 +10001574AC_CACHE_CHECK([for pw_class field in struct passwd],
1575 ac_cv_have_pw_class_in_struct_passwd, [
1576 AC_TRY_COMPILE(
1577 [
Damien Millerad833b32000-08-23 10:46:23 +10001578#include <pwd.h>
1579 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001580 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001581 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1582 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1583 )
1584])
1585if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1586 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1587fi
1588
Kevin Steves82456952001-06-22 21:14:18 +00001589AC_CACHE_CHECK([for pw_expire field in struct passwd],
1590 ac_cv_have_pw_expire_in_struct_passwd, [
1591 AC_TRY_COMPILE(
1592 [
1593#include <pwd.h>
1594 ],
1595 [ struct passwd p; p.pw_expire = 0; ],
1596 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1597 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1598 )
1599])
1600if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1601 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1602fi
1603
1604AC_CACHE_CHECK([for pw_change field in struct passwd],
1605 ac_cv_have_pw_change_in_struct_passwd, [
1606 AC_TRY_COMPILE(
1607 [
1608#include <pwd.h>
1609 ],
1610 [ struct passwd p; p.pw_change = 0; ],
1611 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1612 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1613 )
1614])
1615if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1616 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1617fi
Damien Miller61e50f12000-05-08 20:49:37 +10001618
Kevin Steves939c9db2002-03-22 17:23:25 +00001619AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1620 ac_cv_have_accrights_in_msghdr, [
1621 AC_TRY_COMPILE(
1622 [
Tim Riceae49fe62002-04-12 10:26:21 -07001623#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001624#include <sys/socket.h>
1625#include <sys/uio.h>
1626 ],
1627 [ struct msghdr m; m.msg_accrights = 0; ],
1628 [ ac_cv_have_accrights_in_msghdr="yes" ],
1629 [ ac_cv_have_accrights_in_msghdr="no" ]
1630 )
1631])
1632if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1633 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1634fi
1635
Kevin Stevesa44e0352002-04-07 16:18:03 +00001636AC_CACHE_CHECK([for msg_control field in struct msghdr],
1637 ac_cv_have_control_in_msghdr, [
1638 AC_TRY_COMPILE(
1639 [
Tim Riceae49fe62002-04-12 10:26:21 -07001640#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001641#include <sys/socket.h>
1642#include <sys/uio.h>
1643 ],
1644 [ struct msghdr m; m.msg_control = 0; ],
1645 [ ac_cv_have_control_in_msghdr="yes" ],
1646 [ ac_cv_have_control_in_msghdr="no" ]
1647 )
1648])
1649if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1650 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1651fi
1652
Damien Miller61e50f12000-05-08 20:49:37 +10001653AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1654 AC_TRY_LINK([],
1655 [ extern char *__progname; printf("%s", __progname); ],
1656 [ ac_cv_libc_defines___progname="yes" ],
1657 [ ac_cv_libc_defines___progname="no" ]
1658 )
1659])
1660if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1661 AC_DEFINE(HAVE___PROGNAME)
1662fi
1663
Kevin Steves4846f4a2002-03-22 18:19:53 +00001664AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1665 AC_TRY_LINK([
1666#include <stdio.h>
1667],
1668 [ printf("%s", __FUNCTION__); ],
1669 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1670 [ ac_cv_cc_implements___FUNCTION__="no" ]
1671 )
1672])
1673if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1674 AC_DEFINE(HAVE___FUNCTION__)
1675fi
1676
1677AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1678 AC_TRY_LINK([
1679#include <stdio.h>
1680],
1681 [ printf("%s", __func__); ],
1682 [ ac_cv_cc_implements___func__="yes" ],
1683 [ ac_cv_cc_implements___func__="no" ]
1684 )
1685])
1686if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1687 AC_DEFINE(HAVE___func__)
1688fi
1689
Damien Miller4f8e6692001-07-14 13:22:53 +10001690AC_CACHE_CHECK([whether getopt has optreset support],
1691 ac_cv_have_getopt_optreset, [
1692 AC_TRY_LINK(
1693 [
1694#include <getopt.h>
1695 ],
1696 [ extern int optreset; optreset = 0; ],
1697 [ ac_cv_have_getopt_optreset="yes" ],
1698 [ ac_cv_have_getopt_optreset="no" ]
1699 )
1700])
1701if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1702 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1703fi
Damien Millera22ba012000-03-02 23:09:20 +11001704
Damien Millerecbb26d2000-07-15 14:59:14 +10001705AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1706 AC_TRY_LINK([],
1707 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1708 [ ac_cv_libc_defines_sys_errlist="yes" ],
1709 [ ac_cv_libc_defines_sys_errlist="no" ]
1710 )
1711])
1712if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1713 AC_DEFINE(HAVE_SYS_ERRLIST)
1714fi
1715
1716
Damien Miller11fa2cc2000-08-16 10:35:58 +10001717AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1718 AC_TRY_LINK([],
1719 [ extern int sys_nerr; printf("%i", sys_nerr);],
1720 [ ac_cv_libc_defines_sys_nerr="yes" ],
1721 [ ac_cv_libc_defines_sys_nerr="no" ]
1722 )
1723])
1724if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1725 AC_DEFINE(HAVE_SYS_NERR)
1726fi
1727
Damien Miller85de5802001-09-18 14:01:11 +10001728SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001729
1730# Check whether user wants sectok support
1731AC_ARG_WITH(sectok,
1732 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001733 [
1734 if test "x$withval" != "xno" ; then
1735 if test "x$withval" != "xyes" ; then
1736 CPPFLAGS="$CPPFLAGS -I${withval}"
1737 LDFLAGS="$LDFLAGS -L${withval}"
1738 if test ! -z "$need_dash_r" ; then
1739 LDFLAGS="$LDFLAGS -R${withval}"
1740 fi
1741 if test ! -z "$blibpath" ; then
1742 blibpath="$blibpath:${withval}"
1743 fi
1744 fi
1745 AC_CHECK_HEADERS(sectok.h)
1746 if test "$ac_cv_header_sectok_h" != yes; then
1747 AC_MSG_ERROR(Can't find sectok.h)
1748 fi
1749 AC_CHECK_LIB(sectok, sectok_open)
1750 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1751 AC_MSG_ERROR(Can't find libsectok)
1752 fi
1753 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001754 AC_DEFINE(USE_SECTOK)
1755 SCARD_MSG="yes, using sectok"
1756 fi
1757 ]
1758)
1759
1760# Check whether user wants OpenSC support
1761AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001762 AC_HELP_STRING([--with-opensc=PFX],
1763 [Enable smartcard support using OpenSC]),
1764 opensc_config_prefix="$withval", opensc_config_prefix="")
1765if test x$opensc_config_prefix != x ; then
1766 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1767 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1768 if test "$OPENSC_CONFIG" != "no"; then
1769 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1770 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1771 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1772 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1773 AC_DEFINE(SMARTCARD)
1774 AC_DEFINE(USE_OPENSC)
1775 SCARD_MSG="yes, using OpenSC"
1776 fi
1777fi
Damien Miller85de5802001-09-18 14:01:11 +10001778
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001779# Check whether user wants Kerberos 5 support
1780KRB5_MSG="no"
1781AC_ARG_WITH(kerberos5,
1782 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1783 [
1784 if test "x$withval" != "xno" ; then
1785 if test "x$withval" = "xyes" ; then
1786 KRB5ROOT="/usr/local"
1787 else
1788 KRB5ROOT=${withval}
1789 fi
1790 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1791 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1792 AC_DEFINE(KRB5)
1793 KRB5_MSG="yes"
1794 AC_MSG_CHECKING(whether we are using Heimdal)
1795 AC_TRY_COMPILE([ #include <krb5.h> ],
1796 [ char *tmp = heimdal_version; ],
1797 [ AC_MSG_RESULT(yes)
1798 AC_DEFINE(HEIMDAL)
1799 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1800 ],
1801 [ AC_MSG_RESULT(no)
1802 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1803 ]
1804 )
1805 if test ! -z "$need_dash_r" ; then
1806 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1807 fi
1808 if test ! -z "$blibpath" ; then
1809 blibpath="$blibpath:${KRB5ROOT}/lib"
1810 fi
1811 AC_CHECK_LIB(resolv, dn_expand, , )
1812
1813 KRB5=yes
1814 fi
1815 ]
1816)
1817# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001818KRB4_MSG="no"
1819AC_ARG_WITH(kerberos4,
1820 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1821 [
1822 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001823 if test "x$withval" != "xyes" ; then
1824 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1825 LDFLAGS="$LDFLAGS -L${withval}/lib"
1826 if test ! -z "$need_dash_r" ; then
1827 LDFLAGS="$LDFLAGS -R${withval}/lib"
1828 fi
1829 if test ! -z "$blibpath" ; then
1830 blibpath="$blibpath:${withval}/lib"
1831 fi
1832 else
1833 if test -d /usr/include/kerberosIV ; then
1834 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1835 fi
1836 fi
1837
1838 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001839 if test "$ac_cv_header_krb_h" != yes; then
1840 AC_MSG_WARN([Cannot find krb.h, build may fail])
1841 fi
Damien Miller98344742001-03-28 14:37:06 +10001842 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001843 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001844 AC_CHECK_LIB(krb4, main)
1845 if test "$ac_cv_lib_krb4_main" != yes; then
1846 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1847 else
1848 KLIBS="-lkrb4"
1849 fi
1850 else
1851 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001852 fi
Damien Miller98344742001-03-28 14:37:06 +10001853 AC_CHECK_LIB(des, des_cbc_encrypt)
1854 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1855 AC_CHECK_LIB(des425, des_cbc_encrypt)
1856 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1857 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1858 else
1859 KLIBS="-ldes425"
1860 fi
1861 else
1862 KLIBS="-ldes"
1863 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001864 AC_CHECK_LIB(resolv, dn_expand, , )
1865 KRB4=yes
1866 KRB4_MSG="yes"
1867 AC_DEFINE(KRB4)
1868 fi
1869 ]
1870)
1871
1872# Check whether user wants AFS support
1873AFS_MSG="no"
1874AC_ARG_WITH(afs,
1875 [ --with-afs=PATH Enable AFS support],
1876 [
1877 if test "x$withval" != "xno" ; then
1878
1879 if test "x$withval" != "xyes" ; then
1880 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1881 LDFLAGS="$LDFLAGS -L${withval}/lib"
1882 fi
1883
1884 if test -z "$KRB4" ; then
1885 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1886 fi
1887
1888 LIBS="-lkafs $LIBS"
1889 if test ! -z "$AFS_LIBS" ; then
1890 LIBS="$LIBS $AFS_LIBS"
1891 fi
1892 AC_DEFINE(AFS)
1893 AFS_MSG="yes"
1894 fi
1895 ]
1896)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001897LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001898
Damien Millera22ba012000-03-02 23:09:20 +11001899# Looking for programs, paths and files
1900AC_ARG_WITH(rsh,
1901 [ --with-rsh=PATH Specify path to remote shell program ],
1902 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001903 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001904 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001905 fi
1906 ],
1907 [
1908 AC_PATH_PROG(rsh_path, rsh)
1909 ]
1910)
1911
1912AC_ARG_WITH(xauth,
1913 [ --with-xauth=PATH Specify path to xauth program ],
1914 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001915 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001916 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001917 fi
1918 ],
1919 [
Damien Miller78315eb2000-09-29 23:01:36 +11001920 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 +10001921 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001922 xauth_path="/usr/openwin/bin/xauth"
1923 fi
1924 ]
1925)
1926
Damien Millera19cf472000-11-29 13:28:50 +11001927if test -z "$xauth_path" ; then
1928 XAUTH_PATH="undefined"
1929 AC_SUBST(XAUTH_PATH)
1930else
Damien Millera22ba012000-03-02 23:09:20 +11001931 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001932 XAUTH_PATH=$xauth_path
1933 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001934fi
1935if test ! -z "$rsh_path" ; then
1936 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1937fi
1938
1939# Check for mail directory (last resort if we cannot get it from headers)
1940if test ! -z "$MAIL" ; then
1941 maildir=`dirname $MAIL`
1942 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1943fi
1944
Damien Millera22ba012000-03-02 23:09:20 +11001945if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001946 if test "x$disable_ptmx_check" != "xyes" ; then
1947 AC_CHECK_FILE("/dev/ptmx",
1948 [
1949 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1950 have_dev_ptmx=1
1951 ]
1952 )
1953 fi
Damien Millera22ba012000-03-02 23:09:20 +11001954fi
Damien Miller204ad072000-03-02 23:56:12 +11001955AC_CHECK_FILE("/dev/ptc",
1956 [
1957 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1958 have_dev_ptc=1
1959 ]
1960)
1961
Damien Millera22ba012000-03-02 23:09:20 +11001962# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001963AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001964 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001965 [
Damien Miller897741e2001-04-16 10:41:46 +10001966 case "$withval" in
1967 man|cat|doc)
1968 MANTYPE=$withval
1969 ;;
1970 *)
1971 AC_MSG_ERROR(invalid man type: $withval)
1972 ;;
1973 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001974 ]
1975)
Ben Lindstrombc709922001-04-18 18:04:21 +00001976if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001977 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001978 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1979 MANTYPE=doc
1980 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1981 MANTYPE=man
1982 else
1983 MANTYPE=cat
1984 fi
1985fi
Damien Miller670a4b82000-01-22 13:53:11 +11001986AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001987if test "$MANTYPE" = "doc"; then
1988 mansubdir=man;
1989else
1990 mansubdir=$MANTYPE;
1991fi
1992AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001993
Damien Millera22ba012000-03-02 23:09:20 +11001994# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001995MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001996AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001997 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001998 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001999 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002000 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002001 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002002 fi
2003 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002004)
2005
Damien Millera22ba012000-03-02 23:09:20 +11002006# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002007AC_ARG_WITH(shadow,
2008 [ --without-shadow Disable shadow password support],
2009 [
2010 if test "x$withval" = "xno" ; then
2011 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002012 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002013 fi
2014 ]
2015)
2016
Damien Miller1f335fb2000-06-26 11:31:33 +10002017if test -z "$disable_shadow" ; then
2018 AC_MSG_CHECKING([if the systems has expire shadow information])
2019 AC_TRY_COMPILE(
2020 [
2021#include <sys/types.h>
2022#include <shadow.h>
2023 struct spwd sp;
2024 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2025 [ sp_expire_available=yes ], []
2026 )
2027
2028 if test "x$sp_expire_available" = "xyes" ; then
2029 AC_MSG_RESULT(yes)
2030 AC_DEFINE(HAS_SHADOW_EXPIRE)
2031 else
2032 AC_MSG_RESULT(no)
2033 fi
2034fi
2035
Damien Millera22ba012000-03-02 23:09:20 +11002036# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002037if test ! -z "$IPADDR_IN_DISPLAY" ; then
2038 DISPLAY_HACK_MSG="yes"
2039 AC_DEFINE(IPADDR_IN_DISPLAY)
2040else
2041 DISPLAY_HACK_MSG="no"
2042 AC_ARG_WITH(ipaddr-display,
2043 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2044 [
2045 if test "x$withval" != "xno" ; then
2046 AC_DEFINE(IPADDR_IN_DISPLAY)
2047 DISPLAY_HACK_MSG="yes"
2048 fi
2049 ]
2050 )
2051fi
Damien Miller76112de1999-12-21 11:18:08 +11002052
Tim Rice43a1c132002-04-17 21:19:14 -07002053dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2054if test $ac_cv_func_login_getcapbool = "yes" -a \
2055 $ac_cv_header_login_cap_h = "yes" ; then
2056 USES_LOGIN_CONF=yes
2057fi
Damien Millera22ba012000-03-02 23:09:20 +11002058# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002059SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002060AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11002061 [ --with-default-path=PATH Specify default \$PATH environment for server],
2062 [
Tim Rice43a1c132002-04-17 21:19:14 -07002063 if test "$USES_LOGIN_CONF" = "yes" ; then
2064 AC_MSG_WARN([
2065--with-default-path=PATH has no effect on this system.
2066Edit /etc/login.conf instead.])
2067 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002068 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002069 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002070 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002071 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002072 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2073 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2074 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002075 AC_TRY_RUN(
2076 [
2077/* find out what STDPATH is */
2078#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002079#ifdef HAVE_PATHS_H
2080# include <paths.h>
2081#endif
2082#ifndef _PATH_STDPATH
2083# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2084#endif
2085#include <sys/types.h>
2086#include <sys/stat.h>
2087#include <fcntl.h>
2088#define DATA "conftest.stdpath"
2089
2090main()
2091{
2092 FILE *fd;
2093 int rc;
2094
2095 fd = fopen(DATA,"w");
2096 if(fd == NULL)
2097 exit(1);
2098
2099 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2100 exit(1);
2101
2102 exit(0);
2103}
2104 ], [ user_path=`cat conftest.stdpath` ],
2105 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2106 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2107 )
2108# make sure $bindir is in USER_PATH so scp will work
2109 t_bindir=`eval echo ${bindir}`
2110 case $t_bindir in
2111 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2112 esac
2113 case $t_bindir in
2114 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2115 esac
2116 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2117 if test $? -ne 0 ; then
2118 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2119 if test $? -ne 0 ; then
2120 user_path=$user_path:$t_bindir
2121 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2122 fi
2123 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002124 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002125)
Tim Rice43a1c132002-04-17 21:19:14 -07002126if test "$USES_LOGIN_CONF" != "yes" ; then
2127 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2128 AC_SUBST(user_path)
2129fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002130
Damien Millera22ba012000-03-02 23:09:20 +11002131# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002132IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002133AC_ARG_WITH(ipv4-default,
2134 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2135 [
2136 if test "x$withval" != "xno" ; then
2137 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002138 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002139 fi
2140 ]
2141)
2142
Damien Miller61e50f12000-05-08 20:49:37 +10002143AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002144IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002145AC_ARG_WITH(4in6,
2146 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2147 [
2148 if test "x$withval" != "xno" ; then
2149 AC_MSG_RESULT(yes)
2150 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002151 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002152 else
2153 AC_MSG_RESULT(no)
2154 fi
2155 ],[
2156 if test "x$inet6_default_4in6" = "xyes"; then
2157 AC_MSG_RESULT([yes (default)])
2158 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002159 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002160 else
2161 AC_MSG_RESULT([no (default)])
2162 fi
2163 ]
2164)
2165
Damien Miller60396b02001-02-18 17:01:00 +11002166# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002167BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002168AC_ARG_WITH(bsd-auth,
2169 [ --with-bsd-auth Enable BSD auth support],
2170 [
2171 if test "x$withval" != "xno" ; then
2172 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002173 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002174 fi
2175 ]
2176)
2177
Damien Miller78315eb2000-09-29 23:01:36 +11002178AC_MSG_CHECKING(whether to install ssh as suid root)
2179AC_ARG_ENABLE(suid-ssh,
2180[ --enable-suid-ssh Install ssh as suid root (default)
2181 --disable-suid-ssh Install ssh without suid bit],
2182[ case "$enableval" in
2183 no)
2184 AC_MSG_RESULT(no)
2185 SSHMODE=0711
2186 ;;
2187 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00002188 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11002189 ;;
2190 esac ],
2191 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00002192 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11002193)
2194AC_SUBST(SSHMODE)
2195
2196
Damien Millera22ba012000-03-02 23:09:20 +11002197# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002198piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002199# make sure the directory exists
2200if test ! -d $piddir ; then
2201 piddir=`eval echo ${sysconfdir}`
2202 case $piddir in
2203 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2204 esac
2205fi
2206
Tim Rice88f2ab52002-03-17 12:17:34 -08002207AC_ARG_WITH(pid-dir,
2208 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2209 [
2210 if test "x$withval" != "xno" ; then
2211 piddir=$withval
2212 if test ! -d $piddir ; then
2213 AC_MSG_WARN([** no $piddir directory on this system **])
2214 fi
2215 fi
2216 ]
2217)
2218
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002219AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002220AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002221
andre2ff7b5d2000-06-03 14:57:40 +00002222dnl allow user to disable some login recording features
2223AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002224 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002225 [ AC_DEFINE(DISABLE_LASTLOG) ]
2226)
2227AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002228 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002229 [ AC_DEFINE(DISABLE_UTMP) ]
2230)
2231AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002232 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002233 [ AC_DEFINE(DISABLE_UTMPX) ]
2234)
2235AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002236 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002237 [ AC_DEFINE(DISABLE_WTMP) ]
2238)
2239AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002240 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002241 [ AC_DEFINE(DISABLE_WTMPX) ]
2242)
2243AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002244 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002245 [ AC_DEFINE(DISABLE_LOGIN) ]
2246)
2247AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002248 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002249 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2250)
2251AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002252 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002253 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2254)
2255AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002256 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002257 [
2258 if test "x$withval" = "xno" ; then
2259 AC_DEFINE(DISABLE_LASTLOG)
2260 else
2261 conf_lastlog_location=$withval
2262 fi
2263 ]
2264)
andre2ff7b5d2000-06-03 14:57:40 +00002265
2266dnl lastlog, [uw]tmpx? detection
2267dnl NOTE: set the paths in the platform section to avoid the
2268dnl need for command-line parameters
2269dnl lastlog and [uw]tmp are subject to a file search if all else fails
2270
2271dnl lastlog detection
2272dnl NOTE: the code itself will detect if lastlog is a directory
2273AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2274AC_TRY_COMPILE([
2275#include <sys/types.h>
2276#include <utmp.h>
2277#ifdef HAVE_LASTLOG_H
2278# include <lastlog.h>
2279#endif
Damien Miller2994e082000-06-04 15:51:47 +10002280#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002281# include <paths.h>
2282#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002283#ifdef HAVE_LOGIN_H
2284# include <login.h>
2285#endif
andre2ff7b5d2000-06-03 14:57:40 +00002286 ],
2287 [ char *lastlog = LASTLOG_FILE; ],
2288 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002289 [
2290 AC_MSG_RESULT(no)
2291 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2292 AC_TRY_COMPILE([
2293#include <sys/types.h>
2294#include <utmp.h>
2295#ifdef HAVE_LASTLOG_H
2296# include <lastlog.h>
2297#endif
2298#ifdef HAVE_PATHS_H
2299# include <paths.h>
2300#endif
2301 ],
2302 [ char *lastlog = _PATH_LASTLOG; ],
2303 [ AC_MSG_RESULT(yes) ],
2304 [
andree441aa32000-06-12 22:34:38 +00002305 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002306 system_lastlog_path=no
2307 ])
2308 ]
andre2ff7b5d2000-06-03 14:57:40 +00002309)
Damien Miller2994e082000-06-04 15:51:47 +10002310
andre2ff7b5d2000-06-03 14:57:40 +00002311if test -z "$conf_lastlog_location"; then
2312 if test x"$system_lastlog_path" = x"no" ; then
2313 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002314 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002315 conf_lastlog_location=$f
2316 fi
2317 done
2318 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002319 AC_MSG_WARN([** Cannot find lastlog **])
2320 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002321 fi
2322 fi
2323fi
2324
2325if test -n "$conf_lastlog_location"; then
2326 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2327fi
2328
2329dnl utmp detection
2330AC_MSG_CHECKING([if your system defines UTMP_FILE])
2331AC_TRY_COMPILE([
2332#include <sys/types.h>
2333#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002334#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002335# include <paths.h>
2336#endif
2337 ],
2338 [ char *utmp = UTMP_FILE; ],
2339 [ AC_MSG_RESULT(yes) ],
2340 [ AC_MSG_RESULT(no)
2341 system_utmp_path=no ]
2342)
2343if test -z "$conf_utmp_location"; then
2344 if test x"$system_utmp_path" = x"no" ; then
2345 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2346 if test -f $f ; then
2347 conf_utmp_location=$f
2348 fi
2349 done
2350 if test -z "$conf_utmp_location"; then
2351 AC_DEFINE(DISABLE_UTMP)
2352 fi
2353 fi
2354fi
2355if test -n "$conf_utmp_location"; then
2356 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2357fi
2358
2359dnl wtmp detection
2360AC_MSG_CHECKING([if your system defines WTMP_FILE])
2361AC_TRY_COMPILE([
2362#include <sys/types.h>
2363#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002364#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002365# include <paths.h>
2366#endif
2367 ],
2368 [ char *wtmp = WTMP_FILE; ],
2369 [ AC_MSG_RESULT(yes) ],
2370 [ AC_MSG_RESULT(no)
2371 system_wtmp_path=no ]
2372)
2373if test -z "$conf_wtmp_location"; then
2374 if test x"$system_wtmp_path" = x"no" ; then
2375 for f in /usr/adm/wtmp /var/log/wtmp; do
2376 if test -f $f ; then
2377 conf_wtmp_location=$f
2378 fi
2379 done
2380 if test -z "$conf_wtmp_location"; then
2381 AC_DEFINE(DISABLE_WTMP)
2382 fi
2383 fi
2384fi
2385if test -n "$conf_wtmp_location"; then
2386 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2387fi
2388
2389
2390dnl utmpx detection - I don't know any system so perverse as to require
2391dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2392dnl there, though.
2393AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2394AC_TRY_COMPILE([
2395#include <sys/types.h>
2396#include <utmp.h>
2397#ifdef HAVE_UTMPX_H
2398#include <utmpx.h>
2399#endif
Damien Miller2994e082000-06-04 15:51:47 +10002400#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002401# include <paths.h>
2402#endif
2403 ],
2404 [ char *utmpx = UTMPX_FILE; ],
2405 [ AC_MSG_RESULT(yes) ],
2406 [ AC_MSG_RESULT(no)
2407 system_utmpx_path=no ]
2408)
2409if test -z "$conf_utmpx_location"; then
2410 if test x"$system_utmpx_path" = x"no" ; then
2411 AC_DEFINE(DISABLE_UTMPX)
2412 fi
2413else
2414 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2415fi
2416
2417dnl wtmpx detection
2418AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2419AC_TRY_COMPILE([
2420#include <sys/types.h>
2421#include <utmp.h>
2422#ifdef HAVE_UTMPX_H
2423#include <utmpx.h>
2424#endif
Damien Miller2994e082000-06-04 15:51:47 +10002425#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002426# include <paths.h>
2427#endif
2428 ],
2429 [ char *wtmpx = WTMPX_FILE; ],
2430 [ AC_MSG_RESULT(yes) ],
2431 [ AC_MSG_RESULT(no)
2432 system_wtmpx_path=no ]
2433)
2434if test -z "$conf_wtmpx_location"; then
2435 if test x"$system_wtmpx_path" = x"no" ; then
2436 AC_DEFINE(DISABLE_WTMPX)
2437 fi
2438else
2439 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2440fi
2441
Damien Miller4018c192000-04-30 09:30:44 +10002442
Damien Miller29ea30d2000-03-17 10:54:15 +11002443if test ! -z "$blibpath" ; then
2444 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2445 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2446fi
2447
Tim Rice4cec93f2002-02-26 08:40:48 -08002448dnl remove pam and dl because they are in $LIBPAM
2449if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002450 LIBS=`echo $LIBS | sed 's/-lpam //'`
2451fi
2452if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2453 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002454fi
2455
Damien Millerbac2d8a2000-09-05 16:13:06 +11002456AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002457AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2458AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002459
Damien Miller7b22d652000-06-18 14:07:04 +10002460# Print summary of options
2461
Damien Miller7b22d652000-06-18 14:07:04 +10002462# Someone please show me a better way :)
2463A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2464B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2465C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2466D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002467E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002468F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002469G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002470H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002471
2472echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002473echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002474echo " User binaries: $B"
2475echo " System binaries: $C"
2476echo " Configuration files: $D"
2477echo " Askpass program: $E"
2478echo " Manual pages: $F"
2479echo " PID file: $G"
Tim Rice43a1c132002-04-17 21:19:14 -07002480if test "$USES_LOGIN_CONF" = "yes" ; then
2481echo " At runtime, sshd will use the path defined in /etc/login.conf"
2482else
Tim Rice59ea0a02001-03-10 13:50:45 -08002483echo " sshd default user PATH: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002484fi
Damien Miller897741e2001-04-16 10:41:46 +10002485echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002486echo " PAM support: ${PAM_MSG}"
2487echo " KerberosIV support: $KRB4_MSG"
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002488echo " KerberosV support: $KRB5_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002489echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002490echo " AFS support: $AFS_MSG"
2491echo " S/KEY support: $SKEY_MSG"
2492echo " TCP Wrappers support: $TCPW_MSG"
2493echo " MD5 password support: $MD5_MSG"
2494echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2495echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2496echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002497echo " BSD Auth support: $BSD_AUTH_MSG"
2498echo " Random number source: $RAND_MSG"
2499if test ! -z "$USE_RAND_HELPER" ; then
2500 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002501fi
2502
Damien Miller7b22d652000-06-18 14:07:04 +10002503echo ""
2504
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002505echo " Host: ${host}"
2506echo " Compiler: ${CC}"
2507echo " Compiler flags: ${CFLAGS}"
2508echo "Preprocessor flags: ${CPPFLAGS}"
2509echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002510echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002511
2512echo ""
2513
Damien Miller82cf0ce2000-12-20 13:34:48 +11002514if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002515 echo "PAM is enabled. You may need to install a PAM control file "
2516 echo "for sshd, otherwise password authentication may fail. "
2517 echo "Example PAM control files can be found in the contrib/ "
2518 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002519 echo ""
2520fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002521
2522if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002523 echo "sftp-server will be disabled. Your compiler does not "
2524 echo "support 64bit integers."
2525 echo ""
2526fi
2527
2528if test ! -z "$RAND_HELPER_CMDHASH" ; then
2529 echo "WARNING: you are using the builtin random number collection "
2530 echo "service. Please read WARNING.RNG and request that your OS "
2531 echo "vendor includes kernel-based random number collection in "
2532 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002533 echo ""
2534fi
Damien Miller60396b02001-02-18 17:01:00 +11002535