blob: b1eb4d4df3eb2ba446f280b706386d142d682ed8 [file] [log] [blame]
Damien Miller4df5c762001-02-28 08:14:22 +11001# $Id: configure.in,v 1.257 2001/02/27 21:14:22 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11008AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +10009
Damien Millera22ba012000-03-02 23:09:20 +110010# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110011AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100012AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110013AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000014AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110015AC_PATH_PROG(PERL, perl)
16AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100017AC_PATH_PROG(ENT, ent)
18AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110019AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110020AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110023
Damien Miller3f62aba2000-11-29 11:56:35 +110024if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
26fi
27
Damien Millerad833b32000-08-23 10:46:23 +100028# Use LOGIN_PROGRAM from environment if possible
29if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
31else
32 # Search for login
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
36 fi
37fi
38
Damien Miller166bd442000-03-16 10:48:25 +110039if test -z "$LD" ; then
40 LD=$CC
41fi
42AC_SUBST(LD)
43
44# C Compiler features
45AC_C_INLINE
46if test "$GCC" = "yes"; then
47 CFLAGS="$CFLAGS -Wall"
48fi
49
Damien Millera22ba012000-03-02 23:09:20 +110050# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110051case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110052*-*-aix*)
53 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000054 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110055 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100056 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110057 blibpath="/usr/lib:/lib:/usr/local/lib"
58 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100059 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110060 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000061 MANTYPE='$(CATMAN)'
62 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000063 dnl AIX handles lastlog as part of its login message
64 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100065 MANTYPE='$(CATMAN)'
66 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110067 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110068*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110069 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110070 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
74 AC_DEFINE(BROKEN_VHANGUP)
Ben Lindstrom38e60932001-02-24 00:55:04 +000075 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110076 no_libsocket=1
77 no_libnsl=1
78 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000079*-*-dgux*)
80 AC_DEFINE(IP_TOS_IS_BROKEN)
81 ;;
Damien Miller76112de1999-12-21 11:18:08 +110082*-*-hpux10*)
83 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100084 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110085 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000086 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000091 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110092 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110093 MANTYPE='$(CATMAN)'
94 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110095 ;;
Damien Miller1bead332000-04-30 00:47:29 +100096*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000097 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110098 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110099 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100100 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100101 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100102 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000103 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100104 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000105 MANTYPE='$(CATMAN)'
106 mansubdir=cat
107 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100108*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000109 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000110 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100111 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100112 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100113 no_libsocket=1
114 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000115 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100116 ;;
117*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000118 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000119 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100120 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100121 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000122 AC_DEFINE(WITH_IRIX_ARRAY)
123 AC_DEFINE(WITH_IRIX_PROJECT)
124 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000125 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100126 no_libsocket=1
127 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000128 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000129 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100130 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100131*-*-linux*)
132 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100133 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100134 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000135 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100136 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100137 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000138mips-sony-bsd|mips-sony-newsos4)
139 AC_DEFINE(HAVE_NEWS4)
140 SONY=1
141 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100142 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000143 )
144 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100145*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100146 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100147 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100148*-*-freebsd*)
149 check_for_libcrypt_later=1
150 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000152 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100153 conf_utmp_location=/etc/utmp
154 conf_wtmp_location=/usr/adm/wtmp
155 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000156 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000157 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000158 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100159 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000160 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000161 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000162 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100163*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000164 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000165 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100166 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100167 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000168 # hardwire lastlog location (can't detect it on some versions)
169 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000170 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
171 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
172 if test "$sol2ver" -ge 8; then
173 AC_MSG_RESULT(yes)
174 AC_DEFINE(DISABLE_UTMP)
175 AC_DEFINE(DISABLE_WTMP)
176 else
177 AC_MSG_RESULT(no)
178 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100179 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000180*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000181 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000182 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100183 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100184 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000185 conf_utmp_location=/etc/utmp
186 conf_wtmp_location=/var/adm/wtmp
187 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000188 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000189 MANTYPE='$(CATMAN)'
190 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000191 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000192*-ncr-sysv*)
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 MANTYPE='$(CATMAN)'
196 mansubdir=cat
197 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
198 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000199*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000201 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
202 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100203 IPADDR_IN_DISPLAY=yes
204 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000205 AC_DEFINE(IP_TOS_IS_BROKEN)
206 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000207 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000208 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100209*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
212 MANTYPE='$(CATMAN)'
213 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100214 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100215 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100216 ;;
217*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000218 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100219 LDFLAGS="$LDFLAGS -L/usr/local/lib"
220 MANTYPE='$(CATMAN)'
221 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100222 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100223 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100224 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100225*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000226 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100227 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100228 MANTYPE='$(CATMAN)'
229 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100230 LIBS="$LIBS -lgen -lsocket"
231 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100232*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000233 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100234 LDFLAGS="$LDFLAGS -L/usr/local/lib"
235 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000236 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100237 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100238 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100239 RANLIB=true
240 no_dev_ptmx=1
241 AC_DEFINE(BROKEN_SYS_TERMIO_H)
242 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100243 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000244 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000245 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100246 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100247 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100248 ;;
249*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000250 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000251 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100252 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000253 MANTYPE='$(CATMAN)'
254 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000255 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100256 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100257 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100258 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000259 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000260 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100261 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000262 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000263*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000264 if test ! -z "USE_SIA" ; then
265 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
266 if test -f /etc/sia/matrix.conf; then
267 AC_MSG_RESULT(yes)
268 AC_DEFINE(HAVE_OSF_SIA)
269 AC_DEFINE(DISABLE_LOGIN)
270 LIBS="$LIBS -lsecurity -ldb -lm -laud"
271 else
272 AC_MSG_RESULT(no)
273 fi
274 fi
275 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100276esac
277
Damien Millere37bfc12000-06-05 09:37:43 +1000278# Allow user to specify flags
279AC_ARG_WITH(cflags,
280 [ --with-cflags Specify additional flags to pass to compiler],
281 [
282 if test "x$withval" != "xno" ; then
283 CFLAGS="$CFLAGS $withval"
284 fi
285 ]
286)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000287AC_ARG_WITH(cppflags,
288 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
289 [
290 if test "x$withval" != "xno"; then
291 CPPFLAGS="$CPPFLAGS $withval"
292 fi
293 ]
294)
Damien Millere37bfc12000-06-05 09:37:43 +1000295AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000296 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000297 [
298 if test "x$withval" != "xno" ; then
299 LDFLAGS="$LDFLAGS $withval"
300 fi
301 ]
302)
303AC_ARG_WITH(libs,
304 [ --with-libs Specify additional libraries to link with],
305 [
306 if test "x$withval" != "xno" ; then
307 LIBS="$LIBS $withval"
308 fi
309 ]
310)
311
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000312AC_ARG_WITH(pcre,
313 [ --with-pcre Override built in regex library with pcre],
314 [
315
316 AC_CHECK_LIB(pcre, pcre_info,
317 [
318 AC_DEFINE(HAVE_LIBPCRE)
319 LIBS="$LIBS -lpcreposix -lpcre"
320 no_comp_check="yes"
321 ],
322 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
323 )
324 ]
325)
Damien Millere37bfc12000-06-05 09:37:43 +1000326
Damien Millera22ba012000-03-02 23:09:20 +1100327# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100328if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000329 AC_CHECK_LIB(nsl, yp_match, , )
330fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100331if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000332 AC_CHECK_LIB(socket, main, , )
333fi
334
Damien Millerdf288022001-02-18 13:07:07 +1100335dnl SCO OS3 needs this for libwrap
336AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
337
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000338AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100339AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100340AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100341
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000342# We don't want to check if we did an pcre override.
343if test -z "$no_comp_check" ; then
344 AC_CHECK_FUNC(regcomp,
345 [ AC_DEFINE(HAVE_REGCOMP)],
346 [
347 AC_CHECK_LIB(pcre, pcre_info,
348 [
349 AC_DEFINE(HAVE_LIBPCRE)
350 LIBS="$LIBS -lpcreposix -lpcre"
351 ],
352 [
353 AC_MSG_ERROR([*** No regex library found.])
354 ])
355 ]
356 )
357fi
Damien Millerab18c411999-11-11 10:40:23 +1100358
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000359dnl UnixWare 2.x
360AC_CHECK_FUNC(strcasecmp,
361 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
362)
363AC_CHECK_FUNC(utimes,
364 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
365)
Damien Millerab18c411999-11-11 10:40:23 +1100366
Ben Lindstrom8697e082001-02-24 21:41:10 +0000367AC_FUNC_STRFTIME
368
Damien Millera22ba012000-03-02 23:09:20 +1100369# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000370AC_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 +1100371
Damien Millerc547bf12001-02-16 10:18:12 +1100372# Check whether user wants Kerberos support
373KRB4_MSG="no"
374AC_ARG_WITH(kerberos4,
375 [ --with-kerberos4=PATH Enable Kerberos 4 support],
376 [
377 if test "x$withval" != "xno" ; then
378
379 if test "x$withval" != "xyes" ; then
380 CPPFLAGS="$CPPFLAGS -I${withval}/include"
381 LDFLAGS="$LDFLAGS -L${withval}/lib"
382 if test ! -z "$need_dash_r" ; then
383 LDFLAGS="$LDFLAGS -R${withval}/lib"
384 fi
385 if test ! -z "$blibpath" ; then
386 blibpath="$blibpath:${withval}/lib"
387 fi
388 else
389 if test -d /usr/include/kerberosIV ; then
390 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
391 fi
392 fi
393
394 AC_CHECK_HEADERS(krb.h)
395 AC_CHECK_LIB(krb, main)
396 if test "$ac_cv_header_krb_h" != yes; then
397 AC_MSG_WARN([Cannot find krb.h, build may fail])
398 fi
399 if test "$ac_cv_lib_krb_main" != yes; then
400 AC_MSG_WARN([Cannot find libkrb, build may fail])
401 fi
402
403 KLIBS="-lkrb -ldes"
404 AC_CHECK_LIB(resolv, dn_expand, , )
405 KRB4=yes
406 KRB4_MSG="yes"
407 AC_DEFINE(KRB4)
408 fi
409 ]
410)
411
412# Check whether user wants AFS support
413AFS_MSG="no"
414AC_ARG_WITH(afs,
415 [ --with-afs=PATH Enable AFS support],
416 [
417 if test "x$withval" != "xno" ; then
418
419 if test "x$withval" != "xyes" ; then
420 CPPFLAGS="$CPPFLAGS -I${withval}/include"
421 LDFLAGS="$LDFLAGS -L${withval}/lib"
422 fi
423
424 if test -z "$KRB4" ; then
425 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
426 fi
427
428 LIBS="$LIBS -lkafs"
429 if test ! -z "$AFS_LIBS" ; then
430 LIBS="$LIBS $AFS_LIBS"
431 fi
432 AC_DEFINE(AFS)
433 AFS_MSG="yes"
434 fi
435 ]
436)
437LIBS="$LIBS $KLIBS"
438
439# Check whether user wants S/Key support
440SKEY_MSG="no"
441AC_ARG_WITH(skey,
442 [ --with-skey=PATH Enable S/Key support],
443 [
444 if test "x$withval" != "xno" ; then
445
446 if test "x$withval" != "xyes" ; then
447 CPPFLAGS="$CPPFLAGS -I${withval}/include"
448 LDFLAGS="$LDFLAGS -L${withval}/lib"
449 fi
450
451 AC_DEFINE(SKEY)
452 LIBS="-lskey $LIBS"
453 SKEY_MSG="yes"
454
455 AC_CHECK_FUNC(skey_keyinfo,
456 [],
457 [
458 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
459 ])
460 fi
461 ]
462)
463
464# Check whether user wants TCP wrappers support
465TCPW_MSG="no"
466AC_ARG_WITH(tcp-wrappers,
467 [ --with-tcp-wrappers Enable tcpwrappers support],
468 [
469 if test "x$withval" != "xno" ; then
470 saved_LIBS="$LIBS"
471 LIBS="-lwrap $LIBS"
472 AC_MSG_CHECKING(for libwrap)
473 AC_TRY_LINK(
474 [
475#include <tcpd.h>
476 int deny_severity = 0, allow_severity = 0;
477 ],
478 [hosts_access(0);],
479 [
480 AC_MSG_RESULT(yes)
481 AC_DEFINE(LIBWRAP)
482 TCPW_MSG="yes"
483 ],
484 [
485 AC_MSG_ERROR([*** libwrap missing])
486 ]
487 )
488 fi
489 ]
490)
491
Damien Millerad833b32000-08-23 10:46:23 +1000492dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000493AC_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 +1000494dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000495AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000496dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000497AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000498AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000499dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000500AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000501AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000502dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000503AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000504AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100505
Damien Miller5fc85652000-07-09 23:53:07 +1000506AC_CHECK_FUNC(getuserattr,
507 [AC_DEFINE(HAVE_GETUSERATTR)],
508 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
509)
510
Damien Miller04f80141999-11-19 15:32:34 +1100511AC_CHECK_FUNC(login,
512 [AC_DEFINE(HAVE_LOGIN)],
513 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
514)
515
516AC_CHECK_FUNC(daemon,
517 [AC_DEFINE(HAVE_DAEMON)],
518 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
519)
520
Damien Miller9fb07e42000-03-05 16:22:59 +1100521AC_CHECK_FUNC(getpagesize,
522 [AC_DEFINE(HAVE_GETPAGESIZE)],
523 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
524)
525
Damien Millercb170cb2000-07-01 16:52:55 +1000526# Check for broken snprintf
527if test "x$ac_cv_func_snprintf" = "xyes" ; then
528 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
529 AC_TRY_RUN(
530 [
531#include <stdio.h>
532int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
533 ],
534 [AC_MSG_RESULT(yes)],
535 [
536 AC_MSG_RESULT(no)
537 AC_DEFINE(BROKEN_SNPRINTF)
538 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
539 ]
540 )
541fi
542
Damien Miller606f8802000-09-16 15:39:56 +1100543AC_FUNC_GETPGRP
544
Damien Millera64b57a2001-01-17 10:44:13 +1100545# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000546PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100547AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100548 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100549 [
Damien Millera64b57a2001-01-17 10:44:13 +1100550 if test "x$withval" != "xno" ; then
551 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
552 AC_MSG_ERROR([PAM headers not found])
553 fi
554
555 AC_CHECK_LIB(dl, dlopen, , )
556 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
557 AC_CHECK_FUNCS(pam_getenvlist)
558
559 disable_shadow=yes
560 PAM_MSG="yes"
561
562 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100563 fi
564 ]
565)
Damien Millera22ba012000-03-02 23:09:20 +1100566
Damien Millera64b57a2001-01-17 10:44:13 +1100567# Check for older PAM
568if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100569 # Check PAM strerror arguments (old PAM)
570 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
571 AC_TRY_COMPILE(
572 [
Damien Miller81171112000-04-23 11:14:01 +1000573#include <stdlib.h>
574#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100575 ],
576 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
577 [AC_MSG_RESULT(no)],
578 [
579 AC_DEFINE(HAVE_OLD_PAM)
580 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000581 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100582 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100583 )
Damien Millera22ba012000-03-02 23:09:20 +1100584fi
585
586# The big search for OpenSSL
587AC_ARG_WITH(ssl-dir,
588 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
589 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000590 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100591 tryssldir=$withval
592 fi
593 ]
594)
595
596saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100597saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000598saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100599if test "x$prefix" != "xNONE" ; then
600 tryssldir="$tryssldir $prefix"
601fi
Damien Miller61e50f12000-05-08 20:49:37 +1000602AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100603 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 +1100604 CPPFLAGS="$saved_CPPFLAGS"
605 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000606 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100607
608 # Skip directories if they don't exist
609 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
610 continue;
611 fi
612 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
613 # Try to use $ssldir/lib if it exists, otherwise
614 # $ssldir
615 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000616 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100617 if test ! -z "$need_dash_r" ; then
618 LDFLAGS="$LDFLAGS -R$ssldir/lib"
619 fi
620 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000621 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100622 if test ! -z "$need_dash_r" ; then
623 LDFLAGS="$LDFLAGS -R$ssldir"
624 fi
625 fi
626 # Try to use $ssldir/include if it exists, otherwise
627 # $ssldir
628 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000629 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100630 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000631 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100632 fi
633 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000634
Damien Miller3b512e12000-05-17 23:29:18 +1000635 # Basic test to check for compatible version and correct linking
636 # *does not* test for RSA - that comes later.
637 AC_TRY_RUN(
638 [
Damien Millere59ce622000-05-01 20:54:17 +1000639#include <string.h>
640#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000641int main(void)
642{
Damien Miller3b512e12000-05-17 23:29:18 +1000643 char a[2048];
644 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000645 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000646 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000647}
Damien Miller3b512e12000-05-17 23:29:18 +1000648 ],
649 [
650 found_crypto=1
651 break;
652 ], []
653 )
Damien Miller61e50f12000-05-08 20:49:37 +1000654
655 if test ! -z "$found_crypto" ; then
656 break;
657 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100658 done
659
Damien Miller61e50f12000-05-08 20:49:37 +1000660 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100661 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100662 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000663 if test -z "$ssldir" ; then
664 ssldir="(system)"
665 fi
Damien Millera22ba012000-03-02 23:09:20 +1100666
Damien Miller61e50f12000-05-08 20:49:37 +1000667 ac_cv_openssldir=$ssldir
668])
669
Damien Milleredb82922000-06-20 13:25:52 +1000670if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000671 AC_DEFINE(HAVE_OPENSSL)
672 dnl Need to recover ssldir - test above runs in subshell
673 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100674 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100675 # Try to use $ssldir/lib if it exists, otherwise
676 # $ssldir
677 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000678 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100679 if test ! -z "$need_dash_r" ; then
680 LDFLAGS="$LDFLAGS -R$ssldir/lib"
681 fi
682 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000683 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100684 if test ! -z "$need_dash_r" ; then
685 LDFLAGS="$LDFLAGS -R$ssldir"
686 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100687 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100688 # Try to use $ssldir/include if it exists, otherwise
689 # $ssldir
690 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000691 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100692 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000693 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100694 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100695 fi
Damien Millera22ba012000-03-02 23:09:20 +1100696fi
Damien Miller3b512e12000-05-17 23:29:18 +1000697LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000698
Damien Miller3b512e12000-05-17 23:29:18 +1000699# Now test RSA support
700saved_LIBS="$LIBS"
701AC_MSG_CHECKING([for RSA support])
702for WANTS_RSAREF in "" 1 ; do
703 if test -z "$WANTS_RSAREF" ; then
704 LIBS="$saved_LIBS"
705 else
706 LIBS="$saved_LIBS -lRSAglue -lrsaref"
707 fi
708 AC_TRY_RUN([
709#include <string.h>
710#include <openssl/rand.h>
711#include <openssl/rsa.h>
712#include <openssl/bn.h>
713#include <openssl/sha.h>
714int main(void)
715{
716 int num; RSA *key; static unsigned char p_in[] = "blahblah";
717 unsigned char c[256], p[256];
718 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
719 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
720 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
721 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
722}
723 ],
724 [
725 rsa_works=1
726 break;
727 ], [])
728done
729
730if test ! -z "$no_rsa" ; then
731 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000732 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000733else
734 if test -z "$rsa_works" ; then
735 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000736 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000737 else
738 if test -z "$WANTS_RSAREF" ; then
739 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000740 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000741 else
Damien Miller7b22d652000-06-18 14:07:04 +1000742 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000743 AC_MSG_RESULT(using RSAref)
744 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
745 fi
746 fi
747fi
Damien Millera22ba012000-03-02 23:09:20 +1100748
Damien Millera64b57a2001-01-17 10:44:13 +1100749# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
750# version in OpenSSL. Skip this for PAM
751if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
752 AC_CHECK_LIB(crypt, crypt, , )
753fi
754
Ben Lindstromb5628642000-10-18 00:02:25 +0000755# Cheap hack to ensure NEWS-OS libraries are arranged right.
756if test ! -z "$SONY" ; then
757 LIBS="$LIBS -liberty";
758fi
759
Damien Millera22ba012000-03-02 23:09:20 +1100760# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100761AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100762AC_CHECK_SIZEOF(short int, 2)
763AC_CHECK_SIZEOF(int, 4)
764AC_CHECK_SIZEOF(long int, 4)
765AC_CHECK_SIZEOF(long long int, 8)
766
Damien Millera22ba012000-03-02 23:09:20 +1100767# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100768AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
769 AC_TRY_COMPILE(
770 [ #include <sys/types.h> ],
771 [ u_int a; a = 1;],
772 [ ac_cv_have_u_int="yes" ],
773 [ ac_cv_have_u_int="no" ]
774 )
775])
776if test "x$ac_cv_have_u_int" = "xyes" ; then
777 AC_DEFINE(HAVE_U_INT)
778 have_u_int=1
779fi
780
Damien Miller61e50f12000-05-08 20:49:37 +1000781AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
782 AC_TRY_COMPILE(
783 [ #include <sys/types.h> ],
784 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
785 [ ac_cv_have_intxx_t="yes" ],
786 [ ac_cv_have_intxx_t="no" ]
787 )
788])
789if test "x$ac_cv_have_intxx_t" = "xyes" ; then
790 AC_DEFINE(HAVE_INTXX_T)
791 have_intxx_t=1
792fi
793
Damien Miller578783e2000-09-23 14:12:24 +1100794AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
795 AC_TRY_COMPILE(
796 [ #include <sys/types.h> ],
797 [ int64_t a; a = 1;],
798 [ ac_cv_have_int64_t="yes" ],
799 [ ac_cv_have_int64_t="no" ]
800 )
801])
802if test "x$ac_cv_have_int64_t" = "xyes" ; then
803 AC_DEFINE(HAVE_INT64_T)
804 have_int64_t=1
805fi
806
Damien Miller61e50f12000-05-08 20:49:37 +1000807AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
808 AC_TRY_COMPILE(
809 [ #include <sys/types.h> ],
810 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
811 [ ac_cv_have_u_intxx_t="yes" ],
812 [ ac_cv_have_u_intxx_t="no" ]
813 )
814])
815if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
816 AC_DEFINE(HAVE_U_INTXX_T)
817 have_u_intxx_t=1
818fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100819
Damien Miller578783e2000-09-23 14:12:24 +1100820AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
821 AC_TRY_COMPILE(
822 [ #include <sys/types.h> ],
823 [ u_int64_t a; a = 1;],
824 [ ac_cv_have_u_int64_t="yes" ],
825 [ ac_cv_have_u_int64_t="no" ]
826 )
827])
828if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
829 AC_DEFINE(HAVE_U_INT64_T)
830 have_u_int64_t=1
831fi
832
Damien Milleredb82922000-06-20 13:25:52 +1000833if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
834 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100835then
836 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
837 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000838 [
839#include <sys/bitypes.h>
840 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100841 [
Damien Miller70494d12000-04-03 15:57:06 +1000842 int8_t a; int16_t b; int32_t c;
843 u_int8_t e; u_int16_t f; u_int32_t g;
844 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100845 ],
846 [
847 AC_DEFINE(HAVE_U_INTXX_T)
848 AC_DEFINE(HAVE_INTXX_T)
849 AC_MSG_RESULT(yes)
850 ],
851 [AC_MSG_RESULT(no)]
852 )
853fi
854
Damien Millerd6121d22000-03-17 23:26:46 +1100855if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000856 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
857 AC_TRY_COMPILE(
858 [
859#include <sys/types.h>
860 ],
861 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
862 [ ac_cv_have_uintxx_t="yes" ],
863 [ ac_cv_have_uintxx_t="no" ]
864 )
865 ])
866 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
867 AC_DEFINE(HAVE_UINTXX_T)
868 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100869fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100870
Damien Miller61e50f12000-05-08 20:49:37 +1000871AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
872 AC_TRY_COMPILE(
873 [
Damien Miller81171112000-04-23 11:14:01 +1000874#include <sys/types.h>
875#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000876 ],
877 [socklen_t foo; foo = 1235;],
878 [ ac_cv_have_socklen_t="yes" ],
879 [ ac_cv_have_socklen_t="no" ]
880 )
881])
882if test "x$ac_cv_have_socklen_t" = "xyes" ; then
883 AC_DEFINE(HAVE_SOCKLEN_T)
884fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100885
Damien Miller61e50f12000-05-08 20:49:37 +1000886AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
887 AC_TRY_COMPILE(
888 [
889#include <sys/types.h>
890 ],
891 [ size_t foo; foo = 1235; ],
892 [ ac_cv_have_size_t="yes" ],
893 [ ac_cv_have_size_t="no" ]
894 )
895])
896if test "x$ac_cv_have_size_t" = "xyes" ; then
897 AC_DEFINE(HAVE_SIZE_T)
898fi
Damien Miller95058511999-12-29 10:36:45 +1100899
Damien Miller615f9392000-05-17 22:53:33 +1000900AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
901 AC_TRY_COMPILE(
902 [
903#include <sys/types.h>
904 ],
905 [ ssize_t foo; foo = 1235; ],
906 [ ac_cv_have_ssize_t="yes" ],
907 [ ac_cv_have_ssize_t="no" ]
908 )
909])
910if test "x$ac_cv_have_ssize_t" = "xyes" ; then
911 AC_DEFINE(HAVE_SSIZE_T)
912fi
913
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000914AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
915 AC_TRY_COMPILE(
916 [
917#include <time.h>
918 ],
919 [ clock_t foo; foo = 1235; ],
920 [ ac_cv_have_clock_t="yes" ],
921 [ ac_cv_have_clock_t="no" ]
922 )
923])
924if test "x$ac_cv_have_clock_t" = "xyes" ; then
925 AC_DEFINE(HAVE_CLOCK_T)
926fi
927
Damien Millerb54b40e2000-06-23 08:23:34 +1000928AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
929 AC_TRY_COMPILE(
930 [
931#include <sys/types.h>
932#include <sys/socket.h>
933 ],
934 [ sa_family_t foo; foo = 1235; ],
935 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100936 [ AC_TRY_COMPILE(
937 [
938#include <sys/types.h>
939#include <sys/socket.h>
940#include <netinet/in.h>
941 ],
942 [ sa_family_t foo; foo = 1235; ],
943 [ ac_cv_have_sa_family_t="yes" ],
944
Damien Millerb54b40e2000-06-23 08:23:34 +1000945 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100946 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000947 )
948])
949if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
950 AC_DEFINE(HAVE_SA_FAMILY_T)
951fi
952
Damien Miller0f91b4e2000-06-18 15:43:25 +1000953AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
954 AC_TRY_COMPILE(
955 [
956#include <sys/types.h>
957 ],
958 [ pid_t foo; foo = 1235; ],
959 [ ac_cv_have_pid_t="yes" ],
960 [ ac_cv_have_pid_t="no" ]
961 )
962])
963if test "x$ac_cv_have_pid_t" = "xyes" ; then
964 AC_DEFINE(HAVE_PID_T)
965fi
966
967AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
968 AC_TRY_COMPILE(
969 [
970#include <sys/types.h>
971 ],
972 [ mode_t foo; foo = 1235; ],
973 [ ac_cv_have_mode_t="yes" ],
974 [ ac_cv_have_mode_t="no" ]
975 )
976])
977if test "x$ac_cv_have_mode_t" = "xyes" ; then
978 AC_DEFINE(HAVE_MODE_T)
979fi
980
Damien Miller61e50f12000-05-08 20:49:37 +1000981
982AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
983 AC_TRY_COMPILE(
984 [
Damien Miller81171112000-04-23 11:14:01 +1000985#include <sys/types.h>
986#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000987 ],
988 [ struct sockaddr_storage s; ],
989 [ ac_cv_have_struct_sockaddr_storage="yes" ],
990 [ ac_cv_have_struct_sockaddr_storage="no" ]
991 )
992])
993if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
994 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
995fi
Damien Miller34132e52000-01-14 15:45:46 +1100996
Damien Miller61e50f12000-05-08 20:49:37 +1000997AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
998 AC_TRY_COMPILE(
999 [
Damien Miller7b22d652000-06-18 14:07:04 +10001000#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001001#include <netinet/in.h>
1002 ],
1003 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1004 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1005 [ ac_cv_have_struct_sockaddr_in6="no" ]
1006 )
1007])
1008if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1009 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1010fi
Damien Miller34132e52000-01-14 15:45:46 +11001011
Damien Miller61e50f12000-05-08 20:49:37 +10001012AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1013 AC_TRY_COMPILE(
1014 [
Damien Miller7b22d652000-06-18 14:07:04 +10001015#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001016#include <netinet/in.h>
1017 ],
1018 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1019 [ ac_cv_have_struct_in6_addr="yes" ],
1020 [ ac_cv_have_struct_in6_addr="no" ]
1021 )
1022])
1023if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1024 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1025fi
Damien Miller34132e52000-01-14 15:45:46 +11001026
Damien Miller61e50f12000-05-08 20:49:37 +10001027AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1028 AC_TRY_COMPILE(
1029 [
Damien Miller81171112000-04-23 11:14:01 +10001030#include <sys/types.h>
1031#include <sys/socket.h>
1032#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001033 ],
1034 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1035 [ ac_cv_have_struct_addrinfo="yes" ],
1036 [ ac_cv_have_struct_addrinfo="no" ]
1037 )
1038])
1039if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1040 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1041fi
1042
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001043AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1044 AC_TRY_COMPILE(
1045 [ #include <sys/time.h> ],
1046 [ struct timeval tv; tv.tv_sec = 1;],
1047 [ ac_cv_have_struct_timeval="yes" ],
1048 [ ac_cv_have_struct_timeval="no" ]
1049 )
1050])
1051if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1052 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1053 have_struct_timeval=1
1054fi
1055
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001056# If we don't have int64_t then we can't compile sftp-server. So don't
1057# even attempt to do it.
1058if test "x$ac_cv_have_int64_t" = "xno" -a \
1059 "x$ac_cv_sizeof_long_int" != "x8" -a \
1060 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1061 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001062fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001063AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001064
Damien Miller78315eb2000-09-29 23:01:36 +11001065dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001066OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1067OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1068OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1069OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1070OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001071OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001072OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1073OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001074OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001075OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1076OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1078OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001079OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1080OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1081OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1082OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001083AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001084
Damien Miller942da032000-08-18 13:59:06 +10001085AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1086 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1087 AC_TRY_COMPILE(
1088 [
1089#include <sys/types.h>
1090#include <sys/socket.h>
1091 ],
1092 [ struct sockaddr_un s; s.sun_len = 1; ],
1093 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1094 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1095 )
1096])
1097if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1098 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1099fi
1100
Damien Miller61e50f12000-05-08 20:49:37 +10001101AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1102 ac_cv_have_ss_family_in_struct_ss, [
1103 AC_TRY_COMPILE(
1104 [
Damien Miller81171112000-04-23 11:14:01 +10001105#include <sys/types.h>
1106#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001107 ],
1108 [ struct sockaddr_storage s; s.ss_family = 1; ],
1109 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1110 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1111 )
1112])
1113if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1114 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1115fi
1116
Damien Miller61e50f12000-05-08 20:49:37 +10001117AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1118 ac_cv_have___ss_family_in_struct_ss, [
1119 AC_TRY_COMPILE(
1120 [
Damien Miller81171112000-04-23 11:14:01 +10001121#include <sys/types.h>
1122#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001123 ],
1124 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1125 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1126 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1127 )
1128])
1129if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1130 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1131fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001132
Damien Millerad833b32000-08-23 10:46:23 +10001133AC_CACHE_CHECK([for pw_class field in struct passwd],
1134 ac_cv_have_pw_class_in_struct_passwd, [
1135 AC_TRY_COMPILE(
1136 [
Damien Millerad833b32000-08-23 10:46:23 +10001137#include <pwd.h>
1138 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001139 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001140 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1141 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1142 )
1143])
1144if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1145 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1146fi
1147
Damien Miller61e50f12000-05-08 20:49:37 +10001148
1149AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1150 AC_TRY_LINK([],
1151 [ extern char *__progname; printf("%s", __progname); ],
1152 [ ac_cv_libc_defines___progname="yes" ],
1153 [ ac_cv_libc_defines___progname="no" ]
1154 )
1155])
1156if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1157 AC_DEFINE(HAVE___PROGNAME)
1158fi
1159
Damien Millera22ba012000-03-02 23:09:20 +11001160
Damien Millerecbb26d2000-07-15 14:59:14 +10001161AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1162 AC_TRY_LINK([],
1163 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1164 [ ac_cv_libc_defines_sys_errlist="yes" ],
1165 [ ac_cv_libc_defines_sys_errlist="no" ]
1166 )
1167])
1168if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1169 AC_DEFINE(HAVE_SYS_ERRLIST)
1170fi
1171
1172
Damien Miller11fa2cc2000-08-16 10:35:58 +10001173AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1174 AC_TRY_LINK([],
1175 [ extern int sys_nerr; printf("%i", sys_nerr);],
1176 [ ac_cv_libc_defines_sys_nerr="yes" ],
1177 [ ac_cv_libc_defines_sys_nerr="no" ]
1178 )
1179])
1180if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1181 AC_DEFINE(HAVE_SYS_NERR)
1182fi
1183
1184
Damien Millera22ba012000-03-02 23:09:20 +11001185# Looking for programs, paths and files
1186AC_ARG_WITH(rsh,
1187 [ --with-rsh=PATH Specify path to remote shell program ],
1188 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001189 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001190 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001191 fi
1192 ],
1193 [
1194 AC_PATH_PROG(rsh_path, rsh)
1195 ]
1196)
1197
1198AC_ARG_WITH(xauth,
1199 [ --with-xauth=PATH Specify path to xauth program ],
1200 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001201 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001202 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001203 fi
1204 ],
1205 [
Damien Miller78315eb2000-09-29 23:01:36 +11001206 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 +10001207 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001208 xauth_path="/usr/openwin/bin/xauth"
1209 fi
1210 ]
1211)
1212
Damien Millera19cf472000-11-29 13:28:50 +11001213if test -z "$xauth_path" ; then
1214 XAUTH_PATH="undefined"
1215 AC_SUBST(XAUTH_PATH)
1216else
Damien Millera22ba012000-03-02 23:09:20 +11001217 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001218 XAUTH_PATH=$xauth_path
1219 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001220fi
1221if test ! -z "$rsh_path" ; then
1222 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1223fi
1224
1225# Check for mail directory (last resort if we cannot get it from headers)
1226if test ! -z "$MAIL" ; then
1227 maildir=`dirname $MAIL`
1228 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1229fi
1230
Damien Millera22ba012000-03-02 23:09:20 +11001231if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001232 AC_CHECK_FILE("/dev/ptmx",
1233 [
1234 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1235 have_dev_ptmx=1
1236 ]
1237 )
Damien Millera22ba012000-03-02 23:09:20 +11001238fi
Damien Miller204ad072000-03-02 23:56:12 +11001239AC_CHECK_FILE("/dev/ptc",
1240 [
1241 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1242 have_dev_ptc=1
1243 ]
1244)
1245
Damien Millera22ba012000-03-02 23:09:20 +11001246# Options from here on. Some of these are preset by platform above
1247
Damien Millera22ba012000-03-02 23:09:20 +11001248# Check for user-specified random device, otherwise check /dev/urandom
1249AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001250 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001251 [
Damien Miller040f3832000-04-03 14:50:43 +10001252 if test "x$withval" != "xno" ; then
1253 RANDOM_POOL="$withval";
1254 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1255 fi
Damien Millera22ba012000-03-02 23:09:20 +11001256 ],
1257 [
1258 # Check for random device
1259 AC_CHECK_FILE("/dev/urandom",
1260 [
1261 RANDOM_POOL="/dev/urandom";
1262 AC_SUBST(RANDOM_POOL)
1263 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1264 ]
1265 )
1266 ]
1267)
1268
1269# Check for EGD pool file
1270AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001271 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001272 [
Damien Miller040f3832000-04-03 14:50:43 +10001273 if test "x$withval" != "xno" ; then
1274 EGD_SOCKET="$withval";
1275 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1276 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001277 ],
1278 [
1279 # Check for existing socket only if we don't have a random device already
1280 if test -z "$RANDOM_POOL" ; then
1281 AC_MSG_CHECKING(for PRNGD/EGD socket)
1282 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001283 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
Damien Millerd8ab0d42001-02-13 12:11:17 +11001284 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001285 EGD_SOCKET="$egdsock"
1286 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001287 break;
1288 fi
1289 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001290 if test -x "$EGD_SOCKET" ; then
1291 AC_MSG_RESULT($EGD_SOCKET)
1292 else
1293 AC_MSG_RESULT(not found)
1294 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001295 fi
Damien Millera22ba012000-03-02 23:09:20 +11001296 ]
1297)
1298
Damien Miller0736c4d2001-01-25 10:51:46 +11001299
Damien Miller0437b332000-05-02 09:56:41 +10001300# detect pathnames for entropy gathering commands, if we need them
1301INSTALL_SSH_PRNG_CMDS=""
1302rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001303if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001304 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001305 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1306 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1307 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1308 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1309 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1310 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1311 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1312 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1313 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1314 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1315 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1316 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1317 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1318 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001319
1320 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001321fi
Damien Miller0437b332000-05-02 09:56:41 +10001322AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1323
Damien Miller11e37f62000-04-08 18:23:30 +10001324
Damien Miller670a4b82000-01-22 13:53:11 +11001325AC_ARG_WITH(catman,
1326 [ --with-catman=man|cat Install preformatted manpages[no]],
1327 [
1328 MANTYPE='$(CATMAN)'
1329 if test x"$withval" != x"yes" ; then
1330 mansubdir=$withval
1331 else
1332 mansubdir=cat
1333 fi
1334 ], [
1335 if test -z "$MANTYPE" ; then
1336 MANTYPE='$(TROFFMAN)'
1337 mansubdir=man
1338 fi
1339 ]
1340)
1341AC_SUBST(MANTYPE)
1342AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001343
Damien Millera22ba012000-03-02 23:09:20 +11001344# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001345MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001346AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001347 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001348 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001349 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001350 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001351 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001352 fi
1353 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001354)
1355
Damien Millera22ba012000-03-02 23:09:20 +11001356# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001357AC_ARG_WITH(shadow,
1358 [ --without-shadow Disable shadow password support],
1359 [
1360 if test "x$withval" = "xno" ; then
1361 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001362 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001363 fi
1364 ]
1365)
1366
Damien Miller1f335fb2000-06-26 11:31:33 +10001367if test -z "$disable_shadow" ; then
1368 AC_MSG_CHECKING([if the systems has expire shadow information])
1369 AC_TRY_COMPILE(
1370 [
1371#include <sys/types.h>
1372#include <shadow.h>
1373 struct spwd sp;
1374 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1375 [ sp_expire_available=yes ], []
1376 )
1377
1378 if test "x$sp_expire_available" = "xyes" ; then
1379 AC_MSG_RESULT(yes)
1380 AC_DEFINE(HAS_SHADOW_EXPIRE)
1381 else
1382 AC_MSG_RESULT(no)
1383 fi
1384fi
1385
Damien Millera22ba012000-03-02 23:09:20 +11001386# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001387if test ! -z "$IPADDR_IN_DISPLAY" ; then
1388 DISPLAY_HACK_MSG="yes"
1389 AC_DEFINE(IPADDR_IN_DISPLAY)
1390else
1391 DISPLAY_HACK_MSG="no"
1392 AC_ARG_WITH(ipaddr-display,
1393 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1394 [
1395 if test "x$withval" != "xno" ; then
1396 AC_DEFINE(IPADDR_IN_DISPLAY)
1397 DISPLAY_HACK_MSG="yes"
1398 fi
1399 ]
1400 )
1401fi
Damien Miller76112de1999-12-21 11:18:08 +11001402
Damien Millera22ba012000-03-02 23:09:20 +11001403# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001404SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001405AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001406 [ --with-default-path=PATH Specify default \$PATH environment for server],
1407 [
1408 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001409 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001410 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001411 fi
1412 ]
1413)
1414
Damien Millera22ba012000-03-02 23:09:20 +11001415# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001416IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001417AC_ARG_WITH(ipv4-default,
1418 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1419 [
1420 if test "x$withval" != "xno" ; then
1421 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001422 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001423 fi
1424 ]
1425)
1426
Damien Miller61e50f12000-05-08 20:49:37 +10001427AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001428IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001429AC_ARG_WITH(4in6,
1430 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1431 [
1432 if test "x$withval" != "xno" ; then
1433 AC_MSG_RESULT(yes)
1434 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001435 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001436 else
1437 AC_MSG_RESULT(no)
1438 fi
1439 ],[
1440 if test "x$inet6_default_4in6" = "xyes"; then
1441 AC_MSG_RESULT([yes (default)])
1442 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001443 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001444 else
1445 AC_MSG_RESULT([no (default)])
1446 fi
1447 ]
1448)
1449
Damien Miller60396b02001-02-18 17:01:00 +11001450# Whether to enable BSD auth support
1451AC_ARG_WITH(bsd-auth,
1452 [ --with-bsd-auth Enable BSD auth support],
1453 [
1454 if test "x$withval" != "xno" ; then
1455 AC_DEFINE(BSD_AUTH)
1456 bsd_auth=yes
1457 fi
1458 ]
1459)
1460
Damien Miller78315eb2000-09-29 23:01:36 +11001461AC_MSG_CHECKING(whether to install ssh as suid root)
1462AC_ARG_ENABLE(suid-ssh,
1463[ --enable-suid-ssh Install ssh as suid root (default)
1464 --disable-suid-ssh Install ssh without suid bit],
1465[ case "$enableval" in
1466 no)
1467 AC_MSG_RESULT(no)
1468 SSHMODE=0711
1469 ;;
1470 *) AC_MSG_RESULT(yes)
1471 SSHMODE=04711
1472 ;;
1473 esac ],
1474 AC_MSG_RESULT(yes)
1475 SSHMODE=04711
1476)
1477AC_SUBST(SSHMODE)
1478
1479
Damien Millera22ba012000-03-02 23:09:20 +11001480# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001481piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001482AC_ARG_WITH(pid-dir,
1483 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1484 [
1485 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001486 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001487 fi
1488 ]
1489)
Damien Miller4018c192000-04-30 09:30:44 +10001490
Damien Miller78315eb2000-09-29 23:01:36 +11001491# make sure the directory exists
1492if test ! -d $piddir ; then
1493 piddir=`eval echo ${sysconfdir}`
1494 case $piddir in
1495 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1496 esac
1497fi
1498
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001499AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001500AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001501
andre2ff7b5d2000-06-03 14:57:40 +00001502dnl allow user to disable some login recording features
1503AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001504 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001505 [ AC_DEFINE(DISABLE_LASTLOG) ]
1506)
1507AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001508 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001509 [ AC_DEFINE(DISABLE_UTMP) ]
1510)
1511AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001512 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001513 [ AC_DEFINE(DISABLE_UTMPX) ]
1514)
1515AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001516 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001517 [ AC_DEFINE(DISABLE_WTMP) ]
1518)
1519AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001520 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001521 [ AC_DEFINE(DISABLE_WTMPX) ]
1522)
1523AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001524 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001525 [ AC_DEFINE(DISABLE_LOGIN) ]
1526)
1527AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001528 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001529 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1530)
1531AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001532 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001533 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1534)
1535AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001536 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001537 [
1538 if test "x$withval" = "xno" ; then
1539 AC_DEFINE(DISABLE_LASTLOG)
1540 else
1541 conf_lastlog_location=$withval
1542 fi
1543 ]
1544)
andre2ff7b5d2000-06-03 14:57:40 +00001545
1546dnl lastlog, [uw]tmpx? detection
1547dnl NOTE: set the paths in the platform section to avoid the
1548dnl need for command-line parameters
1549dnl lastlog and [uw]tmp are subject to a file search if all else fails
1550
1551dnl lastlog detection
1552dnl NOTE: the code itself will detect if lastlog is a directory
1553AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1554AC_TRY_COMPILE([
1555#include <sys/types.h>
1556#include <utmp.h>
1557#ifdef HAVE_LASTLOG_H
1558# include <lastlog.h>
1559#endif
Damien Miller2994e082000-06-04 15:51:47 +10001560#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001561# include <paths.h>
1562#endif
1563 ],
1564 [ char *lastlog = LASTLOG_FILE; ],
1565 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001566 [
1567 AC_MSG_RESULT(no)
1568 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1569 AC_TRY_COMPILE([
1570#include <sys/types.h>
1571#include <utmp.h>
1572#ifdef HAVE_LASTLOG_H
1573# include <lastlog.h>
1574#endif
1575#ifdef HAVE_PATHS_H
1576# include <paths.h>
1577#endif
1578 ],
1579 [ char *lastlog = _PATH_LASTLOG; ],
1580 [ AC_MSG_RESULT(yes) ],
1581 [
andree441aa32000-06-12 22:34:38 +00001582 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001583 system_lastlog_path=no
1584 ])
1585 ]
andre2ff7b5d2000-06-03 14:57:40 +00001586)
Damien Miller2994e082000-06-04 15:51:47 +10001587
andre2ff7b5d2000-06-03 14:57:40 +00001588if test -z "$conf_lastlog_location"; then
1589 if test x"$system_lastlog_path" = x"no" ; then
1590 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001591 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001592 conf_lastlog_location=$f
1593 fi
1594 done
1595 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001596 AC_MSG_WARN([** Cannot find lastlog **])
1597 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001598 fi
1599 fi
1600fi
1601
1602if test -n "$conf_lastlog_location"; then
1603 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1604fi
1605
1606dnl utmp detection
1607AC_MSG_CHECKING([if your system defines UTMP_FILE])
1608AC_TRY_COMPILE([
1609#include <sys/types.h>
1610#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001611#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001612# include <paths.h>
1613#endif
1614 ],
1615 [ char *utmp = UTMP_FILE; ],
1616 [ AC_MSG_RESULT(yes) ],
1617 [ AC_MSG_RESULT(no)
1618 system_utmp_path=no ]
1619)
1620if test -z "$conf_utmp_location"; then
1621 if test x"$system_utmp_path" = x"no" ; then
1622 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1623 if test -f $f ; then
1624 conf_utmp_location=$f
1625 fi
1626 done
1627 if test -z "$conf_utmp_location"; then
1628 AC_DEFINE(DISABLE_UTMP)
1629 fi
1630 fi
1631fi
1632if test -n "$conf_utmp_location"; then
1633 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1634fi
1635
1636dnl wtmp detection
1637AC_MSG_CHECKING([if your system defines WTMP_FILE])
1638AC_TRY_COMPILE([
1639#include <sys/types.h>
1640#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001641#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001642# include <paths.h>
1643#endif
1644 ],
1645 [ char *wtmp = WTMP_FILE; ],
1646 [ AC_MSG_RESULT(yes) ],
1647 [ AC_MSG_RESULT(no)
1648 system_wtmp_path=no ]
1649)
1650if test -z "$conf_wtmp_location"; then
1651 if test x"$system_wtmp_path" = x"no" ; then
1652 for f in /usr/adm/wtmp /var/log/wtmp; do
1653 if test -f $f ; then
1654 conf_wtmp_location=$f
1655 fi
1656 done
1657 if test -z "$conf_wtmp_location"; then
1658 AC_DEFINE(DISABLE_WTMP)
1659 fi
1660 fi
1661fi
1662if test -n "$conf_wtmp_location"; then
1663 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1664fi
1665
1666
1667dnl utmpx detection - I don't know any system so perverse as to require
1668dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1669dnl there, though.
1670AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1671AC_TRY_COMPILE([
1672#include <sys/types.h>
1673#include <utmp.h>
1674#ifdef HAVE_UTMPX_H
1675#include <utmpx.h>
1676#endif
Damien Miller2994e082000-06-04 15:51:47 +10001677#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001678# include <paths.h>
1679#endif
1680 ],
1681 [ char *utmpx = UTMPX_FILE; ],
1682 [ AC_MSG_RESULT(yes) ],
1683 [ AC_MSG_RESULT(no)
1684 system_utmpx_path=no ]
1685)
1686if test -z "$conf_utmpx_location"; then
1687 if test x"$system_utmpx_path" = x"no" ; then
1688 AC_DEFINE(DISABLE_UTMPX)
1689 fi
1690else
1691 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1692fi
1693
1694dnl wtmpx detection
1695AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1696AC_TRY_COMPILE([
1697#include <sys/types.h>
1698#include <utmp.h>
1699#ifdef HAVE_UTMPX_H
1700#include <utmpx.h>
1701#endif
Damien Miller2994e082000-06-04 15:51:47 +10001702#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001703# include <paths.h>
1704#endif
1705 ],
1706 [ char *wtmpx = WTMPX_FILE; ],
1707 [ AC_MSG_RESULT(yes) ],
1708 [ AC_MSG_RESULT(no)
1709 system_wtmpx_path=no ]
1710)
1711if test -z "$conf_wtmpx_location"; then
1712 if test x"$system_wtmpx_path" = x"no" ; then
1713 AC_DEFINE(DISABLE_WTMPX)
1714 fi
1715else
1716 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1717fi
1718
Damien Miller4018c192000-04-30 09:30:44 +10001719
1720# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001721entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001722AC_ARG_WITH(entropy-timeout,
1723 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1724 [
1725 if test "x$withval" != "xno" ; then
1726 entropy_timeout=$withval
1727 fi
1728 ]
1729)
1730AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1731
1732
Damien Miller29ea30d2000-03-17 10:54:15 +11001733if test ! -z "$blibpath" ; then
1734 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1735 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1736fi
1737
Damien Millerbac2d8a2000-09-05 16:13:06 +11001738AC_EXEEXT
1739
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001740AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001741
Damien Miller7b22d652000-06-18 14:07:04 +10001742# Print summary of options
1743
1744if test x$MANTYPE = x'$(CATMAN)' ; then
1745 MAN_MSG=cat
1746else
1747 MAN_MSG=man
1748fi
1749if test ! -z "$RANDOM_POOL" ; then
1750 RAND_MSG="Device ($RANDOM_POOL)"
1751else
1752 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001753 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001754 else
1755 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001756 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001757 fi
1758fi
1759
1760# Someone please show me a better way :)
1761A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1762B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1763C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1764D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001765E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001766F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1767G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1768
1769echo ""
1770echo "OpenSSH configured has been configured with the following options."
1771echo " User binaries: $B"
1772echo " System binaries: $C"
1773echo " Configuration files: $D"
1774echo " Askpass program: $E"
1775echo " Manual pages: $F"
1776echo " PID file: $G"
1777echo " Random number collection: $RAND_MSG"
1778echo " Manpage format: $MAN_MSG"
1779echo " PAM support: ${PAM_MSG}"
1780echo " KerberosIV support: $KRB4_MSG"
1781echo " AFS support: $AFS_MSG"
1782echo " S/KEY support: $SKEY_MSG"
1783echo " TCP Wrappers support: $TCPW_MSG"
1784echo " MD5 password support: $MD5_MSG"
1785echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1786echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1787echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1788
Damien Miller60396b02001-02-18 17:01:00 +11001789if test ! -z "$bsd_auth"; then
1790 echo " BSD Auth support: yes"
1791fi
1792
Damien Miller7b22d652000-06-18 14:07:04 +10001793echo ""
1794
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001795echo " Host: ${host}"
1796echo " Compiler: ${CC}"
1797echo " Compiler flags: ${CFLAGS}"
1798echo "Preprocessor flags: ${CPPFLAGS}"
1799echo " Linker flags: ${LDFLAGS}"
1800echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001801
1802echo ""
1803
Damien Miller82cf0ce2000-12-20 13:34:48 +11001804if test "x$PAM_MSG" = "xyes" ; then
1805 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1806 echo "otherwise password authentication may fail. Example PAM control files"
1807 echo "can be found in the contrib/ subdirectory"
1808 echo ""
1809fi
1810
Damien Miller6f9c3372000-10-25 10:06:04 +11001811if test ! -z "$BUILTIN_RNG" ; then
1812 echo "WARNING: you are using the builtin random number collection service."
1813 echo "Please read WARNING.RNG and request that your OS vendor includes"
1814 echo "/dev/random in future versions of their OS."
1815 echo ""
1816fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001817
1818if test ! -z "$NO_SFTP"; then
1819 echo "sftp-server will be disabled. Your compiler does not support"
1820 echo "64bit integers."
1821 echo ""
1822fi
Damien Miller60396b02001-02-18 17:01:00 +11001823