blob: 2104329c5f9794118fa629c0b41d70b834b3a36d [file] [log] [blame]
Damien Miller217f5672001-02-16 12:12:41 +11001# $Id: configure.in,v 1.243 2001/02/16 01:12:41 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 Miller36ccb5c2000-08-09 16:34:27 +1000178 conf_utmp_location=/etc/utmp
179 conf_wtmp_location=/var/adm/wtmp
180 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000181 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000182 MANTYPE='$(CATMAN)'
183 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000184 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000185*-ncr-sysv*)
186 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
187 LDFLAGS="$LDFLAGS -L/usr/local/lib"
188 MANTYPE='$(CATMAN)'
189 mansubdir=cat
190 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
191 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000192*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000194 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
195 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100196 IPADDR_IN_DISPLAY=yes
197 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000198 AC_DEFINE(IP_TOS_IS_BROKEN)
199 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000200 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000201 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100202*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000203 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100204 LDFLAGS="$LDFLAGS -L/usr/local/lib"
205 MANTYPE='$(CATMAN)'
206 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100207 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100208 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100209 ;;
210*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100212 LDFLAGS="$LDFLAGS -L/usr/local/lib"
213 MANTYPE='$(CATMAN)'
214 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100215 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100216 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100217 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100218*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000219 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100220 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100221 MANTYPE='$(CATMAN)'
222 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100223 LIBS="$LIBS -lgen -lsocket"
224 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100225*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000226 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100227 LDFLAGS="$LDFLAGS -L/usr/local/lib"
228 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000229 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100230 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100231 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100232 RANLIB=true
233 no_dev_ptmx=1
234 AC_DEFINE(BROKEN_SYS_TERMIO_H)
235 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100236 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000237 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000238 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100239 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100240 ;;
241*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100244 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000245 MANTYPE='$(CATMAN)'
246 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000247 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100248 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100249 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100250 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000251 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000252 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100253 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000254 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000255*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000256 if test ! -z "USE_SIA" ; then
257 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
258 if test -f /etc/sia/matrix.conf; then
259 AC_MSG_RESULT(yes)
260 AC_DEFINE(HAVE_OSF_SIA)
261 AC_DEFINE(DISABLE_LOGIN)
262 LIBS="$LIBS -lsecurity -ldb -lm -laud"
263 else
264 AC_MSG_RESULT(no)
265 fi
266 fi
267 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100268esac
269
Damien Millere37bfc12000-06-05 09:37:43 +1000270# Allow user to specify flags
271AC_ARG_WITH(cflags,
272 [ --with-cflags Specify additional flags to pass to compiler],
273 [
274 if test "x$withval" != "xno" ; then
275 CFLAGS="$CFLAGS $withval"
276 fi
277 ]
278)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000279AC_ARG_WITH(cppflags,
280 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
281 [
282 if test "x$withval" != "xno"; then
283 CPPFLAGS="$CPPFLAGS $withval"
284 fi
285 ]
286)
Damien Millere37bfc12000-06-05 09:37:43 +1000287AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000288 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000289 [
290 if test "x$withval" != "xno" ; then
291 LDFLAGS="$LDFLAGS $withval"
292 fi
293 ]
294)
295AC_ARG_WITH(libs,
296 [ --with-libs Specify additional libraries to link with],
297 [
298 if test "x$withval" != "xno" ; then
299 LIBS="$LIBS $withval"
300 fi
301 ]
302)
303
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000304AC_ARG_WITH(pcre,
305 [ --with-pcre Override built in regex library with pcre],
306 [
307
308 AC_CHECK_LIB(pcre, pcre_info,
309 [
310 AC_DEFINE(HAVE_LIBPCRE)
311 LIBS="$LIBS -lpcreposix -lpcre"
312 no_comp_check="yes"
313 ],
314 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
315 )
316 ]
317)
Damien Millere37bfc12000-06-05 09:37:43 +1000318
Damien Millera22ba012000-03-02 23:09:20 +1100319# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000320if test -z "$no_libsocket" ; then
321 AC_CHECK_LIB(nsl, yp_match, , )
322fi
323if test -z "$no_libnsl" ; then
324 AC_CHECK_LIB(socket, main, , )
325fi
326
327AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100328AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100329AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100330
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000331# We don't want to check if we did an pcre override.
332if test -z "$no_comp_check" ; then
333 AC_CHECK_FUNC(regcomp,
334 [ AC_DEFINE(HAVE_REGCOMP)],
335 [
336 AC_CHECK_LIB(pcre, pcre_info,
337 [
338 AC_DEFINE(HAVE_LIBPCRE)
339 LIBS="$LIBS -lpcreposix -lpcre"
340 ],
341 [
342 AC_MSG_ERROR([*** No regex library found.])
343 ])
344 ]
345 )
346fi
Damien Millerab18c411999-11-11 10:40:23 +1100347
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000348dnl UnixWare 2.x
349AC_CHECK_FUNC(strcasecmp,
350 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
351)
352AC_CHECK_FUNC(utimes,
353 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
354)
Damien Millerab18c411999-11-11 10:40:23 +1100355
Damien Millera22ba012000-03-02 23:09:20 +1100356# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000357AC_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 +1100358
Damien Millerc547bf12001-02-16 10:18:12 +1100359# Check whether user wants Kerberos support
360KRB4_MSG="no"
361AC_ARG_WITH(kerberos4,
362 [ --with-kerberos4=PATH Enable Kerberos 4 support],
363 [
364 if test "x$withval" != "xno" ; then
365
366 if test "x$withval" != "xyes" ; then
367 CPPFLAGS="$CPPFLAGS -I${withval}/include"
368 LDFLAGS="$LDFLAGS -L${withval}/lib"
369 if test ! -z "$need_dash_r" ; then
370 LDFLAGS="$LDFLAGS -R${withval}/lib"
371 fi
372 if test ! -z "$blibpath" ; then
373 blibpath="$blibpath:${withval}/lib"
374 fi
375 else
376 if test -d /usr/include/kerberosIV ; then
377 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
378 fi
379 fi
380
381 AC_CHECK_HEADERS(krb.h)
382 AC_CHECK_LIB(krb, main)
383 if test "$ac_cv_header_krb_h" != yes; then
384 AC_MSG_WARN([Cannot find krb.h, build may fail])
385 fi
386 if test "$ac_cv_lib_krb_main" != yes; then
387 AC_MSG_WARN([Cannot find libkrb, build may fail])
388 fi
389
390 KLIBS="-lkrb -ldes"
391 AC_CHECK_LIB(resolv, dn_expand, , )
392 KRB4=yes
393 KRB4_MSG="yes"
394 AC_DEFINE(KRB4)
395 fi
396 ]
397)
398
399# Check whether user wants AFS support
400AFS_MSG="no"
401AC_ARG_WITH(afs,
402 [ --with-afs=PATH Enable AFS support],
403 [
404 if test "x$withval" != "xno" ; then
405
406 if test "x$withval" != "xyes" ; then
407 CPPFLAGS="$CPPFLAGS -I${withval}/include"
408 LDFLAGS="$LDFLAGS -L${withval}/lib"
409 fi
410
411 if test -z "$KRB4" ; then
412 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
413 fi
414
415 LIBS="$LIBS -lkafs"
416 if test ! -z "$AFS_LIBS" ; then
417 LIBS="$LIBS $AFS_LIBS"
418 fi
419 AC_DEFINE(AFS)
420 AFS_MSG="yes"
421 fi
422 ]
423)
424LIBS="$LIBS $KLIBS"
425
426# Check whether user wants S/Key support
427SKEY_MSG="no"
428AC_ARG_WITH(skey,
429 [ --with-skey=PATH Enable S/Key support],
430 [
431 if test "x$withval" != "xno" ; then
432
433 if test "x$withval" != "xyes" ; then
434 CPPFLAGS="$CPPFLAGS -I${withval}/include"
435 LDFLAGS="$LDFLAGS -L${withval}/lib"
436 fi
437
438 AC_DEFINE(SKEY)
439 LIBS="-lskey $LIBS"
440 SKEY_MSG="yes"
441
442 AC_CHECK_FUNC(skey_keyinfo,
443 [],
444 [
445 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
446 ])
447 fi
448 ]
449)
450
451# Check whether user wants TCP wrappers support
452TCPW_MSG="no"
453AC_ARG_WITH(tcp-wrappers,
454 [ --with-tcp-wrappers Enable tcpwrappers support],
455 [
456 if test "x$withval" != "xno" ; then
457 saved_LIBS="$LIBS"
458 LIBS="-lwrap $LIBS"
459 AC_MSG_CHECKING(for libwrap)
460 AC_TRY_LINK(
461 [
462#include <tcpd.h>
463 int deny_severity = 0, allow_severity = 0;
464 ],
465 [hosts_access(0);],
466 [
467 AC_MSG_RESULT(yes)
468 AC_DEFINE(LIBWRAP)
469 TCPW_MSG="yes"
470 ],
471 [
472 AC_MSG_ERROR([*** libwrap missing])
473 ]
474 )
475 fi
476 ]
477)
478
Damien Millerad833b32000-08-23 10:46:23 +1000479dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000480AC_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 +1000481dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000482AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000483dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000484AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000485AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000486dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000487AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000488AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000489dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000490AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000491AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100492
Damien Miller5fc85652000-07-09 23:53:07 +1000493AC_CHECK_FUNC(getuserattr,
494 [AC_DEFINE(HAVE_GETUSERATTR)],
495 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
496)
497
Damien Miller04f80141999-11-19 15:32:34 +1100498AC_CHECK_FUNC(login,
499 [AC_DEFINE(HAVE_LOGIN)],
500 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
501)
502
503AC_CHECK_FUNC(daemon,
504 [AC_DEFINE(HAVE_DAEMON)],
505 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
506)
507
Damien Miller9fb07e42000-03-05 16:22:59 +1100508AC_CHECK_FUNC(getpagesize,
509 [AC_DEFINE(HAVE_GETPAGESIZE)],
510 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
511)
512
Damien Millercb170cb2000-07-01 16:52:55 +1000513# Check for broken snprintf
514if test "x$ac_cv_func_snprintf" = "xyes" ; then
515 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
516 AC_TRY_RUN(
517 [
518#include <stdio.h>
519int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
520 ],
521 [AC_MSG_RESULT(yes)],
522 [
523 AC_MSG_RESULT(no)
524 AC_DEFINE(BROKEN_SNPRINTF)
525 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
526 ]
527 )
528fi
529
Damien Miller606f8802000-09-16 15:39:56 +1100530AC_FUNC_GETPGRP
531
Ben Lindstromec3830a2001-01-25 00:07:33 +0000532AC_FUNC_STRFTIME
533
Damien Millera64b57a2001-01-17 10:44:13 +1100534# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000535PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100536AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100537 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100538 [
Damien Millera64b57a2001-01-17 10:44:13 +1100539 if test "x$withval" != "xno" ; then
540 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
541 AC_MSG_ERROR([PAM headers not found])
542 fi
543
544 AC_CHECK_LIB(dl, dlopen, , )
545 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
546 AC_CHECK_FUNCS(pam_getenvlist)
547
548 disable_shadow=yes
549 PAM_MSG="yes"
550
551 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100552 fi
553 ]
554)
Damien Millera22ba012000-03-02 23:09:20 +1100555
Damien Millera64b57a2001-01-17 10:44:13 +1100556# Check for older PAM
557if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100558 # Check PAM strerror arguments (old PAM)
559 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
560 AC_TRY_COMPILE(
561 [
Damien Miller81171112000-04-23 11:14:01 +1000562#include <stdlib.h>
563#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100564 ],
565 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
566 [AC_MSG_RESULT(no)],
567 [
568 AC_DEFINE(HAVE_OLD_PAM)
569 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000570 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100571 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100572 )
Damien Millera22ba012000-03-02 23:09:20 +1100573fi
574
575# The big search for OpenSSL
576AC_ARG_WITH(ssl-dir,
577 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
578 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000579 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100580 tryssldir=$withval
581 fi
582 ]
583)
584
585saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100586saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000587saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100588if test "x$prefix" != "xNONE" ; then
589 tryssldir="$tryssldir $prefix"
590fi
Damien Miller61e50f12000-05-08 20:49:37 +1000591AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100592
Damien Millera1b61e12000-09-16 17:02:16 +1100593 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 +1100594 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000595 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000596 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000597 if test ! -z "$need_dash_r" ; then
598 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
599 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100600 else
Damien Miller61e50f12000-05-08 20:49:37 +1000601 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100602 fi
603
Damien Miller3b512e12000-05-17 23:29:18 +1000604 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000605
Damien Miller3b512e12000-05-17 23:29:18 +1000606 # Basic test to check for compatible version and correct linking
607 # *does not* test for RSA - that comes later.
608 AC_TRY_RUN(
609 [
Damien Millere59ce622000-05-01 20:54:17 +1000610#include <string.h>
611#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000612int main(void)
613{
Damien Miller3b512e12000-05-17 23:29:18 +1000614 char a[2048];
615 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000616 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000617 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000618}
Damien Miller3b512e12000-05-17 23:29:18 +1000619 ],
620 [
621 found_crypto=1
622 break;
623 ], []
624 )
Damien Miller61e50f12000-05-08 20:49:37 +1000625
626 if test ! -z "$found_crypto" ; then
627 break;
628 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100629 done
630
Damien Miller61e50f12000-05-08 20:49:37 +1000631 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100632 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100633 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000634 if test -z "$ssldir" ; then
635 ssldir="(system)"
636 fi
Damien Millera22ba012000-03-02 23:09:20 +1100637
Damien Miller61e50f12000-05-08 20:49:37 +1000638 ac_cv_openssldir=$ssldir
639])
640
Damien Milleredb82922000-06-20 13:25:52 +1000641if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000642 AC_DEFINE(HAVE_OPENSSL)
643 dnl Need to recover ssldir - test above runs in subshell
644 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100645
646 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
647 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
648 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
649 if test ! -z "$need_dash_r" ; then
650 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
651 fi
652 if test ! -z "$blibpath" ; then
653 blibpath="$blibpath:$ssldir:$ssldir/lib"
654 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100655 fi
Damien Millera22ba012000-03-02 23:09:20 +1100656fi
Damien Miller3b512e12000-05-17 23:29:18 +1000657LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000658
Damien Miller3b512e12000-05-17 23:29:18 +1000659# Now test RSA support
660saved_LIBS="$LIBS"
661AC_MSG_CHECKING([for RSA support])
662for WANTS_RSAREF in "" 1 ; do
663 if test -z "$WANTS_RSAREF" ; then
664 LIBS="$saved_LIBS"
665 else
666 LIBS="$saved_LIBS -lRSAglue -lrsaref"
667 fi
668 AC_TRY_RUN([
669#include <string.h>
670#include <openssl/rand.h>
671#include <openssl/rsa.h>
672#include <openssl/bn.h>
673#include <openssl/sha.h>
674int main(void)
675{
676 int num; RSA *key; static unsigned char p_in[] = "blahblah";
677 unsigned char c[256], p[256];
678 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
679 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
680 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
681 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
682}
683 ],
684 [
685 rsa_works=1
686 break;
687 ], [])
688done
689
690if test ! -z "$no_rsa" ; then
691 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000692 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000693else
694 if test -z "$rsa_works" ; then
695 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000696 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000697 else
698 if test -z "$WANTS_RSAREF" ; then
699 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000700 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000701 else
Damien Miller7b22d652000-06-18 14:07:04 +1000702 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000703 AC_MSG_RESULT(using RSAref)
704 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
705 fi
706 fi
707fi
Damien Millera22ba012000-03-02 23:09:20 +1100708
Damien Millera64b57a2001-01-17 10:44:13 +1100709# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
710# version in OpenSSL. Skip this for PAM
711if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
712 AC_CHECK_LIB(crypt, crypt, , )
713fi
714
Ben Lindstromb5628642000-10-18 00:02:25 +0000715# Cheap hack to ensure NEWS-OS libraries are arranged right.
716if test ! -z "$SONY" ; then
717 LIBS="$LIBS -liberty";
718fi
719
Damien Millera22ba012000-03-02 23:09:20 +1100720# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100721AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100722AC_CHECK_SIZEOF(short int, 2)
723AC_CHECK_SIZEOF(int, 4)
724AC_CHECK_SIZEOF(long int, 4)
725AC_CHECK_SIZEOF(long long int, 8)
726
Damien Millera22ba012000-03-02 23:09:20 +1100727# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100728AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
729 AC_TRY_COMPILE(
730 [ #include <sys/types.h> ],
731 [ u_int a; a = 1;],
732 [ ac_cv_have_u_int="yes" ],
733 [ ac_cv_have_u_int="no" ]
734 )
735])
736if test "x$ac_cv_have_u_int" = "xyes" ; then
737 AC_DEFINE(HAVE_U_INT)
738 have_u_int=1
739fi
740
Damien Miller61e50f12000-05-08 20:49:37 +1000741AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
742 AC_TRY_COMPILE(
743 [ #include <sys/types.h> ],
744 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
745 [ ac_cv_have_intxx_t="yes" ],
746 [ ac_cv_have_intxx_t="no" ]
747 )
748])
749if test "x$ac_cv_have_intxx_t" = "xyes" ; then
750 AC_DEFINE(HAVE_INTXX_T)
751 have_intxx_t=1
752fi
753
Damien Miller578783e2000-09-23 14:12:24 +1100754AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
755 AC_TRY_COMPILE(
756 [ #include <sys/types.h> ],
757 [ int64_t a; a = 1;],
758 [ ac_cv_have_int64_t="yes" ],
759 [ ac_cv_have_int64_t="no" ]
760 )
761])
762if test "x$ac_cv_have_int64_t" = "xyes" ; then
763 AC_DEFINE(HAVE_INT64_T)
764 have_int64_t=1
765fi
766
Damien Miller61e50f12000-05-08 20:49:37 +1000767AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
768 AC_TRY_COMPILE(
769 [ #include <sys/types.h> ],
770 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
771 [ ac_cv_have_u_intxx_t="yes" ],
772 [ ac_cv_have_u_intxx_t="no" ]
773 )
774])
775if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
776 AC_DEFINE(HAVE_U_INTXX_T)
777 have_u_intxx_t=1
778fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100779
Damien Miller578783e2000-09-23 14:12:24 +1100780AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
781 AC_TRY_COMPILE(
782 [ #include <sys/types.h> ],
783 [ u_int64_t a; a = 1;],
784 [ ac_cv_have_u_int64_t="yes" ],
785 [ ac_cv_have_u_int64_t="no" ]
786 )
787])
788if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
789 AC_DEFINE(HAVE_U_INT64_T)
790 have_u_int64_t=1
791fi
792
Damien Milleredb82922000-06-20 13:25:52 +1000793if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
794 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100795then
796 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
797 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000798 [
799#include <sys/bitypes.h>
800 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100801 [
Damien Miller70494d12000-04-03 15:57:06 +1000802 int8_t a; int16_t b; int32_t c;
803 u_int8_t e; u_int16_t f; u_int32_t g;
804 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100805 ],
806 [
807 AC_DEFINE(HAVE_U_INTXX_T)
808 AC_DEFINE(HAVE_INTXX_T)
809 AC_MSG_RESULT(yes)
810 ],
811 [AC_MSG_RESULT(no)]
812 )
813fi
814
Damien Millerd6121d22000-03-17 23:26:46 +1100815if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000816 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
817 AC_TRY_COMPILE(
818 [
819#include <sys/types.h>
820 ],
821 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
822 [ ac_cv_have_uintxx_t="yes" ],
823 [ ac_cv_have_uintxx_t="no" ]
824 )
825 ])
826 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
827 AC_DEFINE(HAVE_UINTXX_T)
828 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100829fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100830
Damien Miller61e50f12000-05-08 20:49:37 +1000831AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
832 AC_TRY_COMPILE(
833 [
Damien Miller81171112000-04-23 11:14:01 +1000834#include <sys/types.h>
835#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000836 ],
837 [socklen_t foo; foo = 1235;],
838 [ ac_cv_have_socklen_t="yes" ],
839 [ ac_cv_have_socklen_t="no" ]
840 )
841])
842if test "x$ac_cv_have_socklen_t" = "xyes" ; then
843 AC_DEFINE(HAVE_SOCKLEN_T)
844fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100845
Damien Miller61e50f12000-05-08 20:49:37 +1000846AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
847 AC_TRY_COMPILE(
848 [
849#include <sys/types.h>
850 ],
851 [ size_t foo; foo = 1235; ],
852 [ ac_cv_have_size_t="yes" ],
853 [ ac_cv_have_size_t="no" ]
854 )
855])
856if test "x$ac_cv_have_size_t" = "xyes" ; then
857 AC_DEFINE(HAVE_SIZE_T)
858fi
Damien Miller95058511999-12-29 10:36:45 +1100859
Damien Miller615f9392000-05-17 22:53:33 +1000860AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
861 AC_TRY_COMPILE(
862 [
863#include <sys/types.h>
864 ],
865 [ ssize_t foo; foo = 1235; ],
866 [ ac_cv_have_ssize_t="yes" ],
867 [ ac_cv_have_ssize_t="no" ]
868 )
869])
870if test "x$ac_cv_have_ssize_t" = "xyes" ; then
871 AC_DEFINE(HAVE_SSIZE_T)
872fi
873
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000874AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
875 AC_TRY_COMPILE(
876 [
877#include <time.h>
878 ],
879 [ clock_t foo; foo = 1235; ],
880 [ ac_cv_have_clock_t="yes" ],
881 [ ac_cv_have_clock_t="no" ]
882 )
883])
884if test "x$ac_cv_have_clock_t" = "xyes" ; then
885 AC_DEFINE(HAVE_CLOCK_T)
886fi
887
Damien Millerb54b40e2000-06-23 08:23:34 +1000888AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
889 AC_TRY_COMPILE(
890 [
891#include <sys/types.h>
892#include <sys/socket.h>
893 ],
894 [ sa_family_t foo; foo = 1235; ],
895 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100896 [ AC_TRY_COMPILE(
897 [
898#include <sys/types.h>
899#include <sys/socket.h>
900#include <netinet/in.h>
901 ],
902 [ sa_family_t foo; foo = 1235; ],
903 [ ac_cv_have_sa_family_t="yes" ],
904
Damien Millerb54b40e2000-06-23 08:23:34 +1000905 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100906 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000907 )
908])
909if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
910 AC_DEFINE(HAVE_SA_FAMILY_T)
911fi
912
Damien Miller0f91b4e2000-06-18 15:43:25 +1000913AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
914 AC_TRY_COMPILE(
915 [
916#include <sys/types.h>
917 ],
918 [ pid_t foo; foo = 1235; ],
919 [ ac_cv_have_pid_t="yes" ],
920 [ ac_cv_have_pid_t="no" ]
921 )
922])
923if test "x$ac_cv_have_pid_t" = "xyes" ; then
924 AC_DEFINE(HAVE_PID_T)
925fi
926
927AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
928 AC_TRY_COMPILE(
929 [
930#include <sys/types.h>
931 ],
932 [ mode_t foo; foo = 1235; ],
933 [ ac_cv_have_mode_t="yes" ],
934 [ ac_cv_have_mode_t="no" ]
935 )
936])
937if test "x$ac_cv_have_mode_t" = "xyes" ; then
938 AC_DEFINE(HAVE_MODE_T)
939fi
940
Damien Miller61e50f12000-05-08 20:49:37 +1000941
942AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
943 AC_TRY_COMPILE(
944 [
Damien Miller81171112000-04-23 11:14:01 +1000945#include <sys/types.h>
946#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000947 ],
948 [ struct sockaddr_storage s; ],
949 [ ac_cv_have_struct_sockaddr_storage="yes" ],
950 [ ac_cv_have_struct_sockaddr_storage="no" ]
951 )
952])
953if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
954 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
955fi
Damien Miller34132e52000-01-14 15:45:46 +1100956
Damien Miller61e50f12000-05-08 20:49:37 +1000957AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
958 AC_TRY_COMPILE(
959 [
Damien Miller7b22d652000-06-18 14:07:04 +1000960#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000961#include <netinet/in.h>
962 ],
963 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
964 [ ac_cv_have_struct_sockaddr_in6="yes" ],
965 [ ac_cv_have_struct_sockaddr_in6="no" ]
966 )
967])
968if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
969 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
970fi
Damien Miller34132e52000-01-14 15:45:46 +1100971
Damien Miller61e50f12000-05-08 20:49:37 +1000972AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
973 AC_TRY_COMPILE(
974 [
Damien Miller7b22d652000-06-18 14:07:04 +1000975#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000976#include <netinet/in.h>
977 ],
978 [ struct in6_addr s; s.s6_addr[0] = 0; ],
979 [ ac_cv_have_struct_in6_addr="yes" ],
980 [ ac_cv_have_struct_in6_addr="no" ]
981 )
982])
983if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
984 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
985fi
Damien Miller34132e52000-01-14 15:45:46 +1100986
Damien Miller61e50f12000-05-08 20:49:37 +1000987AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
988 AC_TRY_COMPILE(
989 [
Damien Miller81171112000-04-23 11:14:01 +1000990#include <sys/types.h>
991#include <sys/socket.h>
992#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000993 ],
994 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
995 [ ac_cv_have_struct_addrinfo="yes" ],
996 [ ac_cv_have_struct_addrinfo="no" ]
997 )
998])
999if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1000 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1001fi
1002
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001003AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1004 AC_TRY_COMPILE(
1005 [ #include <sys/time.h> ],
1006 [ struct timeval tv; tv.tv_sec = 1;],
1007 [ ac_cv_have_struct_timeval="yes" ],
1008 [ ac_cv_have_struct_timeval="no" ]
1009 )
1010])
1011if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1012 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1013 have_struct_timeval=1
1014fi
1015
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001016# If we don't have int64_t then we can't compile sftp-server. So don't
1017# even attempt to do it.
1018if test "x$ac_cv_have_int64_t" = "xno" -a \
1019 "x$ac_cv_sizeof_long_int" != "x8" -a \
1020 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1021 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001022fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001023AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001024
Damien Miller78315eb2000-09-29 23:01:36 +11001025dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001026OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1027OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1028OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1029OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1030OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001031OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001032OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1033OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001034OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001035OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1036OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1037OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1038OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001039OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1040OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1041OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1042OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001043AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001044
Damien Miller942da032000-08-18 13:59:06 +10001045AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1046 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1047 AC_TRY_COMPILE(
1048 [
1049#include <sys/types.h>
1050#include <sys/socket.h>
1051 ],
1052 [ struct sockaddr_un s; s.sun_len = 1; ],
1053 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1054 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1055 )
1056])
1057if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1058 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1059fi
1060
Damien Miller61e50f12000-05-08 20:49:37 +10001061AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1062 ac_cv_have_ss_family_in_struct_ss, [
1063 AC_TRY_COMPILE(
1064 [
Damien Miller81171112000-04-23 11:14:01 +10001065#include <sys/types.h>
1066#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001067 ],
1068 [ struct sockaddr_storage s; s.ss_family = 1; ],
1069 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1070 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1071 )
1072])
1073if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1074 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1075fi
1076
Damien Miller61e50f12000-05-08 20:49:37 +10001077AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1078 ac_cv_have___ss_family_in_struct_ss, [
1079 AC_TRY_COMPILE(
1080 [
Damien Miller81171112000-04-23 11:14:01 +10001081#include <sys/types.h>
1082#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001083 ],
1084 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1085 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1086 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1087 )
1088])
1089if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1090 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1091fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001092
Damien Millerad833b32000-08-23 10:46:23 +10001093AC_CACHE_CHECK([for pw_class field in struct passwd],
1094 ac_cv_have_pw_class_in_struct_passwd, [
1095 AC_TRY_COMPILE(
1096 [
Damien Millerad833b32000-08-23 10:46:23 +10001097#include <pwd.h>
1098 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001099 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001100 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1101 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1102 )
1103])
1104if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1105 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1106fi
1107
Damien Miller61e50f12000-05-08 20:49:37 +10001108
1109AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1110 AC_TRY_LINK([],
1111 [ extern char *__progname; printf("%s", __progname); ],
1112 [ ac_cv_libc_defines___progname="yes" ],
1113 [ ac_cv_libc_defines___progname="no" ]
1114 )
1115])
1116if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1117 AC_DEFINE(HAVE___PROGNAME)
1118fi
1119
Damien Millera22ba012000-03-02 23:09:20 +11001120
Damien Millerecbb26d2000-07-15 14:59:14 +10001121AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1122 AC_TRY_LINK([],
1123 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1124 [ ac_cv_libc_defines_sys_errlist="yes" ],
1125 [ ac_cv_libc_defines_sys_errlist="no" ]
1126 )
1127])
1128if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1129 AC_DEFINE(HAVE_SYS_ERRLIST)
1130fi
1131
1132
Damien Miller11fa2cc2000-08-16 10:35:58 +10001133AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1134 AC_TRY_LINK([],
1135 [ extern int sys_nerr; printf("%i", sys_nerr);],
1136 [ ac_cv_libc_defines_sys_nerr="yes" ],
1137 [ ac_cv_libc_defines_sys_nerr="no" ]
1138 )
1139])
1140if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1141 AC_DEFINE(HAVE_SYS_NERR)
1142fi
1143
1144
Damien Millera22ba012000-03-02 23:09:20 +11001145# Looking for programs, paths and files
1146AC_ARG_WITH(rsh,
1147 [ --with-rsh=PATH Specify path to remote shell program ],
1148 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001149 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001150 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001151 fi
1152 ],
1153 [
1154 AC_PATH_PROG(rsh_path, rsh)
1155 ]
1156)
1157
1158AC_ARG_WITH(xauth,
1159 [ --with-xauth=PATH Specify path to xauth program ],
1160 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001161 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001162 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001163 fi
1164 ],
1165 [
Damien Miller78315eb2000-09-29 23:01:36 +11001166 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 +10001167 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001168 xauth_path="/usr/openwin/bin/xauth"
1169 fi
1170 ]
1171)
1172
Damien Millera19cf472000-11-29 13:28:50 +11001173if test -z "$xauth_path" ; then
1174 XAUTH_PATH="undefined"
1175 AC_SUBST(XAUTH_PATH)
1176else
Damien Millera22ba012000-03-02 23:09:20 +11001177 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001178 XAUTH_PATH=$xauth_path
1179 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001180fi
1181if test ! -z "$rsh_path" ; then
1182 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1183fi
1184
1185# Check for mail directory (last resort if we cannot get it from headers)
1186if test ! -z "$MAIL" ; then
1187 maildir=`dirname $MAIL`
1188 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1189fi
1190
Damien Millera22ba012000-03-02 23:09:20 +11001191if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001192 AC_CHECK_FILE("/dev/ptmx",
1193 [
1194 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1195 have_dev_ptmx=1
1196 ]
1197 )
Damien Millera22ba012000-03-02 23:09:20 +11001198fi
Damien Miller204ad072000-03-02 23:56:12 +11001199AC_CHECK_FILE("/dev/ptc",
1200 [
1201 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1202 have_dev_ptc=1
1203 ]
1204)
1205
Damien Millera22ba012000-03-02 23:09:20 +11001206# Options from here on. Some of these are preset by platform above
1207
Damien Millera22ba012000-03-02 23:09:20 +11001208# Check for user-specified random device, otherwise check /dev/urandom
1209AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001210 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001211 [
Damien Miller040f3832000-04-03 14:50:43 +10001212 if test "x$withval" != "xno" ; then
1213 RANDOM_POOL="$withval";
1214 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1215 fi
Damien Millera22ba012000-03-02 23:09:20 +11001216 ],
1217 [
1218 # Check for random device
1219 AC_CHECK_FILE("/dev/urandom",
1220 [
1221 RANDOM_POOL="/dev/urandom";
1222 AC_SUBST(RANDOM_POOL)
1223 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1224 ]
1225 )
1226 ]
1227)
1228
1229# Check for EGD pool file
1230AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001231 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001232 [
Damien Miller040f3832000-04-03 14:50:43 +10001233 if test "x$withval" != "xno" ; then
1234 EGD_SOCKET="$withval";
1235 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1236 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001237 ],
1238 [
1239 # Check for existing socket only if we don't have a random device already
1240 if test -z "$RANDOM_POOL" ; then
1241 AC_MSG_CHECKING(for PRNGD/EGD socket)
1242 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001243 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
Damien Millerd8ab0d42001-02-13 12:11:17 +11001244 if test -r $egdsock && $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001245 EGD_SOCKET="$egdsock"
1246 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001247 break;
1248 fi
1249 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001250 if test -x "$EGD_SOCKET" ; then
1251 AC_MSG_RESULT($EGD_SOCKET)
1252 else
1253 AC_MSG_RESULT(not found)
1254 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001255 fi
Damien Millera22ba012000-03-02 23:09:20 +11001256 ]
1257)
1258
Damien Miller0736c4d2001-01-25 10:51:46 +11001259
Damien Miller0437b332000-05-02 09:56:41 +10001260# detect pathnames for entropy gathering commands, if we need them
1261INSTALL_SSH_PRNG_CMDS=""
1262rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001263if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001264 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001265 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1266 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1267 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1268 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1269 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1270 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1271 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1272 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1273 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1274 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1275 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1276 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1277 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1278 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001279
1280 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001281fi
Damien Miller0437b332000-05-02 09:56:41 +10001282AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1283
Damien Miller11e37f62000-04-08 18:23:30 +10001284
Damien Miller670a4b82000-01-22 13:53:11 +11001285AC_ARG_WITH(catman,
1286 [ --with-catman=man|cat Install preformatted manpages[no]],
1287 [
1288 MANTYPE='$(CATMAN)'
1289 if test x"$withval" != x"yes" ; then
1290 mansubdir=$withval
1291 else
1292 mansubdir=cat
1293 fi
1294 ], [
1295 if test -z "$MANTYPE" ; then
1296 MANTYPE='$(TROFFMAN)'
1297 mansubdir=man
1298 fi
1299 ]
1300)
1301AC_SUBST(MANTYPE)
1302AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001303
Damien Millera22ba012000-03-02 23:09:20 +11001304# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001305MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001306AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001307 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001308 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001309 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001310 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001311 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001312 fi
1313 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001314)
1315
Damien Millera22ba012000-03-02 23:09:20 +11001316# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001317AC_ARG_WITH(shadow,
1318 [ --without-shadow Disable shadow password support],
1319 [
1320 if test "x$withval" = "xno" ; then
1321 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001322 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001323 fi
1324 ]
1325)
1326
Damien Miller1f335fb2000-06-26 11:31:33 +10001327if test -z "$disable_shadow" ; then
1328 AC_MSG_CHECKING([if the systems has expire shadow information])
1329 AC_TRY_COMPILE(
1330 [
1331#include <sys/types.h>
1332#include <shadow.h>
1333 struct spwd sp;
1334 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1335 [ sp_expire_available=yes ], []
1336 )
1337
1338 if test "x$sp_expire_available" = "xyes" ; then
1339 AC_MSG_RESULT(yes)
1340 AC_DEFINE(HAS_SHADOW_EXPIRE)
1341 else
1342 AC_MSG_RESULT(no)
1343 fi
1344fi
1345
Damien Millera22ba012000-03-02 23:09:20 +11001346# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001347if test ! -z "$IPADDR_IN_DISPLAY" ; then
1348 DISPLAY_HACK_MSG="yes"
1349 AC_DEFINE(IPADDR_IN_DISPLAY)
1350else
1351 DISPLAY_HACK_MSG="no"
1352 AC_ARG_WITH(ipaddr-display,
1353 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1354 [
1355 if test "x$withval" != "xno" ; then
1356 AC_DEFINE(IPADDR_IN_DISPLAY)
1357 DISPLAY_HACK_MSG="yes"
1358 fi
1359 ]
1360 )
1361fi
Damien Miller76112de1999-12-21 11:18:08 +11001362
Damien Millera22ba012000-03-02 23:09:20 +11001363# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001364SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001365AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001366 [ --with-default-path=PATH Specify default \$PATH environment for server],
1367 [
1368 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001369 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001370 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001371 fi
1372 ]
1373)
1374
Damien Millera22ba012000-03-02 23:09:20 +11001375# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001376IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001377AC_ARG_WITH(ipv4-default,
1378 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1379 [
1380 if test "x$withval" != "xno" ; then
1381 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001382 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001383 fi
1384 ]
1385)
1386
Damien Miller61e50f12000-05-08 20:49:37 +10001387AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001388IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001389AC_ARG_WITH(4in6,
1390 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1391 [
1392 if test "x$withval" != "xno" ; then
1393 AC_MSG_RESULT(yes)
1394 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001395 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001396 else
1397 AC_MSG_RESULT(no)
1398 fi
1399 ],[
1400 if test "x$inet6_default_4in6" = "xyes"; then
1401 AC_MSG_RESULT([yes (default)])
1402 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001403 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001404 else
1405 AC_MSG_RESULT([no (default)])
1406 fi
1407 ]
1408)
1409
Damien Miller78315eb2000-09-29 23:01:36 +11001410AC_MSG_CHECKING(whether to install ssh as suid root)
1411AC_ARG_ENABLE(suid-ssh,
1412[ --enable-suid-ssh Install ssh as suid root (default)
1413 --disable-suid-ssh Install ssh without suid bit],
1414[ case "$enableval" in
1415 no)
1416 AC_MSG_RESULT(no)
1417 SSHMODE=0711
1418 ;;
1419 *) AC_MSG_RESULT(yes)
1420 SSHMODE=04711
1421 ;;
1422 esac ],
1423 AC_MSG_RESULT(yes)
1424 SSHMODE=04711
1425)
1426AC_SUBST(SSHMODE)
1427
1428
Damien Millera22ba012000-03-02 23:09:20 +11001429# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001430piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001431AC_ARG_WITH(pid-dir,
1432 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1433 [
1434 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001435 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001436 fi
1437 ]
1438)
Damien Miller4018c192000-04-30 09:30:44 +10001439
Damien Miller78315eb2000-09-29 23:01:36 +11001440# make sure the directory exists
1441if test ! -d $piddir ; then
1442 piddir=`eval echo ${sysconfdir}`
1443 case $piddir in
1444 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1445 esac
1446fi
1447
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001448AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001449AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001450
andre2ff7b5d2000-06-03 14:57:40 +00001451dnl allow user to disable some login recording features
1452AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001453 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001454 [ AC_DEFINE(DISABLE_LASTLOG) ]
1455)
1456AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001457 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001458 [ AC_DEFINE(DISABLE_UTMP) ]
1459)
1460AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001461 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001462 [ AC_DEFINE(DISABLE_UTMPX) ]
1463)
1464AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001465 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001466 [ AC_DEFINE(DISABLE_WTMP) ]
1467)
1468AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001469 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001470 [ AC_DEFINE(DISABLE_WTMPX) ]
1471)
1472AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001473 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001474 [ AC_DEFINE(DISABLE_LOGIN) ]
1475)
1476AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001477 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001478 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1479)
1480AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001481 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001482 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1483)
1484AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001485 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001486 [
1487 if test "x$withval" = "xno" ; then
1488 AC_DEFINE(DISABLE_LASTLOG)
1489 else
1490 conf_lastlog_location=$withval
1491 fi
1492 ]
1493)
andre2ff7b5d2000-06-03 14:57:40 +00001494
1495dnl lastlog, [uw]tmpx? detection
1496dnl NOTE: set the paths in the platform section to avoid the
1497dnl need for command-line parameters
1498dnl lastlog and [uw]tmp are subject to a file search if all else fails
1499
1500dnl lastlog detection
1501dnl NOTE: the code itself will detect if lastlog is a directory
1502AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1503AC_TRY_COMPILE([
1504#include <sys/types.h>
1505#include <utmp.h>
1506#ifdef HAVE_LASTLOG_H
1507# include <lastlog.h>
1508#endif
Damien Miller2994e082000-06-04 15:51:47 +10001509#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001510# include <paths.h>
1511#endif
1512 ],
1513 [ char *lastlog = LASTLOG_FILE; ],
1514 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001515 [
1516 AC_MSG_RESULT(no)
1517 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1518 AC_TRY_COMPILE([
1519#include <sys/types.h>
1520#include <utmp.h>
1521#ifdef HAVE_LASTLOG_H
1522# include <lastlog.h>
1523#endif
1524#ifdef HAVE_PATHS_H
1525# include <paths.h>
1526#endif
1527 ],
1528 [ char *lastlog = _PATH_LASTLOG; ],
1529 [ AC_MSG_RESULT(yes) ],
1530 [
andree441aa32000-06-12 22:34:38 +00001531 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001532 system_lastlog_path=no
1533 ])
1534 ]
andre2ff7b5d2000-06-03 14:57:40 +00001535)
Damien Miller2994e082000-06-04 15:51:47 +10001536
andre2ff7b5d2000-06-03 14:57:40 +00001537if test -z "$conf_lastlog_location"; then
1538 if test x"$system_lastlog_path" = x"no" ; then
1539 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001540 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001541 conf_lastlog_location=$f
1542 fi
1543 done
1544 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001545 AC_MSG_WARN([** Cannot find lastlog **])
1546 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001547 fi
1548 fi
1549fi
1550
1551if test -n "$conf_lastlog_location"; then
1552 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1553fi
1554
1555dnl utmp detection
1556AC_MSG_CHECKING([if your system defines UTMP_FILE])
1557AC_TRY_COMPILE([
1558#include <sys/types.h>
1559#include <utmp.h>
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 *utmp = UTMP_FILE; ],
1565 [ AC_MSG_RESULT(yes) ],
1566 [ AC_MSG_RESULT(no)
1567 system_utmp_path=no ]
1568)
1569if test -z "$conf_utmp_location"; then
1570 if test x"$system_utmp_path" = x"no" ; then
1571 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1572 if test -f $f ; then
1573 conf_utmp_location=$f
1574 fi
1575 done
1576 if test -z "$conf_utmp_location"; then
1577 AC_DEFINE(DISABLE_UTMP)
1578 fi
1579 fi
1580fi
1581if test -n "$conf_utmp_location"; then
1582 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1583fi
1584
1585dnl wtmp detection
1586AC_MSG_CHECKING([if your system defines WTMP_FILE])
1587AC_TRY_COMPILE([
1588#include <sys/types.h>
1589#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001590#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001591# include <paths.h>
1592#endif
1593 ],
1594 [ char *wtmp = WTMP_FILE; ],
1595 [ AC_MSG_RESULT(yes) ],
1596 [ AC_MSG_RESULT(no)
1597 system_wtmp_path=no ]
1598)
1599if test -z "$conf_wtmp_location"; then
1600 if test x"$system_wtmp_path" = x"no" ; then
1601 for f in /usr/adm/wtmp /var/log/wtmp; do
1602 if test -f $f ; then
1603 conf_wtmp_location=$f
1604 fi
1605 done
1606 if test -z "$conf_wtmp_location"; then
1607 AC_DEFINE(DISABLE_WTMP)
1608 fi
1609 fi
1610fi
1611if test -n "$conf_wtmp_location"; then
1612 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1613fi
1614
1615
1616dnl utmpx detection - I don't know any system so perverse as to require
1617dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1618dnl there, though.
1619AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1620AC_TRY_COMPILE([
1621#include <sys/types.h>
1622#include <utmp.h>
1623#ifdef HAVE_UTMPX_H
1624#include <utmpx.h>
1625#endif
Damien Miller2994e082000-06-04 15:51:47 +10001626#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001627# include <paths.h>
1628#endif
1629 ],
1630 [ char *utmpx = UTMPX_FILE; ],
1631 [ AC_MSG_RESULT(yes) ],
1632 [ AC_MSG_RESULT(no)
1633 system_utmpx_path=no ]
1634)
1635if test -z "$conf_utmpx_location"; then
1636 if test x"$system_utmpx_path" = x"no" ; then
1637 AC_DEFINE(DISABLE_UTMPX)
1638 fi
1639else
1640 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1641fi
1642
1643dnl wtmpx detection
1644AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1645AC_TRY_COMPILE([
1646#include <sys/types.h>
1647#include <utmp.h>
1648#ifdef HAVE_UTMPX_H
1649#include <utmpx.h>
1650#endif
Damien Miller2994e082000-06-04 15:51:47 +10001651#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001652# include <paths.h>
1653#endif
1654 ],
1655 [ char *wtmpx = WTMPX_FILE; ],
1656 [ AC_MSG_RESULT(yes) ],
1657 [ AC_MSG_RESULT(no)
1658 system_wtmpx_path=no ]
1659)
1660if test -z "$conf_wtmpx_location"; then
1661 if test x"$system_wtmpx_path" = x"no" ; then
1662 AC_DEFINE(DISABLE_WTMPX)
1663 fi
1664else
1665 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1666fi
1667
Damien Miller4018c192000-04-30 09:30:44 +10001668
1669# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001670entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001671AC_ARG_WITH(entropy-timeout,
1672 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1673 [
1674 if test "x$withval" != "xno" ; then
1675 entropy_timeout=$withval
1676 fi
1677 ]
1678)
1679AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1680
1681
Damien Miller29ea30d2000-03-17 10:54:15 +11001682if test ! -z "$blibpath" ; then
1683 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1684 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1685fi
1686
Damien Millerbac2d8a2000-09-05 16:13:06 +11001687AC_EXEEXT
1688
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001689AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001690
Damien Miller7b22d652000-06-18 14:07:04 +10001691# Print summary of options
1692
1693if test x$MANTYPE = x'$(CATMAN)' ; then
1694 MAN_MSG=cat
1695else
1696 MAN_MSG=man
1697fi
1698if test ! -z "$RANDOM_POOL" ; then
1699 RAND_MSG="Device ($RANDOM_POOL)"
1700else
1701 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001702 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001703 else
1704 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001705 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001706 fi
1707fi
1708
1709# Someone please show me a better way :)
1710A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1711B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1712C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1713D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001714E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001715F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1716G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1717
1718echo ""
1719echo "OpenSSH configured has been configured with the following options."
1720echo " User binaries: $B"
1721echo " System binaries: $C"
1722echo " Configuration files: $D"
1723echo " Askpass program: $E"
1724echo " Manual pages: $F"
1725echo " PID file: $G"
1726echo " Random number collection: $RAND_MSG"
1727echo " Manpage format: $MAN_MSG"
1728echo " PAM support: ${PAM_MSG}"
1729echo " KerberosIV support: $KRB4_MSG"
1730echo " AFS support: $AFS_MSG"
1731echo " S/KEY support: $SKEY_MSG"
1732echo " TCP Wrappers support: $TCPW_MSG"
1733echo " MD5 password support: $MD5_MSG"
1734echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1735echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1736echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1737
1738echo ""
1739
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001740echo " Host: ${host}"
1741echo " Compiler: ${CC}"
1742echo " Compiler flags: ${CFLAGS}"
1743echo "Preprocessor flags: ${CPPFLAGS}"
1744echo " Linker flags: ${LDFLAGS}"
1745echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001746
1747echo ""
1748
Damien Miller82cf0ce2000-12-20 13:34:48 +11001749if test "x$PAM_MSG" = "xyes" ; then
1750 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1751 echo "otherwise password authentication may fail. Example PAM control files"
1752 echo "can be found in the contrib/ subdirectory"
1753 echo ""
1754fi
1755
Damien Miller6f9c3372000-10-25 10:06:04 +11001756if test ! -z "$BUILTIN_RNG" ; then
1757 echo "WARNING: you are using the builtin random number collection service."
1758 echo "Please read WARNING.RNG and request that your OS vendor includes"
1759 echo "/dev/random in future versions of their OS."
1760 echo ""
1761fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001762
1763if test ! -z "$NO_SFTP"; then
1764 echo "sftp-server will be disabled. Your compiler does not support"
1765 echo "64bit integers."
1766 echo ""
1767fi