blob: e99d016024b05db347b1b3359b99f3117f0671f7 [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11004AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11005AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10006
Damien Millera22ba012000-03-02 23:09:20 +11007# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +11008AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10009AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110010AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000011AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110016AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110017AC_PATH_PROG(TEST_MINUS_S_SH, bash)
18AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
19AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110020
Damien Miller3f62aba2000-11-29 11:56:35 +110021if test -z "$AR" ; then
22 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
23fi
24
Damien Millerad833b32000-08-23 10:46:23 +100025# Use LOGIN_PROGRAM from environment if possible
26if test ! -z "$LOGIN_PROGRAM" ; then
27 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
28else
29 # Search for login
30 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
31 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
32 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
33 fi
34fi
35
Damien Miller166bd442000-03-16 10:48:25 +110036if test -z "$LD" ; then
37 LD=$CC
38fi
39AC_SUBST(LD)
40
41# C Compiler features
42AC_C_INLINE
43if test "$GCC" = "yes"; then
44 CFLAGS="$CFLAGS -Wall"
45fi
46
Damien Millera22ba012000-03-02 23:09:20 +110047# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110048case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110049*-*-aix*)
50 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000051 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110052 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100053 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110054 blibpath="/usr/lib:/lib:/usr/local/lib"
55 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100056 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110057 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000058 MANTYPE='$(CATMAN)'
59 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000060 dnl AIX handles lastlog as part of its login message
61 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100062 MANTYPE='$(CATMAN)'
63 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110064 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110065*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110066 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110067 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110068 AC_DEFINE(DISABLE_SHADOW)
69 AC_DEFINE(IPV4_DEFAULT)
70 AC_DEFINE(IP_TOS_IS_BROKEN)
71 AC_DEFINE(BROKEN_VHANGUP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110072 no_libsocket=1
73 no_libnsl=1
74 ;;
Damien Miller76112de1999-12-21 11:18:08 +110075*-*-hpux10*)
76 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100077 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110078 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000079 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110080 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100081 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110082 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110083 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000084 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110085 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110086 MANTYPE='$(CATMAN)'
87 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110088 ;;
Damien Miller1bead332000-04-30 00:47:29 +100089*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000090 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110091 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110092 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110093 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110094 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110095 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000096 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110097 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100098 MANTYPE='$(CATMAN)'
99 mansubdir=cat
100 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100101*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000102 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000103 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100104 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100105 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100106 no_libsocket=1
107 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000108 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100109 ;;
110*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000112 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100113 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100114 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000115 AC_DEFINE(WITH_IRIX_ARRAY)
116 AC_DEFINE(WITH_IRIX_PROJECT)
117 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000118 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100119 no_libsocket=1
120 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000121 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000122 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100123 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100124*-*-linux*)
125 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100126 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100127 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000128 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100129 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100130 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000131mips-sony-bsd|mips-sony-newsos4)
132 AC_DEFINE(HAVE_NEWS4)
133 SONY=1
134 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
135 AC_MSG_ERROR([*** libiberty missing - please install first ***])
136 )
137 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100138*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100139 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100140 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100143 conf_utmp_location=/etc/utmp
144 conf_wtmp_location=/usr/adm/wtmp
145 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000146 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000147 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000148 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000149 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000150 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100152*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000153 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100155 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100156 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000157 # hardwire lastlog location (can't detect it on some versions)
158 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000159 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
160 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
161 if test "$sol2ver" -ge 8; then
162 AC_MSG_RESULT(yes)
163 AC_DEFINE(DISABLE_UTMP)
164 AC_DEFINE(DISABLE_WTMP)
165 else
166 AC_MSG_RESULT(no)
167 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100168 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000169*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000170 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000171 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100172 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000173 conf_utmp_location=/etc/utmp
174 conf_wtmp_location=/var/adm/wtmp
175 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000176 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000177 MANTYPE='$(CATMAN)'
178 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000179 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000180*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000182 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
183 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100184 IPADDR_IN_DISPLAY=yes
185 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000186 AC_DEFINE(IP_TOS_IS_BROKEN)
187 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000188 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000189 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100190*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000191 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100192 LDFLAGS="$LDFLAGS -L/usr/local/lib"
193 MANTYPE='$(CATMAN)'
194 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100195 enable_suid_ssh=no
196 ;;
197*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000198 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100199 LDFLAGS="$LDFLAGS -L/usr/local/lib"
200 MANTYPE='$(CATMAN)'
201 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100202 enable_suid_ssh=no
203 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100204*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000205 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100207 MANTYPE='$(CATMAN)'
208 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100209 LIBS="$LIBS -lgen -lsocket"
210 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100211*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100212 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000213 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
215 MANTYPE='$(CATMAN)'
216 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000217 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100218 no_dev_ptmx=1
219 RANLIB=true
220 AC_DEFINE(BROKEN_SYS_TERMIO_H)
221 rsh_path="/usr/bin/rcmd"
222 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000223 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000224 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller78315eb2000-09-29 23:01:36 +1100225 ;;
226*-*-sco3.2v5*)
Ben Lindstrom49af82b2001-01-27 20:43:57 +0000227 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000228 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000229 LDFLAGS="$LDFLAGS -L/usr/local/lib"
230 MANTYPE='$(CATMAN)'
231 mansubdir=cat
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000232 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000233 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100234 rsh_path="/usr/bin/rcmd"
235 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000236 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000237 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millera66626b2000-06-13 18:57:53 +1000238 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000239*-dec-osf*)
240# This is untested
241 if test ! -z "USE_SIA" ; then
242 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
243 if test -f /etc/sia/matrix.conf; then
244 AC_MSG_RESULT(yes)
245 AC_DEFINE(HAVE_OSF_SIA)
246 AC_DEFINE(DISABLE_LOGIN)
247 LIBS="$LIBS -lsecurity -ldb -lm -laud"
248 else
249 AC_MSG_RESULT(no)
250 fi
251 fi
252 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100253esac
254
Damien Millere37bfc12000-06-05 09:37:43 +1000255# Allow user to specify flags
256AC_ARG_WITH(cflags,
257 [ --with-cflags Specify additional flags to pass to compiler],
258 [
259 if test "x$withval" != "xno" ; then
260 CFLAGS="$CFLAGS $withval"
261 fi
262 ]
263)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000264AC_ARG_WITH(cppflags,
265 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
266 [
267 if test "x$withval" != "xno"; then
268 CPPFLAGS="$CPPFLAGS $withval"
269 fi
270 ]
271)
Damien Millere37bfc12000-06-05 09:37:43 +1000272AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000273 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000274 [
275 if test "x$withval" != "xno" ; then
276 LDFLAGS="$LDFLAGS $withval"
277 fi
278 ]
279)
280AC_ARG_WITH(libs,
281 [ --with-libs Specify additional libraries to link with],
282 [
283 if test "x$withval" != "xno" ; then
284 LIBS="$LIBS $withval"
285 fi
286 ]
287)
288
289
Damien Millera22ba012000-03-02 23:09:20 +1100290# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000291if test -z "$no_libsocket" ; then
292 AC_CHECK_LIB(nsl, yp_match, , )
293fi
294if test -z "$no_libnsl" ; then
295 AC_CHECK_LIB(socket, main, , )
296fi
297
298AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Millerab18c411999-11-11 10:40:23 +1100299AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
300AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100301
302AC_CHECK_FUNC(regcomp,
Ben Lindstrom401d58f2001-01-19 17:11:43 +0000303 [ AC_DEFINE(HAVE_REGCOMP)],
Damien Miller6f9c3372000-10-25 10:06:04 +1100304 [
305 AC_CHECK_LIB(pcre, pcre_info,
306 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
307 ]
308)
Damien Millerab18c411999-11-11 10:40:23 +1100309
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000310dnl UnixWare 2.x
311AC_CHECK_FUNC(strcasecmp,
312 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
313)
314AC_CHECK_FUNC(utimes,
315 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
316)
Damien Millerab18c411999-11-11 10:40:23 +1100317
Damien Millera22ba012000-03-02 23:09:20 +1100318# Checks for header files.
Ben Lindstromcb577332001-01-22 21:06:19 +0000319AC_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 +1100320
Damien Millerad833b32000-08-23 10:46:23 +1000321dnl Checks for library functions.
Ben Lindstromdd5c5a32001-02-02 18:58:33 +0000322AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock 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 +1000323dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000324AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000325dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000326AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000327AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000328dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000329AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000330AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000331dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000332AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000333AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100334
Damien Miller5fc85652000-07-09 23:53:07 +1000335AC_CHECK_FUNC(getuserattr,
336 [AC_DEFINE(HAVE_GETUSERATTR)],
337 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
338)
339
Damien Miller04f80141999-11-19 15:32:34 +1100340AC_CHECK_FUNC(login,
341 [AC_DEFINE(HAVE_LOGIN)],
342 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
343)
344
345AC_CHECK_FUNC(daemon,
346 [AC_DEFINE(HAVE_DAEMON)],
347 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
348)
349
Damien Miller9fb07e42000-03-05 16:22:59 +1100350AC_CHECK_FUNC(getpagesize,
351 [AC_DEFINE(HAVE_GETPAGESIZE)],
352 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
353)
354
Damien Millercb170cb2000-07-01 16:52:55 +1000355# Check for broken snprintf
356if test "x$ac_cv_func_snprintf" = "xyes" ; then
357 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
358 AC_TRY_RUN(
359 [
360#include <stdio.h>
361int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
362 ],
363 [AC_MSG_RESULT(yes)],
364 [
365 AC_MSG_RESULT(no)
366 AC_DEFINE(BROKEN_SNPRINTF)
367 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
368 ]
369 )
370fi
371
Damien Miller606f8802000-09-16 15:39:56 +1100372AC_FUNC_GETPGRP
373
Ben Lindstromec3830a2001-01-25 00:07:33 +0000374AC_FUNC_STRFTIME
375
Damien Millera64b57a2001-01-17 10:44:13 +1100376# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000377PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100378AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100379 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100380 [
Damien Millera64b57a2001-01-17 10:44:13 +1100381 if test "x$withval" != "xno" ; then
382 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
383 AC_MSG_ERROR([PAM headers not found])
384 fi
385
386 AC_CHECK_LIB(dl, dlopen, , )
387 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
388 AC_CHECK_FUNCS(pam_getenvlist)
389
390 disable_shadow=yes
391 PAM_MSG="yes"
392
393 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100394 fi
395 ]
396)
Damien Millera22ba012000-03-02 23:09:20 +1100397
Damien Millera64b57a2001-01-17 10:44:13 +1100398# Check for older PAM
399if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100400 # Check PAM strerror arguments (old PAM)
401 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
402 AC_TRY_COMPILE(
403 [
Damien Miller81171112000-04-23 11:14:01 +1000404#include <stdlib.h>
405#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100406 ],
407 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
408 [AC_MSG_RESULT(no)],
409 [
410 AC_DEFINE(HAVE_OLD_PAM)
411 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000412 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100413 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100414 )
Damien Millera22ba012000-03-02 23:09:20 +1100415fi
416
417# The big search for OpenSSL
418AC_ARG_WITH(ssl-dir,
419 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
420 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000421 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100422 tryssldir=$withval
423 fi
424 ]
425)
426
427saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100428saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000429saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100430if test "x$prefix" != "xNONE" ; then
431 tryssldir="$tryssldir $prefix"
432fi
Damien Miller61e50f12000-05-08 20:49:37 +1000433AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100434
Damien Millera1b61e12000-09-16 17:02:16 +1100435 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 +1100436 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000437 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000438 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000439 if test ! -z "$need_dash_r" ; then
440 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
441 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100442 else
Damien Miller61e50f12000-05-08 20:49:37 +1000443 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100444 fi
445
Damien Miller3b512e12000-05-17 23:29:18 +1000446 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000447
Damien Miller3b512e12000-05-17 23:29:18 +1000448 # Basic test to check for compatible version and correct linking
449 # *does not* test for RSA - that comes later.
450 AC_TRY_RUN(
451 [
Damien Millere59ce622000-05-01 20:54:17 +1000452#include <string.h>
453#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000454int main(void)
455{
Damien Miller3b512e12000-05-17 23:29:18 +1000456 char a[2048];
457 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000458 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000459 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000460}
Damien Miller3b512e12000-05-17 23:29:18 +1000461 ],
462 [
463 found_crypto=1
464 break;
465 ], []
466 )
Damien Miller61e50f12000-05-08 20:49:37 +1000467
468 if test ! -z "$found_crypto" ; then
469 break;
470 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100471 done
472
Damien Miller61e50f12000-05-08 20:49:37 +1000473 if test -z "$found_crypto" ; then
474 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100475 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000476 if test -z "$ssldir" ; then
477 ssldir="(system)"
478 fi
Damien Millera22ba012000-03-02 23:09:20 +1100479
Damien Miller61e50f12000-05-08 20:49:37 +1000480 ac_cv_openssldir=$ssldir
481])
482
Damien Milleredb82922000-06-20 13:25:52 +1000483if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000484 AC_DEFINE(HAVE_OPENSSL)
485 dnl Need to recover ssldir - test above runs in subshell
486 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100487
488 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
489 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
490 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
491 if test ! -z "$need_dash_r" ; then
492 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
493 fi
494 if test ! -z "$blibpath" ; then
495 blibpath="$blibpath:$ssldir:$ssldir/lib"
496 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100497 fi
Damien Millera22ba012000-03-02 23:09:20 +1100498fi
Damien Miller3b512e12000-05-17 23:29:18 +1000499LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000500
Damien Miller3b512e12000-05-17 23:29:18 +1000501# Now test RSA support
502saved_LIBS="$LIBS"
503AC_MSG_CHECKING([for RSA support])
504for WANTS_RSAREF in "" 1 ; do
505 if test -z "$WANTS_RSAREF" ; then
506 LIBS="$saved_LIBS"
507 else
508 LIBS="$saved_LIBS -lRSAglue -lrsaref"
509 fi
510 AC_TRY_RUN([
511#include <string.h>
512#include <openssl/rand.h>
513#include <openssl/rsa.h>
514#include <openssl/bn.h>
515#include <openssl/sha.h>
516int main(void)
517{
518 int num; RSA *key; static unsigned char p_in[] = "blahblah";
519 unsigned char c[256], p[256];
520 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
521 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
522 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
523 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
524}
525 ],
526 [
527 rsa_works=1
528 break;
529 ], [])
530done
531
532if test ! -z "$no_rsa" ; then
533 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000534 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000535else
536 if test -z "$rsa_works" ; then
537 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000538 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000539 else
540 if test -z "$WANTS_RSAREF" ; then
541 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000542 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000543 else
Damien Miller7b22d652000-06-18 14:07:04 +1000544 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000545 AC_MSG_RESULT(using RSAref)
546 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
547 fi
548 fi
549fi
Damien Millera22ba012000-03-02 23:09:20 +1100550
Damien Millera64b57a2001-01-17 10:44:13 +1100551# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
552# version in OpenSSL. Skip this for PAM
553if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
554 AC_CHECK_LIB(crypt, crypt, , )
555fi
556
Ben Lindstromb5628642000-10-18 00:02:25 +0000557# Cheap hack to ensure NEWS-OS libraries are arranged right.
558if test ! -z "$SONY" ; then
559 LIBS="$LIBS -liberty";
560fi
561
Damien Millera22ba012000-03-02 23:09:20 +1100562# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100563AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100564AC_CHECK_SIZEOF(short int, 2)
565AC_CHECK_SIZEOF(int, 4)
566AC_CHECK_SIZEOF(long int, 4)
567AC_CHECK_SIZEOF(long long int, 8)
568
Damien Millera22ba012000-03-02 23:09:20 +1100569# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100570AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
571 AC_TRY_COMPILE(
572 [ #include <sys/types.h> ],
573 [ u_int a; a = 1;],
574 [ ac_cv_have_u_int="yes" ],
575 [ ac_cv_have_u_int="no" ]
576 )
577])
578if test "x$ac_cv_have_u_int" = "xyes" ; then
579 AC_DEFINE(HAVE_U_INT)
580 have_u_int=1
581fi
582
Damien Miller61e50f12000-05-08 20:49:37 +1000583AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
584 AC_TRY_COMPILE(
585 [ #include <sys/types.h> ],
586 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
587 [ ac_cv_have_intxx_t="yes" ],
588 [ ac_cv_have_intxx_t="no" ]
589 )
590])
591if test "x$ac_cv_have_intxx_t" = "xyes" ; then
592 AC_DEFINE(HAVE_INTXX_T)
593 have_intxx_t=1
594fi
595
Damien Miller578783e2000-09-23 14:12:24 +1100596AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
597 AC_TRY_COMPILE(
598 [ #include <sys/types.h> ],
599 [ int64_t a; a = 1;],
600 [ ac_cv_have_int64_t="yes" ],
601 [ ac_cv_have_int64_t="no" ]
602 )
603])
604if test "x$ac_cv_have_int64_t" = "xyes" ; then
605 AC_DEFINE(HAVE_INT64_T)
606 have_int64_t=1
607fi
608
Damien Miller61e50f12000-05-08 20:49:37 +1000609AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
610 AC_TRY_COMPILE(
611 [ #include <sys/types.h> ],
612 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
613 [ ac_cv_have_u_intxx_t="yes" ],
614 [ ac_cv_have_u_intxx_t="no" ]
615 )
616])
617if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
618 AC_DEFINE(HAVE_U_INTXX_T)
619 have_u_intxx_t=1
620fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100621
Damien Miller578783e2000-09-23 14:12:24 +1100622AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
623 AC_TRY_COMPILE(
624 [ #include <sys/types.h> ],
625 [ u_int64_t a; a = 1;],
626 [ ac_cv_have_u_int64_t="yes" ],
627 [ ac_cv_have_u_int64_t="no" ]
628 )
629])
630if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
631 AC_DEFINE(HAVE_U_INT64_T)
632 have_u_int64_t=1
633fi
634
Damien Milleredb82922000-06-20 13:25:52 +1000635if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
636 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100637then
638 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
639 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000640 [
641#include <sys/bitypes.h>
642 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100643 [
Damien Miller70494d12000-04-03 15:57:06 +1000644 int8_t a; int16_t b; int32_t c;
645 u_int8_t e; u_int16_t f; u_int32_t g;
646 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100647 ],
648 [
649 AC_DEFINE(HAVE_U_INTXX_T)
650 AC_DEFINE(HAVE_INTXX_T)
651 AC_MSG_RESULT(yes)
652 ],
653 [AC_MSG_RESULT(no)]
654 )
655fi
656
Damien Millerd6121d22000-03-17 23:26:46 +1100657if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000658 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
659 AC_TRY_COMPILE(
660 [
661#include <sys/types.h>
662 ],
663 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
664 [ ac_cv_have_uintxx_t="yes" ],
665 [ ac_cv_have_uintxx_t="no" ]
666 )
667 ])
668 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
669 AC_DEFINE(HAVE_UINTXX_T)
670 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100671fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100672
Damien Miller61e50f12000-05-08 20:49:37 +1000673AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
674 AC_TRY_COMPILE(
675 [
Damien Miller81171112000-04-23 11:14:01 +1000676#include <sys/types.h>
677#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000678 ],
679 [socklen_t foo; foo = 1235;],
680 [ ac_cv_have_socklen_t="yes" ],
681 [ ac_cv_have_socklen_t="no" ]
682 )
683])
684if test "x$ac_cv_have_socklen_t" = "xyes" ; then
685 AC_DEFINE(HAVE_SOCKLEN_T)
686fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100687
Damien Miller61e50f12000-05-08 20:49:37 +1000688AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
689 AC_TRY_COMPILE(
690 [
691#include <sys/types.h>
692 ],
693 [ size_t foo; foo = 1235; ],
694 [ ac_cv_have_size_t="yes" ],
695 [ ac_cv_have_size_t="no" ]
696 )
697])
698if test "x$ac_cv_have_size_t" = "xyes" ; then
699 AC_DEFINE(HAVE_SIZE_T)
700fi
Damien Miller95058511999-12-29 10:36:45 +1100701
Damien Miller615f9392000-05-17 22:53:33 +1000702AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
703 AC_TRY_COMPILE(
704 [
705#include <sys/types.h>
706 ],
707 [ ssize_t foo; foo = 1235; ],
708 [ ac_cv_have_ssize_t="yes" ],
709 [ ac_cv_have_ssize_t="no" ]
710 )
711])
712if test "x$ac_cv_have_ssize_t" = "xyes" ; then
713 AC_DEFINE(HAVE_SSIZE_T)
714fi
715
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000716AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
717 AC_TRY_COMPILE(
718 [
719#include <time.h>
720 ],
721 [ clock_t foo; foo = 1235; ],
722 [ ac_cv_have_clock_t="yes" ],
723 [ ac_cv_have_clock_t="no" ]
724 )
725])
726if test "x$ac_cv_have_clock_t" = "xyes" ; then
727 AC_DEFINE(HAVE_CLOCK_T)
728fi
729
Damien Millerb54b40e2000-06-23 08:23:34 +1000730AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
731 AC_TRY_COMPILE(
732 [
733#include <sys/types.h>
734#include <sys/socket.h>
735 ],
736 [ sa_family_t foo; foo = 1235; ],
737 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100738 [ AC_TRY_COMPILE(
739 [
740#include <sys/types.h>
741#include <sys/socket.h>
742#include <netinet/in.h>
743 ],
744 [ sa_family_t foo; foo = 1235; ],
745 [ ac_cv_have_sa_family_t="yes" ],
746
Damien Millerb54b40e2000-06-23 08:23:34 +1000747 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100748 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000749 )
750])
751if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
752 AC_DEFINE(HAVE_SA_FAMILY_T)
753fi
754
Damien Miller0f91b4e2000-06-18 15:43:25 +1000755AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
756 AC_TRY_COMPILE(
757 [
758#include <sys/types.h>
759 ],
760 [ pid_t foo; foo = 1235; ],
761 [ ac_cv_have_pid_t="yes" ],
762 [ ac_cv_have_pid_t="no" ]
763 )
764])
765if test "x$ac_cv_have_pid_t" = "xyes" ; then
766 AC_DEFINE(HAVE_PID_T)
767fi
768
769AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
770 AC_TRY_COMPILE(
771 [
772#include <sys/types.h>
773 ],
774 [ mode_t foo; foo = 1235; ],
775 [ ac_cv_have_mode_t="yes" ],
776 [ ac_cv_have_mode_t="no" ]
777 )
778])
779if test "x$ac_cv_have_mode_t" = "xyes" ; then
780 AC_DEFINE(HAVE_MODE_T)
781fi
782
Damien Miller61e50f12000-05-08 20:49:37 +1000783
784AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
785 AC_TRY_COMPILE(
786 [
Damien Miller81171112000-04-23 11:14:01 +1000787#include <sys/types.h>
788#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000789 ],
790 [ struct sockaddr_storage s; ],
791 [ ac_cv_have_struct_sockaddr_storage="yes" ],
792 [ ac_cv_have_struct_sockaddr_storage="no" ]
793 )
794])
795if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
796 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
797fi
Damien Miller34132e52000-01-14 15:45:46 +1100798
Damien Miller61e50f12000-05-08 20:49:37 +1000799AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
800 AC_TRY_COMPILE(
801 [
Damien Miller7b22d652000-06-18 14:07:04 +1000802#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000803#include <netinet/in.h>
804 ],
805 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
806 [ ac_cv_have_struct_sockaddr_in6="yes" ],
807 [ ac_cv_have_struct_sockaddr_in6="no" ]
808 )
809])
810if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
811 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
812fi
Damien Miller34132e52000-01-14 15:45:46 +1100813
Damien Miller61e50f12000-05-08 20:49:37 +1000814AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
815 AC_TRY_COMPILE(
816 [
Damien Miller7b22d652000-06-18 14:07:04 +1000817#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000818#include <netinet/in.h>
819 ],
820 [ struct in6_addr s; s.s6_addr[0] = 0; ],
821 [ ac_cv_have_struct_in6_addr="yes" ],
822 [ ac_cv_have_struct_in6_addr="no" ]
823 )
824])
825if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
826 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
827fi
Damien Miller34132e52000-01-14 15:45:46 +1100828
Damien Miller61e50f12000-05-08 20:49:37 +1000829AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
830 AC_TRY_COMPILE(
831 [
Damien Miller81171112000-04-23 11:14:01 +1000832#include <sys/types.h>
833#include <sys/socket.h>
834#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000835 ],
836 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
837 [ ac_cv_have_struct_addrinfo="yes" ],
838 [ ac_cv_have_struct_addrinfo="no" ]
839 )
840])
841if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
842 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
843fi
844
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000845AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
846 AC_TRY_COMPILE(
847 [ #include <sys/time.h> ],
848 [ struct timeval tv; tv.tv_sec = 1;],
849 [ ac_cv_have_struct_timeval="yes" ],
850 [ ac_cv_have_struct_timeval="no" ]
851 )
852])
853if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
854 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
855 have_struct_timeval=1
856fi
857
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000858# If we don't have int64_t then we can't compile sftp-server. So don't
859# even attempt to do it.
860if test "x$ac_cv_have_int64_t" = "xno" -a \
861 "x$ac_cv_sizeof_long_int" != "x8" -a \
862 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
863 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000864fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000865AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000866
Damien Miller78315eb2000-09-29 23:01:36 +1100867dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000868OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
869OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
870OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
871OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
872OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000873OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000874OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
875OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000876OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000877OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
878OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
879OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
880OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000881OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
882OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
883OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
884OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100885AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000886
Damien Miller942da032000-08-18 13:59:06 +1000887AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
888 ac_cv_have_sun_len_in_struct_sockaddr_un, [
889 AC_TRY_COMPILE(
890 [
891#include <sys/types.h>
892#include <sys/socket.h>
893 ],
894 [ struct sockaddr_un s; s.sun_len = 1; ],
895 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
896 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
897 )
898])
899if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
900 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
901fi
902
Damien Miller61e50f12000-05-08 20:49:37 +1000903AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
904 ac_cv_have_ss_family_in_struct_ss, [
905 AC_TRY_COMPILE(
906 [
Damien Miller81171112000-04-23 11:14:01 +1000907#include <sys/types.h>
908#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000909 ],
910 [ struct sockaddr_storage s; s.ss_family = 1; ],
911 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
912 [ ac_cv_have_ss_family_in_struct_ss="no" ],
913 )
914])
915if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
916 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
917fi
918
Damien Miller61e50f12000-05-08 20:49:37 +1000919AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
920 ac_cv_have___ss_family_in_struct_ss, [
921 AC_TRY_COMPILE(
922 [
Damien Miller81171112000-04-23 11:14:01 +1000923#include <sys/types.h>
924#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000925 ],
926 [ struct sockaddr_storage s; s.__ss_family = 1; ],
927 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
928 [ ac_cv_have___ss_family_in_struct_ss="no" ]
929 )
930])
931if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
932 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
933fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100934
Damien Millerad833b32000-08-23 10:46:23 +1000935AC_CACHE_CHECK([for pw_class field in struct passwd],
936 ac_cv_have_pw_class_in_struct_passwd, [
937 AC_TRY_COMPILE(
938 [
Damien Millerad833b32000-08-23 10:46:23 +1000939#include <pwd.h>
940 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000941 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000942 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
943 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
944 )
945])
946if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
947 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
948fi
949
Damien Miller61e50f12000-05-08 20:49:37 +1000950
951AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
952 AC_TRY_LINK([],
953 [ extern char *__progname; printf("%s", __progname); ],
954 [ ac_cv_libc_defines___progname="yes" ],
955 [ ac_cv_libc_defines___progname="no" ]
956 )
957])
958if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
959 AC_DEFINE(HAVE___PROGNAME)
960fi
961
Damien Millera22ba012000-03-02 23:09:20 +1100962
Damien Millerecbb26d2000-07-15 14:59:14 +1000963AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
964 AC_TRY_LINK([],
965 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
966 [ ac_cv_libc_defines_sys_errlist="yes" ],
967 [ ac_cv_libc_defines_sys_errlist="no" ]
968 )
969])
970if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
971 AC_DEFINE(HAVE_SYS_ERRLIST)
972fi
973
974
Damien Miller11fa2cc2000-08-16 10:35:58 +1000975AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
976 AC_TRY_LINK([],
977 [ extern int sys_nerr; printf("%i", sys_nerr);],
978 [ ac_cv_libc_defines_sys_nerr="yes" ],
979 [ ac_cv_libc_defines_sys_nerr="no" ]
980 )
981])
982if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
983 AC_DEFINE(HAVE_SYS_NERR)
984fi
985
986
Damien Millera22ba012000-03-02 23:09:20 +1100987# Looking for programs, paths and files
988AC_ARG_WITH(rsh,
989 [ --with-rsh=PATH Specify path to remote shell program ],
990 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100991 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000992 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100993 fi
994 ],
995 [
996 AC_PATH_PROG(rsh_path, rsh)
997 ]
998)
999
1000AC_ARG_WITH(xauth,
1001 [ --with-xauth=PATH Specify path to xauth program ],
1002 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001003 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001004 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001005 fi
1006 ],
1007 [
Damien Miller78315eb2000-09-29 23:01:36 +11001008 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 +10001009 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001010 xauth_path="/usr/openwin/bin/xauth"
1011 fi
1012 ]
1013)
1014
Damien Millera19cf472000-11-29 13:28:50 +11001015if test -z "$xauth_path" ; then
1016 XAUTH_PATH="undefined"
1017 AC_SUBST(XAUTH_PATH)
1018else
Damien Millera22ba012000-03-02 23:09:20 +11001019 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001020 XAUTH_PATH=$xauth_path
1021 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001022fi
1023if test ! -z "$rsh_path" ; then
1024 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1025fi
1026
1027# Check for mail directory (last resort if we cannot get it from headers)
1028if test ! -z "$MAIL" ; then
1029 maildir=`dirname $MAIL`
1030 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1031fi
1032
Damien Millera22ba012000-03-02 23:09:20 +11001033if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001034 AC_CHECK_FILE("/dev/ptmx",
1035 [
1036 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1037 have_dev_ptmx=1
1038 ]
1039 )
Damien Millera22ba012000-03-02 23:09:20 +11001040fi
Damien Miller204ad072000-03-02 23:56:12 +11001041AC_CHECK_FILE("/dev/ptc",
1042 [
1043 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1044 have_dev_ptc=1
1045 ]
1046)
1047
Damien Millera22ba012000-03-02 23:09:20 +11001048# Options from here on. Some of these are preset by platform above
1049
Damien Millera22ba012000-03-02 23:09:20 +11001050# Check for user-specified random device, otherwise check /dev/urandom
1051AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001052 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001053 [
Damien Miller040f3832000-04-03 14:50:43 +10001054 if test "x$withval" != "xno" ; then
1055 RANDOM_POOL="$withval";
1056 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1057 fi
Damien Millera22ba012000-03-02 23:09:20 +11001058 ],
1059 [
1060 # Check for random device
1061 AC_CHECK_FILE("/dev/urandom",
1062 [
1063 RANDOM_POOL="/dev/urandom";
1064 AC_SUBST(RANDOM_POOL)
1065 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1066 ]
1067 )
1068 ]
1069)
1070
1071# Check for EGD pool file
1072AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001073 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001074 [
Damien Miller040f3832000-04-03 14:50:43 +10001075 if test "x$withval" != "xno" ; then
1076 EGD_SOCKET="$withval";
1077 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1078 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001079 ],
1080 [
1081 # Check for existing socket only if we don't have a random device already
1082 if test -z "$RANDOM_POOL" ; then
1083 AC_MSG_CHECKING(for PRNGD/EGD socket)
1084 # Insert other locations here
Damien Miller4864e8f2001-02-08 10:07:08 +11001085 for egdsock in /var/run/egd-pool /etc/entropy /tmp/entropy ; do
1086 if $TEST_MINUS_S_SH -c "test -S $egdsock -o -p $egdsock" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001087 EGD_SOCKET="$egdsock"
1088 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001089 break;
1090 fi
1091 done
Damien Miller4864e8f2001-02-08 10:07:08 +11001092 if test -x "$EGD_SOCKET" ; then
1093 AC_MSG_RESULT($EGD_SOCKET)
1094 else
1095 AC_MSG_RESULT(not found)
1096 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001097 fi
Damien Millera22ba012000-03-02 23:09:20 +11001098 ]
1099)
1100
Damien Miller0736c4d2001-01-25 10:51:46 +11001101
Damien Miller0437b332000-05-02 09:56:41 +10001102# detect pathnames for entropy gathering commands, if we need them
1103INSTALL_SSH_PRNG_CMDS=""
1104rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001105if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001106 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001107 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1108 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1109 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1110 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1111 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1112 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1113 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1114 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1115 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1116 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1117 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1118 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1119 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1120 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001121
1122 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001123fi
Damien Miller0437b332000-05-02 09:56:41 +10001124AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1125
Damien Miller11e37f62000-04-08 18:23:30 +10001126
Damien Miller670a4b82000-01-22 13:53:11 +11001127AC_ARG_WITH(catman,
1128 [ --with-catman=man|cat Install preformatted manpages[no]],
1129 [
1130 MANTYPE='$(CATMAN)'
1131 if test x"$withval" != x"yes" ; then
1132 mansubdir=$withval
1133 else
1134 mansubdir=cat
1135 fi
1136 ], [
1137 if test -z "$MANTYPE" ; then
1138 MANTYPE='$(TROFFMAN)'
1139 mansubdir=man
1140 fi
1141 ]
1142)
1143AC_SUBST(MANTYPE)
1144AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001145
Damien Millera22ba012000-03-02 23:09:20 +11001146# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001147KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001148AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001149 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001150 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001151 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001152
Ben Lindstrom23e13712000-10-29 22:49:19 +00001153 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001154 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001155 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001156 if test ! -z "$need_dash_r" ; then
1157 LDFLAGS="$LDFLAGS -R${withval}/lib"
1158 fi
1159 if test ! -z "$blibpath" ; then
1160 blibpath="$blibpath:${withval}/lib"
1161 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001162 else
1163 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001164 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001165 fi
1166 fi
1167
1168 AC_CHECK_HEADERS(krb.h)
1169 AC_CHECK_LIB(krb, main)
1170 if test "$ac_cv_header_krb_h" != yes; then
1171 AC_MSG_WARN([Cannot find krb.h, build may fail])
1172 fi
1173 if test "$ac_cv_lib_krb_main" != yes; then
1174 AC_MSG_WARN([Cannot find libkrb, build may fail])
1175 fi
1176
Damien Millerc85f9b42000-01-29 10:20:21 +11001177 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001178 AC_CHECK_LIB(resolv, dn_expand, , )
1179 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001180 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001181 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001182 fi
Damien Miller80297751999-11-19 13:03:25 +11001183 ]
1184)
1185
Damien Millera22ba012000-03-02 23:09:20 +11001186# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001187AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001188AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001189 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001190 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001191 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001192
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001193 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001194 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001195 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001196 fi
1197
1198 if test -z "$KRB4" ; then
1199 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1200 fi
1201
Damien Miller8bdeee21999-12-30 15:50:54 +11001202 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001203 if test ! -z "$AFS_LIBS" ; then
1204 LIBS="$LIBS $AFS_LIBS"
1205 fi
1206 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001207 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001208 fi
Damien Miller80297751999-11-19 13:03:25 +11001209 ]
1210)
Damien Millerc85f9b42000-01-29 10:20:21 +11001211LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001212
Damien Millera22ba012000-03-02 23:09:20 +11001213# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001214SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001215AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001216 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001217 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001218 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001219
1220 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001221 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001222 LDFLAGS="$LDFLAGS -L${withval}/lib"
1223 fi
1224
Damien Miller8bdeee21999-12-30 15:50:54 +11001225 AC_DEFINE(SKEY)
Ben Lindstromb0c2eeb2001-02-03 22:15:00 +00001226 LIBS="-lskey $LIBS"
Damien Miller7b22d652000-06-18 14:07:04 +10001227 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001228
1229 AC_CHECK_FUNC(skey_keyinfo,
1230 [],
1231 [
1232 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1233 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001234 fi
Damien Miller80297751999-11-19 13:03:25 +11001235 ]
1236)
1237
Damien Millera22ba012000-03-02 23:09:20 +11001238# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001239TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001240AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001241 [ --with-tcp-wrappers Enable tcpwrappers support],
1242 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001243 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001244 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001245 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001246 AC_MSG_CHECKING(for libwrap)
1247 AC_TRY_LINK(
1248 [
Damien Miller81171112000-04-23 11:14:01 +10001249#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001250 int deny_severity = 0, allow_severity = 0;
1251 ],
1252 [hosts_access(0);],
1253 [
1254 AC_MSG_RESULT(yes)
1255 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001256 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001257 ],
1258 [
Damien Miller7b22d652000-06-18 14:07:04 +10001259 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001260 ]
1261 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001262 fi
Damien Miller80297751999-11-19 13:03:25 +11001263 ]
1264)
1265
Damien Millera22ba012000-03-02 23:09:20 +11001266# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001267MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001268AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001269 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001270 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001271 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001272 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001273 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001274 fi
1275 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001276)
1277
Damien Millera22ba012000-03-02 23:09:20 +11001278# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001279AC_ARG_WITH(shadow,
1280 [ --without-shadow Disable shadow password support],
1281 [
1282 if test "x$withval" = "xno" ; then
1283 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001284 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001285 fi
1286 ]
1287)
1288
Damien Miller1f335fb2000-06-26 11:31:33 +10001289if test -z "$disable_shadow" ; then
1290 AC_MSG_CHECKING([if the systems has expire shadow information])
1291 AC_TRY_COMPILE(
1292 [
1293#include <sys/types.h>
1294#include <shadow.h>
1295 struct spwd sp;
1296 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1297 [ sp_expire_available=yes ], []
1298 )
1299
1300 if test "x$sp_expire_available" = "xyes" ; then
1301 AC_MSG_RESULT(yes)
1302 AC_DEFINE(HAS_SHADOW_EXPIRE)
1303 else
1304 AC_MSG_RESULT(no)
1305 fi
1306fi
1307
Damien Millera22ba012000-03-02 23:09:20 +11001308# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001309if test ! -z "$IPADDR_IN_DISPLAY" ; then
1310 DISPLAY_HACK_MSG="yes"
1311 AC_DEFINE(IPADDR_IN_DISPLAY)
1312else
1313 DISPLAY_HACK_MSG="no"
1314 AC_ARG_WITH(ipaddr-display,
1315 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1316 [
1317 if test "x$withval" != "xno" ; then
1318 AC_DEFINE(IPADDR_IN_DISPLAY)
1319 DISPLAY_HACK_MSG="yes"
1320 fi
1321 ]
1322 )
1323fi
Damien Miller76112de1999-12-21 11:18:08 +11001324
Damien Millera22ba012000-03-02 23:09:20 +11001325# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001326SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001327AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001328 [ --with-default-path=PATH Specify default \$PATH environment for server],
1329 [
1330 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001331 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001332 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001333 fi
1334 ]
1335)
1336
Damien Millera22ba012000-03-02 23:09:20 +11001337# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001338IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001339AC_ARG_WITH(ipv4-default,
1340 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1341 [
1342 if test "x$withval" != "xno" ; then
1343 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001344 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001345 fi
1346 ]
1347)
1348
Damien Miller61e50f12000-05-08 20:49:37 +10001349AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001350IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001351AC_ARG_WITH(4in6,
1352 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1353 [
1354 if test "x$withval" != "xno" ; then
1355 AC_MSG_RESULT(yes)
1356 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001357 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001358 else
1359 AC_MSG_RESULT(no)
1360 fi
1361 ],[
1362 if test "x$inet6_default_4in6" = "xyes"; then
1363 AC_MSG_RESULT([yes (default)])
1364 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001365 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001366 else
1367 AC_MSG_RESULT([no (default)])
1368 fi
1369 ]
1370)
1371
Damien Miller78315eb2000-09-29 23:01:36 +11001372AC_MSG_CHECKING(whether to install ssh as suid root)
1373AC_ARG_ENABLE(suid-ssh,
1374[ --enable-suid-ssh Install ssh as suid root (default)
1375 --disable-suid-ssh Install ssh without suid bit],
1376[ case "$enableval" in
1377 no)
1378 AC_MSG_RESULT(no)
1379 SSHMODE=0711
1380 ;;
1381 *) AC_MSG_RESULT(yes)
1382 SSHMODE=04711
1383 ;;
1384 esac ],
1385 AC_MSG_RESULT(yes)
1386 SSHMODE=04711
1387)
1388AC_SUBST(SSHMODE)
1389
1390
Damien Millera22ba012000-03-02 23:09:20 +11001391# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001392piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001393AC_ARG_WITH(pid-dir,
1394 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1395 [
1396 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001397 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001398 fi
1399 ]
1400)
Damien Miller4018c192000-04-30 09:30:44 +10001401
Damien Miller78315eb2000-09-29 23:01:36 +11001402# make sure the directory exists
1403if test ! -d $piddir ; then
1404 piddir=`eval echo ${sysconfdir}`
1405 case $piddir in
1406 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1407 esac
1408fi
1409
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001410AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001411AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001412
andre2ff7b5d2000-06-03 14:57:40 +00001413dnl allow user to disable some login recording features
1414AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001415 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001416 [ AC_DEFINE(DISABLE_LASTLOG) ]
1417)
1418AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001419 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001420 [ AC_DEFINE(DISABLE_UTMP) ]
1421)
1422AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001423 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001424 [ AC_DEFINE(DISABLE_UTMPX) ]
1425)
1426AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001427 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001428 [ AC_DEFINE(DISABLE_WTMP) ]
1429)
1430AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001431 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001432 [ AC_DEFINE(DISABLE_WTMPX) ]
1433)
1434AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001435 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001436 [ AC_DEFINE(DISABLE_LOGIN) ]
1437)
1438AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001439 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001440 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1441)
1442AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001443 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001444 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1445)
1446AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001447 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001448 [
1449 if test "x$withval" = "xno" ; then
1450 AC_DEFINE(DISABLE_LASTLOG)
1451 else
1452 conf_lastlog_location=$withval
1453 fi
1454 ]
1455)
andre2ff7b5d2000-06-03 14:57:40 +00001456
1457dnl lastlog, [uw]tmpx? detection
1458dnl NOTE: set the paths in the platform section to avoid the
1459dnl need for command-line parameters
1460dnl lastlog and [uw]tmp are subject to a file search if all else fails
1461
1462dnl lastlog detection
1463dnl NOTE: the code itself will detect if lastlog is a directory
1464AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1465AC_TRY_COMPILE([
1466#include <sys/types.h>
1467#include <utmp.h>
1468#ifdef HAVE_LASTLOG_H
1469# include <lastlog.h>
1470#endif
Damien Miller2994e082000-06-04 15:51:47 +10001471#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001472# include <paths.h>
1473#endif
1474 ],
1475 [ char *lastlog = LASTLOG_FILE; ],
1476 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001477 [
1478 AC_MSG_RESULT(no)
1479 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1480 AC_TRY_COMPILE([
1481#include <sys/types.h>
1482#include <utmp.h>
1483#ifdef HAVE_LASTLOG_H
1484# include <lastlog.h>
1485#endif
1486#ifdef HAVE_PATHS_H
1487# include <paths.h>
1488#endif
1489 ],
1490 [ char *lastlog = _PATH_LASTLOG; ],
1491 [ AC_MSG_RESULT(yes) ],
1492 [
andree441aa32000-06-12 22:34:38 +00001493 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001494 system_lastlog_path=no
1495 ])
1496 ]
andre2ff7b5d2000-06-03 14:57:40 +00001497)
Damien Miller2994e082000-06-04 15:51:47 +10001498
andre2ff7b5d2000-06-03 14:57:40 +00001499if test -z "$conf_lastlog_location"; then
1500 if test x"$system_lastlog_path" = x"no" ; then
1501 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001502 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001503 conf_lastlog_location=$f
1504 fi
1505 done
1506 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001507 AC_MSG_WARN([** Cannot find lastlog **])
1508 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001509 fi
1510 fi
1511fi
1512
1513if test -n "$conf_lastlog_location"; then
1514 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1515fi
1516
1517dnl utmp detection
1518AC_MSG_CHECKING([if your system defines UTMP_FILE])
1519AC_TRY_COMPILE([
1520#include <sys/types.h>
1521#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001522#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001523# include <paths.h>
1524#endif
1525 ],
1526 [ char *utmp = UTMP_FILE; ],
1527 [ AC_MSG_RESULT(yes) ],
1528 [ AC_MSG_RESULT(no)
1529 system_utmp_path=no ]
1530)
1531if test -z "$conf_utmp_location"; then
1532 if test x"$system_utmp_path" = x"no" ; then
1533 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1534 if test -f $f ; then
1535 conf_utmp_location=$f
1536 fi
1537 done
1538 if test -z "$conf_utmp_location"; then
1539 AC_DEFINE(DISABLE_UTMP)
1540 fi
1541 fi
1542fi
1543if test -n "$conf_utmp_location"; then
1544 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1545fi
1546
1547dnl wtmp detection
1548AC_MSG_CHECKING([if your system defines WTMP_FILE])
1549AC_TRY_COMPILE([
1550#include <sys/types.h>
1551#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001552#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001553# include <paths.h>
1554#endif
1555 ],
1556 [ char *wtmp = WTMP_FILE; ],
1557 [ AC_MSG_RESULT(yes) ],
1558 [ AC_MSG_RESULT(no)
1559 system_wtmp_path=no ]
1560)
1561if test -z "$conf_wtmp_location"; then
1562 if test x"$system_wtmp_path" = x"no" ; then
1563 for f in /usr/adm/wtmp /var/log/wtmp; do
1564 if test -f $f ; then
1565 conf_wtmp_location=$f
1566 fi
1567 done
1568 if test -z "$conf_wtmp_location"; then
1569 AC_DEFINE(DISABLE_WTMP)
1570 fi
1571 fi
1572fi
1573if test -n "$conf_wtmp_location"; then
1574 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1575fi
1576
1577
1578dnl utmpx detection - I don't know any system so perverse as to require
1579dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1580dnl there, though.
1581AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1582AC_TRY_COMPILE([
1583#include <sys/types.h>
1584#include <utmp.h>
1585#ifdef HAVE_UTMPX_H
1586#include <utmpx.h>
1587#endif
Damien Miller2994e082000-06-04 15:51:47 +10001588#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001589# include <paths.h>
1590#endif
1591 ],
1592 [ char *utmpx = UTMPX_FILE; ],
1593 [ AC_MSG_RESULT(yes) ],
1594 [ AC_MSG_RESULT(no)
1595 system_utmpx_path=no ]
1596)
1597if test -z "$conf_utmpx_location"; then
1598 if test x"$system_utmpx_path" = x"no" ; then
1599 AC_DEFINE(DISABLE_UTMPX)
1600 fi
1601else
1602 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1603fi
1604
1605dnl wtmpx detection
1606AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1607AC_TRY_COMPILE([
1608#include <sys/types.h>
1609#include <utmp.h>
1610#ifdef HAVE_UTMPX_H
1611#include <utmpx.h>
1612#endif
Damien Miller2994e082000-06-04 15:51:47 +10001613#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001614# include <paths.h>
1615#endif
1616 ],
1617 [ char *wtmpx = WTMPX_FILE; ],
1618 [ AC_MSG_RESULT(yes) ],
1619 [ AC_MSG_RESULT(no)
1620 system_wtmpx_path=no ]
1621)
1622if test -z "$conf_wtmpx_location"; then
1623 if test x"$system_wtmpx_path" = x"no" ; then
1624 AC_DEFINE(DISABLE_WTMPX)
1625 fi
1626else
1627 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1628fi
1629
Damien Miller4018c192000-04-30 09:30:44 +10001630
1631# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001632entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001633AC_ARG_WITH(entropy-timeout,
1634 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1635 [
1636 if test "x$withval" != "xno" ; then
1637 entropy_timeout=$withval
1638 fi
1639 ]
1640)
1641AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1642
1643
Damien Miller29ea30d2000-03-17 10:54:15 +11001644if test ! -z "$blibpath" ; then
1645 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1646 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1647fi
1648
Damien Millerbac2d8a2000-09-05 16:13:06 +11001649AC_EXEEXT
1650
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001651AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001652
Damien Miller7b22d652000-06-18 14:07:04 +10001653# Print summary of options
1654
1655if test x$MANTYPE = x'$(CATMAN)' ; then
1656 MAN_MSG=cat
1657else
1658 MAN_MSG=man
1659fi
1660if test ! -z "$RANDOM_POOL" ; then
1661 RAND_MSG="Device ($RANDOM_POOL)"
1662else
1663 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001664 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001665 else
1666 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001667 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001668 fi
1669fi
1670
1671# Someone please show me a better way :)
1672A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1673B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1674C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1675D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001676E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001677F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1678G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1679
1680echo ""
1681echo "OpenSSH configured has been configured with the following options."
1682echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001683echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001684echo " System binaries: $C"
1685echo " Configuration files: $D"
1686echo " Askpass program: $E"
1687echo " Manual pages: $F"
1688echo " PID file: $G"
1689echo " Random number collection: $RAND_MSG"
1690echo " Manpage format: $MAN_MSG"
1691echo " PAM support: ${PAM_MSG}"
1692echo " KerberosIV support: $KRB4_MSG"
1693echo " AFS support: $AFS_MSG"
1694echo " S/KEY support: $SKEY_MSG"
1695echo " TCP Wrappers support: $TCPW_MSG"
1696echo " MD5 password support: $MD5_MSG"
1697echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1698echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1699echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1700
1701echo ""
1702
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001703echo " Host: ${host}"
1704echo " Compiler: ${CC}"
1705echo " Compiler flags: ${CFLAGS}"
1706echo "Preprocessor flags: ${CPPFLAGS}"
1707echo " Linker flags: ${LDFLAGS}"
1708echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001709
1710echo ""
1711
Damien Miller82cf0ce2000-12-20 13:34:48 +11001712if test "x$PAM_MSG" = "xyes" ; then
1713 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1714 echo "otherwise password authentication may fail. Example PAM control files"
1715 echo "can be found in the contrib/ subdirectory"
1716 echo ""
1717fi
1718
Damien Miller6f9c3372000-10-25 10:06:04 +11001719if test ! -z "$BUILTIN_RNG" ; then
1720 echo "WARNING: you are using the builtin random number collection service."
1721 echo "Please read WARNING.RNG and request that your OS vendor includes"
1722 echo "/dev/random in future versions of their OS."
1723 echo ""
1724fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001725
1726if test ! -z "$NO_SFTP"; then
1727 echo "sftp-server will be disabled. Your compiler does not support"
1728 echo "64bit integers."
1729 echo ""
1730fi