blob: 61d1e06a4be0e89a9c3afea998d4d631c6c74c9f [file] [log] [blame]
Damien Miller9de61e82001-03-19 10:09:27 +11001# $Id: configure.in,v 1.267 2001/03/18 23:09:28 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
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000391# Check for g.gl_matchc glob() extension
392AC_MSG_CHECKING(for gl_matchc field in glob_t)
393AC_EGREP_CPP(FOUNDIT,
394 [
395 #include <glob.h>
396 int main(void){glob_t g; g.gl_matchc = 1;}
397 ],
398 [
399 AC_DEFINE(GLOB_HAS_GL_MATCHC)
400 AC_MSG_RESULT(yes)
401 ],
402 [
403 AC_MSG_RESULT(no)
404 ]
405)
406
407
408
Damien Millerc547bf12001-02-16 10:18:12 +1100409# Check whether user wants Kerberos support
410KRB4_MSG="no"
411AC_ARG_WITH(kerberos4,
412 [ --with-kerberos4=PATH Enable Kerberos 4 support],
413 [
414 if test "x$withval" != "xno" ; then
415
416 if test "x$withval" != "xyes" ; then
417 CPPFLAGS="$CPPFLAGS -I${withval}/include"
418 LDFLAGS="$LDFLAGS -L${withval}/lib"
419 if test ! -z "$need_dash_r" ; then
420 LDFLAGS="$LDFLAGS -R${withval}/lib"
421 fi
422 if test ! -z "$blibpath" ; then
423 blibpath="$blibpath:${withval}/lib"
424 fi
425 else
426 if test -d /usr/include/kerberosIV ; then
427 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
428 fi
429 fi
430
431 AC_CHECK_HEADERS(krb.h)
432 AC_CHECK_LIB(krb, main)
433 if test "$ac_cv_header_krb_h" != yes; then
434 AC_MSG_WARN([Cannot find krb.h, build may fail])
435 fi
436 if test "$ac_cv_lib_krb_main" != yes; then
437 AC_MSG_WARN([Cannot find libkrb, build may fail])
438 fi
439
440 KLIBS="-lkrb -ldes"
441 AC_CHECK_LIB(resolv, dn_expand, , )
442 KRB4=yes
443 KRB4_MSG="yes"
444 AC_DEFINE(KRB4)
445 fi
446 ]
447)
448
449# Check whether user wants AFS support
450AFS_MSG="no"
451AC_ARG_WITH(afs,
452 [ --with-afs=PATH Enable AFS support],
453 [
454 if test "x$withval" != "xno" ; then
455
456 if test "x$withval" != "xyes" ; then
457 CPPFLAGS="$CPPFLAGS -I${withval}/include"
458 LDFLAGS="$LDFLAGS -L${withval}/lib"
459 fi
460
461 if test -z "$KRB4" ; then
462 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
463 fi
464
465 LIBS="$LIBS -lkafs"
466 if test ! -z "$AFS_LIBS" ; then
467 LIBS="$LIBS $AFS_LIBS"
468 fi
469 AC_DEFINE(AFS)
470 AFS_MSG="yes"
471 fi
472 ]
473)
474LIBS="$LIBS $KLIBS"
475
476# Check whether user wants S/Key support
477SKEY_MSG="no"
478AC_ARG_WITH(skey,
479 [ --with-skey=PATH Enable S/Key support],
480 [
481 if test "x$withval" != "xno" ; then
482
483 if test "x$withval" != "xyes" ; then
484 CPPFLAGS="$CPPFLAGS -I${withval}/include"
485 LDFLAGS="$LDFLAGS -L${withval}/lib"
486 fi
487
488 AC_DEFINE(SKEY)
489 LIBS="-lskey $LIBS"
490 SKEY_MSG="yes"
491
492 AC_CHECK_FUNC(skey_keyinfo,
493 [],
494 [
495 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
496 ])
497 fi
498 ]
499)
500
501# Check whether user wants TCP wrappers support
502TCPW_MSG="no"
503AC_ARG_WITH(tcp-wrappers,
504 [ --with-tcp-wrappers Enable tcpwrappers support],
505 [
506 if test "x$withval" != "xno" ; then
507 saved_LIBS="$LIBS"
508 LIBS="-lwrap $LIBS"
509 AC_MSG_CHECKING(for libwrap)
510 AC_TRY_LINK(
511 [
512#include <tcpd.h>
513 int deny_severity = 0, allow_severity = 0;
514 ],
515 [hosts_access(0);],
516 [
517 AC_MSG_RESULT(yes)
518 AC_DEFINE(LIBWRAP)
519 TCPW_MSG="yes"
520 ],
521 [
522 AC_MSG_ERROR([*** libwrap missing])
523 ]
524 )
525 fi
526 ]
527)
528
Damien Millerad833b32000-08-23 10:46:23 +1000529dnl Checks for library functions.
Damien Miller9de61e82001-03-19 10:09:27 +1100530AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell 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 +1000531dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000532AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000533dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000534AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000535AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000536dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000537AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000538AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000539dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000540AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000541AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100542
Damien Miller5fc85652000-07-09 23:53:07 +1000543AC_CHECK_FUNC(getuserattr,
544 [AC_DEFINE(HAVE_GETUSERATTR)],
545 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
546)
547
Damien Miller04f80141999-11-19 15:32:34 +1100548AC_CHECK_FUNC(login,
549 [AC_DEFINE(HAVE_LOGIN)],
550 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
551)
552
553AC_CHECK_FUNC(daemon,
554 [AC_DEFINE(HAVE_DAEMON)],
555 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
556)
557
Damien Miller9fb07e42000-03-05 16:22:59 +1100558AC_CHECK_FUNC(getpagesize,
559 [AC_DEFINE(HAVE_GETPAGESIZE)],
560 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
561)
562
Damien Millercb170cb2000-07-01 16:52:55 +1000563# Check for broken snprintf
564if test "x$ac_cv_func_snprintf" = "xyes" ; then
565 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
566 AC_TRY_RUN(
567 [
568#include <stdio.h>
569int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
570 ],
571 [AC_MSG_RESULT(yes)],
572 [
573 AC_MSG_RESULT(no)
574 AC_DEFINE(BROKEN_SNPRINTF)
575 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
576 ]
577 )
578fi
579
Damien Miller606f8802000-09-16 15:39:56 +1100580AC_FUNC_GETPGRP
581
Damien Millera64b57a2001-01-17 10:44:13 +1100582# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000583PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100584AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100585 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100586 [
Damien Millera64b57a2001-01-17 10:44:13 +1100587 if test "x$withval" != "xno" ; then
588 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
589 AC_MSG_ERROR([PAM headers not found])
590 fi
591
592 AC_CHECK_LIB(dl, dlopen, , )
593 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
594 AC_CHECK_FUNCS(pam_getenvlist)
595
596 disable_shadow=yes
597 PAM_MSG="yes"
598
599 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100600 fi
601 ]
602)
Damien Millera22ba012000-03-02 23:09:20 +1100603
Damien Millera64b57a2001-01-17 10:44:13 +1100604# Check for older PAM
605if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100606 # Check PAM strerror arguments (old PAM)
607 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
608 AC_TRY_COMPILE(
609 [
Damien Miller81171112000-04-23 11:14:01 +1000610#include <stdlib.h>
611#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100612 ],
613 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
614 [AC_MSG_RESULT(no)],
615 [
616 AC_DEFINE(HAVE_OLD_PAM)
617 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000618 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100619 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100620 )
Damien Millera22ba012000-03-02 23:09:20 +1100621fi
622
623# The big search for OpenSSL
624AC_ARG_WITH(ssl-dir,
625 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
626 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000627 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100628 tryssldir=$withval
629 fi
630 ]
631)
632
633saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100634saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000635saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100636if test "x$prefix" != "xNONE" ; then
637 tryssldir="$tryssldir $prefix"
638fi
Damien Miller61e50f12000-05-08 20:49:37 +1000639AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100640 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 +1100641 CPPFLAGS="$saved_CPPFLAGS"
642 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000643 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100644
645 # Skip directories if they don't exist
646 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
647 continue;
648 fi
649 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
650 # Try to use $ssldir/lib if it exists, otherwise
651 # $ssldir
652 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000653 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100654 if test ! -z "$need_dash_r" ; then
655 LDFLAGS="$LDFLAGS -R$ssldir/lib"
656 fi
657 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000658 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100659 if test ! -z "$need_dash_r" ; then
660 LDFLAGS="$LDFLAGS -R$ssldir"
661 fi
662 fi
663 # Try to use $ssldir/include if it exists, otherwise
664 # $ssldir
665 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000666 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100667 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000668 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100669 fi
670 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000671
Damien Miller3b512e12000-05-17 23:29:18 +1000672 # Basic test to check for compatible version and correct linking
673 # *does not* test for RSA - that comes later.
674 AC_TRY_RUN(
675 [
Damien Millere59ce622000-05-01 20:54:17 +1000676#include <string.h>
677#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000678int main(void)
679{
Damien Miller3b512e12000-05-17 23:29:18 +1000680 char a[2048];
681 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000682 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000683 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000684}
Damien Miller3b512e12000-05-17 23:29:18 +1000685 ],
686 [
687 found_crypto=1
688 break;
689 ], []
690 )
Damien Miller61e50f12000-05-08 20:49:37 +1000691
692 if test ! -z "$found_crypto" ; then
693 break;
694 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100695 done
696
Damien Miller61e50f12000-05-08 20:49:37 +1000697 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100698 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100699 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000700 if test -z "$ssldir" ; then
701 ssldir="(system)"
702 fi
Damien Millera22ba012000-03-02 23:09:20 +1100703
Damien Miller61e50f12000-05-08 20:49:37 +1000704 ac_cv_openssldir=$ssldir
705])
706
Damien Milleredb82922000-06-20 13:25:52 +1000707if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000708 AC_DEFINE(HAVE_OPENSSL)
709 dnl Need to recover ssldir - test above runs in subshell
710 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100711 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100712 # Try to use $ssldir/lib if it exists, otherwise
713 # $ssldir
714 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000715 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100716 if test ! -z "$need_dash_r" ; then
717 LDFLAGS="$LDFLAGS -R$ssldir/lib"
718 fi
719 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000720 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100721 if test ! -z "$need_dash_r" ; then
722 LDFLAGS="$LDFLAGS -R$ssldir"
723 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100724 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100725 # Try to use $ssldir/include if it exists, otherwise
726 # $ssldir
727 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000728 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100729 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000730 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100731 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100732 fi
Damien Millera22ba012000-03-02 23:09:20 +1100733fi
Damien Miller3b512e12000-05-17 23:29:18 +1000734LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000735
Damien Miller3b512e12000-05-17 23:29:18 +1000736# Now test RSA support
737saved_LIBS="$LIBS"
738AC_MSG_CHECKING([for RSA support])
739for WANTS_RSAREF in "" 1 ; do
740 if test -z "$WANTS_RSAREF" ; then
741 LIBS="$saved_LIBS"
742 else
743 LIBS="$saved_LIBS -lRSAglue -lrsaref"
744 fi
745 AC_TRY_RUN([
746#include <string.h>
747#include <openssl/rand.h>
748#include <openssl/rsa.h>
749#include <openssl/bn.h>
750#include <openssl/sha.h>
751int main(void)
752{
753 int num; RSA *key; static unsigned char p_in[] = "blahblah";
754 unsigned char c[256], p[256];
755 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
756 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
757 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
758 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
759}
760 ],
761 [
762 rsa_works=1
763 break;
764 ], [])
765done
766
767if test ! -z "$no_rsa" ; then
768 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000769 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000770else
771 if test -z "$rsa_works" ; then
772 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000773 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000774 else
775 if test -z "$WANTS_RSAREF" ; then
776 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000777 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000778 else
Damien Miller7b22d652000-06-18 14:07:04 +1000779 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000780 AC_MSG_RESULT(using RSAref)
781 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
782 fi
783 fi
784fi
Damien Millera22ba012000-03-02 23:09:20 +1100785
Damien Millera64b57a2001-01-17 10:44:13 +1100786# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
787# version in OpenSSL. Skip this for PAM
788if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100789 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100790fi
791
Ben Lindstromb5628642000-10-18 00:02:25 +0000792# Cheap hack to ensure NEWS-OS libraries are arranged right.
793if test ! -z "$SONY" ; then
794 LIBS="$LIBS -liberty";
795fi
796
Damien Millera22ba012000-03-02 23:09:20 +1100797# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100798AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100799AC_CHECK_SIZEOF(short int, 2)
800AC_CHECK_SIZEOF(int, 4)
801AC_CHECK_SIZEOF(long int, 4)
802AC_CHECK_SIZEOF(long long int, 8)
803
Damien Millera22ba012000-03-02 23:09:20 +1100804# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100805AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
806 AC_TRY_COMPILE(
807 [ #include <sys/types.h> ],
808 [ u_int a; a = 1;],
809 [ ac_cv_have_u_int="yes" ],
810 [ ac_cv_have_u_int="no" ]
811 )
812])
813if test "x$ac_cv_have_u_int" = "xyes" ; then
814 AC_DEFINE(HAVE_U_INT)
815 have_u_int=1
816fi
817
Damien Miller61e50f12000-05-08 20:49:37 +1000818AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
819 AC_TRY_COMPILE(
820 [ #include <sys/types.h> ],
821 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
822 [ ac_cv_have_intxx_t="yes" ],
823 [ ac_cv_have_intxx_t="no" ]
824 )
825])
826if test "x$ac_cv_have_intxx_t" = "xyes" ; then
827 AC_DEFINE(HAVE_INTXX_T)
828 have_intxx_t=1
829fi
830
Damien Miller578783e2000-09-23 14:12:24 +1100831AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
832 AC_TRY_COMPILE(
833 [ #include <sys/types.h> ],
834 [ int64_t a; a = 1;],
835 [ ac_cv_have_int64_t="yes" ],
836 [ ac_cv_have_int64_t="no" ]
837 )
838])
839if test "x$ac_cv_have_int64_t" = "xyes" ; then
840 AC_DEFINE(HAVE_INT64_T)
841 have_int64_t=1
842fi
843
Damien Miller61e50f12000-05-08 20:49:37 +1000844AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
845 AC_TRY_COMPILE(
846 [ #include <sys/types.h> ],
847 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
848 [ ac_cv_have_u_intxx_t="yes" ],
849 [ ac_cv_have_u_intxx_t="no" ]
850 )
851])
852if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
853 AC_DEFINE(HAVE_U_INTXX_T)
854 have_u_intxx_t=1
855fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100856
Damien Miller578783e2000-09-23 14:12:24 +1100857AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
858 AC_TRY_COMPILE(
859 [ #include <sys/types.h> ],
860 [ u_int64_t a; a = 1;],
861 [ ac_cv_have_u_int64_t="yes" ],
862 [ ac_cv_have_u_int64_t="no" ]
863 )
864])
865if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
866 AC_DEFINE(HAVE_U_INT64_T)
867 have_u_int64_t=1
868fi
869
Damien Milleredb82922000-06-20 13:25:52 +1000870if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
871 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100872then
873 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
874 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000875 [
876#include <sys/bitypes.h>
877 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100878 [
Damien Miller70494d12000-04-03 15:57:06 +1000879 int8_t a; int16_t b; int32_t c;
880 u_int8_t e; u_int16_t f; u_int32_t g;
881 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100882 ],
883 [
884 AC_DEFINE(HAVE_U_INTXX_T)
885 AC_DEFINE(HAVE_INTXX_T)
886 AC_MSG_RESULT(yes)
887 ],
888 [AC_MSG_RESULT(no)]
889 )
890fi
891
Damien Millerd6121d22000-03-17 23:26:46 +1100892if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000893 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
894 AC_TRY_COMPILE(
895 [
896#include <sys/types.h>
897 ],
898 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
899 [ ac_cv_have_uintxx_t="yes" ],
900 [ ac_cv_have_uintxx_t="no" ]
901 )
902 ])
903 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
904 AC_DEFINE(HAVE_UINTXX_T)
905 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100906fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100907
Damien Miller61e50f12000-05-08 20:49:37 +1000908AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
909 AC_TRY_COMPILE(
910 [
Damien Miller81171112000-04-23 11:14:01 +1000911#include <sys/types.h>
912#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000913 ],
914 [socklen_t foo; foo = 1235;],
915 [ ac_cv_have_socklen_t="yes" ],
916 [ ac_cv_have_socklen_t="no" ]
917 )
918])
919if test "x$ac_cv_have_socklen_t" = "xyes" ; then
920 AC_DEFINE(HAVE_SOCKLEN_T)
921fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100922
Damien Miller61e50f12000-05-08 20:49:37 +1000923AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
924 AC_TRY_COMPILE(
925 [
926#include <sys/types.h>
927 ],
928 [ size_t foo; foo = 1235; ],
929 [ ac_cv_have_size_t="yes" ],
930 [ ac_cv_have_size_t="no" ]
931 )
932])
933if test "x$ac_cv_have_size_t" = "xyes" ; then
934 AC_DEFINE(HAVE_SIZE_T)
935fi
Damien Miller95058511999-12-29 10:36:45 +1100936
Damien Miller615f9392000-05-17 22:53:33 +1000937AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
938 AC_TRY_COMPILE(
939 [
940#include <sys/types.h>
941 ],
942 [ ssize_t foo; foo = 1235; ],
943 [ ac_cv_have_ssize_t="yes" ],
944 [ ac_cv_have_ssize_t="no" ]
945 )
946])
947if test "x$ac_cv_have_ssize_t" = "xyes" ; then
948 AC_DEFINE(HAVE_SSIZE_T)
949fi
950
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000951AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
952 AC_TRY_COMPILE(
953 [
954#include <time.h>
955 ],
956 [ clock_t foo; foo = 1235; ],
957 [ ac_cv_have_clock_t="yes" ],
958 [ ac_cv_have_clock_t="no" ]
959 )
960])
961if test "x$ac_cv_have_clock_t" = "xyes" ; then
962 AC_DEFINE(HAVE_CLOCK_T)
963fi
964
Damien Millerb54b40e2000-06-23 08:23:34 +1000965AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
966 AC_TRY_COMPILE(
967 [
968#include <sys/types.h>
969#include <sys/socket.h>
970 ],
971 [ sa_family_t foo; foo = 1235; ],
972 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100973 [ AC_TRY_COMPILE(
974 [
975#include <sys/types.h>
976#include <sys/socket.h>
977#include <netinet/in.h>
978 ],
979 [ sa_family_t foo; foo = 1235; ],
980 [ ac_cv_have_sa_family_t="yes" ],
981
Damien Millerb54b40e2000-06-23 08:23:34 +1000982 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100983 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000984 )
985])
986if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
987 AC_DEFINE(HAVE_SA_FAMILY_T)
988fi
989
Damien Miller0f91b4e2000-06-18 15:43:25 +1000990AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
991 AC_TRY_COMPILE(
992 [
993#include <sys/types.h>
994 ],
995 [ pid_t foo; foo = 1235; ],
996 [ ac_cv_have_pid_t="yes" ],
997 [ ac_cv_have_pid_t="no" ]
998 )
999])
1000if test "x$ac_cv_have_pid_t" = "xyes" ; then
1001 AC_DEFINE(HAVE_PID_T)
1002fi
1003
1004AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1005 AC_TRY_COMPILE(
1006 [
1007#include <sys/types.h>
1008 ],
1009 [ mode_t foo; foo = 1235; ],
1010 [ ac_cv_have_mode_t="yes" ],
1011 [ ac_cv_have_mode_t="no" ]
1012 )
1013])
1014if test "x$ac_cv_have_mode_t" = "xyes" ; then
1015 AC_DEFINE(HAVE_MODE_T)
1016fi
1017
Damien Miller61e50f12000-05-08 20:49:37 +10001018
1019AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1020 AC_TRY_COMPILE(
1021 [
Damien Miller81171112000-04-23 11:14:01 +10001022#include <sys/types.h>
1023#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001024 ],
1025 [ struct sockaddr_storage s; ],
1026 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1027 [ ac_cv_have_struct_sockaddr_storage="no" ]
1028 )
1029])
1030if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1031 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1032fi
Damien Miller34132e52000-01-14 15:45:46 +11001033
Damien Miller61e50f12000-05-08 20:49:37 +10001034AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1035 AC_TRY_COMPILE(
1036 [
Damien Miller7b22d652000-06-18 14:07:04 +10001037#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001038#include <netinet/in.h>
1039 ],
1040 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1041 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1042 [ ac_cv_have_struct_sockaddr_in6="no" ]
1043 )
1044])
1045if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1046 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1047fi
Damien Miller34132e52000-01-14 15:45:46 +11001048
Damien Miller61e50f12000-05-08 20:49:37 +10001049AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1050 AC_TRY_COMPILE(
1051 [
Damien Miller7b22d652000-06-18 14:07:04 +10001052#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001053#include <netinet/in.h>
1054 ],
1055 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1056 [ ac_cv_have_struct_in6_addr="yes" ],
1057 [ ac_cv_have_struct_in6_addr="no" ]
1058 )
1059])
1060if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1061 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1062fi
Damien Miller34132e52000-01-14 15:45:46 +11001063
Damien Miller61e50f12000-05-08 20:49:37 +10001064AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1065 AC_TRY_COMPILE(
1066 [
Damien Miller81171112000-04-23 11:14:01 +10001067#include <sys/types.h>
1068#include <sys/socket.h>
1069#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001070 ],
1071 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1072 [ ac_cv_have_struct_addrinfo="yes" ],
1073 [ ac_cv_have_struct_addrinfo="no" ]
1074 )
1075])
1076if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1077 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1078fi
1079
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001080AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1081 AC_TRY_COMPILE(
1082 [ #include <sys/time.h> ],
1083 [ struct timeval tv; tv.tv_sec = 1;],
1084 [ ac_cv_have_struct_timeval="yes" ],
1085 [ ac_cv_have_struct_timeval="no" ]
1086 )
1087])
1088if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1089 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1090 have_struct_timeval=1
1091fi
1092
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001093# If we don't have int64_t then we can't compile sftp-server. So don't
1094# even attempt to do it.
1095if test "x$ac_cv_have_int64_t" = "xno" -a \
1096 "x$ac_cv_sizeof_long_int" != "x8" -a \
1097 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1098 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001099else
1100dnl test snprintf (broken on SCO w/gcc)
1101 AC_TRY_RUN(
1102 [
1103#include <stdio.h>
1104#include <string.h>
1105#ifdef HAVE_SNPRINTF
1106main()
1107{
1108 char buf[50];
1109 char expected_out[50];
1110 int mazsize = 50 ;
1111#if (SIZEOF_LONG_INT == 8)
1112 long int num = 0x7fffffffffffffff;
1113#else
1114 long long num = 0x7fffffffffffffff;
1115#endif
1116 strcpy(expected_out, "9223372036854775807");
1117 snprintf(buf, mazsize, "%lld", num);
1118 if(strcmp(buf, expected_out) != 0)
1119 exit(1);
1120 exit(0);
1121}
1122#else
1123main() { exit(0); }
1124#endif
1125 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1126 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001127fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001128AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001129
Damien Miller78315eb2000-09-29 23:01:36 +11001130dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001131OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1132OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1133OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1134OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1135OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001136OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001137OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1138OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001139OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001140OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1141OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1142OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1143OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001144OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1145OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1146OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1147OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001148AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001149
Damien Miller942da032000-08-18 13:59:06 +10001150AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1151 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1152 AC_TRY_COMPILE(
1153 [
1154#include <sys/types.h>
1155#include <sys/socket.h>
1156 ],
1157 [ struct sockaddr_un s; s.sun_len = 1; ],
1158 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1159 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1160 )
1161])
1162if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1163 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1164fi
1165
Damien Miller61e50f12000-05-08 20:49:37 +10001166AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1167 ac_cv_have_ss_family_in_struct_ss, [
1168 AC_TRY_COMPILE(
1169 [
Damien Miller81171112000-04-23 11:14:01 +10001170#include <sys/types.h>
1171#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001172 ],
1173 [ struct sockaddr_storage s; s.ss_family = 1; ],
1174 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1175 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1176 )
1177])
1178if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1179 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1180fi
1181
Damien Miller61e50f12000-05-08 20:49:37 +10001182AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1183 ac_cv_have___ss_family_in_struct_ss, [
1184 AC_TRY_COMPILE(
1185 [
Damien Miller81171112000-04-23 11:14:01 +10001186#include <sys/types.h>
1187#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001188 ],
1189 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1190 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1191 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1192 )
1193])
1194if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1195 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1196fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001197
Damien Millerad833b32000-08-23 10:46:23 +10001198AC_CACHE_CHECK([for pw_class field in struct passwd],
1199 ac_cv_have_pw_class_in_struct_passwd, [
1200 AC_TRY_COMPILE(
1201 [
Damien Millerad833b32000-08-23 10:46:23 +10001202#include <pwd.h>
1203 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001204 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001205 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1206 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1207 )
1208])
1209if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1210 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1211fi
1212
Damien Miller61e50f12000-05-08 20:49:37 +10001213
1214AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1215 AC_TRY_LINK([],
1216 [ extern char *__progname; printf("%s", __progname); ],
1217 [ ac_cv_libc_defines___progname="yes" ],
1218 [ ac_cv_libc_defines___progname="no" ]
1219 )
1220])
1221if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1222 AC_DEFINE(HAVE___PROGNAME)
1223fi
1224
Damien Millera22ba012000-03-02 23:09:20 +11001225
Damien Millerecbb26d2000-07-15 14:59:14 +10001226AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1227 AC_TRY_LINK([],
1228 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1229 [ ac_cv_libc_defines_sys_errlist="yes" ],
1230 [ ac_cv_libc_defines_sys_errlist="no" ]
1231 )
1232])
1233if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1234 AC_DEFINE(HAVE_SYS_ERRLIST)
1235fi
1236
1237
Damien Miller11fa2cc2000-08-16 10:35:58 +10001238AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1239 AC_TRY_LINK([],
1240 [ extern int sys_nerr; printf("%i", sys_nerr);],
1241 [ ac_cv_libc_defines_sys_nerr="yes" ],
1242 [ ac_cv_libc_defines_sys_nerr="no" ]
1243 )
1244])
1245if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1246 AC_DEFINE(HAVE_SYS_NERR)
1247fi
1248
1249
Damien Millera22ba012000-03-02 23:09:20 +11001250# Looking for programs, paths and files
1251AC_ARG_WITH(rsh,
1252 [ --with-rsh=PATH Specify path to remote shell program ],
1253 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001254 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001255 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001256 fi
1257 ],
1258 [
1259 AC_PATH_PROG(rsh_path, rsh)
1260 ]
1261)
1262
1263AC_ARG_WITH(xauth,
1264 [ --with-xauth=PATH Specify path to xauth program ],
1265 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001266 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001267 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001268 fi
1269 ],
1270 [
Damien Miller78315eb2000-09-29 23:01:36 +11001271 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 +10001272 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001273 xauth_path="/usr/openwin/bin/xauth"
1274 fi
1275 ]
1276)
1277
Damien Millera19cf472000-11-29 13:28:50 +11001278if test -z "$xauth_path" ; then
1279 XAUTH_PATH="undefined"
1280 AC_SUBST(XAUTH_PATH)
1281else
Damien Millera22ba012000-03-02 23:09:20 +11001282 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001283 XAUTH_PATH=$xauth_path
1284 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001285fi
1286if test ! -z "$rsh_path" ; then
1287 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1288fi
1289
1290# Check for mail directory (last resort if we cannot get it from headers)
1291if test ! -z "$MAIL" ; then
1292 maildir=`dirname $MAIL`
1293 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1294fi
1295
Damien Millera22ba012000-03-02 23:09:20 +11001296if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001297 AC_CHECK_FILE("/dev/ptmx",
1298 [
1299 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1300 have_dev_ptmx=1
1301 ]
1302 )
Damien Millera22ba012000-03-02 23:09:20 +11001303fi
Damien Miller204ad072000-03-02 23:56:12 +11001304AC_CHECK_FILE("/dev/ptc",
1305 [
1306 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1307 have_dev_ptc=1
1308 ]
1309)
1310
Damien Millera22ba012000-03-02 23:09:20 +11001311# Options from here on. Some of these are preset by platform above
1312
Damien Millera22ba012000-03-02 23:09:20 +11001313# Check for user-specified random device, otherwise check /dev/urandom
1314AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001315 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001316 [
Damien Miller040f3832000-04-03 14:50:43 +10001317 if test "x$withval" != "xno" ; then
1318 RANDOM_POOL="$withval";
1319 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1320 fi
Damien Millera22ba012000-03-02 23:09:20 +11001321 ],
1322 [
1323 # Check for random device
1324 AC_CHECK_FILE("/dev/urandom",
1325 [
1326 RANDOM_POOL="/dev/urandom";
1327 AC_SUBST(RANDOM_POOL)
1328 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1329 ]
1330 )
1331 ]
1332)
1333
Damien Millerd0ccb982001-03-04 00:29:20 +11001334# Check for PRNGD/EGD pool file
1335AC_ARG_WITH(prngd-port,
1336 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1337 [
1338 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1339 PRNGD_PORT="$withval"
1340 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1341 fi
1342 ]
1343)
1344
1345# Check for PRNGD/EGD pool file
1346AC_ARG_WITH(prngd-socket,
1347 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001348 [
Damien Miller040f3832000-04-03 14:50:43 +10001349 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001350 PRNGD_SOCKET="$withval"
1351 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001352 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001353 ],
1354 [
1355 # Check for existing socket only if we don't have a random device already
1356 if test -z "$RANDOM_POOL" ; then
1357 AC_MSG_CHECKING(for PRNGD/EGD socket)
1358 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001359 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001360 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1361 PRNGD_SOCKET="$sock"
1362 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001363 break;
1364 fi
1365 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001366 if test ! -z "$PRNGD_SOCKET" ; then
1367 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001368 else
1369 AC_MSG_RESULT(not found)
1370 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001371 fi
Damien Millera22ba012000-03-02 23:09:20 +11001372 ]
1373)
1374
Damien Miller0736c4d2001-01-25 10:51:46 +11001375
Damien Miller0437b332000-05-02 09:56:41 +10001376# detect pathnames for entropy gathering commands, if we need them
1377INSTALL_SSH_PRNG_CMDS=""
1378rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001379if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001380 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001381 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1382 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1383 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1384 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1385 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1386 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1387 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1388 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1389 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1390 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1391 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1392 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1393 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1394 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001395
1396 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001397fi
Damien Miller0437b332000-05-02 09:56:41 +10001398AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1399
Damien Miller11e37f62000-04-08 18:23:30 +10001400
Damien Miller670a4b82000-01-22 13:53:11 +11001401AC_ARG_WITH(catman,
1402 [ --with-catman=man|cat Install preformatted manpages[no]],
1403 [
1404 MANTYPE='$(CATMAN)'
1405 if test x"$withval" != x"yes" ; then
1406 mansubdir=$withval
1407 else
1408 mansubdir=cat
1409 fi
1410 ], [
1411 if test -z "$MANTYPE" ; then
1412 MANTYPE='$(TROFFMAN)'
1413 mansubdir=man
1414 fi
1415 ]
1416)
1417AC_SUBST(MANTYPE)
1418AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001419
Damien Millera22ba012000-03-02 23:09:20 +11001420# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001421MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001422AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001423 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001424 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001425 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001426 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001427 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001428 fi
1429 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001430)
1431
Damien Millera22ba012000-03-02 23:09:20 +11001432# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001433AC_ARG_WITH(shadow,
1434 [ --without-shadow Disable shadow password support],
1435 [
1436 if test "x$withval" = "xno" ; then
1437 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001438 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001439 fi
1440 ]
1441)
1442
Damien Miller1f335fb2000-06-26 11:31:33 +10001443if test -z "$disable_shadow" ; then
1444 AC_MSG_CHECKING([if the systems has expire shadow information])
1445 AC_TRY_COMPILE(
1446 [
1447#include <sys/types.h>
1448#include <shadow.h>
1449 struct spwd sp;
1450 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1451 [ sp_expire_available=yes ], []
1452 )
1453
1454 if test "x$sp_expire_available" = "xyes" ; then
1455 AC_MSG_RESULT(yes)
1456 AC_DEFINE(HAS_SHADOW_EXPIRE)
1457 else
1458 AC_MSG_RESULT(no)
1459 fi
1460fi
1461
Damien Millera22ba012000-03-02 23:09:20 +11001462# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001463if test ! -z "$IPADDR_IN_DISPLAY" ; then
1464 DISPLAY_HACK_MSG="yes"
1465 AC_DEFINE(IPADDR_IN_DISPLAY)
1466else
1467 DISPLAY_HACK_MSG="no"
1468 AC_ARG_WITH(ipaddr-display,
1469 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1470 [
1471 if test "x$withval" != "xno" ; then
1472 AC_DEFINE(IPADDR_IN_DISPLAY)
1473 DISPLAY_HACK_MSG="yes"
1474 fi
1475 ]
1476 )
1477fi
Damien Miller76112de1999-12-21 11:18:08 +11001478
Damien Millera22ba012000-03-02 23:09:20 +11001479# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001480SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001481AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001482 [ --with-default-path=PATH Specify default \$PATH environment for server],
1483 [
1484 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001485 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001486 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001487 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001488 ],
1489 [
1490 AC_TRY_RUN(
1491 [
1492/* find out what STDPATH is */
1493#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001494#ifdef HAVE_PATHS_H
1495# include <paths.h>
1496#endif
1497#ifndef _PATH_STDPATH
1498# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1499#endif
1500#include <sys/types.h>
1501#include <sys/stat.h>
1502#include <fcntl.h>
1503#define DATA "conftest.stdpath"
1504
1505main()
1506{
1507 FILE *fd;
1508 int rc;
1509
1510 fd = fopen(DATA,"w");
1511 if(fd == NULL)
1512 exit(1);
1513
1514 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1515 exit(1);
1516
1517 exit(0);
1518}
1519 ], [ user_path=`cat conftest.stdpath` ],
1520 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1521 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1522 )
1523# make sure $bindir is in USER_PATH so scp will work
1524 t_bindir=`eval echo ${bindir}`
1525 case $t_bindir in
1526 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1527 esac
1528 case $t_bindir in
1529 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1530 esac
1531 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1532 if test $? -ne 0 ; then
1533 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1534 if test $? -ne 0 ; then
1535 user_path=$user_path:$t_bindir
1536 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1537 fi
1538 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001539 ]
1540)
Tim Rice59ea0a02001-03-10 13:50:45 -08001541AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1542AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001543
Damien Millera22ba012000-03-02 23:09:20 +11001544# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001545IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001546AC_ARG_WITH(ipv4-default,
1547 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1548 [
1549 if test "x$withval" != "xno" ; then
1550 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001551 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001552 fi
1553 ]
1554)
1555
Damien Miller61e50f12000-05-08 20:49:37 +10001556AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001557IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001558AC_ARG_WITH(4in6,
1559 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1560 [
1561 if test "x$withval" != "xno" ; then
1562 AC_MSG_RESULT(yes)
1563 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001564 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001565 else
1566 AC_MSG_RESULT(no)
1567 fi
1568 ],[
1569 if test "x$inet6_default_4in6" = "xyes"; then
1570 AC_MSG_RESULT([yes (default)])
1571 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001572 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001573 else
1574 AC_MSG_RESULT([no (default)])
1575 fi
1576 ]
1577)
1578
Damien Miller60396b02001-02-18 17:01:00 +11001579# Whether to enable BSD auth support
1580AC_ARG_WITH(bsd-auth,
1581 [ --with-bsd-auth Enable BSD auth support],
1582 [
1583 if test "x$withval" != "xno" ; then
1584 AC_DEFINE(BSD_AUTH)
1585 bsd_auth=yes
1586 fi
1587 ]
1588)
1589
Damien Miller78315eb2000-09-29 23:01:36 +11001590AC_MSG_CHECKING(whether to install ssh as suid root)
1591AC_ARG_ENABLE(suid-ssh,
1592[ --enable-suid-ssh Install ssh as suid root (default)
1593 --disable-suid-ssh Install ssh without suid bit],
1594[ case "$enableval" in
1595 no)
1596 AC_MSG_RESULT(no)
1597 SSHMODE=0711
1598 ;;
1599 *) AC_MSG_RESULT(yes)
1600 SSHMODE=04711
1601 ;;
1602 esac ],
1603 AC_MSG_RESULT(yes)
1604 SSHMODE=04711
1605)
1606AC_SUBST(SSHMODE)
1607
1608
Damien Millera22ba012000-03-02 23:09:20 +11001609# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001610piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001611AC_ARG_WITH(pid-dir,
1612 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1613 [
1614 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001615 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001616 fi
1617 ]
1618)
Damien Miller4018c192000-04-30 09:30:44 +10001619
Damien Miller78315eb2000-09-29 23:01:36 +11001620# make sure the directory exists
1621if test ! -d $piddir ; then
1622 piddir=`eval echo ${sysconfdir}`
1623 case $piddir in
1624 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1625 esac
1626fi
1627
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001628AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001629AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001630
andre2ff7b5d2000-06-03 14:57:40 +00001631dnl allow user to disable some login recording features
1632AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001633 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001634 [ AC_DEFINE(DISABLE_LASTLOG) ]
1635)
1636AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001637 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001638 [ AC_DEFINE(DISABLE_UTMP) ]
1639)
1640AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001641 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001642 [ AC_DEFINE(DISABLE_UTMPX) ]
1643)
1644AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001645 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001646 [ AC_DEFINE(DISABLE_WTMP) ]
1647)
1648AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001649 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001650 [ AC_DEFINE(DISABLE_WTMPX) ]
1651)
1652AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001653 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001654 [ AC_DEFINE(DISABLE_LOGIN) ]
1655)
1656AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001657 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001658 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1659)
1660AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001661 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001662 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1663)
1664AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001665 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001666 [
1667 if test "x$withval" = "xno" ; then
1668 AC_DEFINE(DISABLE_LASTLOG)
1669 else
1670 conf_lastlog_location=$withval
1671 fi
1672 ]
1673)
andre2ff7b5d2000-06-03 14:57:40 +00001674
1675dnl lastlog, [uw]tmpx? detection
1676dnl NOTE: set the paths in the platform section to avoid the
1677dnl need for command-line parameters
1678dnl lastlog and [uw]tmp are subject to a file search if all else fails
1679
1680dnl lastlog detection
1681dnl NOTE: the code itself will detect if lastlog is a directory
1682AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1683AC_TRY_COMPILE([
1684#include <sys/types.h>
1685#include <utmp.h>
1686#ifdef HAVE_LASTLOG_H
1687# include <lastlog.h>
1688#endif
Damien Miller2994e082000-06-04 15:51:47 +10001689#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001690# include <paths.h>
1691#endif
1692 ],
1693 [ char *lastlog = LASTLOG_FILE; ],
1694 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001695 [
1696 AC_MSG_RESULT(no)
1697 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1698 AC_TRY_COMPILE([
1699#include <sys/types.h>
1700#include <utmp.h>
1701#ifdef HAVE_LASTLOG_H
1702# include <lastlog.h>
1703#endif
1704#ifdef HAVE_PATHS_H
1705# include <paths.h>
1706#endif
1707 ],
1708 [ char *lastlog = _PATH_LASTLOG; ],
1709 [ AC_MSG_RESULT(yes) ],
1710 [
andree441aa32000-06-12 22:34:38 +00001711 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001712 system_lastlog_path=no
1713 ])
1714 ]
andre2ff7b5d2000-06-03 14:57:40 +00001715)
Damien Miller2994e082000-06-04 15:51:47 +10001716
andre2ff7b5d2000-06-03 14:57:40 +00001717if test -z "$conf_lastlog_location"; then
1718 if test x"$system_lastlog_path" = x"no" ; then
1719 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001720 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001721 conf_lastlog_location=$f
1722 fi
1723 done
1724 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001725 AC_MSG_WARN([** Cannot find lastlog **])
1726 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001727 fi
1728 fi
1729fi
1730
1731if test -n "$conf_lastlog_location"; then
1732 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1733fi
1734
1735dnl utmp detection
1736AC_MSG_CHECKING([if your system defines UTMP_FILE])
1737AC_TRY_COMPILE([
1738#include <sys/types.h>
1739#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001740#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001741# include <paths.h>
1742#endif
1743 ],
1744 [ char *utmp = UTMP_FILE; ],
1745 [ AC_MSG_RESULT(yes) ],
1746 [ AC_MSG_RESULT(no)
1747 system_utmp_path=no ]
1748)
1749if test -z "$conf_utmp_location"; then
1750 if test x"$system_utmp_path" = x"no" ; then
1751 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1752 if test -f $f ; then
1753 conf_utmp_location=$f
1754 fi
1755 done
1756 if test -z "$conf_utmp_location"; then
1757 AC_DEFINE(DISABLE_UTMP)
1758 fi
1759 fi
1760fi
1761if test -n "$conf_utmp_location"; then
1762 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1763fi
1764
1765dnl wtmp detection
1766AC_MSG_CHECKING([if your system defines WTMP_FILE])
1767AC_TRY_COMPILE([
1768#include <sys/types.h>
1769#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001770#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001771# include <paths.h>
1772#endif
1773 ],
1774 [ char *wtmp = WTMP_FILE; ],
1775 [ AC_MSG_RESULT(yes) ],
1776 [ AC_MSG_RESULT(no)
1777 system_wtmp_path=no ]
1778)
1779if test -z "$conf_wtmp_location"; then
1780 if test x"$system_wtmp_path" = x"no" ; then
1781 for f in /usr/adm/wtmp /var/log/wtmp; do
1782 if test -f $f ; then
1783 conf_wtmp_location=$f
1784 fi
1785 done
1786 if test -z "$conf_wtmp_location"; then
1787 AC_DEFINE(DISABLE_WTMP)
1788 fi
1789 fi
1790fi
1791if test -n "$conf_wtmp_location"; then
1792 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1793fi
1794
1795
1796dnl utmpx detection - I don't know any system so perverse as to require
1797dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1798dnl there, though.
1799AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1800AC_TRY_COMPILE([
1801#include <sys/types.h>
1802#include <utmp.h>
1803#ifdef HAVE_UTMPX_H
1804#include <utmpx.h>
1805#endif
Damien Miller2994e082000-06-04 15:51:47 +10001806#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001807# include <paths.h>
1808#endif
1809 ],
1810 [ char *utmpx = UTMPX_FILE; ],
1811 [ AC_MSG_RESULT(yes) ],
1812 [ AC_MSG_RESULT(no)
1813 system_utmpx_path=no ]
1814)
1815if test -z "$conf_utmpx_location"; then
1816 if test x"$system_utmpx_path" = x"no" ; then
1817 AC_DEFINE(DISABLE_UTMPX)
1818 fi
1819else
1820 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1821fi
1822
1823dnl wtmpx detection
1824AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1825AC_TRY_COMPILE([
1826#include <sys/types.h>
1827#include <utmp.h>
1828#ifdef HAVE_UTMPX_H
1829#include <utmpx.h>
1830#endif
Damien Miller2994e082000-06-04 15:51:47 +10001831#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001832# include <paths.h>
1833#endif
1834 ],
1835 [ char *wtmpx = WTMPX_FILE; ],
1836 [ AC_MSG_RESULT(yes) ],
1837 [ AC_MSG_RESULT(no)
1838 system_wtmpx_path=no ]
1839)
1840if test -z "$conf_wtmpx_location"; then
1841 if test x"$system_wtmpx_path" = x"no" ; then
1842 AC_DEFINE(DISABLE_WTMPX)
1843 fi
1844else
1845 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1846fi
1847
Damien Miller4018c192000-04-30 09:30:44 +10001848
1849# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001850entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001851AC_ARG_WITH(entropy-timeout,
1852 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1853 [
1854 if test "x$withval" != "xno" ; then
1855 entropy_timeout=$withval
1856 fi
1857 ]
1858)
1859AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1860
1861
Damien Miller29ea30d2000-03-17 10:54:15 +11001862if test ! -z "$blibpath" ; then
1863 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1864 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1865fi
1866
Damien Millerbac2d8a2000-09-05 16:13:06 +11001867AC_EXEEXT
1868
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001869AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001870
Damien Miller7b22d652000-06-18 14:07:04 +10001871# Print summary of options
1872
1873if test x$MANTYPE = x'$(CATMAN)' ; then
1874 MAN_MSG=cat
1875else
1876 MAN_MSG=man
1877fi
1878if test ! -z "$RANDOM_POOL" ; then
1879 RAND_MSG="Device ($RANDOM_POOL)"
1880else
Damien Millerd0ccb982001-03-04 00:29:20 +11001881 if test ! -z "$PRNGD_PORT" ; then
1882 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1883 elif test ! -z "$PRNGD_SOCKET" ; then
1884 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001885 else
1886 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001887 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001888 fi
1889fi
1890
1891# Someone please show me a better way :)
1892A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1893B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1894C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1895D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001896E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001897F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1898G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001899H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001900
1901echo ""
1902echo "OpenSSH configured has been configured with the following options."
1903echo " User binaries: $B"
1904echo " System binaries: $C"
1905echo " Configuration files: $D"
1906echo " Askpass program: $E"
1907echo " Manual pages: $F"
1908echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001909echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001910echo " Random number collection: $RAND_MSG"
1911echo " Manpage format: $MAN_MSG"
1912echo " PAM support: ${PAM_MSG}"
1913echo " KerberosIV support: $KRB4_MSG"
1914echo " AFS support: $AFS_MSG"
1915echo " S/KEY support: $SKEY_MSG"
1916echo " TCP Wrappers support: $TCPW_MSG"
1917echo " MD5 password support: $MD5_MSG"
1918echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1919echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1920echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1921
Damien Miller60396b02001-02-18 17:01:00 +11001922if test ! -z "$bsd_auth"; then
1923 echo " BSD Auth support: yes"
1924fi
1925
Damien Miller7b22d652000-06-18 14:07:04 +10001926echo ""
1927
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001928echo " Host: ${host}"
1929echo " Compiler: ${CC}"
1930echo " Compiler flags: ${CFLAGS}"
1931echo "Preprocessor flags: ${CPPFLAGS}"
1932echo " Linker flags: ${LDFLAGS}"
1933echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001934
1935echo ""
1936
Damien Miller82cf0ce2000-12-20 13:34:48 +11001937if test "x$PAM_MSG" = "xyes" ; then
1938 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1939 echo "otherwise password authentication may fail. Example PAM control files"
1940 echo "can be found in the contrib/ subdirectory"
1941 echo ""
1942fi
1943
Damien Miller6f9c3372000-10-25 10:06:04 +11001944if test ! -z "$BUILTIN_RNG" ; then
1945 echo "WARNING: you are using the builtin random number collection service."
1946 echo "Please read WARNING.RNG and request that your OS vendor includes"
1947 echo "/dev/random in future versions of their OS."
1948 echo ""
1949fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001950
1951if test ! -z "$NO_SFTP"; then
1952 echo "sftp-server will be disabled. Your compiler does not support"
1953 echo "64bit integers."
1954 echo ""
1955fi
Damien Miller60396b02001-02-18 17:01:00 +11001956