blob: 373089cd59b28ff57bcc559606b41283ba8cae11 [file] [log] [blame]
Ben Lindstrom95276712001-10-23 17:14:00 +00001# $Id: configure.in,v 1.316 2001/10/23 17:14:01 mouring Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110020AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110024
Damien Millere8bb4502001-09-25 16:39:35 +100025# System features
26AC_SYS_LARGEFILE
27
Damien Miller3f62aba2000-11-29 11:56:35 +110028if test -z "$AR" ; then
29 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
30fi
31
Damien Millerad833b32000-08-23 10:46:23 +100032# Use LOGIN_PROGRAM from environment if possible
33if test ! -z "$LOGIN_PROGRAM" ; then
34 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
35else
36 # Search for login
37 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
38 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
39 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
40 fi
41fi
42
Damien Miller166bd442000-03-16 10:48:25 +110043if test -z "$LD" ; then
44 LD=$CC
45fi
46AC_SUBST(LD)
47
Damien Miller166bd442000-03-16 10:48:25 +110048AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100049if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
50 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110051fi
52
Damien Millera22ba012000-03-02 23:09:20 +110053# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110054case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110055*-*-aix*)
56 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100059 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110060 blibpath="/usr/lib:/lib:/usr/local/lib"
61 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100062 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110063 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000064 dnl AIX handles lastlog as part of its login message
65 AC_DEFINE(DISABLE_LASTLOG)
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)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000070 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000074 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110075 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000076*-*-dgux*)
77 AC_DEFINE(IP_TOS_IS_BROKEN)
78 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000079*-*-darwin*)
80 AC_DEFINE(BROKEN_GETADDRINFO)
81 ;;
Damien Miller76112de1999-12-21 11:18:08 +110082*-*-hpux10*)
83 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100084 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110085 fi
Kevin Steves315f8b72001-06-28 00:24:41 +000086 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000091 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +000092 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110093 ;;
Damien Miller1bead332000-04-30 00:47:29 +100094*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +000095 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
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)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000102 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000103 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100104*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000105 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000106 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100107 PATH="$PATH:/usr/etc"
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 Miller91606b12000-06-28 08:22:29 +1000114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000118 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100119 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100120*-*-linux*)
121 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100122 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100123 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000124 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100126 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000127mips-sony-bsd|mips-sony-newsos4)
128 AC_DEFINE(HAVE_NEWS4)
129 SONY=1
130 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100131 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000132 )
133 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100134*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100135 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100136 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100137*-*-freebsd*)
138 check_for_libcrypt_later=1
139 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100142 conf_utmp_location=/etc/utmp
143 conf_wtmp_location=/usr/adm/wtmp
144 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000145 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000146 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000147 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100148 AC_DEFINE(BROKEN_SAVED_UIDS)
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"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000154 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
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)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
158 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000159 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000160 # hardwire lastlog location (can't detect it on some versions)
161 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000162 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
163 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
164 if test "$sol2ver" -ge 8; then
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(DISABLE_UTMP)
167 AC_DEFINE(DISABLE_WTMP)
168 else
169 AC_MSG_RESULT(no)
170 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100171 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000172*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000173 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000174 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100175 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100176 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000177 conf_utmp_location=/etc/utmp
178 conf_wtmp_location=/var/adm/wtmp
179 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000180 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000181 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000182*-ncr-sysv*)
183 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
184 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700185 LIBS="$LIBS -lc89"
Ben Lindstrom34328342001-04-23 22:39:42 +0000186 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000187 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000188*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000190 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100191 IPADDR_IN_DISPLAY=yes
192 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000193 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000194 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerb2dc28e2000-07-12 09:18:33 +1000195 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000196 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100197*-*-sysv4.2*)
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"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700200# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100201 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100202 ;;
203*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000204 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Ricea4f7ae12001-09-17 14:34:33 -0700206# enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100207 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100208 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100209*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000210 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100212 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100213*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000214 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700216 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100217 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100218 RANLIB=true
219 no_dev_ptmx=1
220 AC_DEFINE(BROKEN_SYS_TERMIO_H)
221 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100222 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 Millerfbd884a2001-02-27 08:39:07 +1100225 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100226 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700227 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700228 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100229 ;;
230*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000231 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000232 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100233 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000234 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100235 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100236 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100237 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000238 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000239 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100240 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700241 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000242 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000243*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700244 no_libsocket=1
245 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000246 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700247 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
248 LIBS="$LIBS -lgen -lrsc"
249 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000250*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000251 AC_MSG_CHECKING(for Digital Unix SIA)
252 no_osfsia=""
253 AC_ARG_WITH(osfsia,
254 [ --with-osfsia Enable Digital Unix SIA],
255 [
256 if test "x$withval" = "xno" ; then
257 AC_MSG_RESULT(disabled)
258 no_osfsia=1
259 fi
260 ],
261 )
262 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000263 if test -f /etc/sia/matrix.conf; then
264 AC_MSG_RESULT(yes)
265 AC_DEFINE(HAVE_OSF_SIA)
266 AC_DEFINE(DISABLE_LOGIN)
267 LIBS="$LIBS -lsecurity -ldb -lm -laud"
268 else
269 AC_MSG_RESULT(no)
270 fi
271 fi
272 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000273
274*-*-nto-qnx)
275 AC_DEFINE(USE_PIPES)
276 AC_DEFINE(NO_X11_UNIX_SOCKETS)
277 AC_DEFINE(MISSING_NFDBITS)
278 AC_DEFINE(MISSING_HOWMANY)
279 AC_DEFINE(MISSING_FD_MASK)
280 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100281esac
282
Damien Millere37bfc12000-06-05 09:37:43 +1000283# Allow user to specify flags
284AC_ARG_WITH(cflags,
285 [ --with-cflags Specify additional flags to pass to compiler],
286 [
287 if test "x$withval" != "xno" ; then
288 CFLAGS="$CFLAGS $withval"
289 fi
290 ]
291)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000292AC_ARG_WITH(cppflags,
293 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
294 [
295 if test "x$withval" != "xno"; then
296 CPPFLAGS="$CPPFLAGS $withval"
297 fi
298 ]
299)
Damien Millere37bfc12000-06-05 09:37:43 +1000300AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000301 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000302 [
303 if test "x$withval" != "xno" ; then
304 LDFLAGS="$LDFLAGS $withval"
305 fi
306 ]
307)
308AC_ARG_WITH(libs,
309 [ --with-libs Specify additional libraries to link with],
310 [
311 if test "x$withval" != "xno" ; then
312 LIBS="$LIBS $withval"
313 fi
314 ]
315)
316
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000317AC_ARG_WITH(pcre,
Tim Rice13aae5e2001-10-21 17:53:58 -0700318 [ --with-pcre[[=PATH]] Override built in regex library with pcre
319 (optionally in PATH)],
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000320 [
Tim Rice13aae5e2001-10-21 17:53:58 -0700321 case "$withval" in
322 no) ;;
323 *)
324 if test "x$withval" != "xyes"; then
325 if test -d "$withval/lib"; then
326 if test -n "${need_dash_r}"; then
327 LDFLAGS="${LDFLAGS} -L$withval/lib -R$withval/lib"
328 else
329 LDFLAGS="${LDFLAGS} -L$withval/lib"
330 fi
331 else
332 if test -n "${need_dash_r}"; then
333 LDFLAGS="${LDFLAGS} -L$withval -R$withval"
334 else
335 LDFLAGS="${LDFLAGS} -L$withval"
336 fi
337 fi
338 if test -d "$withval/include"; then
339 CPPFLAGS="${CPPFLAGS} -I$withval/include"
340 else
341 CPPFLAGS="${CPPFLAGS} -I$withval"
342 fi
343 fi
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000344
Tim Rice13aae5e2001-10-21 17:53:58 -0700345 AC_CHECK_HEADER(pcreposix.h,
346 AC_CHECK_LIB(pcre, pcre_info,[
347 AC_DEFINE(HAVE_LIBPCRE)
348 LIBS="$LIBS -lpcreposix -lpcre"
349 no_comp_check=yes],
350 AC_MSG_ERROR([*** unable to locate pcre library ***])),
351 AC_MSG_ERROR([*** unable to locate pcreposix.h include file ***]))
352 ;;
353 esac
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000354 ]
355)
Damien Millere37bfc12000-06-05 09:37:43 +1000356
Damien Millera22ba012000-03-02 23:09:20 +1100357# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700358AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
359AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000360
Damien Millerdf288022001-02-18 13:07:07 +1100361dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700362if test "x$with_tcp_wrappers" != "xno" ; then
363 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
364 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
365 fi
366fi
Damien Millerdf288022001-02-18 13:07:07 +1100367
Tim Rice13aae5e2001-10-21 17:53:58 -0700368AC_CHECK_FUNC(getspnam, ,
369 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
370AC_CHECK_FUNC(login, ,
371 AC_CHECK_LIB(util, login,
372 AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil"))
373
374dnl zlib is required
375AC_ARG_WITH(zlib,
376 [ --with-zlib=PATH Use zlib in PATH],
377 [
378 if test -d "$withval/lib"; then
379 if test -n "${need_dash_r}"; then
380 LDFLAGS="${LDFLAGS} -L$withval/lib -R$withval/lib"
381 else
382 LDFLAGS="${LDFLAGS} -L$withval/lib"
383 fi
384 else
385 if test -n "${need_dash_r}"; then
386 LDFLAGS="${LDFLAGS} -L$withval -R$withval"
387 else
388 LDFLAGS="${LDFLAGS} -L$withval"
389 fi
390 fi
391 if test -d "$withval/include"; then
392 CPPFLAGS="${CPPFLAGS} -I$withval/include"
393 else
394 CPPFLAGS="${CPPFLAGS} -I$withval"
395 fi
396 ]
397)
398
399AC_CHECK_HEADER(zlib.h,
400 AC_CHECK_LIB(z, gzread, ,
401 AC_MSG_ERROR([*** zlib missing. install first or check config.log ***])),
402 AC_MSG_ERROR([*** zlib missing. install first or check config.log ***]))
403
Damien Miller6f9c3372000-10-25 10:06:04 +1100404
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000405# We don't want to check if we did an pcre override.
406if test -z "$no_comp_check" ; then
407 AC_CHECK_FUNC(regcomp,
408 [ AC_DEFINE(HAVE_REGCOMP)],
409 [
410 AC_CHECK_LIB(pcre, pcre_info,
411 [
412 AC_DEFINE(HAVE_LIBPCRE)
413 LIBS="$LIBS -lpcreposix -lpcre"
414 ],
415 [
416 AC_MSG_ERROR([*** No regex library found.])
417 ])
418 ]
419 )
420fi
Damien Millerab18c411999-11-11 10:40:23 +1100421
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000422dnl UnixWare 2.x
423AC_CHECK_FUNC(strcasecmp,
424 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
425)
426AC_CHECK_FUNC(utimes,
427 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
428)
Damien Millerab18c411999-11-11 10:40:23 +1100429
Ben Lindstrom8697e082001-02-24 21:41:10 +0000430AC_FUNC_STRFTIME
431
Damien Millera22ba012000-03-02 23:09:20 +1100432# Checks for header files.
Tim Rice13aae5e2001-10-21 17:53:58 -0700433AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
434 getopt.h glob.h lastlog.h libgen.h limits.h login.h \
435 login_cap.h maillock.h netdb.h netgroup.h \
436 netinet/in_systm.h paths.h poll.h pty.h regex.h \
437 security/pam_appl.h shadow.h stddef.h stdint.h \
438 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
439 sys/poll.h sys/queue.h sys/select.h sys/stat.h \
440 sys/stropts.h sys/sysmacros.h sys/time.h \
441 sys/ttcompat.h sys/un.h time.h ttyent.h usersec.h \
442 util.h utime.h utmp.h utmpx.h)
Damien Miller3c027682001-03-14 11:39:45 +1100443
444# Check for ALTDIRFUNC glob() extension
445AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
446AC_EGREP_CPP(FOUNDIT,
447 [
448 #include <glob.h>
449 #ifdef GLOB_ALTDIRFUNC
450 FOUNDIT
451 #endif
452 ],
453 [
454 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
455 AC_MSG_RESULT(yes)
456 ],
457 [
458 AC_MSG_RESULT(no)
459 ]
460)
Damien Millerab18c411999-11-11 10:40:23 +1100461
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000462# Check for g.gl_matchc glob() extension
463AC_MSG_CHECKING(for gl_matchc field in glob_t)
464AC_EGREP_CPP(FOUNDIT,
465 [
466 #include <glob.h>
467 int main(void){glob_t g; g.gl_matchc = 1;}
468 ],
469 [
470 AC_DEFINE(GLOB_HAS_GL_MATCHC)
471 AC_MSG_RESULT(yes)
472 ],
473 [
474 AC_MSG_RESULT(no)
475 ]
476)
477
Damien Miller18bb4732001-03-28 14:35:30 +1000478AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
479AC_TRY_RUN(
480 [
481#include <sys/types.h>
482#include <dirent.h>
483int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
484 ],
485 [AC_MSG_RESULT(yes)],
486 [
487 AC_MSG_RESULT(no)
488 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
489 ]
490)
491
Damien Millerc547bf12001-02-16 10:18:12 +1100492# Check whether user wants S/Key support
493SKEY_MSG="no"
494AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700495 [ --with-skey[[=PATH]] Enable S/Key support
496 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100497 [
498 if test "x$withval" != "xno" ; then
499
500 if test "x$withval" != "xyes" ; then
501 CPPFLAGS="$CPPFLAGS -I${withval}/include"
502 LDFLAGS="$LDFLAGS -L${withval}/lib"
503 fi
504
505 AC_DEFINE(SKEY)
506 LIBS="-lskey $LIBS"
507 SKEY_MSG="yes"
508
509 AC_CHECK_FUNC(skey_keyinfo,
510 [],
511 [
512 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
513 ])
514 fi
515 ]
516)
517
518# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700519TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100520AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700521 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
522 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100523 [
524 if test "x$withval" != "xno" ; then
525 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700526 saved_LDFLAGS="$LDFLAGS"
527 saved_CPPFLAGS="$CPPFLAGS"
528 if test -n "${withval}" -a "${withval}" != "yes"; then
529 if test -d "${withval}/lib"; then
530 if test -n "${need_dash_r}"; then
531 LDFLAGS="$LDFLAGS -L${withval}/lib -R${withval}/lib"
532 else
533 LDFLAGS="$LDFLAGS -L${withval}/lib"
534 fi
535 else
536 if test -n "${need_dash_r}"; then
537 LDFLAGS="$LDFLAGS -L${withval} -R${withval}"
538 else
539 LDFLAGS="$LDFLAGS -L${withval}"
540 fi
541 fi
542 if test -d "${withval}/include"; then
543 CPPFLAGS="$CPPFLAGS -I${withval}/include"
544 else
545 CPPFLAGS="$CPPFLAGS -I${withval}"
546 fi
547 TCPW_MSG="yes"
548 fi
Damien Millerc547bf12001-02-16 10:18:12 +1100549 LIBS="-lwrap $LIBS"
550 AC_MSG_CHECKING(for libwrap)
551 AC_TRY_LINK(
552 [
553#include <tcpd.h>
554 int deny_severity = 0, allow_severity = 0;
555 ],
556 [hosts_access(0);],
557 [
558 AC_MSG_RESULT(yes)
559 AC_DEFINE(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700560 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100561 ],
562 [
563 AC_MSG_ERROR([*** libwrap missing])
564 ]
565 )
566 fi
567 ]
568)
569
Damien Millerad833b32000-08-23 10:46:23 +1000570dnl Checks for library functions.
Tim Rice13aae5e2001-10-21 17:53:58 -0700571AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa \
572 clock fchmod fchown freeaddrinfo futimes gai_strerror \
573 getaddrinfo getcwd getgrouplist getnameinfo getopt \
574 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
575 inet_ntop innetgr login_getcapbool md5_crypt memmove \
576 mkdtemp on_exit openpty readpassphrase realpath \
577 rresvport_af setdtablesize setegid setenv seteuid \
578 setlogin setproctitle setresgid setreuid setrlimit \
579 setsid setvbuf sigaction sigvec snprintf strerror \
580 strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \
581 vhangup vsnprintf waitpid __b64_ntop _getpty)
582
583dnl IRIX and Solaris 2.5.1 have dirname() in libgen
584AC_CHECK_FUNCS(dirname, ,[
585 AC_CHECK_LIB(gen, dirname,[
586 AC_CACHE_CHECK([for broken dirname],
587 ac_cv_have_broken_dirname, [
588 AC_TRY_RUN(
589 [
590#include <libgen.h>
591#include <string.h>
592
593int main(int argc, char **argv) {
594 char *s, buf[32];
595
596 strncpy(buf,"/etc", 32);
597 s = dirname(buf);
598 if (s && s[0] == '\0') {
599 exit(1);
600 } else {
601 exit(0);
602 }
603}
604 ],
605 [ ac_cv_have_broken_dirname="no" ],
606 [ ac_cv_have_broken_dirname="yes" ]
607 )
608 ])
609 if test "x$ac_cv_have_getopt_optreset" = "xno" ; then
610 LIBS="$LIBS -lgen"
611 AC_DEFINE(HAVE_DIRNAME)
612 fi
613 ])
614])
615
Damien Millerad833b32000-08-23 10:46:23 +1000616dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000617AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000618dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000619AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000620AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000621dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000622AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000623AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000624dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000625AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000626AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100627
Damien Miller5fc85652000-07-09 23:53:07 +1000628AC_CHECK_FUNC(getuserattr,
629 [AC_DEFINE(HAVE_GETUSERATTR)],
630 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
631)
632
Damien Miller04f80141999-11-19 15:32:34 +1100633AC_CHECK_FUNC(login,
634 [AC_DEFINE(HAVE_LOGIN)],
635 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
636)
637
638AC_CHECK_FUNC(daemon,
639 [AC_DEFINE(HAVE_DAEMON)],
640 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
641)
642
Damien Miller9fb07e42000-03-05 16:22:59 +1100643AC_CHECK_FUNC(getpagesize,
644 [AC_DEFINE(HAVE_GETPAGESIZE)],
645 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
646)
647
Damien Millercb170cb2000-07-01 16:52:55 +1000648# Check for broken snprintf
649if test "x$ac_cv_func_snprintf" = "xyes" ; then
650 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
651 AC_TRY_RUN(
652 [
653#include <stdio.h>
654int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
655 ],
656 [AC_MSG_RESULT(yes)],
657 [
658 AC_MSG_RESULT(no)
659 AC_DEFINE(BROKEN_SNPRINTF)
660 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
661 ]
662 )
663fi
664
Damien Miller606f8802000-09-16 15:39:56 +1100665AC_FUNC_GETPGRP
666
Damien Millera64b57a2001-01-17 10:44:13 +1100667# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000668PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100669AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100670 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100671 [
Damien Millera64b57a2001-01-17 10:44:13 +1100672 if test "x$withval" != "xno" ; then
673 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
674 AC_MSG_ERROR([PAM headers not found])
675 fi
676
677 AC_CHECK_LIB(dl, dlopen, , )
678 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
679 AC_CHECK_FUNCS(pam_getenvlist)
680
681 disable_shadow=yes
682 PAM_MSG="yes"
683
684 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100685 fi
686 ]
687)
Damien Millera22ba012000-03-02 23:09:20 +1100688
Damien Millera64b57a2001-01-17 10:44:13 +1100689# Check for older PAM
690if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100691 # Check PAM strerror arguments (old PAM)
692 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
693 AC_TRY_COMPILE(
694 [
Damien Miller81171112000-04-23 11:14:01 +1000695#include <stdlib.h>
696#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100697 ],
698 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
699 [AC_MSG_RESULT(no)],
700 [
701 AC_DEFINE(HAVE_OLD_PAM)
702 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000703 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100704 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100705 )
Damien Millera22ba012000-03-02 23:09:20 +1100706fi
707
708# The big search for OpenSSL
709AC_ARG_WITH(ssl-dir,
710 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
711 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000712 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100713 tryssldir=$withval
714 fi
715 ]
716)
717
718saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100719saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000720saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100721if test "x$prefix" != "xNONE" ; then
722 tryssldir="$tryssldir $prefix"
723fi
Damien Miller61e50f12000-05-08 20:49:37 +1000724AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100725 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
Damien Millerccdefb62001-02-19 12:56:39 +1100726 CPPFLAGS="$saved_CPPFLAGS"
727 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000728 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100729
730 # Skip directories if they don't exist
731 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
732 continue;
733 fi
734 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
735 # Try to use $ssldir/lib if it exists, otherwise
736 # $ssldir
737 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000738 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100739 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000740 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100741 fi
742 else
Damien Millerb68af622001-03-28 21:05:26 +1000743 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100744 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000745 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100746 fi
747 fi
748 # Try to use $ssldir/include if it exists, otherwise
749 # $ssldir
750 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000751 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100752 else
Damien Millerb68af622001-03-28 21:05:26 +1000753 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100754 fi
755 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000756
Damien Miller3b512e12000-05-17 23:29:18 +1000757 # Basic test to check for compatible version and correct linking
758 # *does not* test for RSA - that comes later.
759 AC_TRY_RUN(
760 [
Damien Millere59ce622000-05-01 20:54:17 +1000761#include <string.h>
762#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000763int main(void)
764{
Damien Miller3b512e12000-05-17 23:29:18 +1000765 char a[2048];
766 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000767 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000768 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000769}
Damien Miller3b512e12000-05-17 23:29:18 +1000770 ],
771 [
772 found_crypto=1
773 break;
774 ], []
775 )
Damien Miller61e50f12000-05-08 20:49:37 +1000776
777 if test ! -z "$found_crypto" ; then
778 break;
779 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100780 done
781
Damien Miller61e50f12000-05-08 20:49:37 +1000782 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100783 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100784 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000785 if test -z "$ssldir" ; then
786 ssldir="(system)"
787 fi
Damien Millera22ba012000-03-02 23:09:20 +1100788
Damien Miller61e50f12000-05-08 20:49:37 +1000789 ac_cv_openssldir=$ssldir
790])
791
Damien Milleredb82922000-06-20 13:25:52 +1000792if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000793 AC_DEFINE(HAVE_OPENSSL)
794 dnl Need to recover ssldir - test above runs in subshell
795 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100796 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100797 # Try to use $ssldir/lib if it exists, otherwise
798 # $ssldir
799 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000800 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100801 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000802 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100803 fi
804 else
Damien Millerb68af622001-03-28 21:05:26 +1000805 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100806 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000807 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100808 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100809 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100810 # Try to use $ssldir/include if it exists, otherwise
811 # $ssldir
812 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000813 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100814 else
Damien Millerb68af622001-03-28 21:05:26 +1000815 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100816 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100817 fi
Damien Millera22ba012000-03-02 23:09:20 +1100818fi
Damien Miller3b512e12000-05-17 23:29:18 +1000819LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000820
Damien Miller3b512e12000-05-17 23:29:18 +1000821# Now test RSA support
822saved_LIBS="$LIBS"
823AC_MSG_CHECKING([for RSA support])
824for WANTS_RSAREF in "" 1 ; do
825 if test -z "$WANTS_RSAREF" ; then
826 LIBS="$saved_LIBS"
827 else
828 LIBS="$saved_LIBS -lRSAglue -lrsaref"
829 fi
830 AC_TRY_RUN([
831#include <string.h>
832#include <openssl/rand.h>
833#include <openssl/rsa.h>
834#include <openssl/bn.h>
835#include <openssl/sha.h>
836int main(void)
837{
838 int num; RSA *key; static unsigned char p_in[] = "blahblah";
839 unsigned char c[256], p[256];
840 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
841 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
842 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
843 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
844}
845 ],
846 [
847 rsa_works=1
848 break;
849 ], [])
850done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000851LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000852
853if test ! -z "$no_rsa" ; then
854 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000855 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000856else
857 if test -z "$rsa_works" ; then
858 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000859 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000860 else
861 if test -z "$WANTS_RSAREF" ; then
862 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000863 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000864 else
Damien Miller7b22d652000-06-18 14:07:04 +1000865 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000866 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000867 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000868 fi
869 fi
870fi
Damien Millera22ba012000-03-02 23:09:20 +1100871
Damien Millera64b57a2001-01-17 10:44:13 +1100872# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
873# version in OpenSSL. Skip this for PAM
874if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100875 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100876fi
877
Ben Lindstromb5628642000-10-18 00:02:25 +0000878# Cheap hack to ensure NEWS-OS libraries are arranged right.
879if test ! -z "$SONY" ; then
880 LIBS="$LIBS -liberty";
881fi
882
Damien Millera22ba012000-03-02 23:09:20 +1100883# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100884AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100885AC_CHECK_SIZEOF(short int, 2)
886AC_CHECK_SIZEOF(int, 4)
887AC_CHECK_SIZEOF(long int, 4)
888AC_CHECK_SIZEOF(long long int, 8)
889
Damien Millera22ba012000-03-02 23:09:20 +1100890# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100891AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
892 AC_TRY_COMPILE(
893 [ #include <sys/types.h> ],
894 [ u_int a; a = 1;],
895 [ ac_cv_have_u_int="yes" ],
896 [ ac_cv_have_u_int="no" ]
897 )
898])
899if test "x$ac_cv_have_u_int" = "xyes" ; then
900 AC_DEFINE(HAVE_U_INT)
901 have_u_int=1
902fi
903
Damien Miller61e50f12000-05-08 20:49:37 +1000904AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
905 AC_TRY_COMPILE(
906 [ #include <sys/types.h> ],
907 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
908 [ ac_cv_have_intxx_t="yes" ],
909 [ ac_cv_have_intxx_t="no" ]
910 )
911])
912if test "x$ac_cv_have_intxx_t" = "xyes" ; then
913 AC_DEFINE(HAVE_INTXX_T)
914 have_intxx_t=1
915fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000916
917if (test -z "$have_intxx_t" && \
918 test "x$ac_cv_header_stdint_h" = "xyes")
919then
920 AC_MSG_CHECKING([for intXX_t types in stdint.h])
921 AC_TRY_COMPILE(
922 [ #include <stdint.h> ],
923 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
924 [
925 AC_DEFINE(HAVE_INTXX_T)
926 AC_MSG_RESULT(yes)
927 ],
928 [ AC_MSG_RESULT(no) ]
929 )
930fi
931
Damien Miller578783e2000-09-23 14:12:24 +1100932AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
933 AC_TRY_COMPILE(
934 [ #include <sys/types.h> ],
935 [ int64_t a; a = 1;],
936 [ ac_cv_have_int64_t="yes" ],
937 [ ac_cv_have_int64_t="no" ]
938 )
939])
940if test "x$ac_cv_have_int64_t" = "xyes" ; then
941 AC_DEFINE(HAVE_INT64_T)
942 have_int64_t=1
943fi
944
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000945if test -z "$have_int64_t" ; then
946 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
947 AC_TRY_COMPILE(
948 [ #include <sys/socket.h> ],
949 [ int64_t a; a = 1],
950 [
951 AC_DEFINE(HAVE_INT64_T)
952 AC_MSG_RESULT(yes)
953 ],
954 [ AC_MSG_RESULT(no) ]
955 )
956fi
957
Damien Miller61e50f12000-05-08 20:49:37 +1000958AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
959 AC_TRY_COMPILE(
960 [ #include <sys/types.h> ],
961 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
962 [ ac_cv_have_u_intxx_t="yes" ],
963 [ ac_cv_have_u_intxx_t="no" ]
964 )
965])
966if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
967 AC_DEFINE(HAVE_U_INTXX_T)
968 have_u_intxx_t=1
969fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100970
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000971if test -z "$have_u_intxx_t" ; then
972 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
973 AC_TRY_COMPILE(
974 [ #include <sys/socket.h> ],
975 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
976 [
977 AC_DEFINE(HAVE_U_INTXX_T)
978 AC_MSG_RESULT(yes)
979 ],
980 [ AC_MSG_RESULT(no) ]
981 )
982fi
983
Damien Miller578783e2000-09-23 14:12:24 +1100984AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
985 AC_TRY_COMPILE(
986 [ #include <sys/types.h> ],
987 [ u_int64_t a; a = 1;],
988 [ ac_cv_have_u_int64_t="yes" ],
989 [ ac_cv_have_u_int64_t="no" ]
990 )
991])
992if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
993 AC_DEFINE(HAVE_U_INT64_T)
994 have_u_int64_t=1
995fi
996
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000997if test -z "$have_u_intxx_t" ; then
998 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
999 AC_TRY_COMPILE(
1000 [
1001#include <sys/types.h>
1002 ],
1003 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1004 [ ac_cv_have_uintxx_t="yes" ],
1005 [ ac_cv_have_uintxx_t="no" ]
1006 )
1007 ])
1008 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1009 AC_DEFINE(HAVE_UINTXX_T)
1010 fi
1011fi
1012
1013if test -z "$have_uintxx_t" ; then
1014 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1015 AC_TRY_COMPILE(
1016 [ #include <stdint.h> ],
1017 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1018 [
1019 AC_DEFINE(HAVE_UINTXX_T)
1020 AC_MSG_RESULT(yes)
1021 ],
1022 [ AC_MSG_RESULT(no) ]
1023 )
1024fi
1025
Damien Milleredb82922000-06-20 13:25:52 +10001026if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1027 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001028then
1029 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1030 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001031 [
1032#include <sys/bitypes.h>
1033 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001034 [
Damien Miller70494d12000-04-03 15:57:06 +10001035 int8_t a; int16_t b; int32_t c;
1036 u_int8_t e; u_int16_t f; u_int32_t g;
1037 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001038 ],
1039 [
1040 AC_DEFINE(HAVE_U_INTXX_T)
1041 AC_DEFINE(HAVE_INTXX_T)
1042 AC_MSG_RESULT(yes)
1043 ],
1044 [AC_MSG_RESULT(no)]
1045 )
1046fi
1047
Damien Miller58be7382001-09-15 21:31:54 +10001048
1049AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1050 AC_TRY_COMPILE(
1051 [
1052#include <sys/types.h>
1053 ],
1054 [ u_char foo; foo = 125; ],
1055 [ ac_cv_have_u_char="yes" ],
1056 [ ac_cv_have_u_char="no" ]
1057 )
1058])
1059if test "x$ac_cv_have_u_char" = "xyes" ; then
1060 AC_DEFINE(HAVE_U_CHAR)
1061fi
1062
Tim Rice13aae5e2001-10-21 17:53:58 -07001063TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001064
Damien Miller61e50f12000-05-08 20:49:37 +10001065AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1066 AC_TRY_COMPILE(
1067 [
1068#include <sys/types.h>
1069 ],
1070 [ size_t foo; foo = 1235; ],
1071 [ ac_cv_have_size_t="yes" ],
1072 [ ac_cv_have_size_t="no" ]
1073 )
1074])
1075if test "x$ac_cv_have_size_t" = "xyes" ; then
1076 AC_DEFINE(HAVE_SIZE_T)
1077fi
Damien Miller95058511999-12-29 10:36:45 +11001078
Damien Miller615f9392000-05-17 22:53:33 +10001079AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1080 AC_TRY_COMPILE(
1081 [
1082#include <sys/types.h>
1083 ],
1084 [ ssize_t foo; foo = 1235; ],
1085 [ ac_cv_have_ssize_t="yes" ],
1086 [ ac_cv_have_ssize_t="no" ]
1087 )
1088])
1089if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1090 AC_DEFINE(HAVE_SSIZE_T)
1091fi
1092
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001093AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1094 AC_TRY_COMPILE(
1095 [
1096#include <time.h>
1097 ],
1098 [ clock_t foo; foo = 1235; ],
1099 [ ac_cv_have_clock_t="yes" ],
1100 [ ac_cv_have_clock_t="no" ]
1101 )
1102])
1103if test "x$ac_cv_have_clock_t" = "xyes" ; then
1104 AC_DEFINE(HAVE_CLOCK_T)
1105fi
1106
Damien Millerb54b40e2000-06-23 08:23:34 +10001107AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1108 AC_TRY_COMPILE(
1109 [
1110#include <sys/types.h>
1111#include <sys/socket.h>
1112 ],
1113 [ sa_family_t foo; foo = 1235; ],
1114 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001115 [ AC_TRY_COMPILE(
1116 [
1117#include <sys/types.h>
1118#include <sys/socket.h>
1119#include <netinet/in.h>
1120 ],
1121 [ sa_family_t foo; foo = 1235; ],
1122 [ ac_cv_have_sa_family_t="yes" ],
1123
Damien Millerb54b40e2000-06-23 08:23:34 +10001124 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001125 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001126 )
1127])
1128if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1129 AC_DEFINE(HAVE_SA_FAMILY_T)
1130fi
1131
Damien Miller0f91b4e2000-06-18 15:43:25 +10001132AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1133 AC_TRY_COMPILE(
1134 [
1135#include <sys/types.h>
1136 ],
1137 [ pid_t foo; foo = 1235; ],
1138 [ ac_cv_have_pid_t="yes" ],
1139 [ ac_cv_have_pid_t="no" ]
1140 )
1141])
1142if test "x$ac_cv_have_pid_t" = "xyes" ; then
1143 AC_DEFINE(HAVE_PID_T)
1144fi
1145
1146AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1147 AC_TRY_COMPILE(
1148 [
1149#include <sys/types.h>
1150 ],
1151 [ mode_t foo; foo = 1235; ],
1152 [ ac_cv_have_mode_t="yes" ],
1153 [ ac_cv_have_mode_t="no" ]
1154 )
1155])
1156if test "x$ac_cv_have_mode_t" = "xyes" ; then
1157 AC_DEFINE(HAVE_MODE_T)
1158fi
1159
Damien Miller61e50f12000-05-08 20:49:37 +10001160
1161AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1162 AC_TRY_COMPILE(
1163 [
Damien Miller81171112000-04-23 11:14:01 +10001164#include <sys/types.h>
1165#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001166 ],
1167 [ struct sockaddr_storage s; ],
1168 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1169 [ ac_cv_have_struct_sockaddr_storage="no" ]
1170 )
1171])
1172if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1173 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1174fi
Damien Miller34132e52000-01-14 15:45:46 +11001175
Damien Miller61e50f12000-05-08 20:49:37 +10001176AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1177 AC_TRY_COMPILE(
1178 [
Damien Miller7b22d652000-06-18 14:07:04 +10001179#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001180#include <netinet/in.h>
1181 ],
1182 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1183 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1184 [ ac_cv_have_struct_sockaddr_in6="no" ]
1185 )
1186])
1187if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1188 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1189fi
Damien Miller34132e52000-01-14 15:45:46 +11001190
Damien Miller61e50f12000-05-08 20:49:37 +10001191AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1192 AC_TRY_COMPILE(
1193 [
Damien Miller7b22d652000-06-18 14:07:04 +10001194#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001195#include <netinet/in.h>
1196 ],
1197 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1198 [ ac_cv_have_struct_in6_addr="yes" ],
1199 [ ac_cv_have_struct_in6_addr="no" ]
1200 )
1201])
1202if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1203 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1204fi
Damien Miller34132e52000-01-14 15:45:46 +11001205
Damien Miller61e50f12000-05-08 20:49:37 +10001206AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1207 AC_TRY_COMPILE(
1208 [
Damien Miller81171112000-04-23 11:14:01 +10001209#include <sys/types.h>
1210#include <sys/socket.h>
1211#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001212 ],
1213 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1214 [ ac_cv_have_struct_addrinfo="yes" ],
1215 [ ac_cv_have_struct_addrinfo="no" ]
1216 )
1217])
1218if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1219 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1220fi
1221
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001222AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1223 AC_TRY_COMPILE(
1224 [ #include <sys/time.h> ],
1225 [ struct timeval tv; tv.tv_sec = 1;],
1226 [ ac_cv_have_struct_timeval="yes" ],
1227 [ ac_cv_have_struct_timeval="no" ]
1228 )
1229])
1230if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1231 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1232 have_struct_timeval=1
1233fi
1234
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001235# If we don't have int64_t then we can't compile sftp-server. So don't
1236# even attempt to do it.
1237if test "x$ac_cv_have_int64_t" = "xno" -a \
1238 "x$ac_cv_sizeof_long_int" != "x8" -a \
1239 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1240 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001241else
1242dnl test snprintf (broken on SCO w/gcc)
1243 AC_TRY_RUN(
1244 [
1245#include <stdio.h>
1246#include <string.h>
1247#ifdef HAVE_SNPRINTF
1248main()
1249{
1250 char buf[50];
1251 char expected_out[50];
1252 int mazsize = 50 ;
1253#if (SIZEOF_LONG_INT == 8)
1254 long int num = 0x7fffffffffffffff;
1255#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001256 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001257#endif
1258 strcpy(expected_out, "9223372036854775807");
1259 snprintf(buf, mazsize, "%lld", num);
1260 if(strcmp(buf, expected_out) != 0)
1261 exit(1);
1262 exit(0);
1263}
1264#else
1265main() { exit(0); }
1266#endif
1267 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1268 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001269fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001270AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001271
Damien Miller78315eb2000-09-29 23:01:36 +11001272dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001273OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1274OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1275OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1276OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1277OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001278OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001279OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1280OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001281OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001282OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1283OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1284OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1285OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001286OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1287OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1288OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1289OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001290
1291AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001292
Damien Miller61e50f12000-05-08 20:49:37 +10001293AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1294 ac_cv_have_ss_family_in_struct_ss, [
1295 AC_TRY_COMPILE(
1296 [
Damien Miller81171112000-04-23 11:14:01 +10001297#include <sys/types.h>
1298#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001299 ],
1300 [ struct sockaddr_storage s; s.ss_family = 1; ],
1301 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1302 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1303 )
1304])
1305if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1306 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1307fi
1308
Damien Miller61e50f12000-05-08 20:49:37 +10001309AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1310 ac_cv_have___ss_family_in_struct_ss, [
1311 AC_TRY_COMPILE(
1312 [
Damien Miller81171112000-04-23 11:14:01 +10001313#include <sys/types.h>
1314#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001315 ],
1316 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1317 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1318 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1319 )
1320])
1321if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1322 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1323fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001324
Damien Millerad833b32000-08-23 10:46:23 +10001325AC_CACHE_CHECK([for pw_class field in struct passwd],
1326 ac_cv_have_pw_class_in_struct_passwd, [
1327 AC_TRY_COMPILE(
1328 [
Damien Millerad833b32000-08-23 10:46:23 +10001329#include <pwd.h>
1330 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001331 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001332 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1333 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1334 )
1335])
1336if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1337 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1338fi
1339
Kevin Steves82456952001-06-22 21:14:18 +00001340AC_CACHE_CHECK([for pw_expire field in struct passwd],
1341 ac_cv_have_pw_expire_in_struct_passwd, [
1342 AC_TRY_COMPILE(
1343 [
1344#include <pwd.h>
1345 ],
1346 [ struct passwd p; p.pw_expire = 0; ],
1347 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1348 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1349 )
1350])
1351if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1352 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1353fi
1354
1355AC_CACHE_CHECK([for pw_change field in struct passwd],
1356 ac_cv_have_pw_change_in_struct_passwd, [
1357 AC_TRY_COMPILE(
1358 [
1359#include <pwd.h>
1360 ],
1361 [ struct passwd p; p.pw_change = 0; ],
1362 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1363 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1364 )
1365])
1366if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1367 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1368fi
Damien Miller61e50f12000-05-08 20:49:37 +10001369
1370AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1371 AC_TRY_LINK([],
1372 [ extern char *__progname; printf("%s", __progname); ],
1373 [ ac_cv_libc_defines___progname="yes" ],
1374 [ ac_cv_libc_defines___progname="no" ]
1375 )
1376])
1377if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1378 AC_DEFINE(HAVE___PROGNAME)
1379fi
1380
Damien Miller4f8e6692001-07-14 13:22:53 +10001381AC_CACHE_CHECK([whether getopt has optreset support],
1382 ac_cv_have_getopt_optreset, [
1383 AC_TRY_LINK(
1384 [
1385#include <getopt.h>
1386 ],
1387 [ extern int optreset; optreset = 0; ],
1388 [ ac_cv_have_getopt_optreset="yes" ],
1389 [ ac_cv_have_getopt_optreset="no" ]
1390 )
1391])
1392if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1393 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1394fi
Damien Millera22ba012000-03-02 23:09:20 +11001395
Damien Millerecbb26d2000-07-15 14:59:14 +10001396AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1397 AC_TRY_LINK([],
1398 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1399 [ ac_cv_libc_defines_sys_errlist="yes" ],
1400 [ ac_cv_libc_defines_sys_errlist="no" ]
1401 )
1402])
1403if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1404 AC_DEFINE(HAVE_SYS_ERRLIST)
1405fi
1406
1407
Damien Miller11fa2cc2000-08-16 10:35:58 +10001408AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1409 AC_TRY_LINK([],
1410 [ extern int sys_nerr; printf("%i", sys_nerr);],
1411 [ ac_cv_libc_defines_sys_nerr="yes" ],
1412 [ ac_cv_libc_defines_sys_nerr="no" ]
1413 )
1414])
1415if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1416 AC_DEFINE(HAVE_SYS_NERR)
1417fi
1418
1419
Damien Millerc79bc0d2001-03-28 13:03:42 +10001420# Check whether user wants Kerberos support
Damien Miller85de5802001-09-18 14:01:11 +10001421SCARD_MSG="no"
1422AC_ARG_WITH(smartcard,
1423 [ --with-smartcard Enable smartcard support],
1424 [
1425 if test "x$withval" != "xno" ; then
1426 if test "x$withval" != "xyes" ; then
1427 CPPFLAGS="$CPPFLAGS -I${withval}"
1428 LDFLAGS="$LDFLAGS -L${withval}"
1429 if test ! -z "$need_dash_r" ; then
1430 LDFLAGS="$LDFLAGS -R${withval}"
1431 fi
1432 if test ! -z "$blibpath" ; then
1433 blibpath="$blibpath:${withval}"
1434 fi
1435 fi
1436 AC_CHECK_HEADERS(sectok.h)
1437 if test "$ac_cv_header_sectok_h" != yes; then
1438 AC_MSG_ERROR(Can't find sectok.h)
1439 fi
1440 AC_CHECK_LIB(sectok, sectok_open)
1441 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1442 AC_MSG_ERROR(Can't find libsectok)
1443 fi
1444 AC_DEFINE(SMARTCARD)
1445 SCARD_MSG="yes"
1446 fi
1447 ]
1448)
1449
1450# Check whether user wants Kerberos support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001451KRB4_MSG="no"
1452AC_ARG_WITH(kerberos4,
1453 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1454 [
1455 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001456 if test "x$withval" != "xyes" ; then
1457 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1458 LDFLAGS="$LDFLAGS -L${withval}/lib"
1459 if test ! -z "$need_dash_r" ; then
1460 LDFLAGS="$LDFLAGS -R${withval}/lib"
1461 fi
1462 if test ! -z "$blibpath" ; then
1463 blibpath="$blibpath:${withval}/lib"
1464 fi
1465 else
1466 if test -d /usr/include/kerberosIV ; then
1467 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1468 fi
1469 fi
1470
1471 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001472 if test "$ac_cv_header_krb_h" != yes; then
1473 AC_MSG_WARN([Cannot find krb.h, build may fail])
1474 fi
Damien Miller98344742001-03-28 14:37:06 +10001475 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001476 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001477 AC_CHECK_LIB(krb4, main)
1478 if test "$ac_cv_lib_krb4_main" != yes; then
1479 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1480 else
1481 KLIBS="-lkrb4"
1482 fi
1483 else
1484 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001485 fi
Damien Miller98344742001-03-28 14:37:06 +10001486 AC_CHECK_LIB(des, des_cbc_encrypt)
1487 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1488 AC_CHECK_LIB(des425, des_cbc_encrypt)
1489 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1490 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1491 else
1492 KLIBS="-ldes425"
1493 fi
1494 else
1495 KLIBS="-ldes"
1496 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001497 AC_CHECK_LIB(resolv, dn_expand, , )
1498 KRB4=yes
1499 KRB4_MSG="yes"
1500 AC_DEFINE(KRB4)
1501 fi
1502 ]
1503)
1504
1505# Check whether user wants AFS support
1506AFS_MSG="no"
1507AC_ARG_WITH(afs,
1508 [ --with-afs=PATH Enable AFS support],
1509 [
1510 if test "x$withval" != "xno" ; then
1511
1512 if test "x$withval" != "xyes" ; then
1513 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1514 LDFLAGS="$LDFLAGS -L${withval}/lib"
1515 fi
1516
1517 if test -z "$KRB4" ; then
1518 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1519 fi
1520
1521 LIBS="-lkafs $LIBS"
1522 if test ! -z "$AFS_LIBS" ; then
1523 LIBS="$LIBS $AFS_LIBS"
1524 fi
1525 AC_DEFINE(AFS)
1526 AFS_MSG="yes"
1527 fi
1528 ]
1529)
1530LIBS="$LIBS $KLIBS"
1531
Damien Millera22ba012000-03-02 23:09:20 +11001532# Looking for programs, paths and files
1533AC_ARG_WITH(rsh,
1534 [ --with-rsh=PATH Specify path to remote shell program ],
1535 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001536 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001537 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001538 fi
1539 ],
1540 [
1541 AC_PATH_PROG(rsh_path, rsh)
1542 ]
1543)
1544
1545AC_ARG_WITH(xauth,
1546 [ --with-xauth=PATH Specify path to xauth program ],
1547 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001548 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001549 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001550 fi
1551 ],
1552 [
Damien Miller78315eb2000-09-29 23:01:36 +11001553 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 +10001554 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001555 xauth_path="/usr/openwin/bin/xauth"
1556 fi
1557 ]
1558)
1559
Damien Millera19cf472000-11-29 13:28:50 +11001560if test -z "$xauth_path" ; then
1561 XAUTH_PATH="undefined"
1562 AC_SUBST(XAUTH_PATH)
1563else
Damien Millera22ba012000-03-02 23:09:20 +11001564 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001565 XAUTH_PATH=$xauth_path
1566 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001567fi
1568if test ! -z "$rsh_path" ; then
1569 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1570fi
1571
1572# Check for mail directory (last resort if we cannot get it from headers)
1573if test ! -z "$MAIL" ; then
1574 maildir=`dirname $MAIL`
1575 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1576fi
1577
Damien Millera22ba012000-03-02 23:09:20 +11001578if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001579 AC_CHECK_FILE("/dev/ptmx",
1580 [
1581 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1582 have_dev_ptmx=1
1583 ]
1584 )
Damien Millera22ba012000-03-02 23:09:20 +11001585fi
Damien Miller204ad072000-03-02 23:56:12 +11001586AC_CHECK_FILE("/dev/ptc",
1587 [
1588 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1589 have_dev_ptc=1
1590 ]
1591)
1592
Damien Millera22ba012000-03-02 23:09:20 +11001593# Options from here on. Some of these are preset by platform above
1594
Damien Millera22ba012000-03-02 23:09:20 +11001595# Check for user-specified random device, otherwise check /dev/urandom
1596AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001597 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001598 [
Damien Miller040f3832000-04-03 14:50:43 +10001599 if test "x$withval" != "xno" ; then
1600 RANDOM_POOL="$withval";
1601 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1602 fi
Damien Millera22ba012000-03-02 23:09:20 +11001603 ],
1604 [
1605 # Check for random device
1606 AC_CHECK_FILE("/dev/urandom",
1607 [
1608 RANDOM_POOL="/dev/urandom";
1609 AC_SUBST(RANDOM_POOL)
1610 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1611 ]
1612 )
1613 ]
1614)
1615
Damien Millerd0ccb982001-03-04 00:29:20 +11001616# Check for PRNGD/EGD pool file
1617AC_ARG_WITH(prngd-port,
1618 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1619 [
1620 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1621 PRNGD_PORT="$withval"
1622 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1623 fi
1624 ]
1625)
1626
1627# Check for PRNGD/EGD pool file
1628AC_ARG_WITH(prngd-socket,
1629 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001630 [
Damien Miller040f3832000-04-03 14:50:43 +10001631 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001632 PRNGD_SOCKET="$withval"
1633 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001634 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001635 ],
1636 [
1637 # Check for existing socket only if we don't have a random device already
1638 if test -z "$RANDOM_POOL" ; then
1639 AC_MSG_CHECKING(for PRNGD/EGD socket)
1640 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001641 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001642 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1643 PRNGD_SOCKET="$sock"
1644 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001645 break;
1646 fi
1647 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001648 if test ! -z "$PRNGD_SOCKET" ; then
1649 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001650 else
1651 AC_MSG_RESULT(not found)
1652 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001653 fi
Damien Millera22ba012000-03-02 23:09:20 +11001654 ]
1655)
1656
Damien Miller0736c4d2001-01-25 10:51:46 +11001657
Damien Miller0437b332000-05-02 09:56:41 +10001658# detect pathnames for entropy gathering commands, if we need them
1659INSTALL_SSH_PRNG_CMDS=""
1660rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001661if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001662 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001663 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1664 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1665 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1666 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
Ben Lindstromd9e08242001-07-22 19:32:00 +00001667 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
Damien Miller61e50f12000-05-08 20:49:37 +10001668 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
Ben Lindstrom6db66ff2001-08-06 23:29:16 +00001669 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
Damien Miller61e50f12000-05-08 20:49:37 +10001670 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1671 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1672 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1673 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1674 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1675 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1676 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1677 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1678 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001679
1680 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001681fi
Damien Miller0437b332000-05-02 09:56:41 +10001682AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1683
Damien Miller11e37f62000-04-08 18:23:30 +10001684
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001685AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001686 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001687 [
Damien Miller897741e2001-04-16 10:41:46 +10001688 case "$withval" in
1689 man|cat|doc)
1690 MANTYPE=$withval
1691 ;;
1692 *)
1693 AC_MSG_ERROR(invalid man type: $withval)
1694 ;;
1695 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001696 ]
1697)
Ben Lindstrombc709922001-04-18 18:04:21 +00001698if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001699 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001700 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1701 MANTYPE=doc
1702 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1703 MANTYPE=man
1704 else
1705 MANTYPE=cat
1706 fi
1707fi
Damien Miller670a4b82000-01-22 13:53:11 +11001708AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001709if test "$MANTYPE" = "doc"; then
1710 mansubdir=man;
1711else
1712 mansubdir=$MANTYPE;
1713fi
1714AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001715
Damien Millera22ba012000-03-02 23:09:20 +11001716# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001717MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001718AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001719 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001720 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001721 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001722 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001723 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001724 fi
1725 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001726)
1727
Damien Millera22ba012000-03-02 23:09:20 +11001728# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001729AC_ARG_WITH(shadow,
1730 [ --without-shadow Disable shadow password support],
1731 [
1732 if test "x$withval" = "xno" ; then
1733 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001734 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001735 fi
1736 ]
1737)
1738
Damien Miller1f335fb2000-06-26 11:31:33 +10001739if test -z "$disable_shadow" ; then
1740 AC_MSG_CHECKING([if the systems has expire shadow information])
1741 AC_TRY_COMPILE(
1742 [
1743#include <sys/types.h>
1744#include <shadow.h>
1745 struct spwd sp;
1746 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1747 [ sp_expire_available=yes ], []
1748 )
1749
1750 if test "x$sp_expire_available" = "xyes" ; then
1751 AC_MSG_RESULT(yes)
1752 AC_DEFINE(HAS_SHADOW_EXPIRE)
1753 else
1754 AC_MSG_RESULT(no)
1755 fi
1756fi
1757
Damien Millera22ba012000-03-02 23:09:20 +11001758# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001759if test ! -z "$IPADDR_IN_DISPLAY" ; then
1760 DISPLAY_HACK_MSG="yes"
1761 AC_DEFINE(IPADDR_IN_DISPLAY)
1762else
1763 DISPLAY_HACK_MSG="no"
1764 AC_ARG_WITH(ipaddr-display,
1765 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1766 [
1767 if test "x$withval" != "xno" ; then
1768 AC_DEFINE(IPADDR_IN_DISPLAY)
1769 DISPLAY_HACK_MSG="yes"
1770 fi
1771 ]
1772 )
1773fi
Damien Miller76112de1999-12-21 11:18:08 +11001774
Damien Millera22ba012000-03-02 23:09:20 +11001775# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001776SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001777AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001778 [ --with-default-path=PATH Specify default \$PATH environment for server],
1779 [
1780 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001781 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001782 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001783 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001784 ],
1785 [
1786 AC_TRY_RUN(
1787 [
1788/* find out what STDPATH is */
1789#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001790#ifdef HAVE_PATHS_H
1791# include <paths.h>
1792#endif
1793#ifndef _PATH_STDPATH
1794# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1795#endif
1796#include <sys/types.h>
1797#include <sys/stat.h>
1798#include <fcntl.h>
1799#define DATA "conftest.stdpath"
1800
1801main()
1802{
1803 FILE *fd;
1804 int rc;
1805
1806 fd = fopen(DATA,"w");
1807 if(fd == NULL)
1808 exit(1);
1809
1810 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1811 exit(1);
1812
1813 exit(0);
1814}
1815 ], [ user_path=`cat conftest.stdpath` ],
1816 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1817 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1818 )
1819# make sure $bindir is in USER_PATH so scp will work
1820 t_bindir=`eval echo ${bindir}`
1821 case $t_bindir in
1822 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1823 esac
1824 case $t_bindir in
1825 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1826 esac
1827 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1828 if test $? -ne 0 ; then
1829 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1830 if test $? -ne 0 ; then
1831 user_path=$user_path:$t_bindir
1832 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1833 fi
1834 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001835 ]
1836)
Tim Rice59ea0a02001-03-10 13:50:45 -08001837AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1838AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001839
Damien Millera22ba012000-03-02 23:09:20 +11001840# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001841IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001842AC_ARG_WITH(ipv4-default,
1843 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1844 [
1845 if test "x$withval" != "xno" ; then
1846 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001847 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001848 fi
1849 ]
1850)
1851
Damien Miller61e50f12000-05-08 20:49:37 +10001852AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001853IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001854AC_ARG_WITH(4in6,
1855 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1856 [
1857 if test "x$withval" != "xno" ; then
1858 AC_MSG_RESULT(yes)
1859 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001860 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001861 else
1862 AC_MSG_RESULT(no)
1863 fi
1864 ],[
1865 if test "x$inet6_default_4in6" = "xyes"; then
1866 AC_MSG_RESULT([yes (default)])
1867 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001868 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001869 else
1870 AC_MSG_RESULT([no (default)])
1871 fi
1872 ]
1873)
1874
Damien Miller60396b02001-02-18 17:01:00 +11001875# Whether to enable BSD auth support
1876AC_ARG_WITH(bsd-auth,
1877 [ --with-bsd-auth Enable BSD auth support],
1878 [
1879 if test "x$withval" != "xno" ; then
1880 AC_DEFINE(BSD_AUTH)
1881 bsd_auth=yes
1882 fi
1883 ]
1884)
1885
Damien Miller78315eb2000-09-29 23:01:36 +11001886AC_MSG_CHECKING(whether to install ssh as suid root)
1887AC_ARG_ENABLE(suid-ssh,
1888[ --enable-suid-ssh Install ssh as suid root (default)
1889 --disable-suid-ssh Install ssh without suid bit],
1890[ case "$enableval" in
1891 no)
1892 AC_MSG_RESULT(no)
1893 SSHMODE=0711
1894 ;;
1895 *) AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001896 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001897 ;;
1898 esac ],
1899 AC_MSG_RESULT(yes)
Ben Lindstrom8e2aa5b2001-07-24 17:00:13 +00001900 SSHMODE=4711
Damien Miller78315eb2000-09-29 23:01:36 +11001901)
1902AC_SUBST(SSHMODE)
1903
1904
Damien Millera22ba012000-03-02 23:09:20 +11001905# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001906piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001907AC_ARG_WITH(pid-dir,
1908 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1909 [
1910 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001911 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001912 fi
1913 ]
1914)
Damien Miller4018c192000-04-30 09:30:44 +10001915
Damien Miller78315eb2000-09-29 23:01:36 +11001916# make sure the directory exists
1917if test ! -d $piddir ; then
1918 piddir=`eval echo ${sysconfdir}`
1919 case $piddir in
1920 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1921 esac
1922fi
1923
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001924AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001925AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001926
andre2ff7b5d2000-06-03 14:57:40 +00001927dnl allow user to disable some login recording features
1928AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001929 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001930 [ AC_DEFINE(DISABLE_LASTLOG) ]
1931)
1932AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001933 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001934 [ AC_DEFINE(DISABLE_UTMP) ]
1935)
1936AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001937 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001938 [ AC_DEFINE(DISABLE_UTMPX) ]
1939)
1940AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001941 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001942 [ AC_DEFINE(DISABLE_WTMP) ]
1943)
1944AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001945 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001946 [ AC_DEFINE(DISABLE_WTMPX) ]
1947)
1948AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001949 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001950 [ AC_DEFINE(DISABLE_LOGIN) ]
1951)
1952AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001953 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001954 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1955)
1956AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001957 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001958 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1959)
1960AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001961 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001962 [
1963 if test "x$withval" = "xno" ; then
1964 AC_DEFINE(DISABLE_LASTLOG)
1965 else
1966 conf_lastlog_location=$withval
1967 fi
1968 ]
1969)
andre2ff7b5d2000-06-03 14:57:40 +00001970
1971dnl lastlog, [uw]tmpx? detection
1972dnl NOTE: set the paths in the platform section to avoid the
1973dnl need for command-line parameters
1974dnl lastlog and [uw]tmp are subject to a file search if all else fails
1975
1976dnl lastlog detection
1977dnl NOTE: the code itself will detect if lastlog is a directory
1978AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1979AC_TRY_COMPILE([
1980#include <sys/types.h>
1981#include <utmp.h>
1982#ifdef HAVE_LASTLOG_H
1983# include <lastlog.h>
1984#endif
Damien Miller2994e082000-06-04 15:51:47 +10001985#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001986# include <paths.h>
1987#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001988#ifdef HAVE_LOGIN_H
1989# include <login.h>
1990#endif
andre2ff7b5d2000-06-03 14:57:40 +00001991 ],
1992 [ char *lastlog = LASTLOG_FILE; ],
1993 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001994 [
1995 AC_MSG_RESULT(no)
1996 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1997 AC_TRY_COMPILE([
1998#include <sys/types.h>
1999#include <utmp.h>
2000#ifdef HAVE_LASTLOG_H
2001# include <lastlog.h>
2002#endif
2003#ifdef HAVE_PATHS_H
2004# include <paths.h>
2005#endif
2006 ],
2007 [ char *lastlog = _PATH_LASTLOG; ],
2008 [ AC_MSG_RESULT(yes) ],
2009 [
andree441aa32000-06-12 22:34:38 +00002010 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002011 system_lastlog_path=no
2012 ])
2013 ]
andre2ff7b5d2000-06-03 14:57:40 +00002014)
Damien Miller2994e082000-06-04 15:51:47 +10002015
andre2ff7b5d2000-06-03 14:57:40 +00002016if test -z "$conf_lastlog_location"; then
2017 if test x"$system_lastlog_path" = x"no" ; then
2018 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002019 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002020 conf_lastlog_location=$f
2021 fi
2022 done
2023 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002024 AC_MSG_WARN([** Cannot find lastlog **])
2025 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002026 fi
2027 fi
2028fi
2029
2030if test -n "$conf_lastlog_location"; then
2031 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2032fi
2033
2034dnl utmp detection
2035AC_MSG_CHECKING([if your system defines UTMP_FILE])
2036AC_TRY_COMPILE([
2037#include <sys/types.h>
2038#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002039#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002040# include <paths.h>
2041#endif
2042 ],
2043 [ char *utmp = UTMP_FILE; ],
2044 [ AC_MSG_RESULT(yes) ],
2045 [ AC_MSG_RESULT(no)
2046 system_utmp_path=no ]
2047)
2048if test -z "$conf_utmp_location"; then
2049 if test x"$system_utmp_path" = x"no" ; then
2050 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2051 if test -f $f ; then
2052 conf_utmp_location=$f
2053 fi
2054 done
2055 if test -z "$conf_utmp_location"; then
2056 AC_DEFINE(DISABLE_UTMP)
2057 fi
2058 fi
2059fi
2060if test -n "$conf_utmp_location"; then
2061 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2062fi
2063
2064dnl wtmp detection
2065AC_MSG_CHECKING([if your system defines WTMP_FILE])
2066AC_TRY_COMPILE([
2067#include <sys/types.h>
2068#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002069#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002070# include <paths.h>
2071#endif
2072 ],
2073 [ char *wtmp = WTMP_FILE; ],
2074 [ AC_MSG_RESULT(yes) ],
2075 [ AC_MSG_RESULT(no)
2076 system_wtmp_path=no ]
2077)
2078if test -z "$conf_wtmp_location"; then
2079 if test x"$system_wtmp_path" = x"no" ; then
2080 for f in /usr/adm/wtmp /var/log/wtmp; do
2081 if test -f $f ; then
2082 conf_wtmp_location=$f
2083 fi
2084 done
2085 if test -z "$conf_wtmp_location"; then
2086 AC_DEFINE(DISABLE_WTMP)
2087 fi
2088 fi
2089fi
2090if test -n "$conf_wtmp_location"; then
2091 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2092fi
2093
2094
2095dnl utmpx detection - I don't know any system so perverse as to require
2096dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2097dnl there, though.
2098AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2099AC_TRY_COMPILE([
2100#include <sys/types.h>
2101#include <utmp.h>
2102#ifdef HAVE_UTMPX_H
2103#include <utmpx.h>
2104#endif
Damien Miller2994e082000-06-04 15:51:47 +10002105#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002106# include <paths.h>
2107#endif
2108 ],
2109 [ char *utmpx = UTMPX_FILE; ],
2110 [ AC_MSG_RESULT(yes) ],
2111 [ AC_MSG_RESULT(no)
2112 system_utmpx_path=no ]
2113)
2114if test -z "$conf_utmpx_location"; then
2115 if test x"$system_utmpx_path" = x"no" ; then
2116 AC_DEFINE(DISABLE_UTMPX)
2117 fi
2118else
2119 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2120fi
2121
2122dnl wtmpx detection
2123AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2124AC_TRY_COMPILE([
2125#include <sys/types.h>
2126#include <utmp.h>
2127#ifdef HAVE_UTMPX_H
2128#include <utmpx.h>
2129#endif
Damien Miller2994e082000-06-04 15:51:47 +10002130#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002131# include <paths.h>
2132#endif
2133 ],
2134 [ char *wtmpx = WTMPX_FILE; ],
2135 [ AC_MSG_RESULT(yes) ],
2136 [ AC_MSG_RESULT(no)
2137 system_wtmpx_path=no ]
2138)
2139if test -z "$conf_wtmpx_location"; then
2140 if test x"$system_wtmpx_path" = x"no" ; then
2141 AC_DEFINE(DISABLE_WTMPX)
2142 fi
2143else
2144 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2145fi
2146
Damien Miller4018c192000-04-30 09:30:44 +10002147
2148# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10002149entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10002150AC_ARG_WITH(entropy-timeout,
2151 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
2152 [
2153 if test "x$withval" != "xno" ; then
2154 entropy_timeout=$withval
2155 fi
2156 ]
2157)
2158AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
2159
2160
Damien Miller29ea30d2000-03-17 10:54:15 +11002161if test ! -z "$blibpath" ; then
2162 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2163 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2164fi
2165
Damien Millerbac2d8a2000-09-05 16:13:06 +11002166AC_EXEEXT
2167
Tim Rice13aae5e2001-10-21 17:53:58 -07002168AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2169AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002170
Damien Miller7b22d652000-06-18 14:07:04 +10002171# Print summary of options
2172
Damien Miller7b22d652000-06-18 14:07:04 +10002173if test ! -z "$RANDOM_POOL" ; then
2174 RAND_MSG="Device ($RANDOM_POOL)"
2175else
Damien Millerd0ccb982001-03-04 00:29:20 +11002176 if test ! -z "$PRNGD_PORT" ; then
2177 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
2178 elif test ! -z "$PRNGD_SOCKET" ; then
2179 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10002180 else
2181 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11002182 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10002183 fi
2184fi
2185
2186# Someone please show me a better way :)
2187A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2188B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2189C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2190D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002191E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002192F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002193G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08002194H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10002195
2196echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002197echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10002198echo " User binaries: $B"
2199echo " System binaries: $C"
2200echo " Configuration files: $D"
2201echo " Askpass program: $E"
2202echo " Manual pages: $F"
2203echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08002204echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10002205echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10002206echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10002207echo " PAM support: ${PAM_MSG}"
2208echo " KerberosIV support: $KRB4_MSG"
Damien Miller85de5802001-09-18 14:01:11 +10002209echo " Smartcard support: $SCARD_MSG"
Damien Miller7b22d652000-06-18 14:07:04 +10002210echo " AFS support: $AFS_MSG"
2211echo " S/KEY support: $SKEY_MSG"
2212echo " TCP Wrappers support: $TCPW_MSG"
2213echo " MD5 password support: $MD5_MSG"
2214echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2215echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2216echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2217
Damien Miller60396b02001-02-18 17:01:00 +11002218if test ! -z "$bsd_auth"; then
2219 echo " BSD Auth support: yes"
2220fi
2221
Damien Miller7b22d652000-06-18 14:07:04 +10002222echo ""
2223
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002224echo " Host: ${host}"
2225echo " Compiler: ${CC}"
2226echo " Compiler flags: ${CFLAGS}"
2227echo "Preprocessor flags: ${CPPFLAGS}"
2228echo " Linker flags: ${LDFLAGS}"
2229echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002230
2231echo ""
2232
Damien Miller82cf0ce2000-12-20 13:34:48 +11002233if test "x$PAM_MSG" = "xyes" ; then
2234 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2235 echo "otherwise password authentication may fail. Example PAM control files"
2236 echo "can be found in the contrib/ subdirectory"
2237 echo ""
2238fi
2239
Damien Miller6f9c3372000-10-25 10:06:04 +11002240if test ! -z "$BUILTIN_RNG" ; then
2241 echo "WARNING: you are using the builtin random number collection service."
2242 echo "Please read WARNING.RNG and request that your OS vendor includes"
2243 echo "/dev/random in future versions of their OS."
2244 echo ""
2245fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002246
2247if test ! -z "$NO_SFTP"; then
2248 echo "sftp-server will be disabled. Your compiler does not support"
2249 echo "64bit integers."
2250 echo ""
2251fi
Damien Miller60396b02001-02-18 17:01:00 +11002252