blob: d3a902a8604384d4b922bc8ea3880401e16e7ea8 [file] [log] [blame]
Damien Miller3c027682001-03-14 11:39:45 +11001# $Id: configure.in,v 1.265 2001/03/14 00:39:46 djm Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien 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.
Damien Miller3c027682001-03-14 11:39:45 +1100371AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h glob.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)
372
373# Check for ALTDIRFUNC glob() extension
374AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
375AC_EGREP_CPP(FOUNDIT,
376 [
377 #include <glob.h>
378 #ifdef GLOB_ALTDIRFUNC
379 FOUNDIT
380 #endif
381 ],
382 [
383 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
384 AC_MSG_RESULT(yes)
385 ],
386 [
387 AC_MSG_RESULT(no)
388 ]
389)
Damien Millerab18c411999-11-11 10:40:23 +1100390
Damien Millerc547bf12001-02-16 10:18:12 +1100391# Check whether user wants Kerberos support
392KRB4_MSG="no"
393AC_ARG_WITH(kerberos4,
394 [ --with-kerberos4=PATH Enable Kerberos 4 support],
395 [
396 if test "x$withval" != "xno" ; then
397
398 if test "x$withval" != "xyes" ; then
399 CPPFLAGS="$CPPFLAGS -I${withval}/include"
400 LDFLAGS="$LDFLAGS -L${withval}/lib"
401 if test ! -z "$need_dash_r" ; then
402 LDFLAGS="$LDFLAGS -R${withval}/lib"
403 fi
404 if test ! -z "$blibpath" ; then
405 blibpath="$blibpath:${withval}/lib"
406 fi
407 else
408 if test -d /usr/include/kerberosIV ; then
409 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
410 fi
411 fi
412
413 AC_CHECK_HEADERS(krb.h)
414 AC_CHECK_LIB(krb, main)
415 if test "$ac_cv_header_krb_h" != yes; then
416 AC_MSG_WARN([Cannot find krb.h, build may fail])
417 fi
418 if test "$ac_cv_lib_krb_main" != yes; then
419 AC_MSG_WARN([Cannot find libkrb, build may fail])
420 fi
421
422 KLIBS="-lkrb -ldes"
423 AC_CHECK_LIB(resolv, dn_expand, , )
424 KRB4=yes
425 KRB4_MSG="yes"
426 AC_DEFINE(KRB4)
427 fi
428 ]
429)
430
431# Check whether user wants AFS support
432AFS_MSG="no"
433AC_ARG_WITH(afs,
434 [ --with-afs=PATH Enable AFS support],
435 [
436 if test "x$withval" != "xno" ; then
437
438 if test "x$withval" != "xyes" ; then
439 CPPFLAGS="$CPPFLAGS -I${withval}/include"
440 LDFLAGS="$LDFLAGS -L${withval}/lib"
441 fi
442
443 if test -z "$KRB4" ; then
444 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
445 fi
446
447 LIBS="$LIBS -lkafs"
448 if test ! -z "$AFS_LIBS" ; then
449 LIBS="$LIBS $AFS_LIBS"
450 fi
451 AC_DEFINE(AFS)
452 AFS_MSG="yes"
453 fi
454 ]
455)
456LIBS="$LIBS $KLIBS"
457
458# Check whether user wants S/Key support
459SKEY_MSG="no"
460AC_ARG_WITH(skey,
461 [ --with-skey=PATH Enable S/Key support],
462 [
463 if test "x$withval" != "xno" ; then
464
465 if test "x$withval" != "xyes" ; then
466 CPPFLAGS="$CPPFLAGS -I${withval}/include"
467 LDFLAGS="$LDFLAGS -L${withval}/lib"
468 fi
469
470 AC_DEFINE(SKEY)
471 LIBS="-lskey $LIBS"
472 SKEY_MSG="yes"
473
474 AC_CHECK_FUNC(skey_keyinfo,
475 [],
476 [
477 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
478 ])
479 fi
480 ]
481)
482
483# Check whether user wants TCP wrappers support
484TCPW_MSG="no"
485AC_ARG_WITH(tcp-wrappers,
486 [ --with-tcp-wrappers Enable tcpwrappers support],
487 [
488 if test "x$withval" != "xno" ; then
489 saved_LIBS="$LIBS"
490 LIBS="-lwrap $LIBS"
491 AC_MSG_CHECKING(for libwrap)
492 AC_TRY_LINK(
493 [
494#include <tcpd.h>
495 int deny_severity = 0, allow_severity = 0;
496 ],
497 [hosts_access(0);],
498 [
499 AC_MSG_RESULT(yes)
500 AC_DEFINE(LIBWRAP)
501 TCPW_MSG="yes"
502 ],
503 [
504 AC_MSG_ERROR([*** libwrap missing])
505 ]
506 )
507 fi
508 ]
509)
510
Damien Millerad833b32000-08-23 10:46:23 +1000511dnl Checks for library functions.
Damien Miller3c027682001-03-14 11:39:45 +1100512AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent glob 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 +1000513dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000514AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000515dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000516AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000517AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000518dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000519AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000520AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000521dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000522AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000523AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100524
Damien Miller5fc85652000-07-09 23:53:07 +1000525AC_CHECK_FUNC(getuserattr,
526 [AC_DEFINE(HAVE_GETUSERATTR)],
527 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
528)
529
Damien Miller04f80141999-11-19 15:32:34 +1100530AC_CHECK_FUNC(login,
531 [AC_DEFINE(HAVE_LOGIN)],
532 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
533)
534
535AC_CHECK_FUNC(daemon,
536 [AC_DEFINE(HAVE_DAEMON)],
537 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
538)
539
Damien Miller9fb07e42000-03-05 16:22:59 +1100540AC_CHECK_FUNC(getpagesize,
541 [AC_DEFINE(HAVE_GETPAGESIZE)],
542 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
543)
544
Damien Millercb170cb2000-07-01 16:52:55 +1000545# Check for broken snprintf
546if test "x$ac_cv_func_snprintf" = "xyes" ; then
547 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
548 AC_TRY_RUN(
549 [
550#include <stdio.h>
551int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
552 ],
553 [AC_MSG_RESULT(yes)],
554 [
555 AC_MSG_RESULT(no)
556 AC_DEFINE(BROKEN_SNPRINTF)
557 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
558 ]
559 )
560fi
561
Damien Miller606f8802000-09-16 15:39:56 +1100562AC_FUNC_GETPGRP
563
Damien Millera64b57a2001-01-17 10:44:13 +1100564# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000565PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100566AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100567 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100568 [
Damien Millera64b57a2001-01-17 10:44:13 +1100569 if test "x$withval" != "xno" ; then
570 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
571 AC_MSG_ERROR([PAM headers not found])
572 fi
573
574 AC_CHECK_LIB(dl, dlopen, , )
575 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
576 AC_CHECK_FUNCS(pam_getenvlist)
577
578 disable_shadow=yes
579 PAM_MSG="yes"
580
581 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100582 fi
583 ]
584)
Damien Millera22ba012000-03-02 23:09:20 +1100585
Damien Millera64b57a2001-01-17 10:44:13 +1100586# Check for older PAM
587if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100588 # Check PAM strerror arguments (old PAM)
589 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
590 AC_TRY_COMPILE(
591 [
Damien Miller81171112000-04-23 11:14:01 +1000592#include <stdlib.h>
593#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100594 ],
595 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
596 [AC_MSG_RESULT(no)],
597 [
598 AC_DEFINE(HAVE_OLD_PAM)
599 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000600 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100601 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100602 )
Damien Millera22ba012000-03-02 23:09:20 +1100603fi
604
605# The big search for OpenSSL
606AC_ARG_WITH(ssl-dir,
607 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
608 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000609 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100610 tryssldir=$withval
611 fi
612 ]
613)
614
615saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100616saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000617saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100618if test "x$prefix" != "xNONE" ; then
619 tryssldir="$tryssldir $prefix"
620fi
Damien Miller61e50f12000-05-08 20:49:37 +1000621AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100622 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 +1100623 CPPFLAGS="$saved_CPPFLAGS"
624 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000625 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100626
627 # Skip directories if they don't exist
628 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
629 continue;
630 fi
631 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
632 # Try to use $ssldir/lib if it exists, otherwise
633 # $ssldir
634 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000635 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100636 if test ! -z "$need_dash_r" ; then
637 LDFLAGS="$LDFLAGS -R$ssldir/lib"
638 fi
639 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000640 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100641 if test ! -z "$need_dash_r" ; then
642 LDFLAGS="$LDFLAGS -R$ssldir"
643 fi
644 fi
645 # Try to use $ssldir/include if it exists, otherwise
646 # $ssldir
647 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000648 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100649 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000650 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100651 fi
652 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000653
Damien Miller3b512e12000-05-17 23:29:18 +1000654 # Basic test to check for compatible version and correct linking
655 # *does not* test for RSA - that comes later.
656 AC_TRY_RUN(
657 [
Damien Millere59ce622000-05-01 20:54:17 +1000658#include <string.h>
659#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000660int main(void)
661{
Damien Miller3b512e12000-05-17 23:29:18 +1000662 char a[2048];
663 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000664 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000665 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000666}
Damien Miller3b512e12000-05-17 23:29:18 +1000667 ],
668 [
669 found_crypto=1
670 break;
671 ], []
672 )
Damien Miller61e50f12000-05-08 20:49:37 +1000673
674 if test ! -z "$found_crypto" ; then
675 break;
676 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100677 done
678
Damien Miller61e50f12000-05-08 20:49:37 +1000679 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100680 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100681 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000682 if test -z "$ssldir" ; then
683 ssldir="(system)"
684 fi
Damien Millera22ba012000-03-02 23:09:20 +1100685
Damien Miller61e50f12000-05-08 20:49:37 +1000686 ac_cv_openssldir=$ssldir
687])
688
Damien Milleredb82922000-06-20 13:25:52 +1000689if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000690 AC_DEFINE(HAVE_OPENSSL)
691 dnl Need to recover ssldir - test above runs in subshell
692 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100693 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100694 # Try to use $ssldir/lib if it exists, otherwise
695 # $ssldir
696 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000697 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100698 if test ! -z "$need_dash_r" ; then
699 LDFLAGS="$LDFLAGS -R$ssldir/lib"
700 fi
701 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000702 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100703 if test ! -z "$need_dash_r" ; then
704 LDFLAGS="$LDFLAGS -R$ssldir"
705 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100706 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100707 # Try to use $ssldir/include if it exists, otherwise
708 # $ssldir
709 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000710 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100711 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000712 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100713 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100714 fi
Damien Millera22ba012000-03-02 23:09:20 +1100715fi
Damien Miller3b512e12000-05-17 23:29:18 +1000716LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000717
Damien Miller3b512e12000-05-17 23:29:18 +1000718# Now test RSA support
719saved_LIBS="$LIBS"
720AC_MSG_CHECKING([for RSA support])
721for WANTS_RSAREF in "" 1 ; do
722 if test -z "$WANTS_RSAREF" ; then
723 LIBS="$saved_LIBS"
724 else
725 LIBS="$saved_LIBS -lRSAglue -lrsaref"
726 fi
727 AC_TRY_RUN([
728#include <string.h>
729#include <openssl/rand.h>
730#include <openssl/rsa.h>
731#include <openssl/bn.h>
732#include <openssl/sha.h>
733int main(void)
734{
735 int num; RSA *key; static unsigned char p_in[] = "blahblah";
736 unsigned char c[256], p[256];
737 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
738 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
739 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
740 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
741}
742 ],
743 [
744 rsa_works=1
745 break;
746 ], [])
747done
748
749if test ! -z "$no_rsa" ; then
750 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000751 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000752else
753 if test -z "$rsa_works" ; then
754 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000755 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000756 else
757 if test -z "$WANTS_RSAREF" ; then
758 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000759 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000760 else
Damien Miller7b22d652000-06-18 14:07:04 +1000761 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000762 AC_MSG_RESULT(using RSAref)
763 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
764 fi
765 fi
766fi
Damien Millera22ba012000-03-02 23:09:20 +1100767
Damien Millera64b57a2001-01-17 10:44:13 +1100768# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
769# version in OpenSSL. Skip this for PAM
770if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100771 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100772fi
773
Ben Lindstromb5628642000-10-18 00:02:25 +0000774# Cheap hack to ensure NEWS-OS libraries are arranged right.
775if test ! -z "$SONY" ; then
776 LIBS="$LIBS -liberty";
777fi
778
Damien Millera22ba012000-03-02 23:09:20 +1100779# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100780AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100781AC_CHECK_SIZEOF(short int, 2)
782AC_CHECK_SIZEOF(int, 4)
783AC_CHECK_SIZEOF(long int, 4)
784AC_CHECK_SIZEOF(long long int, 8)
785
Damien Millera22ba012000-03-02 23:09:20 +1100786# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100787AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
788 AC_TRY_COMPILE(
789 [ #include <sys/types.h> ],
790 [ u_int a; a = 1;],
791 [ ac_cv_have_u_int="yes" ],
792 [ ac_cv_have_u_int="no" ]
793 )
794])
795if test "x$ac_cv_have_u_int" = "xyes" ; then
796 AC_DEFINE(HAVE_U_INT)
797 have_u_int=1
798fi
799
Damien Miller61e50f12000-05-08 20:49:37 +1000800AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
801 AC_TRY_COMPILE(
802 [ #include <sys/types.h> ],
803 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
804 [ ac_cv_have_intxx_t="yes" ],
805 [ ac_cv_have_intxx_t="no" ]
806 )
807])
808if test "x$ac_cv_have_intxx_t" = "xyes" ; then
809 AC_DEFINE(HAVE_INTXX_T)
810 have_intxx_t=1
811fi
812
Damien Miller578783e2000-09-23 14:12:24 +1100813AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
814 AC_TRY_COMPILE(
815 [ #include <sys/types.h> ],
816 [ int64_t a; a = 1;],
817 [ ac_cv_have_int64_t="yes" ],
818 [ ac_cv_have_int64_t="no" ]
819 )
820])
821if test "x$ac_cv_have_int64_t" = "xyes" ; then
822 AC_DEFINE(HAVE_INT64_T)
823 have_int64_t=1
824fi
825
Damien Miller61e50f12000-05-08 20:49:37 +1000826AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
827 AC_TRY_COMPILE(
828 [ #include <sys/types.h> ],
829 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
830 [ ac_cv_have_u_intxx_t="yes" ],
831 [ ac_cv_have_u_intxx_t="no" ]
832 )
833])
834if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
835 AC_DEFINE(HAVE_U_INTXX_T)
836 have_u_intxx_t=1
837fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100838
Damien Miller578783e2000-09-23 14:12:24 +1100839AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
840 AC_TRY_COMPILE(
841 [ #include <sys/types.h> ],
842 [ u_int64_t a; a = 1;],
843 [ ac_cv_have_u_int64_t="yes" ],
844 [ ac_cv_have_u_int64_t="no" ]
845 )
846])
847if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
848 AC_DEFINE(HAVE_U_INT64_T)
849 have_u_int64_t=1
850fi
851
Damien Milleredb82922000-06-20 13:25:52 +1000852if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
853 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100854then
855 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
856 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000857 [
858#include <sys/bitypes.h>
859 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100860 [
Damien Miller70494d12000-04-03 15:57:06 +1000861 int8_t a; int16_t b; int32_t c;
862 u_int8_t e; u_int16_t f; u_int32_t g;
863 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100864 ],
865 [
866 AC_DEFINE(HAVE_U_INTXX_T)
867 AC_DEFINE(HAVE_INTXX_T)
868 AC_MSG_RESULT(yes)
869 ],
870 [AC_MSG_RESULT(no)]
871 )
872fi
873
Damien Millerd6121d22000-03-17 23:26:46 +1100874if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000875 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
876 AC_TRY_COMPILE(
877 [
878#include <sys/types.h>
879 ],
880 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
881 [ ac_cv_have_uintxx_t="yes" ],
882 [ ac_cv_have_uintxx_t="no" ]
883 )
884 ])
885 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
886 AC_DEFINE(HAVE_UINTXX_T)
887 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100888fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100889
Damien Miller61e50f12000-05-08 20:49:37 +1000890AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
891 AC_TRY_COMPILE(
892 [
Damien Miller81171112000-04-23 11:14:01 +1000893#include <sys/types.h>
894#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000895 ],
896 [socklen_t foo; foo = 1235;],
897 [ ac_cv_have_socklen_t="yes" ],
898 [ ac_cv_have_socklen_t="no" ]
899 )
900])
901if test "x$ac_cv_have_socklen_t" = "xyes" ; then
902 AC_DEFINE(HAVE_SOCKLEN_T)
903fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100904
Damien Miller61e50f12000-05-08 20:49:37 +1000905AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
906 AC_TRY_COMPILE(
907 [
908#include <sys/types.h>
909 ],
910 [ size_t foo; foo = 1235; ],
911 [ ac_cv_have_size_t="yes" ],
912 [ ac_cv_have_size_t="no" ]
913 )
914])
915if test "x$ac_cv_have_size_t" = "xyes" ; then
916 AC_DEFINE(HAVE_SIZE_T)
917fi
Damien Miller95058511999-12-29 10:36:45 +1100918
Damien Miller615f9392000-05-17 22:53:33 +1000919AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
920 AC_TRY_COMPILE(
921 [
922#include <sys/types.h>
923 ],
924 [ ssize_t foo; foo = 1235; ],
925 [ ac_cv_have_ssize_t="yes" ],
926 [ ac_cv_have_ssize_t="no" ]
927 )
928])
929if test "x$ac_cv_have_ssize_t" = "xyes" ; then
930 AC_DEFINE(HAVE_SSIZE_T)
931fi
932
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000933AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
934 AC_TRY_COMPILE(
935 [
936#include <time.h>
937 ],
938 [ clock_t foo; foo = 1235; ],
939 [ ac_cv_have_clock_t="yes" ],
940 [ ac_cv_have_clock_t="no" ]
941 )
942])
943if test "x$ac_cv_have_clock_t" = "xyes" ; then
944 AC_DEFINE(HAVE_CLOCK_T)
945fi
946
Damien Millerb54b40e2000-06-23 08:23:34 +1000947AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
948 AC_TRY_COMPILE(
949 [
950#include <sys/types.h>
951#include <sys/socket.h>
952 ],
953 [ sa_family_t foo; foo = 1235; ],
954 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100955 [ AC_TRY_COMPILE(
956 [
957#include <sys/types.h>
958#include <sys/socket.h>
959#include <netinet/in.h>
960 ],
961 [ sa_family_t foo; foo = 1235; ],
962 [ ac_cv_have_sa_family_t="yes" ],
963
Damien Millerb54b40e2000-06-23 08:23:34 +1000964 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100965 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000966 )
967])
968if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
969 AC_DEFINE(HAVE_SA_FAMILY_T)
970fi
971
Damien Miller0f91b4e2000-06-18 15:43:25 +1000972AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
973 AC_TRY_COMPILE(
974 [
975#include <sys/types.h>
976 ],
977 [ pid_t foo; foo = 1235; ],
978 [ ac_cv_have_pid_t="yes" ],
979 [ ac_cv_have_pid_t="no" ]
980 )
981])
982if test "x$ac_cv_have_pid_t" = "xyes" ; then
983 AC_DEFINE(HAVE_PID_T)
984fi
985
986AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
987 AC_TRY_COMPILE(
988 [
989#include <sys/types.h>
990 ],
991 [ mode_t foo; foo = 1235; ],
992 [ ac_cv_have_mode_t="yes" ],
993 [ ac_cv_have_mode_t="no" ]
994 )
995])
996if test "x$ac_cv_have_mode_t" = "xyes" ; then
997 AC_DEFINE(HAVE_MODE_T)
998fi
999
Damien Miller61e50f12000-05-08 20:49:37 +10001000
1001AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1002 AC_TRY_COMPILE(
1003 [
Damien Miller81171112000-04-23 11:14:01 +10001004#include <sys/types.h>
1005#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001006 ],
1007 [ struct sockaddr_storage s; ],
1008 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1009 [ ac_cv_have_struct_sockaddr_storage="no" ]
1010 )
1011])
1012if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1013 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1014fi
Damien Miller34132e52000-01-14 15:45:46 +11001015
Damien Miller61e50f12000-05-08 20:49:37 +10001016AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1017 AC_TRY_COMPILE(
1018 [
Damien Miller7b22d652000-06-18 14:07:04 +10001019#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001020#include <netinet/in.h>
1021 ],
1022 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1023 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1024 [ ac_cv_have_struct_sockaddr_in6="no" ]
1025 )
1026])
1027if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1028 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1029fi
Damien Miller34132e52000-01-14 15:45:46 +11001030
Damien Miller61e50f12000-05-08 20:49:37 +10001031AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1032 AC_TRY_COMPILE(
1033 [
Damien Miller7b22d652000-06-18 14:07:04 +10001034#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001035#include <netinet/in.h>
1036 ],
1037 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1038 [ ac_cv_have_struct_in6_addr="yes" ],
1039 [ ac_cv_have_struct_in6_addr="no" ]
1040 )
1041])
1042if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1043 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1044fi
Damien Miller34132e52000-01-14 15:45:46 +11001045
Damien Miller61e50f12000-05-08 20:49:37 +10001046AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1047 AC_TRY_COMPILE(
1048 [
Damien Miller81171112000-04-23 11:14:01 +10001049#include <sys/types.h>
1050#include <sys/socket.h>
1051#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001052 ],
1053 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1054 [ ac_cv_have_struct_addrinfo="yes" ],
1055 [ ac_cv_have_struct_addrinfo="no" ]
1056 )
1057])
1058if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1059 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1060fi
1061
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001062AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1063 AC_TRY_COMPILE(
1064 [ #include <sys/time.h> ],
1065 [ struct timeval tv; tv.tv_sec = 1;],
1066 [ ac_cv_have_struct_timeval="yes" ],
1067 [ ac_cv_have_struct_timeval="no" ]
1068 )
1069])
1070if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1071 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1072 have_struct_timeval=1
1073fi
1074
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001075# If we don't have int64_t then we can't compile sftp-server. So don't
1076# even attempt to do it.
1077if test "x$ac_cv_have_int64_t" = "xno" -a \
1078 "x$ac_cv_sizeof_long_int" != "x8" -a \
1079 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1080 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001081else
1082dnl test snprintf (broken on SCO w/gcc)
1083 AC_TRY_RUN(
1084 [
1085#include <stdio.h>
1086#include <string.h>
1087#ifdef HAVE_SNPRINTF
1088main()
1089{
1090 char buf[50];
1091 char expected_out[50];
1092 int mazsize = 50 ;
1093#if (SIZEOF_LONG_INT == 8)
1094 long int num = 0x7fffffffffffffff;
1095#else
1096 long long num = 0x7fffffffffffffff;
1097#endif
1098 strcpy(expected_out, "9223372036854775807");
1099 snprintf(buf, mazsize, "%lld", num);
1100 if(strcmp(buf, expected_out) != 0)
1101 exit(1);
1102 exit(0);
1103}
1104#else
1105main() { exit(0); }
1106#endif
1107 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1108 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001109fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001110AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001111
Damien Miller78315eb2000-09-29 23:01:36 +11001112dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001113OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1114OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1115OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1116OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1117OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001118OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001119OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1120OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001121OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001122OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1123OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1124OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1125OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001126OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1127OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1128OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1129OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001130AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001131
Damien Miller942da032000-08-18 13:59:06 +10001132AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1133 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1134 AC_TRY_COMPILE(
1135 [
1136#include <sys/types.h>
1137#include <sys/socket.h>
1138 ],
1139 [ struct sockaddr_un s; s.sun_len = 1; ],
1140 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1141 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1142 )
1143])
1144if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1145 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1146fi
1147
Damien Miller61e50f12000-05-08 20:49:37 +10001148AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1149 ac_cv_have_ss_family_in_struct_ss, [
1150 AC_TRY_COMPILE(
1151 [
Damien Miller81171112000-04-23 11:14:01 +10001152#include <sys/types.h>
1153#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001154 ],
1155 [ struct sockaddr_storage s; s.ss_family = 1; ],
1156 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1157 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1158 )
1159])
1160if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1161 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1162fi
1163
Damien Miller61e50f12000-05-08 20:49:37 +10001164AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1165 ac_cv_have___ss_family_in_struct_ss, [
1166 AC_TRY_COMPILE(
1167 [
Damien Miller81171112000-04-23 11:14:01 +10001168#include <sys/types.h>
1169#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001170 ],
1171 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1172 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1173 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1174 )
1175])
1176if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1177 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1178fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001179
Damien Millerad833b32000-08-23 10:46:23 +10001180AC_CACHE_CHECK([for pw_class field in struct passwd],
1181 ac_cv_have_pw_class_in_struct_passwd, [
1182 AC_TRY_COMPILE(
1183 [
Damien Millerad833b32000-08-23 10:46:23 +10001184#include <pwd.h>
1185 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001186 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001187 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1188 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1189 )
1190])
1191if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1192 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1193fi
1194
Damien Miller61e50f12000-05-08 20:49:37 +10001195
1196AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1197 AC_TRY_LINK([],
1198 [ extern char *__progname; printf("%s", __progname); ],
1199 [ ac_cv_libc_defines___progname="yes" ],
1200 [ ac_cv_libc_defines___progname="no" ]
1201 )
1202])
1203if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1204 AC_DEFINE(HAVE___PROGNAME)
1205fi
1206
Damien Millera22ba012000-03-02 23:09:20 +11001207
Damien Millerecbb26d2000-07-15 14:59:14 +10001208AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1209 AC_TRY_LINK([],
1210 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1211 [ ac_cv_libc_defines_sys_errlist="yes" ],
1212 [ ac_cv_libc_defines_sys_errlist="no" ]
1213 )
1214])
1215if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1216 AC_DEFINE(HAVE_SYS_ERRLIST)
1217fi
1218
1219
Damien Miller11fa2cc2000-08-16 10:35:58 +10001220AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1221 AC_TRY_LINK([],
1222 [ extern int sys_nerr; printf("%i", sys_nerr);],
1223 [ ac_cv_libc_defines_sys_nerr="yes" ],
1224 [ ac_cv_libc_defines_sys_nerr="no" ]
1225 )
1226])
1227if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1228 AC_DEFINE(HAVE_SYS_NERR)
1229fi
1230
1231
Damien Millera22ba012000-03-02 23:09:20 +11001232# Looking for programs, paths and files
1233AC_ARG_WITH(rsh,
1234 [ --with-rsh=PATH Specify path to remote shell program ],
1235 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001236 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001237 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001238 fi
1239 ],
1240 [
1241 AC_PATH_PROG(rsh_path, rsh)
1242 ]
1243)
1244
1245AC_ARG_WITH(xauth,
1246 [ --with-xauth=PATH Specify path to xauth program ],
1247 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001248 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001249 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001250 fi
1251 ],
1252 [
Damien Miller78315eb2000-09-29 23:01:36 +11001253 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 +10001254 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001255 xauth_path="/usr/openwin/bin/xauth"
1256 fi
1257 ]
1258)
1259
Damien Millera19cf472000-11-29 13:28:50 +11001260if test -z "$xauth_path" ; then
1261 XAUTH_PATH="undefined"
1262 AC_SUBST(XAUTH_PATH)
1263else
Damien Millera22ba012000-03-02 23:09:20 +11001264 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001265 XAUTH_PATH=$xauth_path
1266 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001267fi
1268if test ! -z "$rsh_path" ; then
1269 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1270fi
1271
1272# Check for mail directory (last resort if we cannot get it from headers)
1273if test ! -z "$MAIL" ; then
1274 maildir=`dirname $MAIL`
1275 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1276fi
1277
Damien Millera22ba012000-03-02 23:09:20 +11001278if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001279 AC_CHECK_FILE("/dev/ptmx",
1280 [
1281 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1282 have_dev_ptmx=1
1283 ]
1284 )
Damien Millera22ba012000-03-02 23:09:20 +11001285fi
Damien Miller204ad072000-03-02 23:56:12 +11001286AC_CHECK_FILE("/dev/ptc",
1287 [
1288 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1289 have_dev_ptc=1
1290 ]
1291)
1292
Damien Millera22ba012000-03-02 23:09:20 +11001293# Options from here on. Some of these are preset by platform above
1294
Damien Millera22ba012000-03-02 23:09:20 +11001295# Check for user-specified random device, otherwise check /dev/urandom
1296AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001297 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001298 [
Damien Miller040f3832000-04-03 14:50:43 +10001299 if test "x$withval" != "xno" ; then
1300 RANDOM_POOL="$withval";
1301 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1302 fi
Damien Millera22ba012000-03-02 23:09:20 +11001303 ],
1304 [
1305 # Check for random device
1306 AC_CHECK_FILE("/dev/urandom",
1307 [
1308 RANDOM_POOL="/dev/urandom";
1309 AC_SUBST(RANDOM_POOL)
1310 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1311 ]
1312 )
1313 ]
1314)
1315
Damien Millerd0ccb982001-03-04 00:29:20 +11001316# Check for PRNGD/EGD pool file
1317AC_ARG_WITH(prngd-port,
1318 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1319 [
1320 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1321 PRNGD_PORT="$withval"
1322 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1323 fi
1324 ]
1325)
1326
1327# Check for PRNGD/EGD pool file
1328AC_ARG_WITH(prngd-socket,
1329 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001330 [
Damien Miller040f3832000-04-03 14:50:43 +10001331 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001332 PRNGD_SOCKET="$withval"
1333 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001334 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001335 ],
1336 [
1337 # Check for existing socket only if we don't have a random device already
1338 if test -z "$RANDOM_POOL" ; then
1339 AC_MSG_CHECKING(for PRNGD/EGD socket)
1340 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001341 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001342 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1343 PRNGD_SOCKET="$sock"
1344 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001345 break;
1346 fi
1347 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001348 if test ! -z "$PRNGD_SOCKET" ; then
1349 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001350 else
1351 AC_MSG_RESULT(not found)
1352 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001353 fi
Damien Millera22ba012000-03-02 23:09:20 +11001354 ]
1355)
1356
Damien Miller0736c4d2001-01-25 10:51:46 +11001357
Damien Miller0437b332000-05-02 09:56:41 +10001358# detect pathnames for entropy gathering commands, if we need them
1359INSTALL_SSH_PRNG_CMDS=""
1360rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001361if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001362 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001363 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1364 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1365 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1366 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1367 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1368 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1369 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1370 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1371 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1372 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1373 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1374 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1375 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1376 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001377
1378 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001379fi
Damien Miller0437b332000-05-02 09:56:41 +10001380AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1381
Damien Miller11e37f62000-04-08 18:23:30 +10001382
Damien Miller670a4b82000-01-22 13:53:11 +11001383AC_ARG_WITH(catman,
1384 [ --with-catman=man|cat Install preformatted manpages[no]],
1385 [
1386 MANTYPE='$(CATMAN)'
1387 if test x"$withval" != x"yes" ; then
1388 mansubdir=$withval
1389 else
1390 mansubdir=cat
1391 fi
1392 ], [
1393 if test -z "$MANTYPE" ; then
1394 MANTYPE='$(TROFFMAN)'
1395 mansubdir=man
1396 fi
1397 ]
1398)
1399AC_SUBST(MANTYPE)
1400AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001401
Damien Millera22ba012000-03-02 23:09:20 +11001402# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001403MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001404AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001405 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001406 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001407 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001408 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001409 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001410 fi
1411 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001412)
1413
Damien Millera22ba012000-03-02 23:09:20 +11001414# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001415AC_ARG_WITH(shadow,
1416 [ --without-shadow Disable shadow password support],
1417 [
1418 if test "x$withval" = "xno" ; then
1419 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001420 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001421 fi
1422 ]
1423)
1424
Damien Miller1f335fb2000-06-26 11:31:33 +10001425if test -z "$disable_shadow" ; then
1426 AC_MSG_CHECKING([if the systems has expire shadow information])
1427 AC_TRY_COMPILE(
1428 [
1429#include <sys/types.h>
1430#include <shadow.h>
1431 struct spwd sp;
1432 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1433 [ sp_expire_available=yes ], []
1434 )
1435
1436 if test "x$sp_expire_available" = "xyes" ; then
1437 AC_MSG_RESULT(yes)
1438 AC_DEFINE(HAS_SHADOW_EXPIRE)
1439 else
1440 AC_MSG_RESULT(no)
1441 fi
1442fi
1443
Damien Millera22ba012000-03-02 23:09:20 +11001444# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001445if test ! -z "$IPADDR_IN_DISPLAY" ; then
1446 DISPLAY_HACK_MSG="yes"
1447 AC_DEFINE(IPADDR_IN_DISPLAY)
1448else
1449 DISPLAY_HACK_MSG="no"
1450 AC_ARG_WITH(ipaddr-display,
1451 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1452 [
1453 if test "x$withval" != "xno" ; then
1454 AC_DEFINE(IPADDR_IN_DISPLAY)
1455 DISPLAY_HACK_MSG="yes"
1456 fi
1457 ]
1458 )
1459fi
Damien Miller76112de1999-12-21 11:18:08 +11001460
Damien Millera22ba012000-03-02 23:09:20 +11001461# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001462SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001463AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001464 [ --with-default-path=PATH Specify default \$PATH environment for server],
1465 [
1466 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001467 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001468 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001469 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001470 ],
1471 [
1472 AC_TRY_RUN(
1473 [
1474/* find out what STDPATH is */
1475#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001476#ifdef HAVE_PATHS_H
1477# include <paths.h>
1478#endif
1479#ifndef _PATH_STDPATH
1480# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1481#endif
1482#include <sys/types.h>
1483#include <sys/stat.h>
1484#include <fcntl.h>
1485#define DATA "conftest.stdpath"
1486
1487main()
1488{
1489 FILE *fd;
1490 int rc;
1491
1492 fd = fopen(DATA,"w");
1493 if(fd == NULL)
1494 exit(1);
1495
1496 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1497 exit(1);
1498
1499 exit(0);
1500}
1501 ], [ user_path=`cat conftest.stdpath` ],
1502 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1503 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1504 )
1505# make sure $bindir is in USER_PATH so scp will work
1506 t_bindir=`eval echo ${bindir}`
1507 case $t_bindir in
1508 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1509 esac
1510 case $t_bindir in
1511 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1512 esac
1513 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1514 if test $? -ne 0 ; then
1515 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1516 if test $? -ne 0 ; then
1517 user_path=$user_path:$t_bindir
1518 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1519 fi
1520 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001521 ]
1522)
Tim Rice59ea0a02001-03-10 13:50:45 -08001523AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1524AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001525
Damien Millera22ba012000-03-02 23:09:20 +11001526# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001527IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001528AC_ARG_WITH(ipv4-default,
1529 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1530 [
1531 if test "x$withval" != "xno" ; then
1532 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001533 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001534 fi
1535 ]
1536)
1537
Damien Miller61e50f12000-05-08 20:49:37 +10001538AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001539IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001540AC_ARG_WITH(4in6,
1541 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1542 [
1543 if test "x$withval" != "xno" ; then
1544 AC_MSG_RESULT(yes)
1545 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001546 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001547 else
1548 AC_MSG_RESULT(no)
1549 fi
1550 ],[
1551 if test "x$inet6_default_4in6" = "xyes"; then
1552 AC_MSG_RESULT([yes (default)])
1553 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001554 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001555 else
1556 AC_MSG_RESULT([no (default)])
1557 fi
1558 ]
1559)
1560
Damien Miller60396b02001-02-18 17:01:00 +11001561# Whether to enable BSD auth support
1562AC_ARG_WITH(bsd-auth,
1563 [ --with-bsd-auth Enable BSD auth support],
1564 [
1565 if test "x$withval" != "xno" ; then
1566 AC_DEFINE(BSD_AUTH)
1567 bsd_auth=yes
1568 fi
1569 ]
1570)
1571
Damien Miller78315eb2000-09-29 23:01:36 +11001572AC_MSG_CHECKING(whether to install ssh as suid root)
1573AC_ARG_ENABLE(suid-ssh,
1574[ --enable-suid-ssh Install ssh as suid root (default)
1575 --disable-suid-ssh Install ssh without suid bit],
1576[ case "$enableval" in
1577 no)
1578 AC_MSG_RESULT(no)
1579 SSHMODE=0711
1580 ;;
1581 *) AC_MSG_RESULT(yes)
1582 SSHMODE=04711
1583 ;;
1584 esac ],
1585 AC_MSG_RESULT(yes)
1586 SSHMODE=04711
1587)
1588AC_SUBST(SSHMODE)
1589
1590
Damien Millera22ba012000-03-02 23:09:20 +11001591# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001592piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001593AC_ARG_WITH(pid-dir,
1594 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1595 [
1596 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001597 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001598 fi
1599 ]
1600)
Damien Miller4018c192000-04-30 09:30:44 +10001601
Damien Miller78315eb2000-09-29 23:01:36 +11001602# make sure the directory exists
1603if test ! -d $piddir ; then
1604 piddir=`eval echo ${sysconfdir}`
1605 case $piddir in
1606 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1607 esac
1608fi
1609
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001610AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001611AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001612
andre2ff7b5d2000-06-03 14:57:40 +00001613dnl allow user to disable some login recording features
1614AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001615 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001616 [ AC_DEFINE(DISABLE_LASTLOG) ]
1617)
1618AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001619 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001620 [ AC_DEFINE(DISABLE_UTMP) ]
1621)
1622AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001623 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001624 [ AC_DEFINE(DISABLE_UTMPX) ]
1625)
1626AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001627 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001628 [ AC_DEFINE(DISABLE_WTMP) ]
1629)
1630AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001631 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001632 [ AC_DEFINE(DISABLE_WTMPX) ]
1633)
1634AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001635 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001636 [ AC_DEFINE(DISABLE_LOGIN) ]
1637)
1638AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001639 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001640 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1641)
1642AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001643 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001644 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1645)
1646AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001647 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001648 [
1649 if test "x$withval" = "xno" ; then
1650 AC_DEFINE(DISABLE_LASTLOG)
1651 else
1652 conf_lastlog_location=$withval
1653 fi
1654 ]
1655)
andre2ff7b5d2000-06-03 14:57:40 +00001656
1657dnl lastlog, [uw]tmpx? detection
1658dnl NOTE: set the paths in the platform section to avoid the
1659dnl need for command-line parameters
1660dnl lastlog and [uw]tmp are subject to a file search if all else fails
1661
1662dnl lastlog detection
1663dnl NOTE: the code itself will detect if lastlog is a directory
1664AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1665AC_TRY_COMPILE([
1666#include <sys/types.h>
1667#include <utmp.h>
1668#ifdef HAVE_LASTLOG_H
1669# include <lastlog.h>
1670#endif
Damien Miller2994e082000-06-04 15:51:47 +10001671#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001672# include <paths.h>
1673#endif
1674 ],
1675 [ char *lastlog = LASTLOG_FILE; ],
1676 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001677 [
1678 AC_MSG_RESULT(no)
1679 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1680 AC_TRY_COMPILE([
1681#include <sys/types.h>
1682#include <utmp.h>
1683#ifdef HAVE_LASTLOG_H
1684# include <lastlog.h>
1685#endif
1686#ifdef HAVE_PATHS_H
1687# include <paths.h>
1688#endif
1689 ],
1690 [ char *lastlog = _PATH_LASTLOG; ],
1691 [ AC_MSG_RESULT(yes) ],
1692 [
andree441aa32000-06-12 22:34:38 +00001693 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001694 system_lastlog_path=no
1695 ])
1696 ]
andre2ff7b5d2000-06-03 14:57:40 +00001697)
Damien Miller2994e082000-06-04 15:51:47 +10001698
andre2ff7b5d2000-06-03 14:57:40 +00001699if test -z "$conf_lastlog_location"; then
1700 if test x"$system_lastlog_path" = x"no" ; then
1701 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001702 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001703 conf_lastlog_location=$f
1704 fi
1705 done
1706 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001707 AC_MSG_WARN([** Cannot find lastlog **])
1708 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001709 fi
1710 fi
1711fi
1712
1713if test -n "$conf_lastlog_location"; then
1714 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1715fi
1716
1717dnl utmp detection
1718AC_MSG_CHECKING([if your system defines UTMP_FILE])
1719AC_TRY_COMPILE([
1720#include <sys/types.h>
1721#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001722#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001723# include <paths.h>
1724#endif
1725 ],
1726 [ char *utmp = UTMP_FILE; ],
1727 [ AC_MSG_RESULT(yes) ],
1728 [ AC_MSG_RESULT(no)
1729 system_utmp_path=no ]
1730)
1731if test -z "$conf_utmp_location"; then
1732 if test x"$system_utmp_path" = x"no" ; then
1733 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1734 if test -f $f ; then
1735 conf_utmp_location=$f
1736 fi
1737 done
1738 if test -z "$conf_utmp_location"; then
1739 AC_DEFINE(DISABLE_UTMP)
1740 fi
1741 fi
1742fi
1743if test -n "$conf_utmp_location"; then
1744 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1745fi
1746
1747dnl wtmp detection
1748AC_MSG_CHECKING([if your system defines WTMP_FILE])
1749AC_TRY_COMPILE([
1750#include <sys/types.h>
1751#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001752#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001753# include <paths.h>
1754#endif
1755 ],
1756 [ char *wtmp = WTMP_FILE; ],
1757 [ AC_MSG_RESULT(yes) ],
1758 [ AC_MSG_RESULT(no)
1759 system_wtmp_path=no ]
1760)
1761if test -z "$conf_wtmp_location"; then
1762 if test x"$system_wtmp_path" = x"no" ; then
1763 for f in /usr/adm/wtmp /var/log/wtmp; do
1764 if test -f $f ; then
1765 conf_wtmp_location=$f
1766 fi
1767 done
1768 if test -z "$conf_wtmp_location"; then
1769 AC_DEFINE(DISABLE_WTMP)
1770 fi
1771 fi
1772fi
1773if test -n "$conf_wtmp_location"; then
1774 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1775fi
1776
1777
1778dnl utmpx detection - I don't know any system so perverse as to require
1779dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1780dnl there, though.
1781AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1782AC_TRY_COMPILE([
1783#include <sys/types.h>
1784#include <utmp.h>
1785#ifdef HAVE_UTMPX_H
1786#include <utmpx.h>
1787#endif
Damien Miller2994e082000-06-04 15:51:47 +10001788#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001789# include <paths.h>
1790#endif
1791 ],
1792 [ char *utmpx = UTMPX_FILE; ],
1793 [ AC_MSG_RESULT(yes) ],
1794 [ AC_MSG_RESULT(no)
1795 system_utmpx_path=no ]
1796)
1797if test -z "$conf_utmpx_location"; then
1798 if test x"$system_utmpx_path" = x"no" ; then
1799 AC_DEFINE(DISABLE_UTMPX)
1800 fi
1801else
1802 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1803fi
1804
1805dnl wtmpx detection
1806AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1807AC_TRY_COMPILE([
1808#include <sys/types.h>
1809#include <utmp.h>
1810#ifdef HAVE_UTMPX_H
1811#include <utmpx.h>
1812#endif
Damien Miller2994e082000-06-04 15:51:47 +10001813#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001814# include <paths.h>
1815#endif
1816 ],
1817 [ char *wtmpx = WTMPX_FILE; ],
1818 [ AC_MSG_RESULT(yes) ],
1819 [ AC_MSG_RESULT(no)
1820 system_wtmpx_path=no ]
1821)
1822if test -z "$conf_wtmpx_location"; then
1823 if test x"$system_wtmpx_path" = x"no" ; then
1824 AC_DEFINE(DISABLE_WTMPX)
1825 fi
1826else
1827 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1828fi
1829
Damien Miller4018c192000-04-30 09:30:44 +10001830
1831# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001832entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001833AC_ARG_WITH(entropy-timeout,
1834 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1835 [
1836 if test "x$withval" != "xno" ; then
1837 entropy_timeout=$withval
1838 fi
1839 ]
1840)
1841AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1842
1843
Damien Miller29ea30d2000-03-17 10:54:15 +11001844if test ! -z "$blibpath" ; then
1845 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1846 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1847fi
1848
Damien Millerbac2d8a2000-09-05 16:13:06 +11001849AC_EXEEXT
1850
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001851AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001852
Damien Miller7b22d652000-06-18 14:07:04 +10001853# Print summary of options
1854
1855if test x$MANTYPE = x'$(CATMAN)' ; then
1856 MAN_MSG=cat
1857else
1858 MAN_MSG=man
1859fi
1860if test ! -z "$RANDOM_POOL" ; then
1861 RAND_MSG="Device ($RANDOM_POOL)"
1862else
Damien Millerd0ccb982001-03-04 00:29:20 +11001863 if test ! -z "$PRNGD_PORT" ; then
1864 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1865 elif test ! -z "$PRNGD_SOCKET" ; then
1866 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001867 else
1868 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001869 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001870 fi
1871fi
1872
1873# Someone please show me a better way :)
1874A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1875B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1876C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1877D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001878E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001879F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1880G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001881H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001882
1883echo ""
1884echo "OpenSSH configured has been configured with the following options."
1885echo " User binaries: $B"
1886echo " System binaries: $C"
1887echo " Configuration files: $D"
1888echo " Askpass program: $E"
1889echo " Manual pages: $F"
1890echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001891echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001892echo " Random number collection: $RAND_MSG"
1893echo " Manpage format: $MAN_MSG"
1894echo " PAM support: ${PAM_MSG}"
1895echo " KerberosIV support: $KRB4_MSG"
1896echo " AFS support: $AFS_MSG"
1897echo " S/KEY support: $SKEY_MSG"
1898echo " TCP Wrappers support: $TCPW_MSG"
1899echo " MD5 password support: $MD5_MSG"
1900echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1901echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1902echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1903
Damien Miller60396b02001-02-18 17:01:00 +11001904if test ! -z "$bsd_auth"; then
1905 echo " BSD Auth support: yes"
1906fi
1907
Damien Miller7b22d652000-06-18 14:07:04 +10001908echo ""
1909
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001910echo " Host: ${host}"
1911echo " Compiler: ${CC}"
1912echo " Compiler flags: ${CFLAGS}"
1913echo "Preprocessor flags: ${CPPFLAGS}"
1914echo " Linker flags: ${LDFLAGS}"
1915echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001916
1917echo ""
1918
Damien Miller82cf0ce2000-12-20 13:34:48 +11001919if test "x$PAM_MSG" = "xyes" ; then
1920 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1921 echo "otherwise password authentication may fail. Example PAM control files"
1922 echo "can be found in the contrib/ subdirectory"
1923 echo ""
1924fi
1925
Damien Miller6f9c3372000-10-25 10:06:04 +11001926if test ! -z "$BUILTIN_RNG" ; then
1927 echo "WARNING: you are using the builtin random number collection service."
1928 echo "Please read WARNING.RNG and request that your OS vendor includes"
1929 echo "/dev/random in future versions of their OS."
1930 echo ""
1931fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001932
1933if test ! -z "$NO_SFTP"; then
1934 echo "sftp-server will be disabled. Your compiler does not support"
1935 echo "64bit integers."
1936 echo ""
1937fi
Damien Miller60396b02001-02-18 17:01:00 +11001938