blob: 9d6b0a737317f567483c435478656cd4b62ce5cd [file] [log] [blame]
Damien Miller896b88a2001-02-27 14:42:48 +11001# $Id: configure.in,v 1.256 2001/02/27 03:42:48 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10008
Damien Millera22ba012000-03-02 23:09:20 +11009# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110010AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100011AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110012AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000013AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110014AC_PATH_PROG(PERL, perl)
15AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100016AC_PATH_PROG(ENT, ent)
17AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110018AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110019AC_PATH_PROG(TEST_MINUS_S_SH, bash)
20AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
21AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110022
Damien Miller3f62aba2000-11-29 11:56:35 +110023if test -z "$AR" ; then
24 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
25fi
26
Damien Millerad833b32000-08-23 10:46:23 +100027# Use LOGIN_PROGRAM from environment if possible
28if test ! -z "$LOGIN_PROGRAM" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
30else
31 # Search for login
32 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
33 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
35 fi
36fi
37
Damien Miller166bd442000-03-16 10:48:25 +110038if test -z "$LD" ; then
39 LD=$CC
40fi
41AC_SUBST(LD)
42
43# C Compiler features
44AC_C_INLINE
45if test "$GCC" = "yes"; then
46 CFLAGS="$CFLAGS -Wall"
47fi
48
Damien Millera22ba012000-03-02 23:09:20 +110049# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110050case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110051*-*-aix*)
52 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000053 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110054 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100055 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110056 blibpath="/usr/lib:/lib:/usr/local/lib"
57 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100058 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110059 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000060 MANTYPE='$(CATMAN)'
61 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000062 dnl AIX handles lastlog as part of its login message
63 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100064 MANTYPE='$(CATMAN)'
65 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110066 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110067*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110068 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110070 AC_DEFINE(DISABLE_SHADOW)
71 AC_DEFINE(IPV4_DEFAULT)
72 AC_DEFINE(IP_TOS_IS_BROKEN)
73 AC_DEFINE(BROKEN_VHANGUP)
Ben Lindstrom38e60932001-02-24 00:55:04 +000074 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110075 no_libsocket=1
76 no_libnsl=1
77 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000078*-*-dgux*)
79 AC_DEFINE(IP_TOS_IS_BROKEN)
80 ;;
Damien Miller76112de1999-12-21 11:18:08 +110081*-*-hpux10*)
82 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100083 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110084 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000085 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110086 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100087 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110088 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110089 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000090 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110091 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110092 MANTYPE='$(CATMAN)'
93 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110094 ;;
Damien Miller1bead332000-04-30 00:47:29 +100095*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000096 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110097 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110098 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110099 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100100 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100101 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000102 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100103 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000104 MANTYPE='$(CATMAN)'
105 mansubdir=cat
106 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100107*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000109 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100110 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100111 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100112 no_libsocket=1
113 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000114 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100115 ;;
116*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000117 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000118 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100119 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100120 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000121 AC_DEFINE(WITH_IRIX_ARRAY)
122 AC_DEFINE(WITH_IRIX_PROJECT)
123 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000124 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100125 no_libsocket=1
126 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000127 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000128 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100129 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100130*-*-linux*)
131 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100132 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100133 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000134 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100135 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100136 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000137mips-sony-bsd|mips-sony-newsos4)
138 AC_DEFINE(HAVE_NEWS4)
139 SONY=1
140 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100141 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000142 )
143 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100144*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100145 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100146 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100147*-*-freebsd*)
148 check_for_libcrypt_later=1
149 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000150*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100152 conf_utmp_location=/etc/utmp
153 conf_wtmp_location=/usr/adm/wtmp
154 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000155 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000156 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000157 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100158 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000159 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000160 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000161 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100162*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000163 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000164 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100165 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100166 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000167 # hardwire lastlog location (can't detect it on some versions)
168 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000169 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
170 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
171 if test "$sol2ver" -ge 8; then
172 AC_MSG_RESULT(yes)
173 AC_DEFINE(DISABLE_UTMP)
174 AC_DEFINE(DISABLE_WTMP)
175 else
176 AC_MSG_RESULT(no)
177 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100178 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000179*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000180 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000181 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100182 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100183 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000184 conf_utmp_location=/etc/utmp
185 conf_wtmp_location=/var/adm/wtmp
186 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000187 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000188 MANTYPE='$(CATMAN)'
189 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000190 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000191*-ncr-sysv*)
192 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
194 MANTYPE='$(CATMAN)'
195 mansubdir=cat
196 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
197 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000198*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000199 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000200 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
201 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100202 IPADDR_IN_DISPLAY=yes
203 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000204 AC_DEFINE(IP_TOS_IS_BROKEN)
205 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000206 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000207 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100208*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000209 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100210 LDFLAGS="$LDFLAGS -L/usr/local/lib"
211 MANTYPE='$(CATMAN)'
212 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100213 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100214 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100215 ;;
216*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000217 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100218 LDFLAGS="$LDFLAGS -L/usr/local/lib"
219 MANTYPE='$(CATMAN)'
220 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100221 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100222 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100223 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100224*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000225 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100226 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100227 MANTYPE='$(CATMAN)'
228 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100229 LIBS="$LIBS -lgen -lsocket"
230 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100231*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000232 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
234 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000235 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100236 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100237 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100238 RANLIB=true
239 no_dev_ptmx=1
240 AC_DEFINE(BROKEN_SYS_TERMIO_H)
241 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100242 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000243 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000244 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100245 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100246 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100247 ;;
248*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000249 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000250 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100251 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000252 MANTYPE='$(CATMAN)'
253 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000254 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100255 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100256 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100257 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000258 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000259 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100260 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000261 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000262*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000263 if test ! -z "USE_SIA" ; then
264 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
265 if test -f /etc/sia/matrix.conf; then
266 AC_MSG_RESULT(yes)
267 AC_DEFINE(HAVE_OSF_SIA)
268 AC_DEFINE(DISABLE_LOGIN)
269 LIBS="$LIBS -lsecurity -ldb -lm -laud"
270 else
271 AC_MSG_RESULT(no)
272 fi
273 fi
274 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100275esac
276
Damien Millere37bfc12000-06-05 09:37:43 +1000277# Allow user to specify flags
278AC_ARG_WITH(cflags,
279 [ --with-cflags Specify additional flags to pass to compiler],
280 [
281 if test "x$withval" != "xno" ; then
282 CFLAGS="$CFLAGS $withval"
283 fi
284 ]
285)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000286AC_ARG_WITH(cppflags,
287 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
288 [
289 if test "x$withval" != "xno"; then
290 CPPFLAGS="$CPPFLAGS $withval"
291 fi
292 ]
293)
Damien Millere37bfc12000-06-05 09:37:43 +1000294AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000295 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000296 [
297 if test "x$withval" != "xno" ; then
298 LDFLAGS="$LDFLAGS $withval"
299 fi
300 ]
301)
302AC_ARG_WITH(libs,
303 [ --with-libs Specify additional libraries to link with],
304 [
305 if test "x$withval" != "xno" ; then
306 LIBS="$LIBS $withval"
307 fi
308 ]
309)
310
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000311AC_ARG_WITH(pcre,
312 [ --with-pcre Override built in regex library with pcre],
313 [
314
315 AC_CHECK_LIB(pcre, pcre_info,
316 [
317 AC_DEFINE(HAVE_LIBPCRE)
318 LIBS="$LIBS -lpcreposix -lpcre"
319 no_comp_check="yes"
320 ],
321 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
322 )
323 ]
324)
Damien Millere37bfc12000-06-05 09:37:43 +1000325
Damien Millera22ba012000-03-02 23:09:20 +1100326# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100327if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000328 AC_CHECK_LIB(nsl, yp_match, , )
329fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100330if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000331 AC_CHECK_LIB(socket, main, , )
332fi
333
Damien Millerdf288022001-02-18 13:07:07 +1100334dnl SCO OS3 needs this for libwrap
335AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
336
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000337AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100338AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100339AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100340
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000341# We don't want to check if we did an pcre override.
342if test -z "$no_comp_check" ; then
343 AC_CHECK_FUNC(regcomp,
344 [ AC_DEFINE(HAVE_REGCOMP)],
345 [
346 AC_CHECK_LIB(pcre, pcre_info,
347 [
348 AC_DEFINE(HAVE_LIBPCRE)
349 LIBS="$LIBS -lpcreposix -lpcre"
350 ],
351 [
352 AC_MSG_ERROR([*** No regex library found.])
353 ])
354 ]
355 )
356fi
Damien Millerab18c411999-11-11 10:40:23 +1100357
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000358dnl UnixWare 2.x
359AC_CHECK_FUNC(strcasecmp,
360 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
361)
362AC_CHECK_FUNC(utimes,
363 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
364)
Damien Millerab18c411999-11-11 10:40:23 +1100365
Ben Lindstrom8697e082001-02-24 21:41:10 +0000366AC_FUNC_STRFTIME
367
Damien Millera22ba012000-03-02 23:09:20 +1100368# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000369AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
Damien Millerab18c411999-11-11 10:40:23 +1100370
Damien Millerc547bf12001-02-16 10:18:12 +1100371# Check whether user wants Kerberos support
372KRB4_MSG="no"
373AC_ARG_WITH(kerberos4,
374 [ --with-kerberos4=PATH Enable Kerberos 4 support],
375 [
376 if test "x$withval" != "xno" ; then
377
378 if test "x$withval" != "xyes" ; then
379 CPPFLAGS="$CPPFLAGS -I${withval}/include"
380 LDFLAGS="$LDFLAGS -L${withval}/lib"
381 if test ! -z "$need_dash_r" ; then
382 LDFLAGS="$LDFLAGS -R${withval}/lib"
383 fi
384 if test ! -z "$blibpath" ; then
385 blibpath="$blibpath:${withval}/lib"
386 fi
387 else
388 if test -d /usr/include/kerberosIV ; then
389 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
390 fi
391 fi
392
393 AC_CHECK_HEADERS(krb.h)
394 AC_CHECK_LIB(krb, main)
395 if test "$ac_cv_header_krb_h" != yes; then
396 AC_MSG_WARN([Cannot find krb.h, build may fail])
397 fi
398 if test "$ac_cv_lib_krb_main" != yes; then
399 AC_MSG_WARN([Cannot find libkrb, build may fail])
400 fi
401
402 KLIBS="-lkrb -ldes"
403 AC_CHECK_LIB(resolv, dn_expand, , )
404 KRB4=yes
405 KRB4_MSG="yes"
406 AC_DEFINE(KRB4)
407 fi
408 ]
409)
410
411# Check whether user wants AFS support
412AFS_MSG="no"
413AC_ARG_WITH(afs,
414 [ --with-afs=PATH Enable AFS support],
415 [
416 if test "x$withval" != "xno" ; then
417
418 if test "x$withval" != "xyes" ; then
419 CPPFLAGS="$CPPFLAGS -I${withval}/include"
420 LDFLAGS="$LDFLAGS -L${withval}/lib"
421 fi
422
423 if test -z "$KRB4" ; then
424 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
425 fi
426
427 LIBS="$LIBS -lkafs"
428 if test ! -z "$AFS_LIBS" ; then
429 LIBS="$LIBS $AFS_LIBS"
430 fi
431 AC_DEFINE(AFS)
432 AFS_MSG="yes"
433 fi
434 ]
435)
436LIBS="$LIBS $KLIBS"
437
438# Check whether user wants S/Key support
439SKEY_MSG="no"
440AC_ARG_WITH(skey,
441 [ --with-skey=PATH Enable S/Key support],
442 [
443 if test "x$withval" != "xno" ; then
444
445 if test "x$withval" != "xyes" ; then
446 CPPFLAGS="$CPPFLAGS -I${withval}/include"
447 LDFLAGS="$LDFLAGS -L${withval}/lib"
448 fi
449
450 AC_DEFINE(SKEY)
451 LIBS="-lskey $LIBS"
452 SKEY_MSG="yes"
453
454 AC_CHECK_FUNC(skey_keyinfo,
455 [],
456 [
457 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
458 ])
459 fi
460 ]
461)
462
463# Check whether user wants TCP wrappers support
464TCPW_MSG="no"
465AC_ARG_WITH(tcp-wrappers,
466 [ --with-tcp-wrappers Enable tcpwrappers support],
467 [
468 if test "x$withval" != "xno" ; then
469 saved_LIBS="$LIBS"
470 LIBS="-lwrap $LIBS"
471 AC_MSG_CHECKING(for libwrap)
472 AC_TRY_LINK(
473 [
474#include <tcpd.h>
475 int deny_severity = 0, allow_severity = 0;
476 ],
477 [hosts_access(0);],
478 [
479 AC_MSG_RESULT(yes)
480 AC_DEFINE(LIBWRAP)
481 TCPW_MSG="yes"
482 ],
483 [
484 AC_MSG_ERROR([*** libwrap missing])
485 ]
486 )
487 fi
488 ]
489)
490
Damien Millerad833b32000-08-23 10:46:23 +1000491dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000492AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000493dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000494AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000495dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000496AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000497AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000498dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000499AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000500AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000501dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000502AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000503AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100504
Damien Miller5fc85652000-07-09 23:53:07 +1000505AC_CHECK_FUNC(getuserattr,
506 [AC_DEFINE(HAVE_GETUSERATTR)],
507 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
508)
509
Damien Miller04f80141999-11-19 15:32:34 +1100510AC_CHECK_FUNC(login,
511 [AC_DEFINE(HAVE_LOGIN)],
512 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
513)
514
515AC_CHECK_FUNC(daemon,
516 [AC_DEFINE(HAVE_DAEMON)],
517 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
518)
519
Damien Miller9fb07e42000-03-05 16:22:59 +1100520AC_CHECK_FUNC(getpagesize,
521 [AC_DEFINE(HAVE_GETPAGESIZE)],
522 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
523)
524
Damien Millercb170cb2000-07-01 16:52:55 +1000525# Check for broken snprintf
526if test "x$ac_cv_func_snprintf" = "xyes" ; then
527 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
528 AC_TRY_RUN(
529 [
530#include <stdio.h>
531int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
532 ],
533 [AC_MSG_RESULT(yes)],
534 [
535 AC_MSG_RESULT(no)
536 AC_DEFINE(BROKEN_SNPRINTF)
537 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
538 ]
539 )
540fi
541
Damien Miller606f8802000-09-16 15:39:56 +1100542AC_FUNC_GETPGRP
543
Damien Millera64b57a2001-01-17 10:44:13 +1100544# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000545PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100546AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100547 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100548 [
Damien Millera64b57a2001-01-17 10:44:13 +1100549 if test "x$withval" != "xno" ; then
550 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
551 AC_MSG_ERROR([PAM headers not found])
552 fi
553
554 AC_CHECK_LIB(dl, dlopen, , )
555 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
556 AC_CHECK_FUNCS(pam_getenvlist)
557
558 disable_shadow=yes
559 PAM_MSG="yes"
560
561 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100562 fi
563 ]
564)
Damien Millera22ba012000-03-02 23:09:20 +1100565
Damien Millera64b57a2001-01-17 10:44:13 +1100566# Check for older PAM
567if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100568 # Check PAM strerror arguments (old PAM)
569 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
570 AC_TRY_COMPILE(
571 [
Damien Miller81171112000-04-23 11:14:01 +1000572#include <stdlib.h>
573#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100574 ],
575 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
576 [AC_MSG_RESULT(no)],
577 [
578 AC_DEFINE(HAVE_OLD_PAM)
579 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000580 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100581 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100582 )
Damien Millera22ba012000-03-02 23:09:20 +1100583fi
584
585# The big search for OpenSSL
586AC_ARG_WITH(ssl-dir,
587 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
588 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000589 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100590 tryssldir=$withval
591 fi
592 ]
593)
594
595saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100596saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000597saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100598if test "x$prefix" != "xNONE" ; then
599 tryssldir="$tryssldir $prefix"
600fi
Damien Miller61e50f12000-05-08 20:49:37 +1000601AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100602 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 +1100603 CPPFLAGS="$saved_CPPFLAGS"
604 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000605 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100606
607 # Skip directories if they don't exist
608 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
609 continue;
610 fi
611 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
612 # Try to use $ssldir/lib if it exists, otherwise
613 # $ssldir
614 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000615 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100616 if test ! -z "$need_dash_r" ; then
617 LDFLAGS="$LDFLAGS -R$ssldir/lib"
618 fi
619 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000620 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100621 if test ! -z "$need_dash_r" ; then
622 LDFLAGS="$LDFLAGS -R$ssldir"
623 fi
624 fi
625 # Try to use $ssldir/include if it exists, otherwise
626 # $ssldir
627 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000628 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100629 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000630 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100631 fi
632 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000633
Damien Miller3b512e12000-05-17 23:29:18 +1000634 # Basic test to check for compatible version and correct linking
635 # *does not* test for RSA - that comes later.
636 AC_TRY_RUN(
637 [
Damien Millere59ce622000-05-01 20:54:17 +1000638#include <string.h>
639#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000640int main(void)
641{
Damien Miller3b512e12000-05-17 23:29:18 +1000642 char a[2048];
643 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000644 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000645 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000646}
Damien Miller3b512e12000-05-17 23:29:18 +1000647 ],
648 [
649 found_crypto=1
650 break;
651 ], []
652 )
Damien Miller61e50f12000-05-08 20:49:37 +1000653
654 if test ! -z "$found_crypto" ; then
655 break;
656 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100657 done
658
Damien Miller61e50f12000-05-08 20:49:37 +1000659 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100660 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100661 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000662 if test -z "$ssldir" ; then
663 ssldir="(system)"
664 fi
Damien Millera22ba012000-03-02 23:09:20 +1100665
Damien Miller61e50f12000-05-08 20:49:37 +1000666 ac_cv_openssldir=$ssldir
667])
668
Damien Milleredb82922000-06-20 13:25:52 +1000669if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000670 AC_DEFINE(HAVE_OPENSSL)
671 dnl Need to recover ssldir - test above runs in subshell
672 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100673 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100674 # Try to use $ssldir/lib if it exists, otherwise
675 # $ssldir
676 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000677 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100678 if test ! -z "$need_dash_r" ; then
679 LDFLAGS="$LDFLAGS -R$ssldir/lib"
680 fi
681 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000682 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100683 if test ! -z "$need_dash_r" ; then
684 LDFLAGS="$LDFLAGS -R$ssldir"
685 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100686 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100687 # Try to use $ssldir/include if it exists, otherwise
688 # $ssldir
689 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000690 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100691 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000692 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100693 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100694 fi
Damien Millera22ba012000-03-02 23:09:20 +1100695fi
Damien Miller3b512e12000-05-17 23:29:18 +1000696LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000697
Damien Miller3b512e12000-05-17 23:29:18 +1000698# Now test RSA support
699saved_LIBS="$LIBS"
700AC_MSG_CHECKING([for RSA support])
701for WANTS_RSAREF in "" 1 ; do
702 if test -z "$WANTS_RSAREF" ; then
703 LIBS="$saved_LIBS"
704 else
705 LIBS="$saved_LIBS -lRSAglue -lrsaref"
706 fi
707 AC_TRY_RUN([
708#include <string.h>
709#include <openssl/rand.h>
710#include <openssl/rsa.h>
711#include <openssl/bn.h>
712#include <openssl/sha.h>
713int main(void)
714{
715 int num; RSA *key; static unsigned char p_in[] = "blahblah";
716 unsigned char c[256], p[256];
717 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
718 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
719 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
720 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
721}
722 ],
723 [
724 rsa_works=1
725 break;
726 ], [])
727done
728
729if test ! -z "$no_rsa" ; then
730 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000731 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000732else
733 if test -z "$rsa_works" ; then
734 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000735 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000736 else
737 if test -z "$WANTS_RSAREF" ; then
738 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000739 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000740 else
Damien Miller7b22d652000-06-18 14:07:04 +1000741 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000742 AC_MSG_RESULT(using RSAref)
743 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
744 fi
745 fi
746fi
Damien Millera22ba012000-03-02 23:09:20 +1100747
Damien Millera64b57a2001-01-17 10:44:13 +1100748# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
749# version in OpenSSL. Skip this for PAM
750if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
751 AC_CHECK_LIB(crypt, crypt, , )
752fi
753
Ben Lindstromb5628642000-10-18 00:02:25 +0000754# Cheap hack to ensure NEWS-OS libraries are arranged right.
755if test ! -z "$SONY" ; then
756 LIBS="$LIBS -liberty";
757fi
758
Damien Millera22ba012000-03-02 23:09:20 +1100759# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100760AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100761AC_CHECK_SIZEOF(short int, 2)
762AC_CHECK_SIZEOF(int, 4)
763AC_CHECK_SIZEOF(long int, 4)
764AC_CHECK_SIZEOF(long long int, 8)
765
Damien Millera22ba012000-03-02 23:09:20 +1100766# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100767AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
768 AC_TRY_COMPILE(
769 [ #include <sys/types.h> ],
770 [ u_int a; a = 1;],
771 [ ac_cv_have_u_int="yes" ],
772 [ ac_cv_have_u_int="no" ]
773 )
774])
775if test "x$ac_cv_have_u_int" = "xyes" ; then
776 AC_DEFINE(HAVE_U_INT)
777 have_u_int=1
778fi
779
Damien Miller61e50f12000-05-08 20:49:37 +1000780AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
781 AC_TRY_COMPILE(
782 [ #include <sys/types.h> ],
783 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
784 [ ac_cv_have_intxx_t="yes" ],
785 [ ac_cv_have_intxx_t="no" ]
786 )
787])
788if test "x$ac_cv_have_intxx_t" = "xyes" ; then
789 AC_DEFINE(HAVE_INTXX_T)
790 have_intxx_t=1
791fi
792
Damien Miller578783e2000-09-23 14:12:24 +1100793AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
794 AC_TRY_COMPILE(
795 [ #include <sys/types.h> ],
796 [ int64_t a; a = 1;],
797 [ ac_cv_have_int64_t="yes" ],
798 [ ac_cv_have_int64_t="no" ]
799 )
800])
801if test "x$ac_cv_have_int64_t" = "xyes" ; then
802 AC_DEFINE(HAVE_INT64_T)
803 have_int64_t=1
804fi
805
Damien Miller61e50f12000-05-08 20:49:37 +1000806AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
807 AC_TRY_COMPILE(
808 [ #include <sys/types.h> ],
809 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
810 [ ac_cv_have_u_intxx_t="yes" ],
811 [ ac_cv_have_u_intxx_t="no" ]
812 )
813])
814if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
815 AC_DEFINE(HAVE_U_INTXX_T)
816 have_u_intxx_t=1
817fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100818
Damien Miller578783e2000-09-23 14:12:24 +1100819AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
820 AC_TRY_COMPILE(
821 [ #include <sys/types.h> ],
822 [ u_int64_t a; a = 1;],
823 [ ac_cv_have_u_int64_t="yes" ],
824 [ ac_cv_have_u_int64_t="no" ]
825 )
826])
827if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
828 AC_DEFINE(HAVE_U_INT64_T)
829 have_u_int64_t=1
830fi
831
Damien Milleredb82922000-06-20 13:25:52 +1000832if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
833 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100834then
835 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
836 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000837 [
838#include <sys/bitypes.h>
839 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100840 [
Damien Miller70494d12000-04-03 15:57:06 +1000841 int8_t a; int16_t b; int32_t c;
842 u_int8_t e; u_int16_t f; u_int32_t g;
843 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100844 ],
845 [
846 AC_DEFINE(HAVE_U_INTXX_T)
847 AC_DEFINE(HAVE_INTXX_T)
848 AC_MSG_RESULT(yes)
849 ],
850 [AC_MSG_RESULT(no)]
851 )
852fi
853
Damien Millerd6121d22000-03-17 23:26:46 +1100854if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000855 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
856 AC_TRY_COMPILE(
857 [
858#include <sys/types.h>
859 ],
860 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
861 [ ac_cv_have_uintxx_t="yes" ],
862 [ ac_cv_have_uintxx_t="no" ]
863 )
864 ])
865 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
866 AC_DEFINE(HAVE_UINTXX_T)
867 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100868fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100869
Damien Miller61e50f12000-05-08 20:49:37 +1000870AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
871 AC_TRY_COMPILE(
872 [
Damien Miller81171112000-04-23 11:14:01 +1000873#include <sys/types.h>
874#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000875 ],
876 [socklen_t foo; foo = 1235;],
877 [ ac_cv_have_socklen_t="yes" ],
878 [ ac_cv_have_socklen_t="no" ]
879 )
880])
881if test "x$ac_cv_have_socklen_t" = "xyes" ; then
882 AC_DEFINE(HAVE_SOCKLEN_T)
883fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100884
Damien Miller61e50f12000-05-08 20:49:37 +1000885AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
886 AC_TRY_COMPILE(
887 [
888#include <sys/types.h>
889 ],
890 [ size_t foo; foo = 1235; ],
891 [ ac_cv_have_size_t="yes" ],
892 [ ac_cv_have_size_t="no" ]
893 )
894])
895if test "x$ac_cv_have_size_t" = "xyes" ; then
896 AC_DEFINE(HAVE_SIZE_T)
897fi
Damien Miller95058511999-12-29 10:36:45 +1100898
Damien Miller615f9392000-05-17 22:53:33 +1000899AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
900 AC_TRY_COMPILE(
901 [
902#include <sys/types.h>
903 ],
904 [ ssize_t foo; foo = 1235; ],
905 [ ac_cv_have_ssize_t="yes" ],
906 [ ac_cv_have_ssize_t="no" ]
907 )
908])
909if test "x$ac_cv_have_ssize_t" = "xyes" ; then
910 AC_DEFINE(HAVE_SSIZE_T)
911fi
912
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000913AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
914 AC_TRY_COMPILE(
915 [
916#include <time.h>
917 ],
918 [ clock_t foo; foo = 1235; ],
919 [ ac_cv_have_clock_t="yes" ],
920 [ ac_cv_have_clock_t="no" ]
921 )
922])
923if test "x$ac_cv_have_clock_t" = "xyes" ; then
924 AC_DEFINE(HAVE_CLOCK_T)
925fi
926
Damien Millerb54b40e2000-06-23 08:23:34 +1000927AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
928 AC_TRY_COMPILE(
929 [
930#include <sys/types.h>
931#include <sys/socket.h>
932 ],
933 [ sa_family_t foo; foo = 1235; ],
934 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100935 [ AC_TRY_COMPILE(
936 [
937#include <sys/types.h>
938#include <sys/socket.h>
939#include <netinet/in.h>
940 ],
941 [ sa_family_t foo; foo = 1235; ],
942 [ ac_cv_have_sa_family_t="yes" ],
943
Damien Millerb54b40e2000-06-23 08:23:34 +1000944 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100945 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000946 )
947])
948if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
949 AC_DEFINE(HAVE_SA_FAMILY_T)
950fi
951
Damien Miller0f91b4e2000-06-18 15:43:25 +1000952AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
953 AC_TRY_COMPILE(
954 [
955#include <sys/types.h>
956 ],
957 [ pid_t foo; foo = 1235; ],
958 [ ac_cv_have_pid_t="yes" ],
959 [ ac_cv_have_pid_t="no" ]
960 )
961])
962if test "x$ac_cv_have_pid_t" = "xyes" ; then
963 AC_DEFINE(HAVE_PID_T)
964fi
965
966AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
967 AC_TRY_COMPILE(
968 [
969#include <sys/types.h>
970 ],
971 [ mode_t foo; foo = 1235; ],
972 [ ac_cv_have_mode_t="yes" ],
973 [ ac_cv_have_mode_t="no" ]
974 )
975])
976if test "x$ac_cv_have_mode_t" = "xyes" ; then
977 AC_DEFINE(HAVE_MODE_T)
978fi
979
Damien Miller61e50f12000-05-08 20:49:37 +1000980
981AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
982 AC_TRY_COMPILE(
983 [
Damien Miller81171112000-04-23 11:14:01 +1000984#include <sys/types.h>
985#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000986 ],
987 [ struct sockaddr_storage s; ],
988 [ ac_cv_have_struct_sockaddr_storage="yes" ],
989 [ ac_cv_have_struct_sockaddr_storage="no" ]
990 )
991])
992if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
993 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
994fi
Damien Miller34132e52000-01-14 15:45:46 +1100995
Damien Miller61e50f12000-05-08 20:49:37 +1000996AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
997 AC_TRY_COMPILE(
998 [
Damien Miller7b22d652000-06-18 14:07:04 +1000999#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001000#include <netinet/in.h>
1001 ],
1002 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1003 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1004 [ ac_cv_have_struct_sockaddr_in6="no" ]
1005 )
1006])
1007if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1008 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1009fi
Damien Miller34132e52000-01-14 15:45:46 +11001010
Damien Miller61e50f12000-05-08 20:49:37 +10001011AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1012 AC_TRY_COMPILE(
1013 [
Damien Miller7b22d652000-06-18 14:07:04 +10001014#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001015#include <netinet/in.h>
1016 ],
1017 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1018 [ ac_cv_have_struct_in6_addr="yes" ],
1019 [ ac_cv_have_struct_in6_addr="no" ]
1020 )
1021])
1022if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1023 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1024fi
Damien Miller34132e52000-01-14 15:45:46 +11001025
Damien Miller61e50f12000-05-08 20:49:37 +10001026AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1027 AC_TRY_COMPILE(
1028 [
Damien Miller81171112000-04-23 11:14:01 +10001029#include <sys/types.h>
1030#include <sys/socket.h>
1031#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001032 ],
1033 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1034 [ ac_cv_have_struct_addrinfo="yes" ],
1035 [ ac_cv_have_struct_addrinfo="no" ]
1036 )
1037])
1038if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1039 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1040fi
1041
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001042AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1043 AC_TRY_COMPILE(
1044 [ #include <sys/time.h> ],
1045 [ struct timeval tv; tv.tv_sec = 1;],
1046 [ ac_cv_have_struct_timeval="yes" ],
1047 [ ac_cv_have_struct_timeval="no" ]
1048 )
1049])
1050if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1051 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1052 have_struct_timeval=1
1053fi
1054
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001055# If we don't have int64_t then we can't compile sftp-server. So don't
1056# even attempt to do it.
1057if test "x$ac_cv_have_int64_t" = "xno" -a \
1058 "x$ac_cv_sizeof_long_int" != "x8" -a \
1059 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1060 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001061fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001062AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001063
Damien Miller78315eb2000-09-29 23:01:36 +11001064dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001065OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1066OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1067OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1068OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1069OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001070OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001071OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1072OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001073OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001074OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1075OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1076OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001078OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1079OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1080OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1081OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001082AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001083
Damien Miller942da032000-08-18 13:59:06 +10001084AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1085 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1086 AC_TRY_COMPILE(
1087 [
1088#include <sys/types.h>
1089#include <sys/socket.h>
1090 ],
1091 [ struct sockaddr_un s; s.sun_len = 1; ],
1092 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1093 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1094 )
1095])
1096if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1097 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1098fi
1099
Damien Miller61e50f12000-05-08 20:49:37 +10001100AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1101 ac_cv_have_ss_family_in_struct_ss, [
1102 AC_TRY_COMPILE(
1103 [
Damien Miller81171112000-04-23 11:14:01 +10001104#include <sys/types.h>
1105#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001106 ],
1107 [ struct sockaddr_storage s; s.ss_family = 1; ],
1108 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1109 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1110 )
1111])
1112if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1113 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1114fi
1115
Damien Miller61e50f12000-05-08 20:49:37 +10001116AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1117 ac_cv_have___ss_family_in_struct_ss, [
1118 AC_TRY_COMPILE(
1119 [
Damien Miller81171112000-04-23 11:14:01 +10001120#include <sys/types.h>
1121#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001122 ],
1123 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1124 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1125 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1126 )
1127])
1128if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1129 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1130fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001131
Damien Millerad833b32000-08-23 10:46:23 +10001132AC_CACHE_CHECK([for pw_class field in struct passwd],
1133 ac_cv_have_pw_class_in_struct_passwd, [
1134 AC_TRY_COMPILE(
1135 [
Damien Millerad833b32000-08-23 10:46:23 +10001136#include <pwd.h>
1137 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001138 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001139 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1140 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1141 )
1142])
1143if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1144 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1145fi
1146
Damien Miller61e50f12000-05-08 20:49:37 +10001147
1148AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1149 AC_TRY_LINK([],
1150 [ extern char *__progname; printf("%s", __progname); ],
1151 [ ac_cv_libc_defines___progname="yes" ],
1152 [ ac_cv_libc_defines___progname="no" ]
1153 )
1154])
1155if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1156 AC_DEFINE(HAVE___PROGNAME)
1157fi
1158
Damien Millera22ba012000-03-02 23:09:20 +11001159
Damien Millerecbb26d2000-07-15 14:59:14 +10001160AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1161 AC_TRY_LINK([],
1162 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1163 [ ac_cv_libc_defines_sys_errlist="yes" ],
1164 [ ac_cv_libc_defines_sys_errlist="no" ]
1165 )
1166])
1167if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1168 AC_DEFINE(HAVE_SYS_ERRLIST)
1169fi
1170
1171
Damien Miller11fa2cc2000-08-16 10:35:58 +10001172AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1173 AC_TRY_LINK([],
1174 [ extern int sys_nerr; printf("%i", sys_nerr);],
1175 [ ac_cv_libc_defines_sys_nerr="yes" ],
1176 [ ac_cv_libc_defines_sys_nerr="no" ]
1177 )
1178])
1179if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1180 AC_DEFINE(HAVE_SYS_NERR)
1181fi
1182
1183
Damien Millera22ba012000-03-02 23:09:20 +11001184# Looking for programs, paths and files
1185AC_ARG_WITH(rsh,
1186 [ --with-rsh=PATH Specify path to remote shell program ],
1187 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001188 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001189 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001190 fi
1191 ],
1192 [
1193 AC_PATH_PROG(rsh_path, rsh)
1194 ]
1195)
1196
1197AC_ARG_WITH(xauth,
1198 [ --with-xauth=PATH Specify path to xauth program ],
1199 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001200 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001201 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001202 fi
1203 ],
1204 [
Damien Miller78315eb2000-09-29 23:01:36 +11001205 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 +10001206 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001207 xauth_path="/usr/openwin/bin/xauth"
1208 fi
1209 ]
1210)
1211
Damien Millera19cf472000-11-29 13:28:50 +11001212if test -z "$xauth_path" ; then
1213 XAUTH_PATH="undefined"
1214 AC_SUBST(XAUTH_PATH)
1215else
Damien Millera22ba012000-03-02 23:09:20 +11001216 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001217 XAUTH_PATH=$xauth_path
1218 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001219fi
1220if test ! -z "$rsh_path" ; then
1221 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1222fi
1223
1224# Check for mail directory (last resort if we cannot get it from headers)
1225if test ! -z "$MAIL" ; then
1226 maildir=`dirname $MAIL`
1227 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1228fi
1229
Damien Millera22ba012000-03-02 23:09:20 +11001230if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001231 AC_CHECK_FILE("/dev/ptmx",
1232 [
1233 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1234 have_dev_ptmx=1
1235 ]
1236 )
Damien Millera22ba012000-03-02 23:09:20 +11001237fi
Damien Miller204ad072000-03-02 23:56:12 +11001238AC_CHECK_FILE("/dev/ptc",
1239 [
1240 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1241 have_dev_ptc=1
1242 ]
1243)
1244
Damien Millera22ba012000-03-02 23:09:20 +11001245# Options from here on. Some of these are preset by platform above
1246
Damien Millera22ba012000-03-02 23:09:20 +11001247# Check for user-specified random device, otherwise check /dev/urandom
1248AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001249 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001250 [
Damien Miller040f3832000-04-03 14:50:43 +10001251 if test "x$withval" != "xno" ; then
1252 RANDOM_POOL="$withval";
1253 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1254 fi
Damien Millera22ba012000-03-02 23:09:20 +11001255 ],
1256 [
1257 # Check for random device
1258 AC_CHECK_FILE("/dev/urandom",
1259 [
1260 RANDOM_POOL="/dev/urandom";
1261 AC_SUBST(RANDOM_POOL)
1262 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1263 ]
1264 )
1265 ]
1266)
1267
1268# Check for EGD pool file
1269AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001270 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001271 [
Damien Miller040f3832000-04-03 14:50:43 +10001272 if test "x$withval" != "xno" ; then
1273 EGD_SOCKET="$withval";
1274 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1275 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001276 ],
1277 [
1278 # Check for existing socket only if we don't have a random device already
1279 if test -z "$RANDOM_POOL" ; then
1280 AC_MSG_CHECKING(for PRNGD/EGD socket)
1281 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001282 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
Damien Millerd8ab0d42001-02-13 12:11:17 +11001283 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001284 EGD_SOCKET="$egdsock"
1285 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001286 break;
1287 fi
1288 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001289 if test -x "$EGD_SOCKET" ; then
1290 AC_MSG_RESULT($EGD_SOCKET)
1291 else
1292 AC_MSG_RESULT(not found)
1293 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001294 fi
Damien Millera22ba012000-03-02 23:09:20 +11001295 ]
1296)
1297
Damien Miller0736c4d2001-01-25 10:51:46 +11001298
Damien Miller0437b332000-05-02 09:56:41 +10001299# detect pathnames for entropy gathering commands, if we need them
1300INSTALL_SSH_PRNG_CMDS=""
1301rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001302if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001303 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001304 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1305 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1306 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1307 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1308 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1309 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1310 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1311 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1312 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1313 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1314 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1315 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1316 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1317 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001318
1319 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001320fi
Damien Miller0437b332000-05-02 09:56:41 +10001321AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1322
Damien Miller11e37f62000-04-08 18:23:30 +10001323
Damien Miller670a4b82000-01-22 13:53:11 +11001324AC_ARG_WITH(catman,
1325 [ --with-catman=man|cat Install preformatted manpages[no]],
1326 [
1327 MANTYPE='$(CATMAN)'
1328 if test x"$withval" != x"yes" ; then
1329 mansubdir=$withval
1330 else
1331 mansubdir=cat
1332 fi
1333 ], [
1334 if test -z "$MANTYPE" ; then
1335 MANTYPE='$(TROFFMAN)'
1336 mansubdir=man
1337 fi
1338 ]
1339)
1340AC_SUBST(MANTYPE)
1341AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001342
Damien Millera22ba012000-03-02 23:09:20 +11001343# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001344MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001345AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001346 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001347 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001348 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001349 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001350 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001351 fi
1352 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001353)
1354
Damien Millera22ba012000-03-02 23:09:20 +11001355# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001356AC_ARG_WITH(shadow,
1357 [ --without-shadow Disable shadow password support],
1358 [
1359 if test "x$withval" = "xno" ; then
1360 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001361 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001362 fi
1363 ]
1364)
1365
Damien Miller1f335fb2000-06-26 11:31:33 +10001366if test -z "$disable_shadow" ; then
1367 AC_MSG_CHECKING([if the systems has expire shadow information])
1368 AC_TRY_COMPILE(
1369 [
1370#include <sys/types.h>
1371#include <shadow.h>
1372 struct spwd sp;
1373 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1374 [ sp_expire_available=yes ], []
1375 )
1376
1377 if test "x$sp_expire_available" = "xyes" ; then
1378 AC_MSG_RESULT(yes)
1379 AC_DEFINE(HAS_SHADOW_EXPIRE)
1380 else
1381 AC_MSG_RESULT(no)
1382 fi
1383fi
1384
Damien Millera22ba012000-03-02 23:09:20 +11001385# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001386if test ! -z "$IPADDR_IN_DISPLAY" ; then
1387 DISPLAY_HACK_MSG="yes"
1388 AC_DEFINE(IPADDR_IN_DISPLAY)
1389else
1390 DISPLAY_HACK_MSG="no"
1391 AC_ARG_WITH(ipaddr-display,
1392 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1393 [
1394 if test "x$withval" != "xno" ; then
1395 AC_DEFINE(IPADDR_IN_DISPLAY)
1396 DISPLAY_HACK_MSG="yes"
1397 fi
1398 ]
1399 )
1400fi
Damien Miller76112de1999-12-21 11:18:08 +11001401
Damien Millera22ba012000-03-02 23:09:20 +11001402# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001403SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001404AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001405 [ --with-default-path=PATH Specify default \$PATH environment for server],
1406 [
1407 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001408 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001409 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001410 fi
1411 ]
1412)
1413
Damien Millera22ba012000-03-02 23:09:20 +11001414# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001415IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001416AC_ARG_WITH(ipv4-default,
1417 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1418 [
1419 if test "x$withval" != "xno" ; then
1420 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001421 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001422 fi
1423 ]
1424)
1425
Damien Miller61e50f12000-05-08 20:49:37 +10001426AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001427IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001428AC_ARG_WITH(4in6,
1429 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1430 [
1431 if test "x$withval" != "xno" ; then
1432 AC_MSG_RESULT(yes)
1433 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001434 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001435 else
1436 AC_MSG_RESULT(no)
1437 fi
1438 ],[
1439 if test "x$inet6_default_4in6" = "xyes"; then
1440 AC_MSG_RESULT([yes (default)])
1441 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001442 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001443 else
1444 AC_MSG_RESULT([no (default)])
1445 fi
1446 ]
1447)
1448
Damien Miller60396b02001-02-18 17:01:00 +11001449# Whether to enable BSD auth support
1450AC_ARG_WITH(bsd-auth,
1451 [ --with-bsd-auth Enable BSD auth support],
1452 [
1453 if test "x$withval" != "xno" ; then
1454 AC_DEFINE(BSD_AUTH)
1455 bsd_auth=yes
1456 fi
1457 ]
1458)
1459
Damien Miller78315eb2000-09-29 23:01:36 +11001460AC_MSG_CHECKING(whether to install ssh as suid root)
1461AC_ARG_ENABLE(suid-ssh,
1462[ --enable-suid-ssh Install ssh as suid root (default)
1463 --disable-suid-ssh Install ssh without suid bit],
1464[ case "$enableval" in
1465 no)
1466 AC_MSG_RESULT(no)
1467 SSHMODE=0711
1468 ;;
1469 *) AC_MSG_RESULT(yes)
1470 SSHMODE=04711
1471 ;;
1472 esac ],
1473 AC_MSG_RESULT(yes)
1474 SSHMODE=04711
1475)
1476AC_SUBST(SSHMODE)
1477
1478
Damien Millera22ba012000-03-02 23:09:20 +11001479# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001480piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001481AC_ARG_WITH(pid-dir,
1482 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1483 [
1484 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001485 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001486 fi
1487 ]
1488)
Damien Miller4018c192000-04-30 09:30:44 +10001489
Damien Miller78315eb2000-09-29 23:01:36 +11001490# make sure the directory exists
1491if test ! -d $piddir ; then
1492 piddir=`eval echo ${sysconfdir}`
1493 case $piddir in
1494 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1495 esac
1496fi
1497
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001498AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001499AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001500
andre2ff7b5d2000-06-03 14:57:40 +00001501dnl allow user to disable some login recording features
1502AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001503 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001504 [ AC_DEFINE(DISABLE_LASTLOG) ]
1505)
1506AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001507 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001508 [ AC_DEFINE(DISABLE_UTMP) ]
1509)
1510AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001511 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001512 [ AC_DEFINE(DISABLE_UTMPX) ]
1513)
1514AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001515 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001516 [ AC_DEFINE(DISABLE_WTMP) ]
1517)
1518AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001519 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001520 [ AC_DEFINE(DISABLE_WTMPX) ]
1521)
1522AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001523 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001524 [ AC_DEFINE(DISABLE_LOGIN) ]
1525)
1526AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001527 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001528 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1529)
1530AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001531 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001532 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1533)
1534AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001535 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001536 [
1537 if test "x$withval" = "xno" ; then
1538 AC_DEFINE(DISABLE_LASTLOG)
1539 else
1540 conf_lastlog_location=$withval
1541 fi
1542 ]
1543)
andre2ff7b5d2000-06-03 14:57:40 +00001544
1545dnl lastlog, [uw]tmpx? detection
1546dnl NOTE: set the paths in the platform section to avoid the
1547dnl need for command-line parameters
1548dnl lastlog and [uw]tmp are subject to a file search if all else fails
1549
1550dnl lastlog detection
1551dnl NOTE: the code itself will detect if lastlog is a directory
1552AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1553AC_TRY_COMPILE([
1554#include <sys/types.h>
1555#include <utmp.h>
1556#ifdef HAVE_LASTLOG_H
1557# include <lastlog.h>
1558#endif
Damien Miller2994e082000-06-04 15:51:47 +10001559#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001560# include <paths.h>
1561#endif
1562 ],
1563 [ char *lastlog = LASTLOG_FILE; ],
1564 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001565 [
1566 AC_MSG_RESULT(no)
1567 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1568 AC_TRY_COMPILE([
1569#include <sys/types.h>
1570#include <utmp.h>
1571#ifdef HAVE_LASTLOG_H
1572# include <lastlog.h>
1573#endif
1574#ifdef HAVE_PATHS_H
1575# include <paths.h>
1576#endif
1577 ],
1578 [ char *lastlog = _PATH_LASTLOG; ],
1579 [ AC_MSG_RESULT(yes) ],
1580 [
andree441aa32000-06-12 22:34:38 +00001581 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001582 system_lastlog_path=no
1583 ])
1584 ]
andre2ff7b5d2000-06-03 14:57:40 +00001585)
Damien Miller2994e082000-06-04 15:51:47 +10001586
andre2ff7b5d2000-06-03 14:57:40 +00001587if test -z "$conf_lastlog_location"; then
1588 if test x"$system_lastlog_path" = x"no" ; then
1589 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001590 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001591 conf_lastlog_location=$f
1592 fi
1593 done
1594 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001595 AC_MSG_WARN([** Cannot find lastlog **])
1596 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001597 fi
1598 fi
1599fi
1600
1601if test -n "$conf_lastlog_location"; then
1602 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1603fi
1604
1605dnl utmp detection
1606AC_MSG_CHECKING([if your system defines UTMP_FILE])
1607AC_TRY_COMPILE([
1608#include <sys/types.h>
1609#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001610#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001611# include <paths.h>
1612#endif
1613 ],
1614 [ char *utmp = UTMP_FILE; ],
1615 [ AC_MSG_RESULT(yes) ],
1616 [ AC_MSG_RESULT(no)
1617 system_utmp_path=no ]
1618)
1619if test -z "$conf_utmp_location"; then
1620 if test x"$system_utmp_path" = x"no" ; then
1621 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1622 if test -f $f ; then
1623 conf_utmp_location=$f
1624 fi
1625 done
1626 if test -z "$conf_utmp_location"; then
1627 AC_DEFINE(DISABLE_UTMP)
1628 fi
1629 fi
1630fi
1631if test -n "$conf_utmp_location"; then
1632 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1633fi
1634
1635dnl wtmp detection
1636AC_MSG_CHECKING([if your system defines WTMP_FILE])
1637AC_TRY_COMPILE([
1638#include <sys/types.h>
1639#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001640#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001641# include <paths.h>
1642#endif
1643 ],
1644 [ char *wtmp = WTMP_FILE; ],
1645 [ AC_MSG_RESULT(yes) ],
1646 [ AC_MSG_RESULT(no)
1647 system_wtmp_path=no ]
1648)
1649if test -z "$conf_wtmp_location"; then
1650 if test x"$system_wtmp_path" = x"no" ; then
1651 for f in /usr/adm/wtmp /var/log/wtmp; do
1652 if test -f $f ; then
1653 conf_wtmp_location=$f
1654 fi
1655 done
1656 if test -z "$conf_wtmp_location"; then
1657 AC_DEFINE(DISABLE_WTMP)
1658 fi
1659 fi
1660fi
1661if test -n "$conf_wtmp_location"; then
1662 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1663fi
1664
1665
1666dnl utmpx detection - I don't know any system so perverse as to require
1667dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1668dnl there, though.
1669AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1670AC_TRY_COMPILE([
1671#include <sys/types.h>
1672#include <utmp.h>
1673#ifdef HAVE_UTMPX_H
1674#include <utmpx.h>
1675#endif
Damien Miller2994e082000-06-04 15:51:47 +10001676#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001677# include <paths.h>
1678#endif
1679 ],
1680 [ char *utmpx = UTMPX_FILE; ],
1681 [ AC_MSG_RESULT(yes) ],
1682 [ AC_MSG_RESULT(no)
1683 system_utmpx_path=no ]
1684)
1685if test -z "$conf_utmpx_location"; then
1686 if test x"$system_utmpx_path" = x"no" ; then
1687 AC_DEFINE(DISABLE_UTMPX)
1688 fi
1689else
1690 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1691fi
1692
1693dnl wtmpx detection
1694AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1695AC_TRY_COMPILE([
1696#include <sys/types.h>
1697#include <utmp.h>
1698#ifdef HAVE_UTMPX_H
1699#include <utmpx.h>
1700#endif
Damien Miller2994e082000-06-04 15:51:47 +10001701#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001702# include <paths.h>
1703#endif
1704 ],
1705 [ char *wtmpx = WTMPX_FILE; ],
1706 [ AC_MSG_RESULT(yes) ],
1707 [ AC_MSG_RESULT(no)
1708 system_wtmpx_path=no ]
1709)
1710if test -z "$conf_wtmpx_location"; then
1711 if test x"$system_wtmpx_path" = x"no" ; then
1712 AC_DEFINE(DISABLE_WTMPX)
1713 fi
1714else
1715 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1716fi
1717
Damien Miller4018c192000-04-30 09:30:44 +10001718
1719# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001720entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001721AC_ARG_WITH(entropy-timeout,
1722 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1723 [
1724 if test "x$withval" != "xno" ; then
1725 entropy_timeout=$withval
1726 fi
1727 ]
1728)
1729AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1730
1731
Damien Miller29ea30d2000-03-17 10:54:15 +11001732if test ! -z "$blibpath" ; then
1733 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1734 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1735fi
1736
Damien Millerbac2d8a2000-09-05 16:13:06 +11001737AC_EXEEXT
1738
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001739AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001740
Damien Miller7b22d652000-06-18 14:07:04 +10001741# Print summary of options
1742
1743if test x$MANTYPE = x'$(CATMAN)' ; then
1744 MAN_MSG=cat
1745else
1746 MAN_MSG=man
1747fi
1748if test ! -z "$RANDOM_POOL" ; then
1749 RAND_MSG="Device ($RANDOM_POOL)"
1750else
1751 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001752 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001753 else
1754 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001755 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001756 fi
1757fi
1758
1759# Someone please show me a better way :)
1760A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1761B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1762C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1763D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001764E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001765F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1766G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1767
1768echo ""
1769echo "OpenSSH configured has been configured with the following options."
1770echo " User binaries: $B"
1771echo " System binaries: $C"
1772echo " Configuration files: $D"
1773echo " Askpass program: $E"
1774echo " Manual pages: $F"
1775echo " PID file: $G"
1776echo " Random number collection: $RAND_MSG"
1777echo " Manpage format: $MAN_MSG"
1778echo " PAM support: ${PAM_MSG}"
1779echo " KerberosIV support: $KRB4_MSG"
1780echo " AFS support: $AFS_MSG"
1781echo " S/KEY support: $SKEY_MSG"
1782echo " TCP Wrappers support: $TCPW_MSG"
1783echo " MD5 password support: $MD5_MSG"
1784echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1785echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1786echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1787
Damien Miller60396b02001-02-18 17:01:00 +11001788if test ! -z "$bsd_auth"; then
1789 echo " BSD Auth support: yes"
1790fi
1791
Damien Miller7b22d652000-06-18 14:07:04 +10001792echo ""
1793
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001794echo " Host: ${host}"
1795echo " Compiler: ${CC}"
1796echo " Compiler flags: ${CFLAGS}"
1797echo "Preprocessor flags: ${CPPFLAGS}"
1798echo " Linker flags: ${LDFLAGS}"
1799echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001800
1801echo ""
1802
Damien Miller82cf0ce2000-12-20 13:34:48 +11001803if test "x$PAM_MSG" = "xyes" ; then
1804 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1805 echo "otherwise password authentication may fail. Example PAM control files"
1806 echo "can be found in the contrib/ subdirectory"
1807 echo ""
1808fi
1809
Damien Miller6f9c3372000-10-25 10:06:04 +11001810if test ! -z "$BUILTIN_RNG" ; then
1811 echo "WARNING: you are using the builtin random number collection service."
1812 echo "Please read WARNING.RNG and request that your OS vendor includes"
1813 echo "/dev/random in future versions of their OS."
1814 echo ""
1815fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001816
1817if test ! -z "$NO_SFTP"; then
1818 echo "sftp-server will be disabled. Your compiler does not support"
1819 echo "64bit integers."
1820 echo ""
1821fi
Damien Miller60396b02001-02-18 17:01:00 +11001822