blob: a5870f336e105fcb4692cd179c1238e0f6dde5a8 [file] [log] [blame]
Damien Miller60396b02001-02-18 17:01:00 +11001# $Id: configure.in,v 1.247 2001/02/18 06:01:00 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)
Damien Millerbac2d8a2000-09-05 16:13:06 +110074 no_libsocket=1
75 no_libnsl=1
76 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000077*-*-dgux*)
78 AC_DEFINE(IP_TOS_IS_BROKEN)
79 ;;
Damien Miller76112de1999-12-21 11:18:08 +110080*-*-hpux10*)
81 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100082 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110083 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000084 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110085 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100086 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110087 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110088 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000089 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110090 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110091 MANTYPE='$(CATMAN)'
92 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110093 ;;
Damien Miller1bead332000-04-30 00:47:29 +100094*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000095 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110096 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110097 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110098 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110099 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100100 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000101 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100102 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000103 MANTYPE='$(CATMAN)'
104 mansubdir=cat
105 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100106*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000107 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000108 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100109 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100110 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100111 no_libsocket=1
112 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000113 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100114 ;;
115*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000116 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000117 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100118 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100119 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000120 AC_DEFINE(WITH_IRIX_ARRAY)
121 AC_DEFINE(WITH_IRIX_PROJECT)
122 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000123 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100124 no_libsocket=1
125 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000126 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000127 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100128 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100129*-*-linux*)
130 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100131 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100132 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000133 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100134 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100135 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000136mips-sony-bsd|mips-sony-newsos4)
137 AC_DEFINE(HAVE_NEWS4)
138 SONY=1
139 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100140 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000141 )
142 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100143*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100144 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100145 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000146*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000147 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100148 conf_utmp_location=/etc/utmp
149 conf_wtmp_location=/usr/adm/wtmp
150 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000152 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000153 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000154 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000155 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000156 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100157*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000158 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100159 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100160 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100161 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000162 # hardwire lastlog location (can't detect it on some versions)
163 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000164 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
165 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
166 if test "$sol2ver" -ge 8; then
167 AC_MSG_RESULT(yes)
168 AC_DEFINE(DISABLE_UTMP)
169 AC_DEFINE(DISABLE_WTMP)
170 else
171 AC_MSG_RESULT(no)
172 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100173 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000174*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000175 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000176 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100177 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100178 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000179 conf_utmp_location=/etc/utmp
180 conf_wtmp_location=/var/adm/wtmp
181 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000182 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000183 MANTYPE='$(CATMAN)'
184 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000185 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000186*-ncr-sysv*)
187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib"
189 MANTYPE='$(CATMAN)'
190 mansubdir=cat
191 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
192 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000193*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000194 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000195 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
196 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100197 IPADDR_IN_DISPLAY=yes
198 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000199 AC_DEFINE(IP_TOS_IS_BROKEN)
200 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000201 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000202 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100203*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000204 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
206 MANTYPE='$(CATMAN)'
207 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100208 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100209 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100210 ;;
211*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000212 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100213 LDFLAGS="$LDFLAGS -L/usr/local/lib"
214 MANTYPE='$(CATMAN)'
215 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100216 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100217 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100218 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100219*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000220 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100221 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100222 MANTYPE='$(CATMAN)'
223 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100224 LIBS="$LIBS -lgen -lsocket"
225 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100226*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000227 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100228 LDFLAGS="$LDFLAGS -L/usr/local/lib"
229 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000230 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100231 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100232 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100233 RANLIB=true
234 no_dev_ptmx=1
235 AC_DEFINE(BROKEN_SYS_TERMIO_H)
236 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100237 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000238 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000239 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100240 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100241 ;;
242*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000244 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100245 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000246 MANTYPE='$(CATMAN)'
247 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000248 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100249 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100250 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100251 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000252 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000253 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100254 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000255 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000256*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000257 if test ! -z "USE_SIA" ; then
258 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
259 if test -f /etc/sia/matrix.conf; then
260 AC_MSG_RESULT(yes)
261 AC_DEFINE(HAVE_OSF_SIA)
262 AC_DEFINE(DISABLE_LOGIN)
263 LIBS="$LIBS -lsecurity -ldb -lm -laud"
264 else
265 AC_MSG_RESULT(no)
266 fi
267 fi
268 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100269esac
270
Damien Millere37bfc12000-06-05 09:37:43 +1000271# Allow user to specify flags
272AC_ARG_WITH(cflags,
273 [ --with-cflags Specify additional flags to pass to compiler],
274 [
275 if test "x$withval" != "xno" ; then
276 CFLAGS="$CFLAGS $withval"
277 fi
278 ]
279)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000280AC_ARG_WITH(cppflags,
281 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
282 [
283 if test "x$withval" != "xno"; then
284 CPPFLAGS="$CPPFLAGS $withval"
285 fi
286 ]
287)
Damien Millere37bfc12000-06-05 09:37:43 +1000288AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000289 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000290 [
291 if test "x$withval" != "xno" ; then
292 LDFLAGS="$LDFLAGS $withval"
293 fi
294 ]
295)
296AC_ARG_WITH(libs,
297 [ --with-libs Specify additional libraries to link with],
298 [
299 if test "x$withval" != "xno" ; then
300 LIBS="$LIBS $withval"
301 fi
302 ]
303)
304
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000305AC_ARG_WITH(pcre,
306 [ --with-pcre Override built in regex library with pcre],
307 [
308
309 AC_CHECK_LIB(pcre, pcre_info,
310 [
311 AC_DEFINE(HAVE_LIBPCRE)
312 LIBS="$LIBS -lpcreposix -lpcre"
313 no_comp_check="yes"
314 ],
315 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
316 )
317 ]
318)
Damien Millere37bfc12000-06-05 09:37:43 +1000319
Damien Millera22ba012000-03-02 23:09:20 +1100320# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100321if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000322 AC_CHECK_LIB(nsl, yp_match, , )
323fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100324if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000325 AC_CHECK_LIB(socket, main, , )
326fi
327
Damien Millerdf288022001-02-18 13:07:07 +1100328dnl SCO OS3 needs this for libwrap
329AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
330
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000331AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100332AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100333AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100334
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000335# We don't want to check if we did an pcre override.
336if test -z "$no_comp_check" ; then
337 AC_CHECK_FUNC(regcomp,
338 [ AC_DEFINE(HAVE_REGCOMP)],
339 [
340 AC_CHECK_LIB(pcre, pcre_info,
341 [
342 AC_DEFINE(HAVE_LIBPCRE)
343 LIBS="$LIBS -lpcreposix -lpcre"
344 ],
345 [
346 AC_MSG_ERROR([*** No regex library found.])
347 ])
348 ]
349 )
350fi
Damien Millerab18c411999-11-11 10:40:23 +1100351
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000352dnl UnixWare 2.x
353AC_CHECK_FUNC(strcasecmp,
354 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
355)
356AC_CHECK_FUNC(utimes,
357 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
358)
Damien Millerab18c411999-11-11 10:40:23 +1100359
Damien Millera22ba012000-03-02 23:09:20 +1100360# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000361AC_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 +1100362
Damien Millerc547bf12001-02-16 10:18:12 +1100363# Check whether user wants Kerberos support
364KRB4_MSG="no"
365AC_ARG_WITH(kerberos4,
366 [ --with-kerberos4=PATH Enable Kerberos 4 support],
367 [
368 if test "x$withval" != "xno" ; then
369
370 if test "x$withval" != "xyes" ; then
371 CPPFLAGS="$CPPFLAGS -I${withval}/include"
372 LDFLAGS="$LDFLAGS -L${withval}/lib"
373 if test ! -z "$need_dash_r" ; then
374 LDFLAGS="$LDFLAGS -R${withval}/lib"
375 fi
376 if test ! -z "$blibpath" ; then
377 blibpath="$blibpath:${withval}/lib"
378 fi
379 else
380 if test -d /usr/include/kerberosIV ; then
381 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
382 fi
383 fi
384
385 AC_CHECK_HEADERS(krb.h)
386 AC_CHECK_LIB(krb, main)
387 if test "$ac_cv_header_krb_h" != yes; then
388 AC_MSG_WARN([Cannot find krb.h, build may fail])
389 fi
390 if test "$ac_cv_lib_krb_main" != yes; then
391 AC_MSG_WARN([Cannot find libkrb, build may fail])
392 fi
393
394 KLIBS="-lkrb -ldes"
395 AC_CHECK_LIB(resolv, dn_expand, , )
396 KRB4=yes
397 KRB4_MSG="yes"
398 AC_DEFINE(KRB4)
399 fi
400 ]
401)
402
403# Check whether user wants AFS support
404AFS_MSG="no"
405AC_ARG_WITH(afs,
406 [ --with-afs=PATH Enable AFS support],
407 [
408 if test "x$withval" != "xno" ; then
409
410 if test "x$withval" != "xyes" ; then
411 CPPFLAGS="$CPPFLAGS -I${withval}/include"
412 LDFLAGS="$LDFLAGS -L${withval}/lib"
413 fi
414
415 if test -z "$KRB4" ; then
416 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
417 fi
418
419 LIBS="$LIBS -lkafs"
420 if test ! -z "$AFS_LIBS" ; then
421 LIBS="$LIBS $AFS_LIBS"
422 fi
423 AC_DEFINE(AFS)
424 AFS_MSG="yes"
425 fi
426 ]
427)
428LIBS="$LIBS $KLIBS"
429
430# Check whether user wants S/Key support
431SKEY_MSG="no"
432AC_ARG_WITH(skey,
433 [ --with-skey=PATH Enable S/Key support],
434 [
435 if test "x$withval" != "xno" ; then
436
437 if test "x$withval" != "xyes" ; then
438 CPPFLAGS="$CPPFLAGS -I${withval}/include"
439 LDFLAGS="$LDFLAGS -L${withval}/lib"
440 fi
441
442 AC_DEFINE(SKEY)
443 LIBS="-lskey $LIBS"
444 SKEY_MSG="yes"
445
446 AC_CHECK_FUNC(skey_keyinfo,
447 [],
448 [
449 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
450 ])
451 fi
452 ]
453)
454
455# Check whether user wants TCP wrappers support
456TCPW_MSG="no"
457AC_ARG_WITH(tcp-wrappers,
458 [ --with-tcp-wrappers Enable tcpwrappers support],
459 [
460 if test "x$withval" != "xno" ; then
461 saved_LIBS="$LIBS"
462 LIBS="-lwrap $LIBS"
463 AC_MSG_CHECKING(for libwrap)
464 AC_TRY_LINK(
465 [
466#include <tcpd.h>
467 int deny_severity = 0, allow_severity = 0;
468 ],
469 [hosts_access(0);],
470 [
471 AC_MSG_RESULT(yes)
472 AC_DEFINE(LIBWRAP)
473 TCPW_MSG="yes"
474 ],
475 [
476 AC_MSG_ERROR([*** libwrap missing])
477 ]
478 )
479 fi
480 ]
481)
482
Damien Millerad833b32000-08-23 10:46:23 +1000483dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000484AC_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 +1000485dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000486AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000487dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000488AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000489AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000490dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000491AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000492AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000493dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000494AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000495AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100496
Damien Miller5fc85652000-07-09 23:53:07 +1000497AC_CHECK_FUNC(getuserattr,
498 [AC_DEFINE(HAVE_GETUSERATTR)],
499 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
500)
501
Damien Miller04f80141999-11-19 15:32:34 +1100502AC_CHECK_FUNC(login,
503 [AC_DEFINE(HAVE_LOGIN)],
504 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
505)
506
507AC_CHECK_FUNC(daemon,
508 [AC_DEFINE(HAVE_DAEMON)],
509 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
510)
511
Damien Miller9fb07e42000-03-05 16:22:59 +1100512AC_CHECK_FUNC(getpagesize,
513 [AC_DEFINE(HAVE_GETPAGESIZE)],
514 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
515)
516
Damien Millercb170cb2000-07-01 16:52:55 +1000517# Check for broken snprintf
518if test "x$ac_cv_func_snprintf" = "xyes" ; then
519 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
520 AC_TRY_RUN(
521 [
522#include <stdio.h>
523int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
524 ],
525 [AC_MSG_RESULT(yes)],
526 [
527 AC_MSG_RESULT(no)
528 AC_DEFINE(BROKEN_SNPRINTF)
529 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
530 ]
531 )
532fi
533
Damien Miller606f8802000-09-16 15:39:56 +1100534AC_FUNC_GETPGRP
535
Ben Lindstromec3830a2001-01-25 00:07:33 +0000536AC_FUNC_STRFTIME
537
Damien Millera64b57a2001-01-17 10:44:13 +1100538# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000539PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100540AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100541 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100542 [
Damien Millera64b57a2001-01-17 10:44:13 +1100543 if test "x$withval" != "xno" ; then
544 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
545 AC_MSG_ERROR([PAM headers not found])
546 fi
547
548 AC_CHECK_LIB(dl, dlopen, , )
549 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
550 AC_CHECK_FUNCS(pam_getenvlist)
551
552 disable_shadow=yes
553 PAM_MSG="yes"
554
555 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100556 fi
557 ]
558)
Damien Millera22ba012000-03-02 23:09:20 +1100559
Damien Millera64b57a2001-01-17 10:44:13 +1100560# Check for older PAM
561if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100562 # Check PAM strerror arguments (old PAM)
563 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
564 AC_TRY_COMPILE(
565 [
Damien Miller81171112000-04-23 11:14:01 +1000566#include <stdlib.h>
567#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100568 ],
569 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
570 [AC_MSG_RESULT(no)],
571 [
572 AC_DEFINE(HAVE_OLD_PAM)
573 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000574 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100575 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100576 )
Damien Millera22ba012000-03-02 23:09:20 +1100577fi
578
579# The big search for OpenSSL
580AC_ARG_WITH(ssl-dir,
581 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
582 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000583 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100584 tryssldir=$withval
585 fi
586 ]
587)
588
589saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100590saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000591saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100592if test "x$prefix" != "xNONE" ; then
593 tryssldir="$tryssldir $prefix"
594fi
Damien Miller61e50f12000-05-08 20:49:37 +1000595AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100596
Damien Millera1b61e12000-09-16 17:02:16 +1100597 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 Millera64b57a2001-01-17 10:44:13 +1100598 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000599 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000600 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000601 if test ! -z "$need_dash_r" ; then
602 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
603 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100604 else
Damien Miller61e50f12000-05-08 20:49:37 +1000605 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100606 fi
607
Damien Miller3b512e12000-05-17 23:29:18 +1000608 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000609
Damien Miller3b512e12000-05-17 23:29:18 +1000610 # Basic test to check for compatible version and correct linking
611 # *does not* test for RSA - that comes later.
612 AC_TRY_RUN(
613 [
Damien Millere59ce622000-05-01 20:54:17 +1000614#include <string.h>
615#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000616int main(void)
617{
Damien Miller3b512e12000-05-17 23:29:18 +1000618 char a[2048];
619 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000620 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000621 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000622}
Damien Miller3b512e12000-05-17 23:29:18 +1000623 ],
624 [
625 found_crypto=1
626 break;
627 ], []
628 )
Damien Miller61e50f12000-05-08 20:49:37 +1000629
630 if test ! -z "$found_crypto" ; then
631 break;
632 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100633 done
634
Damien Miller61e50f12000-05-08 20:49:37 +1000635 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100636 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100637 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000638 if test -z "$ssldir" ; then
639 ssldir="(system)"
640 fi
Damien Millera22ba012000-03-02 23:09:20 +1100641
Damien Miller61e50f12000-05-08 20:49:37 +1000642 ac_cv_openssldir=$ssldir
643])
644
Damien Milleredb82922000-06-20 13:25:52 +1000645if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000646 AC_DEFINE(HAVE_OPENSSL)
647 dnl Need to recover ssldir - test above runs in subshell
648 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100649
650 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
651 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
652 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
653 if test ! -z "$need_dash_r" ; then
654 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
655 fi
656 if test ! -z "$blibpath" ; then
657 blibpath="$blibpath:$ssldir:$ssldir/lib"
658 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100659 fi
Damien Millera22ba012000-03-02 23:09:20 +1100660fi
Damien Miller3b512e12000-05-17 23:29:18 +1000661LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000662
Damien Miller3b512e12000-05-17 23:29:18 +1000663# Now test RSA support
664saved_LIBS="$LIBS"
665AC_MSG_CHECKING([for RSA support])
666for WANTS_RSAREF in "" 1 ; do
667 if test -z "$WANTS_RSAREF" ; then
668 LIBS="$saved_LIBS"
669 else
670 LIBS="$saved_LIBS -lRSAglue -lrsaref"
671 fi
672 AC_TRY_RUN([
673#include <string.h>
674#include <openssl/rand.h>
675#include <openssl/rsa.h>
676#include <openssl/bn.h>
677#include <openssl/sha.h>
678int main(void)
679{
680 int num; RSA *key; static unsigned char p_in[] = "blahblah";
681 unsigned char c[256], p[256];
682 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
683 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
684 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
685 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
686}
687 ],
688 [
689 rsa_works=1
690 break;
691 ], [])
692done
693
694if test ! -z "$no_rsa" ; then
695 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000696 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000697else
698 if test -z "$rsa_works" ; then
699 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000700 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000701 else
702 if test -z "$WANTS_RSAREF" ; then
703 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000704 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000705 else
Damien Miller7b22d652000-06-18 14:07:04 +1000706 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000707 AC_MSG_RESULT(using RSAref)
708 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
709 fi
710 fi
711fi
Damien Millera22ba012000-03-02 23:09:20 +1100712
Damien Millera64b57a2001-01-17 10:44:13 +1100713# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
714# version in OpenSSL. Skip this for PAM
715if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
716 AC_CHECK_LIB(crypt, crypt, , )
717fi
718
Ben Lindstromb5628642000-10-18 00:02:25 +0000719# Cheap hack to ensure NEWS-OS libraries are arranged right.
720if test ! -z "$SONY" ; then
721 LIBS="$LIBS -liberty";
722fi
723
Damien Millera22ba012000-03-02 23:09:20 +1100724# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100725AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100726AC_CHECK_SIZEOF(short int, 2)
727AC_CHECK_SIZEOF(int, 4)
728AC_CHECK_SIZEOF(long int, 4)
729AC_CHECK_SIZEOF(long long int, 8)
730
Damien Millera22ba012000-03-02 23:09:20 +1100731# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100732AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
733 AC_TRY_COMPILE(
734 [ #include <sys/types.h> ],
735 [ u_int a; a = 1;],
736 [ ac_cv_have_u_int="yes" ],
737 [ ac_cv_have_u_int="no" ]
738 )
739])
740if test "x$ac_cv_have_u_int" = "xyes" ; then
741 AC_DEFINE(HAVE_U_INT)
742 have_u_int=1
743fi
744
Damien Miller61e50f12000-05-08 20:49:37 +1000745AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
746 AC_TRY_COMPILE(
747 [ #include <sys/types.h> ],
748 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
749 [ ac_cv_have_intxx_t="yes" ],
750 [ ac_cv_have_intxx_t="no" ]
751 )
752])
753if test "x$ac_cv_have_intxx_t" = "xyes" ; then
754 AC_DEFINE(HAVE_INTXX_T)
755 have_intxx_t=1
756fi
757
Damien Miller578783e2000-09-23 14:12:24 +1100758AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
759 AC_TRY_COMPILE(
760 [ #include <sys/types.h> ],
761 [ int64_t a; a = 1;],
762 [ ac_cv_have_int64_t="yes" ],
763 [ ac_cv_have_int64_t="no" ]
764 )
765])
766if test "x$ac_cv_have_int64_t" = "xyes" ; then
767 AC_DEFINE(HAVE_INT64_T)
768 have_int64_t=1
769fi
770
Damien Miller61e50f12000-05-08 20:49:37 +1000771AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
772 AC_TRY_COMPILE(
773 [ #include <sys/types.h> ],
774 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
775 [ ac_cv_have_u_intxx_t="yes" ],
776 [ ac_cv_have_u_intxx_t="no" ]
777 )
778])
779if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
780 AC_DEFINE(HAVE_U_INTXX_T)
781 have_u_intxx_t=1
782fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100783
Damien Miller578783e2000-09-23 14:12:24 +1100784AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
785 AC_TRY_COMPILE(
786 [ #include <sys/types.h> ],
787 [ u_int64_t a; a = 1;],
788 [ ac_cv_have_u_int64_t="yes" ],
789 [ ac_cv_have_u_int64_t="no" ]
790 )
791])
792if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
793 AC_DEFINE(HAVE_U_INT64_T)
794 have_u_int64_t=1
795fi
796
Damien Milleredb82922000-06-20 13:25:52 +1000797if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
798 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100799then
800 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
801 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000802 [
803#include <sys/bitypes.h>
804 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100805 [
Damien Miller70494d12000-04-03 15:57:06 +1000806 int8_t a; int16_t b; int32_t c;
807 u_int8_t e; u_int16_t f; u_int32_t g;
808 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100809 ],
810 [
811 AC_DEFINE(HAVE_U_INTXX_T)
812 AC_DEFINE(HAVE_INTXX_T)
813 AC_MSG_RESULT(yes)
814 ],
815 [AC_MSG_RESULT(no)]
816 )
817fi
818
Damien Millerd6121d22000-03-17 23:26:46 +1100819if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000820 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
821 AC_TRY_COMPILE(
822 [
823#include <sys/types.h>
824 ],
825 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
826 [ ac_cv_have_uintxx_t="yes" ],
827 [ ac_cv_have_uintxx_t="no" ]
828 )
829 ])
830 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
831 AC_DEFINE(HAVE_UINTXX_T)
832 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100833fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100834
Damien Miller61e50f12000-05-08 20:49:37 +1000835AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
836 AC_TRY_COMPILE(
837 [
Damien Miller81171112000-04-23 11:14:01 +1000838#include <sys/types.h>
839#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000840 ],
841 [socklen_t foo; foo = 1235;],
842 [ ac_cv_have_socklen_t="yes" ],
843 [ ac_cv_have_socklen_t="no" ]
844 )
845])
846if test "x$ac_cv_have_socklen_t" = "xyes" ; then
847 AC_DEFINE(HAVE_SOCKLEN_T)
848fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100849
Damien Miller61e50f12000-05-08 20:49:37 +1000850AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
851 AC_TRY_COMPILE(
852 [
853#include <sys/types.h>
854 ],
855 [ size_t foo; foo = 1235; ],
856 [ ac_cv_have_size_t="yes" ],
857 [ ac_cv_have_size_t="no" ]
858 )
859])
860if test "x$ac_cv_have_size_t" = "xyes" ; then
861 AC_DEFINE(HAVE_SIZE_T)
862fi
Damien Miller95058511999-12-29 10:36:45 +1100863
Damien Miller615f9392000-05-17 22:53:33 +1000864AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
865 AC_TRY_COMPILE(
866 [
867#include <sys/types.h>
868 ],
869 [ ssize_t foo; foo = 1235; ],
870 [ ac_cv_have_ssize_t="yes" ],
871 [ ac_cv_have_ssize_t="no" ]
872 )
873])
874if test "x$ac_cv_have_ssize_t" = "xyes" ; then
875 AC_DEFINE(HAVE_SSIZE_T)
876fi
877
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000878AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
879 AC_TRY_COMPILE(
880 [
881#include <time.h>
882 ],
883 [ clock_t foo; foo = 1235; ],
884 [ ac_cv_have_clock_t="yes" ],
885 [ ac_cv_have_clock_t="no" ]
886 )
887])
888if test "x$ac_cv_have_clock_t" = "xyes" ; then
889 AC_DEFINE(HAVE_CLOCK_T)
890fi
891
Damien Millerb54b40e2000-06-23 08:23:34 +1000892AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
893 AC_TRY_COMPILE(
894 [
895#include <sys/types.h>
896#include <sys/socket.h>
897 ],
898 [ sa_family_t foo; foo = 1235; ],
899 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100900 [ AC_TRY_COMPILE(
901 [
902#include <sys/types.h>
903#include <sys/socket.h>
904#include <netinet/in.h>
905 ],
906 [ sa_family_t foo; foo = 1235; ],
907 [ ac_cv_have_sa_family_t="yes" ],
908
Damien Millerb54b40e2000-06-23 08:23:34 +1000909 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100910 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000911 )
912])
913if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
914 AC_DEFINE(HAVE_SA_FAMILY_T)
915fi
916
Damien Miller0f91b4e2000-06-18 15:43:25 +1000917AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
918 AC_TRY_COMPILE(
919 [
920#include <sys/types.h>
921 ],
922 [ pid_t foo; foo = 1235; ],
923 [ ac_cv_have_pid_t="yes" ],
924 [ ac_cv_have_pid_t="no" ]
925 )
926])
927if test "x$ac_cv_have_pid_t" = "xyes" ; then
928 AC_DEFINE(HAVE_PID_T)
929fi
930
931AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
932 AC_TRY_COMPILE(
933 [
934#include <sys/types.h>
935 ],
936 [ mode_t foo; foo = 1235; ],
937 [ ac_cv_have_mode_t="yes" ],
938 [ ac_cv_have_mode_t="no" ]
939 )
940])
941if test "x$ac_cv_have_mode_t" = "xyes" ; then
942 AC_DEFINE(HAVE_MODE_T)
943fi
944
Damien Miller61e50f12000-05-08 20:49:37 +1000945
946AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
947 AC_TRY_COMPILE(
948 [
Damien Miller81171112000-04-23 11:14:01 +1000949#include <sys/types.h>
950#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000951 ],
952 [ struct sockaddr_storage s; ],
953 [ ac_cv_have_struct_sockaddr_storage="yes" ],
954 [ ac_cv_have_struct_sockaddr_storage="no" ]
955 )
956])
957if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
958 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
959fi
Damien Miller34132e52000-01-14 15:45:46 +1100960
Damien Miller61e50f12000-05-08 20:49:37 +1000961AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
962 AC_TRY_COMPILE(
963 [
Damien Miller7b22d652000-06-18 14:07:04 +1000964#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000965#include <netinet/in.h>
966 ],
967 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
968 [ ac_cv_have_struct_sockaddr_in6="yes" ],
969 [ ac_cv_have_struct_sockaddr_in6="no" ]
970 )
971])
972if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
973 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
974fi
Damien Miller34132e52000-01-14 15:45:46 +1100975
Damien Miller61e50f12000-05-08 20:49:37 +1000976AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
977 AC_TRY_COMPILE(
978 [
Damien Miller7b22d652000-06-18 14:07:04 +1000979#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000980#include <netinet/in.h>
981 ],
982 [ struct in6_addr s; s.s6_addr[0] = 0; ],
983 [ ac_cv_have_struct_in6_addr="yes" ],
984 [ ac_cv_have_struct_in6_addr="no" ]
985 )
986])
987if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
988 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
989fi
Damien Miller34132e52000-01-14 15:45:46 +1100990
Damien Miller61e50f12000-05-08 20:49:37 +1000991AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
992 AC_TRY_COMPILE(
993 [
Damien Miller81171112000-04-23 11:14:01 +1000994#include <sys/types.h>
995#include <sys/socket.h>
996#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000997 ],
998 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
999 [ ac_cv_have_struct_addrinfo="yes" ],
1000 [ ac_cv_have_struct_addrinfo="no" ]
1001 )
1002])
1003if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1004 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1005fi
1006
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001007AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1008 AC_TRY_COMPILE(
1009 [ #include <sys/time.h> ],
1010 [ struct timeval tv; tv.tv_sec = 1;],
1011 [ ac_cv_have_struct_timeval="yes" ],
1012 [ ac_cv_have_struct_timeval="no" ]
1013 )
1014])
1015if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1016 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1017 have_struct_timeval=1
1018fi
1019
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001020# If we don't have int64_t then we can't compile sftp-server. So don't
1021# even attempt to do it.
1022if test "x$ac_cv_have_int64_t" = "xno" -a \
1023 "x$ac_cv_sizeof_long_int" != "x8" -a \
1024 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1025 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001026fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001027AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001028
Damien Miller78315eb2000-09-29 23:01:36 +11001029dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001030OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1031OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1032OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1033OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1034OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001035OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001036OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1037OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001038OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001039OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1040OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1041OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1042OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001043OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1044OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1045OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1046OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001047AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001048
Damien Miller942da032000-08-18 13:59:06 +10001049AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1050 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1051 AC_TRY_COMPILE(
1052 [
1053#include <sys/types.h>
1054#include <sys/socket.h>
1055 ],
1056 [ struct sockaddr_un s; s.sun_len = 1; ],
1057 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1058 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1059 )
1060])
1061if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1062 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1063fi
1064
Damien Miller61e50f12000-05-08 20:49:37 +10001065AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1066 ac_cv_have_ss_family_in_struct_ss, [
1067 AC_TRY_COMPILE(
1068 [
Damien Miller81171112000-04-23 11:14:01 +10001069#include <sys/types.h>
1070#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001071 ],
1072 [ struct sockaddr_storage s; s.ss_family = 1; ],
1073 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1074 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1075 )
1076])
1077if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1078 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1079fi
1080
Damien Miller61e50f12000-05-08 20:49:37 +10001081AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1082 ac_cv_have___ss_family_in_struct_ss, [
1083 AC_TRY_COMPILE(
1084 [
Damien Miller81171112000-04-23 11:14:01 +10001085#include <sys/types.h>
1086#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001087 ],
1088 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1089 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1090 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1091 )
1092])
1093if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1094 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1095fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001096
Damien Millerad833b32000-08-23 10:46:23 +10001097AC_CACHE_CHECK([for pw_class field in struct passwd],
1098 ac_cv_have_pw_class_in_struct_passwd, [
1099 AC_TRY_COMPILE(
1100 [
Damien Millerad833b32000-08-23 10:46:23 +10001101#include <pwd.h>
1102 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001103 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001104 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1105 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1106 )
1107])
1108if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1109 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1110fi
1111
Damien Miller61e50f12000-05-08 20:49:37 +10001112
1113AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1114 AC_TRY_LINK([],
1115 [ extern char *__progname; printf("%s", __progname); ],
1116 [ ac_cv_libc_defines___progname="yes" ],
1117 [ ac_cv_libc_defines___progname="no" ]
1118 )
1119])
1120if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1121 AC_DEFINE(HAVE___PROGNAME)
1122fi
1123
Damien Millera22ba012000-03-02 23:09:20 +11001124
Damien Millerecbb26d2000-07-15 14:59:14 +10001125AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1126 AC_TRY_LINK([],
1127 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1128 [ ac_cv_libc_defines_sys_errlist="yes" ],
1129 [ ac_cv_libc_defines_sys_errlist="no" ]
1130 )
1131])
1132if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1133 AC_DEFINE(HAVE_SYS_ERRLIST)
1134fi
1135
1136
Damien Miller11fa2cc2000-08-16 10:35:58 +10001137AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1138 AC_TRY_LINK([],
1139 [ extern int sys_nerr; printf("%i", sys_nerr);],
1140 [ ac_cv_libc_defines_sys_nerr="yes" ],
1141 [ ac_cv_libc_defines_sys_nerr="no" ]
1142 )
1143])
1144if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1145 AC_DEFINE(HAVE_SYS_NERR)
1146fi
1147
1148
Damien Millera22ba012000-03-02 23:09:20 +11001149# Looking for programs, paths and files
1150AC_ARG_WITH(rsh,
1151 [ --with-rsh=PATH Specify path to remote shell program ],
1152 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001153 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001154 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001155 fi
1156 ],
1157 [
1158 AC_PATH_PROG(rsh_path, rsh)
1159 ]
1160)
1161
1162AC_ARG_WITH(xauth,
1163 [ --with-xauth=PATH Specify path to xauth program ],
1164 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001165 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001166 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001167 fi
1168 ],
1169 [
Damien Miller78315eb2000-09-29 23:01:36 +11001170 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 +10001171 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001172 xauth_path="/usr/openwin/bin/xauth"
1173 fi
1174 ]
1175)
1176
Damien Millera19cf472000-11-29 13:28:50 +11001177if test -z "$xauth_path" ; then
1178 XAUTH_PATH="undefined"
1179 AC_SUBST(XAUTH_PATH)
1180else
Damien Millera22ba012000-03-02 23:09:20 +11001181 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001182 XAUTH_PATH=$xauth_path
1183 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001184fi
1185if test ! -z "$rsh_path" ; then
1186 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1187fi
1188
1189# Check for mail directory (last resort if we cannot get it from headers)
1190if test ! -z "$MAIL" ; then
1191 maildir=`dirname $MAIL`
1192 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1193fi
1194
Damien Millera22ba012000-03-02 23:09:20 +11001195if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001196 AC_CHECK_FILE("/dev/ptmx",
1197 [
1198 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1199 have_dev_ptmx=1
1200 ]
1201 )
Damien Millera22ba012000-03-02 23:09:20 +11001202fi
Damien Miller204ad072000-03-02 23:56:12 +11001203AC_CHECK_FILE("/dev/ptc",
1204 [
1205 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1206 have_dev_ptc=1
1207 ]
1208)
1209
Damien Millera22ba012000-03-02 23:09:20 +11001210# Options from here on. Some of these are preset by platform above
1211
Damien Millera22ba012000-03-02 23:09:20 +11001212# Check for user-specified random device, otherwise check /dev/urandom
1213AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001214 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001215 [
Damien Miller040f3832000-04-03 14:50:43 +10001216 if test "x$withval" != "xno" ; then
1217 RANDOM_POOL="$withval";
1218 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1219 fi
Damien Millera22ba012000-03-02 23:09:20 +11001220 ],
1221 [
1222 # Check for random device
1223 AC_CHECK_FILE("/dev/urandom",
1224 [
1225 RANDOM_POOL="/dev/urandom";
1226 AC_SUBST(RANDOM_POOL)
1227 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1228 ]
1229 )
1230 ]
1231)
1232
1233# Check for EGD pool file
1234AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001235 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001236 [
Damien Miller040f3832000-04-03 14:50:43 +10001237 if test "x$withval" != "xno" ; then
1238 EGD_SOCKET="$withval";
1239 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1240 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001241 ],
1242 [
1243 # Check for existing socket only if we don't have a random device already
1244 if test -z "$RANDOM_POOL" ; then
1245 AC_MSG_CHECKING(for PRNGD/EGD socket)
1246 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001247 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
Damien Millerd8ab0d42001-02-13 12:11:17 +11001248 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001249 EGD_SOCKET="$egdsock"
1250 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001251 break;
1252 fi
1253 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001254 if test -x "$EGD_SOCKET" ; then
1255 AC_MSG_RESULT($EGD_SOCKET)
1256 else
1257 AC_MSG_RESULT(not found)
1258 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001259 fi
Damien Millera22ba012000-03-02 23:09:20 +11001260 ]
1261)
1262
Damien Miller0736c4d2001-01-25 10:51:46 +11001263
Damien Miller0437b332000-05-02 09:56:41 +10001264# detect pathnames for entropy gathering commands, if we need them
1265INSTALL_SSH_PRNG_CMDS=""
1266rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001267if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001268 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001269 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1270 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1271 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1272 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1273 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1274 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1275 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1276 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1277 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1278 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1279 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1280 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1281 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1282 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001283
1284 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001285fi
Damien Miller0437b332000-05-02 09:56:41 +10001286AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1287
Damien Miller11e37f62000-04-08 18:23:30 +10001288
Damien Miller670a4b82000-01-22 13:53:11 +11001289AC_ARG_WITH(catman,
1290 [ --with-catman=man|cat Install preformatted manpages[no]],
1291 [
1292 MANTYPE='$(CATMAN)'
1293 if test x"$withval" != x"yes" ; then
1294 mansubdir=$withval
1295 else
1296 mansubdir=cat
1297 fi
1298 ], [
1299 if test -z "$MANTYPE" ; then
1300 MANTYPE='$(TROFFMAN)'
1301 mansubdir=man
1302 fi
1303 ]
1304)
1305AC_SUBST(MANTYPE)
1306AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001307
Damien Millera22ba012000-03-02 23:09:20 +11001308# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001309MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001310AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001311 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001312 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001313 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001314 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001315 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001316 fi
1317 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001318)
1319
Damien Millera22ba012000-03-02 23:09:20 +11001320# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001321AC_ARG_WITH(shadow,
1322 [ --without-shadow Disable shadow password support],
1323 [
1324 if test "x$withval" = "xno" ; then
1325 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001326 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001327 fi
1328 ]
1329)
1330
Damien Miller1f335fb2000-06-26 11:31:33 +10001331if test -z "$disable_shadow" ; then
1332 AC_MSG_CHECKING([if the systems has expire shadow information])
1333 AC_TRY_COMPILE(
1334 [
1335#include <sys/types.h>
1336#include <shadow.h>
1337 struct spwd sp;
1338 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1339 [ sp_expire_available=yes ], []
1340 )
1341
1342 if test "x$sp_expire_available" = "xyes" ; then
1343 AC_MSG_RESULT(yes)
1344 AC_DEFINE(HAS_SHADOW_EXPIRE)
1345 else
1346 AC_MSG_RESULT(no)
1347 fi
1348fi
1349
Damien Millera22ba012000-03-02 23:09:20 +11001350# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001351if test ! -z "$IPADDR_IN_DISPLAY" ; then
1352 DISPLAY_HACK_MSG="yes"
1353 AC_DEFINE(IPADDR_IN_DISPLAY)
1354else
1355 DISPLAY_HACK_MSG="no"
1356 AC_ARG_WITH(ipaddr-display,
1357 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1358 [
1359 if test "x$withval" != "xno" ; then
1360 AC_DEFINE(IPADDR_IN_DISPLAY)
1361 DISPLAY_HACK_MSG="yes"
1362 fi
1363 ]
1364 )
1365fi
Damien Miller76112de1999-12-21 11:18:08 +11001366
Damien Millera22ba012000-03-02 23:09:20 +11001367# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001368SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001369AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001370 [ --with-default-path=PATH Specify default \$PATH environment for server],
1371 [
1372 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001373 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001374 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001375 fi
1376 ]
1377)
1378
Damien Millera22ba012000-03-02 23:09:20 +11001379# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001380IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001381AC_ARG_WITH(ipv4-default,
1382 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1383 [
1384 if test "x$withval" != "xno" ; then
1385 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001386 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001387 fi
1388 ]
1389)
1390
Damien Miller61e50f12000-05-08 20:49:37 +10001391AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001392IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001393AC_ARG_WITH(4in6,
1394 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1395 [
1396 if test "x$withval" != "xno" ; then
1397 AC_MSG_RESULT(yes)
1398 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001399 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001400 else
1401 AC_MSG_RESULT(no)
1402 fi
1403 ],[
1404 if test "x$inet6_default_4in6" = "xyes"; then
1405 AC_MSG_RESULT([yes (default)])
1406 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001407 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001408 else
1409 AC_MSG_RESULT([no (default)])
1410 fi
1411 ]
1412)
1413
Damien Miller60396b02001-02-18 17:01:00 +11001414# Whether to enable BSD auth support
1415AC_ARG_WITH(bsd-auth,
1416 [ --with-bsd-auth Enable BSD auth support],
1417 [
1418 if test "x$withval" != "xno" ; then
1419 AC_DEFINE(BSD_AUTH)
1420 bsd_auth=yes
1421 fi
1422 ]
1423)
1424
Damien Miller78315eb2000-09-29 23:01:36 +11001425AC_MSG_CHECKING(whether to install ssh as suid root)
1426AC_ARG_ENABLE(suid-ssh,
1427[ --enable-suid-ssh Install ssh as suid root (default)
1428 --disable-suid-ssh Install ssh without suid bit],
1429[ case "$enableval" in
1430 no)
1431 AC_MSG_RESULT(no)
1432 SSHMODE=0711
1433 ;;
1434 *) AC_MSG_RESULT(yes)
1435 SSHMODE=04711
1436 ;;
1437 esac ],
1438 AC_MSG_RESULT(yes)
1439 SSHMODE=04711
1440)
1441AC_SUBST(SSHMODE)
1442
1443
Damien Millera22ba012000-03-02 23:09:20 +11001444# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001445piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001446AC_ARG_WITH(pid-dir,
1447 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1448 [
1449 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001450 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001451 fi
1452 ]
1453)
Damien Miller4018c192000-04-30 09:30:44 +10001454
Damien Miller78315eb2000-09-29 23:01:36 +11001455# make sure the directory exists
1456if test ! -d $piddir ; then
1457 piddir=`eval echo ${sysconfdir}`
1458 case $piddir in
1459 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1460 esac
1461fi
1462
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001463AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001464AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001465
andre2ff7b5d2000-06-03 14:57:40 +00001466dnl allow user to disable some login recording features
1467AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001468 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001469 [ AC_DEFINE(DISABLE_LASTLOG) ]
1470)
1471AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001472 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001473 [ AC_DEFINE(DISABLE_UTMP) ]
1474)
1475AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001476 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001477 [ AC_DEFINE(DISABLE_UTMPX) ]
1478)
1479AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001480 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001481 [ AC_DEFINE(DISABLE_WTMP) ]
1482)
1483AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001484 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001485 [ AC_DEFINE(DISABLE_WTMPX) ]
1486)
1487AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001488 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001489 [ AC_DEFINE(DISABLE_LOGIN) ]
1490)
1491AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001492 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001493 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1494)
1495AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001496 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001497 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1498)
1499AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001500 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001501 [
1502 if test "x$withval" = "xno" ; then
1503 AC_DEFINE(DISABLE_LASTLOG)
1504 else
1505 conf_lastlog_location=$withval
1506 fi
1507 ]
1508)
andre2ff7b5d2000-06-03 14:57:40 +00001509
1510dnl lastlog, [uw]tmpx? detection
1511dnl NOTE: set the paths in the platform section to avoid the
1512dnl need for command-line parameters
1513dnl lastlog and [uw]tmp are subject to a file search if all else fails
1514
1515dnl lastlog detection
1516dnl NOTE: the code itself will detect if lastlog is a directory
1517AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1518AC_TRY_COMPILE([
1519#include <sys/types.h>
1520#include <utmp.h>
1521#ifdef HAVE_LASTLOG_H
1522# include <lastlog.h>
1523#endif
Damien Miller2994e082000-06-04 15:51:47 +10001524#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001525# include <paths.h>
1526#endif
1527 ],
1528 [ char *lastlog = LASTLOG_FILE; ],
1529 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001530 [
1531 AC_MSG_RESULT(no)
1532 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1533 AC_TRY_COMPILE([
1534#include <sys/types.h>
1535#include <utmp.h>
1536#ifdef HAVE_LASTLOG_H
1537# include <lastlog.h>
1538#endif
1539#ifdef HAVE_PATHS_H
1540# include <paths.h>
1541#endif
1542 ],
1543 [ char *lastlog = _PATH_LASTLOG; ],
1544 [ AC_MSG_RESULT(yes) ],
1545 [
andree441aa32000-06-12 22:34:38 +00001546 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001547 system_lastlog_path=no
1548 ])
1549 ]
andre2ff7b5d2000-06-03 14:57:40 +00001550)
Damien Miller2994e082000-06-04 15:51:47 +10001551
andre2ff7b5d2000-06-03 14:57:40 +00001552if test -z "$conf_lastlog_location"; then
1553 if test x"$system_lastlog_path" = x"no" ; then
1554 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001555 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001556 conf_lastlog_location=$f
1557 fi
1558 done
1559 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001560 AC_MSG_WARN([** Cannot find lastlog **])
1561 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001562 fi
1563 fi
1564fi
1565
1566if test -n "$conf_lastlog_location"; then
1567 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1568fi
1569
1570dnl utmp detection
1571AC_MSG_CHECKING([if your system defines UTMP_FILE])
1572AC_TRY_COMPILE([
1573#include <sys/types.h>
1574#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001575#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001576# include <paths.h>
1577#endif
1578 ],
1579 [ char *utmp = UTMP_FILE; ],
1580 [ AC_MSG_RESULT(yes) ],
1581 [ AC_MSG_RESULT(no)
1582 system_utmp_path=no ]
1583)
1584if test -z "$conf_utmp_location"; then
1585 if test x"$system_utmp_path" = x"no" ; then
1586 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1587 if test -f $f ; then
1588 conf_utmp_location=$f
1589 fi
1590 done
1591 if test -z "$conf_utmp_location"; then
1592 AC_DEFINE(DISABLE_UTMP)
1593 fi
1594 fi
1595fi
1596if test -n "$conf_utmp_location"; then
1597 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1598fi
1599
1600dnl wtmp detection
1601AC_MSG_CHECKING([if your system defines WTMP_FILE])
1602AC_TRY_COMPILE([
1603#include <sys/types.h>
1604#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001605#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001606# include <paths.h>
1607#endif
1608 ],
1609 [ char *wtmp = WTMP_FILE; ],
1610 [ AC_MSG_RESULT(yes) ],
1611 [ AC_MSG_RESULT(no)
1612 system_wtmp_path=no ]
1613)
1614if test -z "$conf_wtmp_location"; then
1615 if test x"$system_wtmp_path" = x"no" ; then
1616 for f in /usr/adm/wtmp /var/log/wtmp; do
1617 if test -f $f ; then
1618 conf_wtmp_location=$f
1619 fi
1620 done
1621 if test -z "$conf_wtmp_location"; then
1622 AC_DEFINE(DISABLE_WTMP)
1623 fi
1624 fi
1625fi
1626if test -n "$conf_wtmp_location"; then
1627 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1628fi
1629
1630
1631dnl utmpx detection - I don't know any system so perverse as to require
1632dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1633dnl there, though.
1634AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1635AC_TRY_COMPILE([
1636#include <sys/types.h>
1637#include <utmp.h>
1638#ifdef HAVE_UTMPX_H
1639#include <utmpx.h>
1640#endif
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 *utmpx = UTMPX_FILE; ],
1646 [ AC_MSG_RESULT(yes) ],
1647 [ AC_MSG_RESULT(no)
1648 system_utmpx_path=no ]
1649)
1650if test -z "$conf_utmpx_location"; then
1651 if test x"$system_utmpx_path" = x"no" ; then
1652 AC_DEFINE(DISABLE_UTMPX)
1653 fi
1654else
1655 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1656fi
1657
1658dnl wtmpx detection
1659AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1660AC_TRY_COMPILE([
1661#include <sys/types.h>
1662#include <utmp.h>
1663#ifdef HAVE_UTMPX_H
1664#include <utmpx.h>
1665#endif
Damien Miller2994e082000-06-04 15:51:47 +10001666#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001667# include <paths.h>
1668#endif
1669 ],
1670 [ char *wtmpx = WTMPX_FILE; ],
1671 [ AC_MSG_RESULT(yes) ],
1672 [ AC_MSG_RESULT(no)
1673 system_wtmpx_path=no ]
1674)
1675if test -z "$conf_wtmpx_location"; then
1676 if test x"$system_wtmpx_path" = x"no" ; then
1677 AC_DEFINE(DISABLE_WTMPX)
1678 fi
1679else
1680 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1681fi
1682
Damien Miller4018c192000-04-30 09:30:44 +10001683
1684# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001685entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001686AC_ARG_WITH(entropy-timeout,
1687 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1688 [
1689 if test "x$withval" != "xno" ; then
1690 entropy_timeout=$withval
1691 fi
1692 ]
1693)
1694AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1695
1696
Damien Miller29ea30d2000-03-17 10:54:15 +11001697if test ! -z "$blibpath" ; then
1698 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1699 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1700fi
1701
Damien Millerbac2d8a2000-09-05 16:13:06 +11001702AC_EXEEXT
1703
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001704AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001705
Damien Miller7b22d652000-06-18 14:07:04 +10001706# Print summary of options
1707
1708if test x$MANTYPE = x'$(CATMAN)' ; then
1709 MAN_MSG=cat
1710else
1711 MAN_MSG=man
1712fi
1713if test ! -z "$RANDOM_POOL" ; then
1714 RAND_MSG="Device ($RANDOM_POOL)"
1715else
1716 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001717 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001718 else
1719 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001720 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001721 fi
1722fi
1723
1724# Someone please show me a better way :)
1725A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1726B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1727C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1728D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001729E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001730F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1731G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1732
1733echo ""
1734echo "OpenSSH configured has been configured with the following options."
1735echo " User binaries: $B"
1736echo " System binaries: $C"
1737echo " Configuration files: $D"
1738echo " Askpass program: $E"
1739echo " Manual pages: $F"
1740echo " PID file: $G"
1741echo " Random number collection: $RAND_MSG"
1742echo " Manpage format: $MAN_MSG"
1743echo " PAM support: ${PAM_MSG}"
1744echo " KerberosIV support: $KRB4_MSG"
1745echo " AFS support: $AFS_MSG"
1746echo " S/KEY support: $SKEY_MSG"
1747echo " TCP Wrappers support: $TCPW_MSG"
1748echo " MD5 password support: $MD5_MSG"
1749echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1750echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1751echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1752
Damien Miller60396b02001-02-18 17:01:00 +11001753if test ! -z "$bsd_auth"; then
1754 echo " BSD Auth support: yes"
1755fi
1756
Damien Miller7b22d652000-06-18 14:07:04 +10001757echo ""
1758
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001759echo " Host: ${host}"
1760echo " Compiler: ${CC}"
1761echo " Compiler flags: ${CFLAGS}"
1762echo "Preprocessor flags: ${CPPFLAGS}"
1763echo " Linker flags: ${LDFLAGS}"
1764echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001765
1766echo ""
1767
Damien Miller82cf0ce2000-12-20 13:34:48 +11001768if test "x$PAM_MSG" = "xyes" ; then
1769 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1770 echo "otherwise password authentication may fail. Example PAM control files"
1771 echo "can be found in the contrib/ subdirectory"
1772 echo ""
1773fi
1774
Damien Miller6f9c3372000-10-25 10:06:04 +11001775if test ! -z "$BUILTIN_RNG" ; then
1776 echo "WARNING: you are using the builtin random number collection service."
1777 echo "Please read WARNING.RNG and request that your OS vendor includes"
1778 echo "/dev/random in future versions of their OS."
1779 echo ""
1780fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001781
1782if test ! -z "$NO_SFTP"; then
1783 echo "sftp-server will be disabled. Your compiler does not support"
1784 echo "64bit integers."
1785 echo ""
1786fi
Damien Miller60396b02001-02-18 17:01:00 +11001787