blob: 9edb6ac6e0399ad8bc6a301c95dd7acd61779b4b [file] [log] [blame]
Tim Rice59ea0a02001-03-10 13:50:45 -08001# $Id: configure.in,v 1.263 2001/03/10 21:50:45 tim Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11008AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +10009
Damien Millera22ba012000-03-02 23:09:20 +110010# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110011AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100012AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110013AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000014AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110015AC_PATH_PROG(PERL, perl)
16AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100017AC_PATH_PROG(ENT, ent)
18AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110019AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110020AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110023
Damien Miller3f62aba2000-11-29 11:56:35 +110024if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
26fi
27
Damien Millerad833b32000-08-23 10:46:23 +100028# Use LOGIN_PROGRAM from environment if possible
29if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
31else
32 # Search for login
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
36 fi
37fi
38
Damien Miller166bd442000-03-16 10:48:25 +110039if test -z "$LD" ; then
40 LD=$CC
41fi
42AC_SUBST(LD)
43
44# C Compiler features
45AC_C_INLINE
46if test "$GCC" = "yes"; then
47 CFLAGS="$CFLAGS -Wall"
48fi
49
Damien Millera22ba012000-03-02 23:09:20 +110050# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110051case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110052*-*-aix*)
53 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000054 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110055 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100056 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110057 blibpath="/usr/lib:/lib:/usr/local/lib"
58 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100059 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110060 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000061 MANTYPE='$(CATMAN)'
62 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000063 dnl AIX handles lastlog as part of its login message
64 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100065 MANTYPE='$(CATMAN)'
66 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110067 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110068*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110069 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110070 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 AC_DEFINE(DISABLE_SHADOW)
72 AC_DEFINE(IPV4_DEFAULT)
73 AC_DEFINE(IP_TOS_IS_BROKEN)
74 AC_DEFINE(BROKEN_VHANGUP)
Ben Lindstrom38e60932001-02-24 00:55:04 +000075 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110076 no_libsocket=1
77 no_libnsl=1
78 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000079*-*-dgux*)
80 AC_DEFINE(IP_TOS_IS_BROKEN)
81 ;;
Damien Miller76112de1999-12-21 11:18:08 +110082*-*-hpux10*)
83 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100084 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110085 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000086 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000091 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110092 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110093 MANTYPE='$(CATMAN)'
94 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110095 ;;
Damien Miller1bead332000-04-30 00:47:29 +100096*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000097 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110098 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110099 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100100 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100101 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100102 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000103 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100104 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000105 MANTYPE='$(CATMAN)'
106 mansubdir=cat
107 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100108*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000109 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000110 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100111 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100112 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100113 no_libsocket=1
114 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000115 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100116 ;;
117*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000118 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000119 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100120 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100121 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000122 AC_DEFINE(WITH_IRIX_ARRAY)
123 AC_DEFINE(WITH_IRIX_PROJECT)
124 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000125 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100126 no_libsocket=1
127 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000128 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000129 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100130 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100131*-*-linux*)
132 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100133 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100134 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000135 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100136 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100137 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000138mips-sony-bsd|mips-sony-newsos4)
139 AC_DEFINE(HAVE_NEWS4)
140 SONY=1
141 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100142 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000143 )
144 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100145*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100146 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100147 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100148*-*-freebsd*)
149 check_for_libcrypt_later=1
150 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000151*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000152 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100153 conf_utmp_location=/etc/utmp
154 conf_wtmp_location=/usr/adm/wtmp
155 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000156 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000157 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000158 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100159 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000160 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000161 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000162 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100163*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000164 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000165 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100166 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100167 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000168 # hardwire lastlog location (can't detect it on some versions)
169 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000170 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
171 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
172 if test "$sol2ver" -ge 8; then
173 AC_MSG_RESULT(yes)
174 AC_DEFINE(DISABLE_UTMP)
175 AC_DEFINE(DISABLE_WTMP)
176 else
177 AC_MSG_RESULT(no)
178 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100179 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000180*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000181 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000182 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100183 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100184 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000185 conf_utmp_location=/etc/utmp
186 conf_wtmp_location=/var/adm/wtmp
187 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000188 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000189 MANTYPE='$(CATMAN)'
190 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000191 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000192*-ncr-sysv*)
193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 MANTYPE='$(CATMAN)'
196 mansubdir=cat
197 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
198 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000199*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000200 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000201 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
202 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100203 IPADDR_IN_DISPLAY=yes
204 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000205 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000206 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller2ae714f2000-07-11 09:29:50 +1000207 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000208 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000209 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100210*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100212 LDFLAGS="$LDFLAGS -L/usr/local/lib"
213 MANTYPE='$(CATMAN)'
214 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100215 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100216 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100217 ;;
218*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000219 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100220 LDFLAGS="$LDFLAGS -L/usr/local/lib"
221 MANTYPE='$(CATMAN)'
222 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100223 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100224 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100225 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100226*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000227 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100228 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100229 MANTYPE='$(CATMAN)'
230 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100231 LIBS="$LIBS -lgen -lsocket"
232 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100233*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000234 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100235 LDFLAGS="$LDFLAGS -L/usr/local/lib"
236 MANTYPE='$(CATMAN)'
Ben Lindstrom980754c2000-11-12 00:04:24 +0000237 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100238 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100239 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100240 RANLIB=true
241 no_dev_ptmx=1
242 AC_DEFINE(BROKEN_SYS_TERMIO_H)
243 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100244 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000245 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000246 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100247 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100248 AC_CHECK_FUNCS(getluid setluid)
Damien Miller78315eb2000-09-29 23:01:36 +1100249 ;;
250*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000251 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000252 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100253 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000254 MANTYPE='$(CATMAN)'
255 mansubdir=cat
Damien Millera66626b2000-06-13 18:57:53 +1000256 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100257 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100258 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100259 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000260 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000261 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100262 AC_CHECK_FUNCS(getluid setluid)
Damien Millera66626b2000-06-13 18:57:53 +1000263 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000264*-dec-osf*)
Damien Millerb8c656e2000-06-28 15:22:41 +1000265 if test ! -z "USE_SIA" ; then
266 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
267 if test -f /etc/sia/matrix.conf; then
268 AC_MSG_RESULT(yes)
269 AC_DEFINE(HAVE_OSF_SIA)
270 AC_DEFINE(DISABLE_LOGIN)
271 LIBS="$LIBS -lsecurity -ldb -lm -laud"
272 else
273 AC_MSG_RESULT(no)
274 fi
275 fi
276 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100277esac
278
Damien Millere37bfc12000-06-05 09:37:43 +1000279# Allow user to specify flags
280AC_ARG_WITH(cflags,
281 [ --with-cflags Specify additional flags to pass to compiler],
282 [
283 if test "x$withval" != "xno" ; then
284 CFLAGS="$CFLAGS $withval"
285 fi
286 ]
287)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000288AC_ARG_WITH(cppflags,
289 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
290 [
291 if test "x$withval" != "xno"; then
292 CPPFLAGS="$CPPFLAGS $withval"
293 fi
294 ]
295)
Damien Millere37bfc12000-06-05 09:37:43 +1000296AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000297 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000298 [
299 if test "x$withval" != "xno" ; then
300 LDFLAGS="$LDFLAGS $withval"
301 fi
302 ]
303)
304AC_ARG_WITH(libs,
305 [ --with-libs Specify additional libraries to link with],
306 [
307 if test "x$withval" != "xno" ; then
308 LIBS="$LIBS $withval"
309 fi
310 ]
311)
312
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000313AC_ARG_WITH(pcre,
314 [ --with-pcre Override built in regex library with pcre],
315 [
316
317 AC_CHECK_LIB(pcre, pcre_info,
318 [
319 AC_DEFINE(HAVE_LIBPCRE)
320 LIBS="$LIBS -lpcreposix -lpcre"
321 no_comp_check="yes"
322 ],
323 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
324 )
325 ]
326)
Damien Millere37bfc12000-06-05 09:37:43 +1000327
Damien Millera22ba012000-03-02 23:09:20 +1100328# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100329if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000330 AC_CHECK_LIB(nsl, yp_match, , )
331fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100332if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000333 AC_CHECK_LIB(socket, main, , )
334fi
335
Damien Millerdf288022001-02-18 13:07:07 +1100336dnl SCO OS3 needs this for libwrap
337AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
338
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000339AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100340AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100341AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100342
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000343# We don't want to check if we did an pcre override.
344if test -z "$no_comp_check" ; then
345 AC_CHECK_FUNC(regcomp,
346 [ AC_DEFINE(HAVE_REGCOMP)],
347 [
348 AC_CHECK_LIB(pcre, pcre_info,
349 [
350 AC_DEFINE(HAVE_LIBPCRE)
351 LIBS="$LIBS -lpcreposix -lpcre"
352 ],
353 [
354 AC_MSG_ERROR([*** No regex library found.])
355 ])
356 ]
357 )
358fi
Damien Millerab18c411999-11-11 10:40:23 +1100359
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000360dnl UnixWare 2.x
361AC_CHECK_FUNC(strcasecmp,
362 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
363)
364AC_CHECK_FUNC(utimes,
365 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
366)
Damien Millerab18c411999-11-11 10:40:23 +1100367
Ben Lindstrom8697e082001-02-24 21:41:10 +0000368AC_FUNC_STRFTIME
369
Damien Millera22ba012000-03-02 23:09:20 +1100370# Checks for header files.
Ben Lindstrom2320b192001-02-15 03:46:28 +0000371AC_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 +1100372
Damien Millerc547bf12001-02-16 10:18:12 +1100373# Check whether user wants Kerberos support
374KRB4_MSG="no"
375AC_ARG_WITH(kerberos4,
376 [ --with-kerberos4=PATH Enable Kerberos 4 support],
377 [
378 if test "x$withval" != "xno" ; then
379
380 if test "x$withval" != "xyes" ; then
381 CPPFLAGS="$CPPFLAGS -I${withval}/include"
382 LDFLAGS="$LDFLAGS -L${withval}/lib"
383 if test ! -z "$need_dash_r" ; then
384 LDFLAGS="$LDFLAGS -R${withval}/lib"
385 fi
386 if test ! -z "$blibpath" ; then
387 blibpath="$blibpath:${withval}/lib"
388 fi
389 else
390 if test -d /usr/include/kerberosIV ; then
391 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
392 fi
393 fi
394
395 AC_CHECK_HEADERS(krb.h)
396 AC_CHECK_LIB(krb, main)
397 if test "$ac_cv_header_krb_h" != yes; then
398 AC_MSG_WARN([Cannot find krb.h, build may fail])
399 fi
400 if test "$ac_cv_lib_krb_main" != yes; then
401 AC_MSG_WARN([Cannot find libkrb, build may fail])
402 fi
403
404 KLIBS="-lkrb -ldes"
405 AC_CHECK_LIB(resolv, dn_expand, , )
406 KRB4=yes
407 KRB4_MSG="yes"
408 AC_DEFINE(KRB4)
409 fi
410 ]
411)
412
413# Check whether user wants AFS support
414AFS_MSG="no"
415AC_ARG_WITH(afs,
416 [ --with-afs=PATH Enable AFS support],
417 [
418 if test "x$withval" != "xno" ; then
419
420 if test "x$withval" != "xyes" ; then
421 CPPFLAGS="$CPPFLAGS -I${withval}/include"
422 LDFLAGS="$LDFLAGS -L${withval}/lib"
423 fi
424
425 if test -z "$KRB4" ; then
426 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
427 fi
428
429 LIBS="$LIBS -lkafs"
430 if test ! -z "$AFS_LIBS" ; then
431 LIBS="$LIBS $AFS_LIBS"
432 fi
433 AC_DEFINE(AFS)
434 AFS_MSG="yes"
435 fi
436 ]
437)
438LIBS="$LIBS $KLIBS"
439
440# Check whether user wants S/Key support
441SKEY_MSG="no"
442AC_ARG_WITH(skey,
443 [ --with-skey=PATH Enable S/Key support],
444 [
445 if test "x$withval" != "xno" ; then
446
447 if test "x$withval" != "xyes" ; then
448 CPPFLAGS="$CPPFLAGS -I${withval}/include"
449 LDFLAGS="$LDFLAGS -L${withval}/lib"
450 fi
451
452 AC_DEFINE(SKEY)
453 LIBS="-lskey $LIBS"
454 SKEY_MSG="yes"
455
456 AC_CHECK_FUNC(skey_keyinfo,
457 [],
458 [
459 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
460 ])
461 fi
462 ]
463)
464
465# Check whether user wants TCP wrappers support
466TCPW_MSG="no"
467AC_ARG_WITH(tcp-wrappers,
468 [ --with-tcp-wrappers Enable tcpwrappers support],
469 [
470 if test "x$withval" != "xno" ; then
471 saved_LIBS="$LIBS"
472 LIBS="-lwrap $LIBS"
473 AC_MSG_CHECKING(for libwrap)
474 AC_TRY_LINK(
475 [
476#include <tcpd.h>
477 int deny_severity = 0, allow_severity = 0;
478 ],
479 [hosts_access(0);],
480 [
481 AC_MSG_RESULT(yes)
482 AC_DEFINE(LIBWRAP)
483 TCPW_MSG="yes"
484 ],
485 [
486 AC_MSG_ERROR([*** libwrap missing])
487 ]
488 )
489 fi
490 ]
491)
492
Damien Millerad833b32000-08-23 10:46:23 +1000493dnl Checks for library functions.
Ben Lindstrom34bb0c72001-02-13 02:40:56 +0000494AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000495dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000496AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000497dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000498AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000499AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000500dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000501AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000502AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000503dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000504AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000505AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100506
Damien Miller5fc85652000-07-09 23:53:07 +1000507AC_CHECK_FUNC(getuserattr,
508 [AC_DEFINE(HAVE_GETUSERATTR)],
509 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
510)
511
Damien Miller04f80141999-11-19 15:32:34 +1100512AC_CHECK_FUNC(login,
513 [AC_DEFINE(HAVE_LOGIN)],
514 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
515)
516
517AC_CHECK_FUNC(daemon,
518 [AC_DEFINE(HAVE_DAEMON)],
519 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
520)
521
Damien Miller9fb07e42000-03-05 16:22:59 +1100522AC_CHECK_FUNC(getpagesize,
523 [AC_DEFINE(HAVE_GETPAGESIZE)],
524 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
525)
526
Damien Millercb170cb2000-07-01 16:52:55 +1000527# Check for broken snprintf
528if test "x$ac_cv_func_snprintf" = "xyes" ; then
529 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
530 AC_TRY_RUN(
531 [
532#include <stdio.h>
533int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
534 ],
535 [AC_MSG_RESULT(yes)],
536 [
537 AC_MSG_RESULT(no)
538 AC_DEFINE(BROKEN_SNPRINTF)
539 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
540 ]
541 )
542fi
543
Damien Miller606f8802000-09-16 15:39:56 +1100544AC_FUNC_GETPGRP
545
Damien Millera64b57a2001-01-17 10:44:13 +1100546# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000547PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100548AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100549 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100550 [
Damien Millera64b57a2001-01-17 10:44:13 +1100551 if test "x$withval" != "xno" ; then
552 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
553 AC_MSG_ERROR([PAM headers not found])
554 fi
555
556 AC_CHECK_LIB(dl, dlopen, , )
557 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
558 AC_CHECK_FUNCS(pam_getenvlist)
559
560 disable_shadow=yes
561 PAM_MSG="yes"
562
563 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100564 fi
565 ]
566)
Damien Millera22ba012000-03-02 23:09:20 +1100567
Damien Millera64b57a2001-01-17 10:44:13 +1100568# Check for older PAM
569if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100570 # Check PAM strerror arguments (old PAM)
571 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
572 AC_TRY_COMPILE(
573 [
Damien Miller81171112000-04-23 11:14:01 +1000574#include <stdlib.h>
575#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100576 ],
577 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
578 [AC_MSG_RESULT(no)],
579 [
580 AC_DEFINE(HAVE_OLD_PAM)
581 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000582 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100583 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100584 )
Damien Millera22ba012000-03-02 23:09:20 +1100585fi
586
587# The big search for OpenSSL
588AC_ARG_WITH(ssl-dir,
589 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
590 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000591 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100592 tryssldir=$withval
593 fi
594 ]
595)
596
597saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100598saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000599saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100600if test "x$prefix" != "xNONE" ; then
601 tryssldir="$tryssldir $prefix"
602fi
Damien Miller61e50f12000-05-08 20:49:37 +1000603AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100604 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 +1100605 CPPFLAGS="$saved_CPPFLAGS"
606 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000607 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100608
609 # Skip directories if they don't exist
610 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
611 continue;
612 fi
613 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
614 # Try to use $ssldir/lib if it exists, otherwise
615 # $ssldir
616 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000617 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100618 if test ! -z "$need_dash_r" ; then
619 LDFLAGS="$LDFLAGS -R$ssldir/lib"
620 fi
621 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000622 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100623 if test ! -z "$need_dash_r" ; then
624 LDFLAGS="$LDFLAGS -R$ssldir"
625 fi
626 fi
627 # Try to use $ssldir/include if it exists, otherwise
628 # $ssldir
629 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000630 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100631 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000632 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100633 fi
634 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000635
Damien Miller3b512e12000-05-17 23:29:18 +1000636 # Basic test to check for compatible version and correct linking
637 # *does not* test for RSA - that comes later.
638 AC_TRY_RUN(
639 [
Damien Millere59ce622000-05-01 20:54:17 +1000640#include <string.h>
641#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000642int main(void)
643{
Damien Miller3b512e12000-05-17 23:29:18 +1000644 char a[2048];
645 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000646 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000647 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000648}
Damien Miller3b512e12000-05-17 23:29:18 +1000649 ],
650 [
651 found_crypto=1
652 break;
653 ], []
654 )
Damien Miller61e50f12000-05-08 20:49:37 +1000655
656 if test ! -z "$found_crypto" ; then
657 break;
658 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100659 done
660
Damien Miller61e50f12000-05-08 20:49:37 +1000661 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100662 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100663 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000664 if test -z "$ssldir" ; then
665 ssldir="(system)"
666 fi
Damien Millera22ba012000-03-02 23:09:20 +1100667
Damien Miller61e50f12000-05-08 20:49:37 +1000668 ac_cv_openssldir=$ssldir
669])
670
Damien Milleredb82922000-06-20 13:25:52 +1000671if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000672 AC_DEFINE(HAVE_OPENSSL)
673 dnl Need to recover ssldir - test above runs in subshell
674 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100675 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100676 # Try to use $ssldir/lib if it exists, otherwise
677 # $ssldir
678 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000679 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100680 if test ! -z "$need_dash_r" ; then
681 LDFLAGS="$LDFLAGS -R$ssldir/lib"
682 fi
683 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000684 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100685 if test ! -z "$need_dash_r" ; then
686 LDFLAGS="$LDFLAGS -R$ssldir"
687 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100688 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100689 # Try to use $ssldir/include if it exists, otherwise
690 # $ssldir
691 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000692 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100693 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000694 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100695 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100696 fi
Damien Millera22ba012000-03-02 23:09:20 +1100697fi
Damien Miller3b512e12000-05-17 23:29:18 +1000698LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000699
Damien Miller3b512e12000-05-17 23:29:18 +1000700# Now test RSA support
701saved_LIBS="$LIBS"
702AC_MSG_CHECKING([for RSA support])
703for WANTS_RSAREF in "" 1 ; do
704 if test -z "$WANTS_RSAREF" ; then
705 LIBS="$saved_LIBS"
706 else
707 LIBS="$saved_LIBS -lRSAglue -lrsaref"
708 fi
709 AC_TRY_RUN([
710#include <string.h>
711#include <openssl/rand.h>
712#include <openssl/rsa.h>
713#include <openssl/bn.h>
714#include <openssl/sha.h>
715int main(void)
716{
717 int num; RSA *key; static unsigned char p_in[] = "blahblah";
718 unsigned char c[256], p[256];
719 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
720 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
721 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
722 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
723}
724 ],
725 [
726 rsa_works=1
727 break;
728 ], [])
729done
730
731if test ! -z "$no_rsa" ; then
732 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000733 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000734else
735 if test -z "$rsa_works" ; then
736 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000737 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000738 else
739 if test -z "$WANTS_RSAREF" ; then
740 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000741 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000742 else
Damien Miller7b22d652000-06-18 14:07:04 +1000743 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000744 AC_MSG_RESULT(using RSAref)
745 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
746 fi
747 fi
748fi
Damien Millera22ba012000-03-02 23:09:20 +1100749
Damien Millera64b57a2001-01-17 10:44:13 +1100750# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
751# version in OpenSSL. Skip this for PAM
752if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100753 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100754fi
755
Ben Lindstromb5628642000-10-18 00:02:25 +0000756# Cheap hack to ensure NEWS-OS libraries are arranged right.
757if test ! -z "$SONY" ; then
758 LIBS="$LIBS -liberty";
759fi
760
Damien Millera22ba012000-03-02 23:09:20 +1100761# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100762AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100763AC_CHECK_SIZEOF(short int, 2)
764AC_CHECK_SIZEOF(int, 4)
765AC_CHECK_SIZEOF(long int, 4)
766AC_CHECK_SIZEOF(long long int, 8)
767
Damien Millera22ba012000-03-02 23:09:20 +1100768# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100769AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
770 AC_TRY_COMPILE(
771 [ #include <sys/types.h> ],
772 [ u_int a; a = 1;],
773 [ ac_cv_have_u_int="yes" ],
774 [ ac_cv_have_u_int="no" ]
775 )
776])
777if test "x$ac_cv_have_u_int" = "xyes" ; then
778 AC_DEFINE(HAVE_U_INT)
779 have_u_int=1
780fi
781
Damien Miller61e50f12000-05-08 20:49:37 +1000782AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
783 AC_TRY_COMPILE(
784 [ #include <sys/types.h> ],
785 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
786 [ ac_cv_have_intxx_t="yes" ],
787 [ ac_cv_have_intxx_t="no" ]
788 )
789])
790if test "x$ac_cv_have_intxx_t" = "xyes" ; then
791 AC_DEFINE(HAVE_INTXX_T)
792 have_intxx_t=1
793fi
794
Damien Miller578783e2000-09-23 14:12:24 +1100795AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
796 AC_TRY_COMPILE(
797 [ #include <sys/types.h> ],
798 [ int64_t a; a = 1;],
799 [ ac_cv_have_int64_t="yes" ],
800 [ ac_cv_have_int64_t="no" ]
801 )
802])
803if test "x$ac_cv_have_int64_t" = "xyes" ; then
804 AC_DEFINE(HAVE_INT64_T)
805 have_int64_t=1
806fi
807
Damien Miller61e50f12000-05-08 20:49:37 +1000808AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
809 AC_TRY_COMPILE(
810 [ #include <sys/types.h> ],
811 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
812 [ ac_cv_have_u_intxx_t="yes" ],
813 [ ac_cv_have_u_intxx_t="no" ]
814 )
815])
816if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
817 AC_DEFINE(HAVE_U_INTXX_T)
818 have_u_intxx_t=1
819fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100820
Damien Miller578783e2000-09-23 14:12:24 +1100821AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
822 AC_TRY_COMPILE(
823 [ #include <sys/types.h> ],
824 [ u_int64_t a; a = 1;],
825 [ ac_cv_have_u_int64_t="yes" ],
826 [ ac_cv_have_u_int64_t="no" ]
827 )
828])
829if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
830 AC_DEFINE(HAVE_U_INT64_T)
831 have_u_int64_t=1
832fi
833
Damien Milleredb82922000-06-20 13:25:52 +1000834if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
835 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100836then
837 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
838 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000839 [
840#include <sys/bitypes.h>
841 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100842 [
Damien Miller70494d12000-04-03 15:57:06 +1000843 int8_t a; int16_t b; int32_t c;
844 u_int8_t e; u_int16_t f; u_int32_t g;
845 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100846 ],
847 [
848 AC_DEFINE(HAVE_U_INTXX_T)
849 AC_DEFINE(HAVE_INTXX_T)
850 AC_MSG_RESULT(yes)
851 ],
852 [AC_MSG_RESULT(no)]
853 )
854fi
855
Damien Millerd6121d22000-03-17 23:26:46 +1100856if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000857 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
858 AC_TRY_COMPILE(
859 [
860#include <sys/types.h>
861 ],
862 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
863 [ ac_cv_have_uintxx_t="yes" ],
864 [ ac_cv_have_uintxx_t="no" ]
865 )
866 ])
867 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
868 AC_DEFINE(HAVE_UINTXX_T)
869 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100870fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100871
Damien Miller61e50f12000-05-08 20:49:37 +1000872AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
873 AC_TRY_COMPILE(
874 [
Damien Miller81171112000-04-23 11:14:01 +1000875#include <sys/types.h>
876#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000877 ],
878 [socklen_t foo; foo = 1235;],
879 [ ac_cv_have_socklen_t="yes" ],
880 [ ac_cv_have_socklen_t="no" ]
881 )
882])
883if test "x$ac_cv_have_socklen_t" = "xyes" ; then
884 AC_DEFINE(HAVE_SOCKLEN_T)
885fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100886
Damien Miller61e50f12000-05-08 20:49:37 +1000887AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
888 AC_TRY_COMPILE(
889 [
890#include <sys/types.h>
891 ],
892 [ size_t foo; foo = 1235; ],
893 [ ac_cv_have_size_t="yes" ],
894 [ ac_cv_have_size_t="no" ]
895 )
896])
897if test "x$ac_cv_have_size_t" = "xyes" ; then
898 AC_DEFINE(HAVE_SIZE_T)
899fi
Damien Miller95058511999-12-29 10:36:45 +1100900
Damien Miller615f9392000-05-17 22:53:33 +1000901AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
902 AC_TRY_COMPILE(
903 [
904#include <sys/types.h>
905 ],
906 [ ssize_t foo; foo = 1235; ],
907 [ ac_cv_have_ssize_t="yes" ],
908 [ ac_cv_have_ssize_t="no" ]
909 )
910])
911if test "x$ac_cv_have_ssize_t" = "xyes" ; then
912 AC_DEFINE(HAVE_SSIZE_T)
913fi
914
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000915AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
916 AC_TRY_COMPILE(
917 [
918#include <time.h>
919 ],
920 [ clock_t foo; foo = 1235; ],
921 [ ac_cv_have_clock_t="yes" ],
922 [ ac_cv_have_clock_t="no" ]
923 )
924])
925if test "x$ac_cv_have_clock_t" = "xyes" ; then
926 AC_DEFINE(HAVE_CLOCK_T)
927fi
928
Damien Millerb54b40e2000-06-23 08:23:34 +1000929AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
930 AC_TRY_COMPILE(
931 [
932#include <sys/types.h>
933#include <sys/socket.h>
934 ],
935 [ sa_family_t foo; foo = 1235; ],
936 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100937 [ AC_TRY_COMPILE(
938 [
939#include <sys/types.h>
940#include <sys/socket.h>
941#include <netinet/in.h>
942 ],
943 [ sa_family_t foo; foo = 1235; ],
944 [ ac_cv_have_sa_family_t="yes" ],
945
Damien Millerb54b40e2000-06-23 08:23:34 +1000946 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100947 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000948 )
949])
950if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
951 AC_DEFINE(HAVE_SA_FAMILY_T)
952fi
953
Damien Miller0f91b4e2000-06-18 15:43:25 +1000954AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
955 AC_TRY_COMPILE(
956 [
957#include <sys/types.h>
958 ],
959 [ pid_t foo; foo = 1235; ],
960 [ ac_cv_have_pid_t="yes" ],
961 [ ac_cv_have_pid_t="no" ]
962 )
963])
964if test "x$ac_cv_have_pid_t" = "xyes" ; then
965 AC_DEFINE(HAVE_PID_T)
966fi
967
968AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
969 AC_TRY_COMPILE(
970 [
971#include <sys/types.h>
972 ],
973 [ mode_t foo; foo = 1235; ],
974 [ ac_cv_have_mode_t="yes" ],
975 [ ac_cv_have_mode_t="no" ]
976 )
977])
978if test "x$ac_cv_have_mode_t" = "xyes" ; then
979 AC_DEFINE(HAVE_MODE_T)
980fi
981
Damien Miller61e50f12000-05-08 20:49:37 +1000982
983AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
984 AC_TRY_COMPILE(
985 [
Damien Miller81171112000-04-23 11:14:01 +1000986#include <sys/types.h>
987#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000988 ],
989 [ struct sockaddr_storage s; ],
990 [ ac_cv_have_struct_sockaddr_storage="yes" ],
991 [ ac_cv_have_struct_sockaddr_storage="no" ]
992 )
993])
994if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
995 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
996fi
Damien Miller34132e52000-01-14 15:45:46 +1100997
Damien Miller61e50f12000-05-08 20:49:37 +1000998AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
999 AC_TRY_COMPILE(
1000 [
Damien Miller7b22d652000-06-18 14:07:04 +10001001#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001002#include <netinet/in.h>
1003 ],
1004 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1005 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1006 [ ac_cv_have_struct_sockaddr_in6="no" ]
1007 )
1008])
1009if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1010 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1011fi
Damien Miller34132e52000-01-14 15:45:46 +11001012
Damien Miller61e50f12000-05-08 20:49:37 +10001013AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1014 AC_TRY_COMPILE(
1015 [
Damien Miller7b22d652000-06-18 14:07:04 +10001016#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001017#include <netinet/in.h>
1018 ],
1019 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1020 [ ac_cv_have_struct_in6_addr="yes" ],
1021 [ ac_cv_have_struct_in6_addr="no" ]
1022 )
1023])
1024if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1025 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1026fi
Damien Miller34132e52000-01-14 15:45:46 +11001027
Damien Miller61e50f12000-05-08 20:49:37 +10001028AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1029 AC_TRY_COMPILE(
1030 [
Damien Miller81171112000-04-23 11:14:01 +10001031#include <sys/types.h>
1032#include <sys/socket.h>
1033#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001034 ],
1035 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1036 [ ac_cv_have_struct_addrinfo="yes" ],
1037 [ ac_cv_have_struct_addrinfo="no" ]
1038 )
1039])
1040if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1041 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1042fi
1043
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001044AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1045 AC_TRY_COMPILE(
1046 [ #include <sys/time.h> ],
1047 [ struct timeval tv; tv.tv_sec = 1;],
1048 [ ac_cv_have_struct_timeval="yes" ],
1049 [ ac_cv_have_struct_timeval="no" ]
1050 )
1051])
1052if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1053 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1054 have_struct_timeval=1
1055fi
1056
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001057# If we don't have int64_t then we can't compile sftp-server. So don't
1058# even attempt to do it.
1059if test "x$ac_cv_have_int64_t" = "xno" -a \
1060 "x$ac_cv_sizeof_long_int" != "x8" -a \
1061 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1062 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001063fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001064AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001065
Damien Miller78315eb2000-09-29 23:01:36 +11001066dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001067OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1068OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1069OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1070OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1071OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001072OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001073OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1074OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001075OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001076OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1078OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1079OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001080OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1081OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1082OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1083OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001084AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001085
Damien Miller942da032000-08-18 13:59:06 +10001086AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1087 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1088 AC_TRY_COMPILE(
1089 [
1090#include <sys/types.h>
1091#include <sys/socket.h>
1092 ],
1093 [ struct sockaddr_un s; s.sun_len = 1; ],
1094 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1095 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1096 )
1097])
1098if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1099 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1100fi
1101
Damien Miller61e50f12000-05-08 20:49:37 +10001102AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1103 ac_cv_have_ss_family_in_struct_ss, [
1104 AC_TRY_COMPILE(
1105 [
Damien Miller81171112000-04-23 11:14:01 +10001106#include <sys/types.h>
1107#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001108 ],
1109 [ struct sockaddr_storage s; s.ss_family = 1; ],
1110 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1111 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1112 )
1113])
1114if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1115 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1116fi
1117
Damien Miller61e50f12000-05-08 20:49:37 +10001118AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1119 ac_cv_have___ss_family_in_struct_ss, [
1120 AC_TRY_COMPILE(
1121 [
Damien Miller81171112000-04-23 11:14:01 +10001122#include <sys/types.h>
1123#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001124 ],
1125 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1126 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1127 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1128 )
1129])
1130if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1131 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1132fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001133
Damien Millerad833b32000-08-23 10:46:23 +10001134AC_CACHE_CHECK([for pw_class field in struct passwd],
1135 ac_cv_have_pw_class_in_struct_passwd, [
1136 AC_TRY_COMPILE(
1137 [
Damien Millerad833b32000-08-23 10:46:23 +10001138#include <pwd.h>
1139 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001140 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001141 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1142 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1143 )
1144])
1145if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1146 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1147fi
1148
Damien Miller61e50f12000-05-08 20:49:37 +10001149
1150AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1151 AC_TRY_LINK([],
1152 [ extern char *__progname; printf("%s", __progname); ],
1153 [ ac_cv_libc_defines___progname="yes" ],
1154 [ ac_cv_libc_defines___progname="no" ]
1155 )
1156])
1157if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1158 AC_DEFINE(HAVE___PROGNAME)
1159fi
1160
Damien Millera22ba012000-03-02 23:09:20 +11001161
Damien Millerecbb26d2000-07-15 14:59:14 +10001162AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1163 AC_TRY_LINK([],
1164 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1165 [ ac_cv_libc_defines_sys_errlist="yes" ],
1166 [ ac_cv_libc_defines_sys_errlist="no" ]
1167 )
1168])
1169if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1170 AC_DEFINE(HAVE_SYS_ERRLIST)
1171fi
1172
1173
Damien Miller11fa2cc2000-08-16 10:35:58 +10001174AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1175 AC_TRY_LINK([],
1176 [ extern int sys_nerr; printf("%i", sys_nerr);],
1177 [ ac_cv_libc_defines_sys_nerr="yes" ],
1178 [ ac_cv_libc_defines_sys_nerr="no" ]
1179 )
1180])
1181if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1182 AC_DEFINE(HAVE_SYS_NERR)
1183fi
1184
1185
Damien Millera22ba012000-03-02 23:09:20 +11001186# Looking for programs, paths and files
1187AC_ARG_WITH(rsh,
1188 [ --with-rsh=PATH Specify path to remote shell program ],
1189 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001190 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001191 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001192 fi
1193 ],
1194 [
1195 AC_PATH_PROG(rsh_path, rsh)
1196 ]
1197)
1198
1199AC_ARG_WITH(xauth,
1200 [ --with-xauth=PATH Specify path to xauth program ],
1201 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001202 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001203 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001204 fi
1205 ],
1206 [
Damien Miller78315eb2000-09-29 23:01:36 +11001207 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 +10001208 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001209 xauth_path="/usr/openwin/bin/xauth"
1210 fi
1211 ]
1212)
1213
Damien Millera19cf472000-11-29 13:28:50 +11001214if test -z "$xauth_path" ; then
1215 XAUTH_PATH="undefined"
1216 AC_SUBST(XAUTH_PATH)
1217else
Damien Millera22ba012000-03-02 23:09:20 +11001218 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001219 XAUTH_PATH=$xauth_path
1220 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001221fi
1222if test ! -z "$rsh_path" ; then
1223 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1224fi
1225
1226# Check for mail directory (last resort if we cannot get it from headers)
1227if test ! -z "$MAIL" ; then
1228 maildir=`dirname $MAIL`
1229 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1230fi
1231
Damien Millera22ba012000-03-02 23:09:20 +11001232if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001233 AC_CHECK_FILE("/dev/ptmx",
1234 [
1235 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1236 have_dev_ptmx=1
1237 ]
1238 )
Damien Millera22ba012000-03-02 23:09:20 +11001239fi
Damien Miller204ad072000-03-02 23:56:12 +11001240AC_CHECK_FILE("/dev/ptc",
1241 [
1242 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1243 have_dev_ptc=1
1244 ]
1245)
1246
Damien Millera22ba012000-03-02 23:09:20 +11001247# Options from here on. Some of these are preset by platform above
1248
Damien Millera22ba012000-03-02 23:09:20 +11001249# Check for user-specified random device, otherwise check /dev/urandom
1250AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001251 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001252 [
Damien Miller040f3832000-04-03 14:50:43 +10001253 if test "x$withval" != "xno" ; then
1254 RANDOM_POOL="$withval";
1255 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1256 fi
Damien Millera22ba012000-03-02 23:09:20 +11001257 ],
1258 [
1259 # Check for random device
1260 AC_CHECK_FILE("/dev/urandom",
1261 [
1262 RANDOM_POOL="/dev/urandom";
1263 AC_SUBST(RANDOM_POOL)
1264 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1265 ]
1266 )
1267 ]
1268)
1269
Damien Millerd0ccb982001-03-04 00:29:20 +11001270# Check for PRNGD/EGD pool file
1271AC_ARG_WITH(prngd-port,
1272 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1273 [
1274 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1275 PRNGD_PORT="$withval"
1276 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1277 fi
1278 ]
1279)
1280
1281# Check for PRNGD/EGD pool file
1282AC_ARG_WITH(prngd-socket,
1283 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001284 [
Damien Miller040f3832000-04-03 14:50:43 +10001285 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001286 PRNGD_SOCKET="$withval"
1287 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001288 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001289 ],
1290 [
1291 # Check for existing socket only if we don't have a random device already
1292 if test -z "$RANDOM_POOL" ; then
1293 AC_MSG_CHECKING(for PRNGD/EGD socket)
1294 # Insert other locations here
Damien Millerd0ccb982001-03-04 00:29:20 +11001295 for sock in /var/run/egd-pool /etc/entropy; do
1296 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1297 PRNGD_SOCKET="$sock"
1298 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001299 break;
1300 fi
1301 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001302 if test ! -z "$PRNGD_SOCKET" ; then
1303 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001304 else
1305 AC_MSG_RESULT(not found)
1306 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001307 fi
Damien Millera22ba012000-03-02 23:09:20 +11001308 ]
1309)
1310
Damien Miller0736c4d2001-01-25 10:51:46 +11001311
Damien Miller0437b332000-05-02 09:56:41 +10001312# detect pathnames for entropy gathering commands, if we need them
1313INSTALL_SSH_PRNG_CMDS=""
1314rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001315if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001316 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001317 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1318 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1319 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1320 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1321 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1322 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1323 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1324 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1325 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1326 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1327 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1328 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1329 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1330 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001331
1332 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001333fi
Damien Miller0437b332000-05-02 09:56:41 +10001334AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1335
Damien Miller11e37f62000-04-08 18:23:30 +10001336
Damien Miller670a4b82000-01-22 13:53:11 +11001337AC_ARG_WITH(catman,
1338 [ --with-catman=man|cat Install preformatted manpages[no]],
1339 [
1340 MANTYPE='$(CATMAN)'
1341 if test x"$withval" != x"yes" ; then
1342 mansubdir=$withval
1343 else
1344 mansubdir=cat
1345 fi
1346 ], [
1347 if test -z "$MANTYPE" ; then
1348 MANTYPE='$(TROFFMAN)'
1349 mansubdir=man
1350 fi
1351 ]
1352)
1353AC_SUBST(MANTYPE)
1354AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001355
Damien Millera22ba012000-03-02 23:09:20 +11001356# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001357MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001358AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001359 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001360 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001361 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001362 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001363 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001364 fi
1365 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001366)
1367
Damien Millera22ba012000-03-02 23:09:20 +11001368# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001369AC_ARG_WITH(shadow,
1370 [ --without-shadow Disable shadow password support],
1371 [
1372 if test "x$withval" = "xno" ; then
1373 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001374 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001375 fi
1376 ]
1377)
1378
Damien Miller1f335fb2000-06-26 11:31:33 +10001379if test -z "$disable_shadow" ; then
1380 AC_MSG_CHECKING([if the systems has expire shadow information])
1381 AC_TRY_COMPILE(
1382 [
1383#include <sys/types.h>
1384#include <shadow.h>
1385 struct spwd sp;
1386 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1387 [ sp_expire_available=yes ], []
1388 )
1389
1390 if test "x$sp_expire_available" = "xyes" ; then
1391 AC_MSG_RESULT(yes)
1392 AC_DEFINE(HAS_SHADOW_EXPIRE)
1393 else
1394 AC_MSG_RESULT(no)
1395 fi
1396fi
1397
Damien Millera22ba012000-03-02 23:09:20 +11001398# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001399if test ! -z "$IPADDR_IN_DISPLAY" ; then
1400 DISPLAY_HACK_MSG="yes"
1401 AC_DEFINE(IPADDR_IN_DISPLAY)
1402else
1403 DISPLAY_HACK_MSG="no"
1404 AC_ARG_WITH(ipaddr-display,
1405 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1406 [
1407 if test "x$withval" != "xno" ; then
1408 AC_DEFINE(IPADDR_IN_DISPLAY)
1409 DISPLAY_HACK_MSG="yes"
1410 fi
1411 ]
1412 )
1413fi
Damien Miller76112de1999-12-21 11:18:08 +11001414
Damien Millera22ba012000-03-02 23:09:20 +11001415# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001416SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001417AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001418 [ --with-default-path=PATH Specify default \$PATH environment for server],
1419 [
1420 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001421 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001422 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001423 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001424 ],
1425 [
1426 AC_TRY_RUN(
1427 [
1428/* find out what STDPATH is */
1429#include <stdio.h>
1430#include "config.h"
1431#ifdef HAVE_PATHS_H
1432# include <paths.h>
1433#endif
1434#ifndef _PATH_STDPATH
1435# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1436#endif
1437#include <sys/types.h>
1438#include <sys/stat.h>
1439#include <fcntl.h>
1440#define DATA "conftest.stdpath"
1441
1442main()
1443{
1444 FILE *fd;
1445 int rc;
1446
1447 fd = fopen(DATA,"w");
1448 if(fd == NULL)
1449 exit(1);
1450
1451 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1452 exit(1);
1453
1454 exit(0);
1455}
1456 ], [ user_path=`cat conftest.stdpath` ],
1457 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1458 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1459 )
1460# make sure $bindir is in USER_PATH so scp will work
1461 t_bindir=`eval echo ${bindir}`
1462 case $t_bindir in
1463 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1464 esac
1465 case $t_bindir in
1466 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1467 esac
1468 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1469 if test $? -ne 0 ; then
1470 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1471 if test $? -ne 0 ; then
1472 user_path=$user_path:$t_bindir
1473 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1474 fi
1475 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001476 ]
1477)
Tim Rice59ea0a02001-03-10 13:50:45 -08001478AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1479AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001480
Damien Millera22ba012000-03-02 23:09:20 +11001481# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001482IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001483AC_ARG_WITH(ipv4-default,
1484 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1485 [
1486 if test "x$withval" != "xno" ; then
1487 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001488 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001489 fi
1490 ]
1491)
1492
Damien Miller61e50f12000-05-08 20:49:37 +10001493AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001494IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001495AC_ARG_WITH(4in6,
1496 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1497 [
1498 if test "x$withval" != "xno" ; then
1499 AC_MSG_RESULT(yes)
1500 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001501 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001502 else
1503 AC_MSG_RESULT(no)
1504 fi
1505 ],[
1506 if test "x$inet6_default_4in6" = "xyes"; then
1507 AC_MSG_RESULT([yes (default)])
1508 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001509 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001510 else
1511 AC_MSG_RESULT([no (default)])
1512 fi
1513 ]
1514)
1515
Damien Miller60396b02001-02-18 17:01:00 +11001516# Whether to enable BSD auth support
1517AC_ARG_WITH(bsd-auth,
1518 [ --with-bsd-auth Enable BSD auth support],
1519 [
1520 if test "x$withval" != "xno" ; then
1521 AC_DEFINE(BSD_AUTH)
1522 bsd_auth=yes
1523 fi
1524 ]
1525)
1526
Damien Miller78315eb2000-09-29 23:01:36 +11001527AC_MSG_CHECKING(whether to install ssh as suid root)
1528AC_ARG_ENABLE(suid-ssh,
1529[ --enable-suid-ssh Install ssh as suid root (default)
1530 --disable-suid-ssh Install ssh without suid bit],
1531[ case "$enableval" in
1532 no)
1533 AC_MSG_RESULT(no)
1534 SSHMODE=0711
1535 ;;
1536 *) AC_MSG_RESULT(yes)
1537 SSHMODE=04711
1538 ;;
1539 esac ],
1540 AC_MSG_RESULT(yes)
1541 SSHMODE=04711
1542)
1543AC_SUBST(SSHMODE)
1544
1545
Damien Millera22ba012000-03-02 23:09:20 +11001546# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001547piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001548AC_ARG_WITH(pid-dir,
1549 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1550 [
1551 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001552 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001553 fi
1554 ]
1555)
Damien Miller4018c192000-04-30 09:30:44 +10001556
Damien Miller78315eb2000-09-29 23:01:36 +11001557# make sure the directory exists
1558if test ! -d $piddir ; then
1559 piddir=`eval echo ${sysconfdir}`
1560 case $piddir in
1561 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1562 esac
1563fi
1564
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001565AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001566AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001567
andre2ff7b5d2000-06-03 14:57:40 +00001568dnl allow user to disable some login recording features
1569AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001570 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001571 [ AC_DEFINE(DISABLE_LASTLOG) ]
1572)
1573AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001574 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001575 [ AC_DEFINE(DISABLE_UTMP) ]
1576)
1577AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001578 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001579 [ AC_DEFINE(DISABLE_UTMPX) ]
1580)
1581AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001582 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001583 [ AC_DEFINE(DISABLE_WTMP) ]
1584)
1585AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001586 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001587 [ AC_DEFINE(DISABLE_WTMPX) ]
1588)
1589AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001590 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001591 [ AC_DEFINE(DISABLE_LOGIN) ]
1592)
1593AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001594 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001595 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1596)
1597AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001598 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001599 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1600)
1601AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001602 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001603 [
1604 if test "x$withval" = "xno" ; then
1605 AC_DEFINE(DISABLE_LASTLOG)
1606 else
1607 conf_lastlog_location=$withval
1608 fi
1609 ]
1610)
andre2ff7b5d2000-06-03 14:57:40 +00001611
1612dnl lastlog, [uw]tmpx? detection
1613dnl NOTE: set the paths in the platform section to avoid the
1614dnl need for command-line parameters
1615dnl lastlog and [uw]tmp are subject to a file search if all else fails
1616
1617dnl lastlog detection
1618dnl NOTE: the code itself will detect if lastlog is a directory
1619AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1620AC_TRY_COMPILE([
1621#include <sys/types.h>
1622#include <utmp.h>
1623#ifdef HAVE_LASTLOG_H
1624# include <lastlog.h>
1625#endif
Damien Miller2994e082000-06-04 15:51:47 +10001626#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001627# include <paths.h>
1628#endif
1629 ],
1630 [ char *lastlog = LASTLOG_FILE; ],
1631 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001632 [
1633 AC_MSG_RESULT(no)
1634 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1635 AC_TRY_COMPILE([
1636#include <sys/types.h>
1637#include <utmp.h>
1638#ifdef HAVE_LASTLOG_H
1639# include <lastlog.h>
1640#endif
1641#ifdef HAVE_PATHS_H
1642# include <paths.h>
1643#endif
1644 ],
1645 [ char *lastlog = _PATH_LASTLOG; ],
1646 [ AC_MSG_RESULT(yes) ],
1647 [
andree441aa32000-06-12 22:34:38 +00001648 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001649 system_lastlog_path=no
1650 ])
1651 ]
andre2ff7b5d2000-06-03 14:57:40 +00001652)
Damien Miller2994e082000-06-04 15:51:47 +10001653
andre2ff7b5d2000-06-03 14:57:40 +00001654if test -z "$conf_lastlog_location"; then
1655 if test x"$system_lastlog_path" = x"no" ; then
1656 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001657 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001658 conf_lastlog_location=$f
1659 fi
1660 done
1661 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001662 AC_MSG_WARN([** Cannot find lastlog **])
1663 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001664 fi
1665 fi
1666fi
1667
1668if test -n "$conf_lastlog_location"; then
1669 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1670fi
1671
1672dnl utmp detection
1673AC_MSG_CHECKING([if your system defines UTMP_FILE])
1674AC_TRY_COMPILE([
1675#include <sys/types.h>
1676#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001677#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001678# include <paths.h>
1679#endif
1680 ],
1681 [ char *utmp = UTMP_FILE; ],
1682 [ AC_MSG_RESULT(yes) ],
1683 [ AC_MSG_RESULT(no)
1684 system_utmp_path=no ]
1685)
1686if test -z "$conf_utmp_location"; then
1687 if test x"$system_utmp_path" = x"no" ; then
1688 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1689 if test -f $f ; then
1690 conf_utmp_location=$f
1691 fi
1692 done
1693 if test -z "$conf_utmp_location"; then
1694 AC_DEFINE(DISABLE_UTMP)
1695 fi
1696 fi
1697fi
1698if test -n "$conf_utmp_location"; then
1699 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1700fi
1701
1702dnl wtmp detection
1703AC_MSG_CHECKING([if your system defines WTMP_FILE])
1704AC_TRY_COMPILE([
1705#include <sys/types.h>
1706#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001707#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001708# include <paths.h>
1709#endif
1710 ],
1711 [ char *wtmp = WTMP_FILE; ],
1712 [ AC_MSG_RESULT(yes) ],
1713 [ AC_MSG_RESULT(no)
1714 system_wtmp_path=no ]
1715)
1716if test -z "$conf_wtmp_location"; then
1717 if test x"$system_wtmp_path" = x"no" ; then
1718 for f in /usr/adm/wtmp /var/log/wtmp; do
1719 if test -f $f ; then
1720 conf_wtmp_location=$f
1721 fi
1722 done
1723 if test -z "$conf_wtmp_location"; then
1724 AC_DEFINE(DISABLE_WTMP)
1725 fi
1726 fi
1727fi
1728if test -n "$conf_wtmp_location"; then
1729 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1730fi
1731
1732
1733dnl utmpx detection - I don't know any system so perverse as to require
1734dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1735dnl there, though.
1736AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1737AC_TRY_COMPILE([
1738#include <sys/types.h>
1739#include <utmp.h>
1740#ifdef HAVE_UTMPX_H
1741#include <utmpx.h>
1742#endif
Damien Miller2994e082000-06-04 15:51:47 +10001743#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001744# include <paths.h>
1745#endif
1746 ],
1747 [ char *utmpx = UTMPX_FILE; ],
1748 [ AC_MSG_RESULT(yes) ],
1749 [ AC_MSG_RESULT(no)
1750 system_utmpx_path=no ]
1751)
1752if test -z "$conf_utmpx_location"; then
1753 if test x"$system_utmpx_path" = x"no" ; then
1754 AC_DEFINE(DISABLE_UTMPX)
1755 fi
1756else
1757 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1758fi
1759
1760dnl wtmpx detection
1761AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1762AC_TRY_COMPILE([
1763#include <sys/types.h>
1764#include <utmp.h>
1765#ifdef HAVE_UTMPX_H
1766#include <utmpx.h>
1767#endif
Damien Miller2994e082000-06-04 15:51:47 +10001768#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001769# include <paths.h>
1770#endif
1771 ],
1772 [ char *wtmpx = WTMPX_FILE; ],
1773 [ AC_MSG_RESULT(yes) ],
1774 [ AC_MSG_RESULT(no)
1775 system_wtmpx_path=no ]
1776)
1777if test -z "$conf_wtmpx_location"; then
1778 if test x"$system_wtmpx_path" = x"no" ; then
1779 AC_DEFINE(DISABLE_WTMPX)
1780 fi
1781else
1782 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1783fi
1784
Damien Miller4018c192000-04-30 09:30:44 +10001785
1786# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001787entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001788AC_ARG_WITH(entropy-timeout,
1789 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1790 [
1791 if test "x$withval" != "xno" ; then
1792 entropy_timeout=$withval
1793 fi
1794 ]
1795)
1796AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1797
1798
Damien Miller29ea30d2000-03-17 10:54:15 +11001799if test ! -z "$blibpath" ; then
1800 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1801 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1802fi
1803
Damien Millerbac2d8a2000-09-05 16:13:06 +11001804AC_EXEEXT
1805
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001806AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001807
Damien Miller7b22d652000-06-18 14:07:04 +10001808# Print summary of options
1809
1810if test x$MANTYPE = x'$(CATMAN)' ; then
1811 MAN_MSG=cat
1812else
1813 MAN_MSG=man
1814fi
1815if test ! -z "$RANDOM_POOL" ; then
1816 RAND_MSG="Device ($RANDOM_POOL)"
1817else
Damien Millerd0ccb982001-03-04 00:29:20 +11001818 if test ! -z "$PRNGD_PORT" ; then
1819 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1820 elif test ! -z "$PRNGD_SOCKET" ; then
1821 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001822 else
1823 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001824 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001825 fi
1826fi
1827
1828# Someone please show me a better way :)
1829A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1830B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1831C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1832D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001833E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001834F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1835G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001836H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001837
1838echo ""
1839echo "OpenSSH configured has been configured with the following options."
1840echo " User binaries: $B"
1841echo " System binaries: $C"
1842echo " Configuration files: $D"
1843echo " Askpass program: $E"
1844echo " Manual pages: $F"
1845echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001846echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001847echo " Random number collection: $RAND_MSG"
1848echo " Manpage format: $MAN_MSG"
1849echo " PAM support: ${PAM_MSG}"
1850echo " KerberosIV support: $KRB4_MSG"
1851echo " AFS support: $AFS_MSG"
1852echo " S/KEY support: $SKEY_MSG"
1853echo " TCP Wrappers support: $TCPW_MSG"
1854echo " MD5 password support: $MD5_MSG"
1855echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1856echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1857echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1858
Damien Miller60396b02001-02-18 17:01:00 +11001859if test ! -z "$bsd_auth"; then
1860 echo " BSD Auth support: yes"
1861fi
1862
Damien Miller7b22d652000-06-18 14:07:04 +10001863echo ""
1864
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001865echo " Host: ${host}"
1866echo " Compiler: ${CC}"
1867echo " Compiler flags: ${CFLAGS}"
1868echo "Preprocessor flags: ${CPPFLAGS}"
1869echo " Linker flags: ${LDFLAGS}"
1870echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001871
1872echo ""
1873
Damien Miller82cf0ce2000-12-20 13:34:48 +11001874if test "x$PAM_MSG" = "xyes" ; then
1875 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1876 echo "otherwise password authentication may fail. Example PAM control files"
1877 echo "can be found in the contrib/ subdirectory"
1878 echo ""
1879fi
1880
Damien Miller6f9c3372000-10-25 10:06:04 +11001881if test ! -z "$BUILTIN_RNG" ; then
1882 echo "WARNING: you are using the builtin random number collection service."
1883 echo "Please read WARNING.RNG and request that your OS vendor includes"
1884 echo "/dev/random in future versions of their OS."
1885 echo ""
1886fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001887
1888if test ! -z "$NO_SFTP"; then
1889 echo "sftp-server will be disabled. Your compiler does not support"
1890 echo "64bit integers."
1891 echo ""
1892fi
Damien Miller60396b02001-02-18 17:01:00 +11001893