blob: 256443a93e8748c3f3eca48076ac9acaa9f6f910 [file] [log] [blame]
Damien Miller98344742001-03-28 14:37:06 +10001# $Id: configure.in,v 1.270 2001/03/28 04:37:06 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
Damien Miller18bb4732001-03-28 14:35:30 +1000407AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
408AC_TRY_RUN(
409 [
410#include <sys/types.h>
411#include <dirent.h>
412int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
413 ],
414 [AC_MSG_RESULT(yes)],
415 [
416 AC_MSG_RESULT(no)
417 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
418 ]
419)
420
Damien Millerc547bf12001-02-16 10:18:12 +1100421# Check whether user wants S/Key support
422SKEY_MSG="no"
423AC_ARG_WITH(skey,
424 [ --with-skey=PATH Enable S/Key support],
425 [
426 if test "x$withval" != "xno" ; then
427
428 if test "x$withval" != "xyes" ; then
429 CPPFLAGS="$CPPFLAGS -I${withval}/include"
430 LDFLAGS="$LDFLAGS -L${withval}/lib"
431 fi
432
433 AC_DEFINE(SKEY)
434 LIBS="-lskey $LIBS"
435 SKEY_MSG="yes"
436
437 AC_CHECK_FUNC(skey_keyinfo,
438 [],
439 [
440 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
441 ])
442 fi
443 ]
444)
445
446# Check whether user wants TCP wrappers support
447TCPW_MSG="no"
448AC_ARG_WITH(tcp-wrappers,
449 [ --with-tcp-wrappers Enable tcpwrappers support],
450 [
451 if test "x$withval" != "xno" ; then
452 saved_LIBS="$LIBS"
453 LIBS="-lwrap $LIBS"
454 AC_MSG_CHECKING(for libwrap)
455 AC_TRY_LINK(
456 [
457#include <tcpd.h>
458 int deny_severity = 0, allow_severity = 0;
459 ],
460 [hosts_access(0);],
461 [
462 AC_MSG_RESULT(yes)
463 AC_DEFINE(LIBWRAP)
464 TCPW_MSG="yes"
465 ],
466 [
467 AC_MSG_ERROR([*** libwrap missing])
468 ]
469 )
470 fi
471 ]
472)
473
Damien Millerad833b32000-08-23 10:46:23 +1000474dnl Checks for library functions.
Damien Miller9de61e82001-03-19 10:09:27 +1100475AC_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 +1000476dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000477AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000478dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000479AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000480AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000481dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000482AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000483AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000484dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000485AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000486AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100487
Damien Miller5fc85652000-07-09 23:53:07 +1000488AC_CHECK_FUNC(getuserattr,
489 [AC_DEFINE(HAVE_GETUSERATTR)],
490 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
491)
492
Damien Miller04f80141999-11-19 15:32:34 +1100493AC_CHECK_FUNC(login,
494 [AC_DEFINE(HAVE_LOGIN)],
495 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
496)
497
498AC_CHECK_FUNC(daemon,
499 [AC_DEFINE(HAVE_DAEMON)],
500 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
501)
502
Damien Miller9fb07e42000-03-05 16:22:59 +1100503AC_CHECK_FUNC(getpagesize,
504 [AC_DEFINE(HAVE_GETPAGESIZE)],
505 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
506)
507
Damien Millercb170cb2000-07-01 16:52:55 +1000508# Check for broken snprintf
509if test "x$ac_cv_func_snprintf" = "xyes" ; then
510 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
511 AC_TRY_RUN(
512 [
513#include <stdio.h>
514int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
515 ],
516 [AC_MSG_RESULT(yes)],
517 [
518 AC_MSG_RESULT(no)
519 AC_DEFINE(BROKEN_SNPRINTF)
520 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
521 ]
522 )
523fi
524
Damien Miller606f8802000-09-16 15:39:56 +1100525AC_FUNC_GETPGRP
526
Damien Millera64b57a2001-01-17 10:44:13 +1100527# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000528PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100529AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100530 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100531 [
Damien Millera64b57a2001-01-17 10:44:13 +1100532 if test "x$withval" != "xno" ; then
533 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
534 AC_MSG_ERROR([PAM headers not found])
535 fi
536
537 AC_CHECK_LIB(dl, dlopen, , )
538 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
539 AC_CHECK_FUNCS(pam_getenvlist)
540
541 disable_shadow=yes
542 PAM_MSG="yes"
543
544 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100545 fi
546 ]
547)
Damien Millera22ba012000-03-02 23:09:20 +1100548
Damien Millera64b57a2001-01-17 10:44:13 +1100549# Check for older PAM
550if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100551 # Check PAM strerror arguments (old PAM)
552 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
553 AC_TRY_COMPILE(
554 [
Damien Miller81171112000-04-23 11:14:01 +1000555#include <stdlib.h>
556#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100557 ],
558 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
559 [AC_MSG_RESULT(no)],
560 [
561 AC_DEFINE(HAVE_OLD_PAM)
562 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000563 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100564 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100565 )
Damien Millera22ba012000-03-02 23:09:20 +1100566fi
567
568# The big search for OpenSSL
569AC_ARG_WITH(ssl-dir,
570 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
571 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000572 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100573 tryssldir=$withval
574 fi
575 ]
576)
577
578saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100579saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000580saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100581if test "x$prefix" != "xNONE" ; then
582 tryssldir="$tryssldir $prefix"
583fi
Damien Miller61e50f12000-05-08 20:49:37 +1000584AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100585 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 +1100586 CPPFLAGS="$saved_CPPFLAGS"
587 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000588 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100589
590 # Skip directories if they don't exist
591 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
592 continue;
593 fi
594 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
595 # Try to use $ssldir/lib if it exists, otherwise
596 # $ssldir
597 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000598 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100599 if test ! -z "$need_dash_r" ; then
600 LDFLAGS="$LDFLAGS -R$ssldir/lib"
601 fi
602 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000603 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100604 if test ! -z "$need_dash_r" ; then
605 LDFLAGS="$LDFLAGS -R$ssldir"
606 fi
607 fi
608 # Try to use $ssldir/include if it exists, otherwise
609 # $ssldir
610 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000611 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100612 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000613 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100614 fi
615 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000616
Damien Miller3b512e12000-05-17 23:29:18 +1000617 # Basic test to check for compatible version and correct linking
618 # *does not* test for RSA - that comes later.
619 AC_TRY_RUN(
620 [
Damien Millere59ce622000-05-01 20:54:17 +1000621#include <string.h>
622#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000623int main(void)
624{
Damien Miller3b512e12000-05-17 23:29:18 +1000625 char a[2048];
626 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000627 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000628 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000629}
Damien Miller3b512e12000-05-17 23:29:18 +1000630 ],
631 [
632 found_crypto=1
633 break;
634 ], []
635 )
Damien Miller61e50f12000-05-08 20:49:37 +1000636
637 if test ! -z "$found_crypto" ; then
638 break;
639 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100640 done
641
Damien Miller61e50f12000-05-08 20:49:37 +1000642 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100643 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100644 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000645 if test -z "$ssldir" ; then
646 ssldir="(system)"
647 fi
Damien Millera22ba012000-03-02 23:09:20 +1100648
Damien Miller61e50f12000-05-08 20:49:37 +1000649 ac_cv_openssldir=$ssldir
650])
651
Damien Milleredb82922000-06-20 13:25:52 +1000652if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000653 AC_DEFINE(HAVE_OPENSSL)
654 dnl Need to recover ssldir - test above runs in subshell
655 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100656 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100657 # Try to use $ssldir/lib if it exists, otherwise
658 # $ssldir
659 if test -d "$ssldir/lib" ; then
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000660 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
Damien Millerccdefb62001-02-19 12:56:39 +1100661 if test ! -z "$need_dash_r" ; then
662 LDFLAGS="$LDFLAGS -R$ssldir/lib"
663 fi
664 else
Ben Lindstrom5eff0312001-02-21 02:35:37 +0000665 LDFLAGS="$saved_LDFLAGS -L$ssldir"
Damien Millerccdefb62001-02-19 12:56:39 +1100666 if test ! -z "$need_dash_r" ; then
667 LDFLAGS="$LDFLAGS -R$ssldir"
668 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100669 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100670 # Try to use $ssldir/include if it exists, otherwise
671 # $ssldir
672 if test -d "$ssldir/include" ; then
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000673 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Millerccdefb62001-02-19 12:56:39 +1100674 else
Ben Lindstrom4ef92b52001-02-23 05:05:53 +0000675 CPPFLAGS="$saved_CPPFLAGS -I$ssldir"
Damien Millera64b57a2001-01-17 10:44:13 +1100676 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100677 fi
Damien Millera22ba012000-03-02 23:09:20 +1100678fi
Damien Miller3b512e12000-05-17 23:29:18 +1000679LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000680
Damien Miller3b512e12000-05-17 23:29:18 +1000681# Now test RSA support
682saved_LIBS="$LIBS"
683AC_MSG_CHECKING([for RSA support])
684for WANTS_RSAREF in "" 1 ; do
685 if test -z "$WANTS_RSAREF" ; then
686 LIBS="$saved_LIBS"
687 else
688 LIBS="$saved_LIBS -lRSAglue -lrsaref"
689 fi
690 AC_TRY_RUN([
691#include <string.h>
692#include <openssl/rand.h>
693#include <openssl/rsa.h>
694#include <openssl/bn.h>
695#include <openssl/sha.h>
696int main(void)
697{
698 int num; RSA *key; static unsigned char p_in[] = "blahblah";
699 unsigned char c[256], p[256];
700 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
701 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
702 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
703 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
704}
705 ],
706 [
707 rsa_works=1
708 break;
709 ], [])
710done
711
712if test ! -z "$no_rsa" ; then
713 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000714 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000715else
716 if test -z "$rsa_works" ; then
717 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000718 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000719 else
720 if test -z "$WANTS_RSAREF" ; then
721 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000722 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000723 else
Damien Miller7b22d652000-06-18 14:07:04 +1000724 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000725 AC_MSG_RESULT(using RSAref)
726 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
727 fi
728 fi
729fi
Damien Millera22ba012000-03-02 23:09:20 +1100730
Damien Millera64b57a2001-01-17 10:44:13 +1100731# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
732# version in OpenSSL. Skip this for PAM
733if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100734 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100735fi
736
Ben Lindstromb5628642000-10-18 00:02:25 +0000737# Cheap hack to ensure NEWS-OS libraries are arranged right.
738if test ! -z "$SONY" ; then
739 LIBS="$LIBS -liberty";
740fi
741
Damien Millera22ba012000-03-02 23:09:20 +1100742# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100743AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100744AC_CHECK_SIZEOF(short int, 2)
745AC_CHECK_SIZEOF(int, 4)
746AC_CHECK_SIZEOF(long int, 4)
747AC_CHECK_SIZEOF(long long int, 8)
748
Damien Millera22ba012000-03-02 23:09:20 +1100749# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100750AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
751 AC_TRY_COMPILE(
752 [ #include <sys/types.h> ],
753 [ u_int a; a = 1;],
754 [ ac_cv_have_u_int="yes" ],
755 [ ac_cv_have_u_int="no" ]
756 )
757])
758if test "x$ac_cv_have_u_int" = "xyes" ; then
759 AC_DEFINE(HAVE_U_INT)
760 have_u_int=1
761fi
762
Damien Miller61e50f12000-05-08 20:49:37 +1000763AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
764 AC_TRY_COMPILE(
765 [ #include <sys/types.h> ],
766 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
767 [ ac_cv_have_intxx_t="yes" ],
768 [ ac_cv_have_intxx_t="no" ]
769 )
770])
771if test "x$ac_cv_have_intxx_t" = "xyes" ; then
772 AC_DEFINE(HAVE_INTXX_T)
773 have_intxx_t=1
774fi
775
Damien Miller578783e2000-09-23 14:12:24 +1100776AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
777 AC_TRY_COMPILE(
778 [ #include <sys/types.h> ],
779 [ int64_t a; a = 1;],
780 [ ac_cv_have_int64_t="yes" ],
781 [ ac_cv_have_int64_t="no" ]
782 )
783])
784if test "x$ac_cv_have_int64_t" = "xyes" ; then
785 AC_DEFINE(HAVE_INT64_T)
786 have_int64_t=1
787fi
788
Damien Miller61e50f12000-05-08 20:49:37 +1000789AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
790 AC_TRY_COMPILE(
791 [ #include <sys/types.h> ],
792 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
793 [ ac_cv_have_u_intxx_t="yes" ],
794 [ ac_cv_have_u_intxx_t="no" ]
795 )
796])
797if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
798 AC_DEFINE(HAVE_U_INTXX_T)
799 have_u_intxx_t=1
800fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100801
Damien Miller578783e2000-09-23 14:12:24 +1100802AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
803 AC_TRY_COMPILE(
804 [ #include <sys/types.h> ],
805 [ u_int64_t a; a = 1;],
806 [ ac_cv_have_u_int64_t="yes" ],
807 [ ac_cv_have_u_int64_t="no" ]
808 )
809])
810if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
811 AC_DEFINE(HAVE_U_INT64_T)
812 have_u_int64_t=1
813fi
814
Damien Milleredb82922000-06-20 13:25:52 +1000815if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
816 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100817then
818 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
819 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000820 [
821#include <sys/bitypes.h>
822 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100823 [
Damien Miller70494d12000-04-03 15:57:06 +1000824 int8_t a; int16_t b; int32_t c;
825 u_int8_t e; u_int16_t f; u_int32_t g;
826 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100827 ],
828 [
829 AC_DEFINE(HAVE_U_INTXX_T)
830 AC_DEFINE(HAVE_INTXX_T)
831 AC_MSG_RESULT(yes)
832 ],
833 [AC_MSG_RESULT(no)]
834 )
835fi
836
Damien Millerd6121d22000-03-17 23:26:46 +1100837if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000838 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
839 AC_TRY_COMPILE(
840 [
841#include <sys/types.h>
842 ],
843 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
844 [ ac_cv_have_uintxx_t="yes" ],
845 [ ac_cv_have_uintxx_t="no" ]
846 )
847 ])
848 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
849 AC_DEFINE(HAVE_UINTXX_T)
850 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100851fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100852
Damien Miller61e50f12000-05-08 20:49:37 +1000853AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
854 AC_TRY_COMPILE(
855 [
Damien Miller81171112000-04-23 11:14:01 +1000856#include <sys/types.h>
857#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000858 ],
859 [socklen_t foo; foo = 1235;],
860 [ ac_cv_have_socklen_t="yes" ],
861 [ ac_cv_have_socklen_t="no" ]
862 )
863])
864if test "x$ac_cv_have_socklen_t" = "xyes" ; then
865 AC_DEFINE(HAVE_SOCKLEN_T)
866fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100867
Damien Miller61e50f12000-05-08 20:49:37 +1000868AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
869 AC_TRY_COMPILE(
870 [
871#include <sys/types.h>
872 ],
873 [ size_t foo; foo = 1235; ],
874 [ ac_cv_have_size_t="yes" ],
875 [ ac_cv_have_size_t="no" ]
876 )
877])
878if test "x$ac_cv_have_size_t" = "xyes" ; then
879 AC_DEFINE(HAVE_SIZE_T)
880fi
Damien Miller95058511999-12-29 10:36:45 +1100881
Damien Miller615f9392000-05-17 22:53:33 +1000882AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
883 AC_TRY_COMPILE(
884 [
885#include <sys/types.h>
886 ],
887 [ ssize_t foo; foo = 1235; ],
888 [ ac_cv_have_ssize_t="yes" ],
889 [ ac_cv_have_ssize_t="no" ]
890 )
891])
892if test "x$ac_cv_have_ssize_t" = "xyes" ; then
893 AC_DEFINE(HAVE_SSIZE_T)
894fi
895
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000896AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
897 AC_TRY_COMPILE(
898 [
899#include <time.h>
900 ],
901 [ clock_t foo; foo = 1235; ],
902 [ ac_cv_have_clock_t="yes" ],
903 [ ac_cv_have_clock_t="no" ]
904 )
905])
906if test "x$ac_cv_have_clock_t" = "xyes" ; then
907 AC_DEFINE(HAVE_CLOCK_T)
908fi
909
Damien Millerb54b40e2000-06-23 08:23:34 +1000910AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
911 AC_TRY_COMPILE(
912 [
913#include <sys/types.h>
914#include <sys/socket.h>
915 ],
916 [ sa_family_t foo; foo = 1235; ],
917 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100918 [ AC_TRY_COMPILE(
919 [
920#include <sys/types.h>
921#include <sys/socket.h>
922#include <netinet/in.h>
923 ],
924 [ sa_family_t foo; foo = 1235; ],
925 [ ac_cv_have_sa_family_t="yes" ],
926
Damien Millerb54b40e2000-06-23 08:23:34 +1000927 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100928 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000929 )
930])
931if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
932 AC_DEFINE(HAVE_SA_FAMILY_T)
933fi
934
Damien Miller0f91b4e2000-06-18 15:43:25 +1000935AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
936 AC_TRY_COMPILE(
937 [
938#include <sys/types.h>
939 ],
940 [ pid_t foo; foo = 1235; ],
941 [ ac_cv_have_pid_t="yes" ],
942 [ ac_cv_have_pid_t="no" ]
943 )
944])
945if test "x$ac_cv_have_pid_t" = "xyes" ; then
946 AC_DEFINE(HAVE_PID_T)
947fi
948
949AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
950 AC_TRY_COMPILE(
951 [
952#include <sys/types.h>
953 ],
954 [ mode_t foo; foo = 1235; ],
955 [ ac_cv_have_mode_t="yes" ],
956 [ ac_cv_have_mode_t="no" ]
957 )
958])
959if test "x$ac_cv_have_mode_t" = "xyes" ; then
960 AC_DEFINE(HAVE_MODE_T)
961fi
962
Damien Miller61e50f12000-05-08 20:49:37 +1000963
964AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
965 AC_TRY_COMPILE(
966 [
Damien Miller81171112000-04-23 11:14:01 +1000967#include <sys/types.h>
968#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000969 ],
970 [ struct sockaddr_storage s; ],
971 [ ac_cv_have_struct_sockaddr_storage="yes" ],
972 [ ac_cv_have_struct_sockaddr_storage="no" ]
973 )
974])
975if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
976 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
977fi
Damien Miller34132e52000-01-14 15:45:46 +1100978
Damien Miller61e50f12000-05-08 20:49:37 +1000979AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
980 AC_TRY_COMPILE(
981 [
Damien Miller7b22d652000-06-18 14:07:04 +1000982#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000983#include <netinet/in.h>
984 ],
985 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
986 [ ac_cv_have_struct_sockaddr_in6="yes" ],
987 [ ac_cv_have_struct_sockaddr_in6="no" ]
988 )
989])
990if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
991 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
992fi
Damien Miller34132e52000-01-14 15:45:46 +1100993
Damien Miller61e50f12000-05-08 20:49:37 +1000994AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
995 AC_TRY_COMPILE(
996 [
Damien Miller7b22d652000-06-18 14:07:04 +1000997#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000998#include <netinet/in.h>
999 ],
1000 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1001 [ ac_cv_have_struct_in6_addr="yes" ],
1002 [ ac_cv_have_struct_in6_addr="no" ]
1003 )
1004])
1005if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1006 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1007fi
Damien Miller34132e52000-01-14 15:45:46 +11001008
Damien Miller61e50f12000-05-08 20:49:37 +10001009AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1010 AC_TRY_COMPILE(
1011 [
Damien Miller81171112000-04-23 11:14:01 +10001012#include <sys/types.h>
1013#include <sys/socket.h>
1014#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001015 ],
1016 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1017 [ ac_cv_have_struct_addrinfo="yes" ],
1018 [ ac_cv_have_struct_addrinfo="no" ]
1019 )
1020])
1021if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1022 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1023fi
1024
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001025AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1026 AC_TRY_COMPILE(
1027 [ #include <sys/time.h> ],
1028 [ struct timeval tv; tv.tv_sec = 1;],
1029 [ ac_cv_have_struct_timeval="yes" ],
1030 [ ac_cv_have_struct_timeval="no" ]
1031 )
1032])
1033if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1034 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1035 have_struct_timeval=1
1036fi
1037
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001038# If we don't have int64_t then we can't compile sftp-server. So don't
1039# even attempt to do it.
1040if test "x$ac_cv_have_int64_t" = "xno" -a \
1041 "x$ac_cv_sizeof_long_int" != "x8" -a \
1042 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1043 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001044else
1045dnl test snprintf (broken on SCO w/gcc)
1046 AC_TRY_RUN(
1047 [
1048#include <stdio.h>
1049#include <string.h>
1050#ifdef HAVE_SNPRINTF
1051main()
1052{
1053 char buf[50];
1054 char expected_out[50];
1055 int mazsize = 50 ;
1056#if (SIZEOF_LONG_INT == 8)
1057 long int num = 0x7fffffffffffffff;
1058#else
1059 long long num = 0x7fffffffffffffff;
1060#endif
1061 strcpy(expected_out, "9223372036854775807");
1062 snprintf(buf, mazsize, "%lld", num);
1063 if(strcmp(buf, expected_out) != 0)
1064 exit(1);
1065 exit(0);
1066}
1067#else
1068main() { exit(0); }
1069#endif
1070 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1071 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001072fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001073AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001074
Damien Miller78315eb2000-09-29 23:01:36 +11001075dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001076OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1078OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1079OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1080OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001081OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001082OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1083OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001084OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001085OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1086OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1087OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1088OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001089OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1090OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1091OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1092OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001093AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001094
Damien Miller942da032000-08-18 13:59:06 +10001095AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1096 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1097 AC_TRY_COMPILE(
1098 [
1099#include <sys/types.h>
1100#include <sys/socket.h>
1101 ],
1102 [ struct sockaddr_un s; s.sun_len = 1; ],
1103 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1104 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1105 )
1106])
1107if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1108 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1109fi
1110
Damien Miller61e50f12000-05-08 20:49:37 +10001111AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1112 ac_cv_have_ss_family_in_struct_ss, [
1113 AC_TRY_COMPILE(
1114 [
Damien Miller81171112000-04-23 11:14:01 +10001115#include <sys/types.h>
1116#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001117 ],
1118 [ struct sockaddr_storage s; s.ss_family = 1; ],
1119 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1120 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1121 )
1122])
1123if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1124 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1125fi
1126
Damien Miller61e50f12000-05-08 20:49:37 +10001127AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1128 ac_cv_have___ss_family_in_struct_ss, [
1129 AC_TRY_COMPILE(
1130 [
Damien Miller81171112000-04-23 11:14:01 +10001131#include <sys/types.h>
1132#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001133 ],
1134 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1135 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1136 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1137 )
1138])
1139if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1140 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1141fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001142
Damien Millerad833b32000-08-23 10:46:23 +10001143AC_CACHE_CHECK([for pw_class field in struct passwd],
1144 ac_cv_have_pw_class_in_struct_passwd, [
1145 AC_TRY_COMPILE(
1146 [
Damien Millerad833b32000-08-23 10:46:23 +10001147#include <pwd.h>
1148 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001149 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001150 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1151 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1152 )
1153])
1154if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1155 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1156fi
1157
Damien Miller61e50f12000-05-08 20:49:37 +10001158
1159AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1160 AC_TRY_LINK([],
1161 [ extern char *__progname; printf("%s", __progname); ],
1162 [ ac_cv_libc_defines___progname="yes" ],
1163 [ ac_cv_libc_defines___progname="no" ]
1164 )
1165])
1166if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1167 AC_DEFINE(HAVE___PROGNAME)
1168fi
1169
Damien Millera22ba012000-03-02 23:09:20 +11001170
Damien Millerecbb26d2000-07-15 14:59:14 +10001171AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1172 AC_TRY_LINK([],
1173 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1174 [ ac_cv_libc_defines_sys_errlist="yes" ],
1175 [ ac_cv_libc_defines_sys_errlist="no" ]
1176 )
1177])
1178if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1179 AC_DEFINE(HAVE_SYS_ERRLIST)
1180fi
1181
1182
Damien Miller11fa2cc2000-08-16 10:35:58 +10001183AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1184 AC_TRY_LINK([],
1185 [ extern int sys_nerr; printf("%i", sys_nerr);],
1186 [ ac_cv_libc_defines_sys_nerr="yes" ],
1187 [ ac_cv_libc_defines_sys_nerr="no" ]
1188 )
1189])
1190if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1191 AC_DEFINE(HAVE_SYS_NERR)
1192fi
1193
1194
Damien Millerc79bc0d2001-03-28 13:03:42 +10001195# Check whether user wants Kerberos support
1196KRB4_MSG="no"
1197AC_ARG_WITH(kerberos4,
1198 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1199 [
1200 if test "x$withval" != "xno" ; then
1201
1202 if test "x$withval" != "xyes" ; then
1203 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1204 LDFLAGS="$LDFLAGS -L${withval}/lib"
1205 if test ! -z "$need_dash_r" ; then
1206 LDFLAGS="$LDFLAGS -R${withval}/lib"
1207 fi
1208 if test ! -z "$blibpath" ; then
1209 blibpath="$blibpath:${withval}/lib"
1210 fi
1211 else
1212 if test -d /usr/include/kerberosIV ; then
1213 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1214 fi
1215 fi
1216
1217 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001218 if test "$ac_cv_header_krb_h" != yes; then
1219 AC_MSG_WARN([Cannot find krb.h, build may fail])
1220 fi
Damien Miller98344742001-03-28 14:37:06 +10001221 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001222 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001223 AC_CHECK_LIB(krb4, main)
1224 if test "$ac_cv_lib_krb4_main" != yes; then
1225 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1226 else
1227 KLIBS="-lkrb4"
1228 fi
1229 else
1230 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001231 fi
Damien Miller98344742001-03-28 14:37:06 +10001232 AC_CHECK_LIB(des, des_cbc_encrypt)
1233 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1234 AC_CHECK_LIB(des425, des_cbc_encrypt)
1235 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1236 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1237 else
1238 KLIBS="-ldes425"
1239 fi
1240 else
1241 KLIBS="-ldes"
1242 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001243 AC_CHECK_LIB(resolv, dn_expand, , )
1244 KRB4=yes
1245 KRB4_MSG="yes"
1246 AC_DEFINE(KRB4)
1247 fi
1248 ]
1249)
1250
1251# Check whether user wants AFS support
1252AFS_MSG="no"
1253AC_ARG_WITH(afs,
1254 [ --with-afs=PATH Enable AFS support],
1255 [
1256 if test "x$withval" != "xno" ; then
1257
1258 if test "x$withval" != "xyes" ; then
1259 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1260 LDFLAGS="$LDFLAGS -L${withval}/lib"
1261 fi
1262
1263 if test -z "$KRB4" ; then
1264 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1265 fi
1266
1267 LIBS="-lkafs $LIBS"
1268 if test ! -z "$AFS_LIBS" ; then
1269 LIBS="$LIBS $AFS_LIBS"
1270 fi
1271 AC_DEFINE(AFS)
1272 AFS_MSG="yes"
1273 fi
1274 ]
1275)
1276LIBS="$LIBS $KLIBS"
1277
Damien Millera22ba012000-03-02 23:09:20 +11001278# Looking for programs, paths and files
1279AC_ARG_WITH(rsh,
1280 [ --with-rsh=PATH Specify path to remote shell program ],
1281 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001282 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001283 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001284 fi
1285 ],
1286 [
1287 AC_PATH_PROG(rsh_path, rsh)
1288 ]
1289)
1290
1291AC_ARG_WITH(xauth,
1292 [ --with-xauth=PATH Specify path to xauth program ],
1293 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001294 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001295 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001296 fi
1297 ],
1298 [
Damien Miller78315eb2000-09-29 23:01:36 +11001299 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 +10001300 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001301 xauth_path="/usr/openwin/bin/xauth"
1302 fi
1303 ]
1304)
1305
Damien Millera19cf472000-11-29 13:28:50 +11001306if test -z "$xauth_path" ; then
1307 XAUTH_PATH="undefined"
1308 AC_SUBST(XAUTH_PATH)
1309else
Damien Millera22ba012000-03-02 23:09:20 +11001310 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001311 XAUTH_PATH=$xauth_path
1312 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001313fi
1314if test ! -z "$rsh_path" ; then
1315 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1316fi
1317
1318# Check for mail directory (last resort if we cannot get it from headers)
1319if test ! -z "$MAIL" ; then
1320 maildir=`dirname $MAIL`
1321 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1322fi
1323
Damien Millera22ba012000-03-02 23:09:20 +11001324if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001325 AC_CHECK_FILE("/dev/ptmx",
1326 [
1327 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1328 have_dev_ptmx=1
1329 ]
1330 )
Damien Millera22ba012000-03-02 23:09:20 +11001331fi
Damien Miller204ad072000-03-02 23:56:12 +11001332AC_CHECK_FILE("/dev/ptc",
1333 [
1334 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1335 have_dev_ptc=1
1336 ]
1337)
1338
Damien Millera22ba012000-03-02 23:09:20 +11001339# Options from here on. Some of these are preset by platform above
1340
Damien Millera22ba012000-03-02 23:09:20 +11001341# Check for user-specified random device, otherwise check /dev/urandom
1342AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001343 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001344 [
Damien Miller040f3832000-04-03 14:50:43 +10001345 if test "x$withval" != "xno" ; then
1346 RANDOM_POOL="$withval";
1347 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1348 fi
Damien Millera22ba012000-03-02 23:09:20 +11001349 ],
1350 [
1351 # Check for random device
1352 AC_CHECK_FILE("/dev/urandom",
1353 [
1354 RANDOM_POOL="/dev/urandom";
1355 AC_SUBST(RANDOM_POOL)
1356 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1357 ]
1358 )
1359 ]
1360)
1361
Damien Millerd0ccb982001-03-04 00:29:20 +11001362# Check for PRNGD/EGD pool file
1363AC_ARG_WITH(prngd-port,
1364 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1365 [
1366 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1367 PRNGD_PORT="$withval"
1368 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1369 fi
1370 ]
1371)
1372
1373# Check for PRNGD/EGD pool file
1374AC_ARG_WITH(prngd-socket,
1375 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001376 [
Damien Miller040f3832000-04-03 14:50:43 +10001377 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001378 PRNGD_SOCKET="$withval"
1379 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001380 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001381 ],
1382 [
1383 # Check for existing socket only if we don't have a random device already
1384 if test -z "$RANDOM_POOL" ; then
1385 AC_MSG_CHECKING(for PRNGD/EGD socket)
1386 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001387 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001388 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1389 PRNGD_SOCKET="$sock"
1390 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001391 break;
1392 fi
1393 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001394 if test ! -z "$PRNGD_SOCKET" ; then
1395 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001396 else
1397 AC_MSG_RESULT(not found)
1398 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001399 fi
Damien Millera22ba012000-03-02 23:09:20 +11001400 ]
1401)
1402
Damien Miller0736c4d2001-01-25 10:51:46 +11001403
Damien Miller0437b332000-05-02 09:56:41 +10001404# detect pathnames for entropy gathering commands, if we need them
1405INSTALL_SSH_PRNG_CMDS=""
1406rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001407if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001408 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001409 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1410 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1411 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1412 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1413 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1414 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1415 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1416 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1417 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1418 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1419 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1420 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1421 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1422 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001423
1424 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001425fi
Damien Miller0437b332000-05-02 09:56:41 +10001426AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1427
Damien Miller11e37f62000-04-08 18:23:30 +10001428
Damien Miller670a4b82000-01-22 13:53:11 +11001429AC_ARG_WITH(catman,
1430 [ --with-catman=man|cat Install preformatted manpages[no]],
1431 [
1432 MANTYPE='$(CATMAN)'
1433 if test x"$withval" != x"yes" ; then
1434 mansubdir=$withval
1435 else
1436 mansubdir=cat
1437 fi
1438 ], [
1439 if test -z "$MANTYPE" ; then
1440 MANTYPE='$(TROFFMAN)'
1441 mansubdir=man
1442 fi
1443 ]
1444)
1445AC_SUBST(MANTYPE)
1446AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001447
Damien Millera22ba012000-03-02 23:09:20 +11001448# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001449MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001450AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001451 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001452 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001453 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001454 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001455 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001456 fi
1457 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001458)
1459
Damien Millera22ba012000-03-02 23:09:20 +11001460# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001461AC_ARG_WITH(shadow,
1462 [ --without-shadow Disable shadow password support],
1463 [
1464 if test "x$withval" = "xno" ; then
1465 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001466 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001467 fi
1468 ]
1469)
1470
Damien Miller1f335fb2000-06-26 11:31:33 +10001471if test -z "$disable_shadow" ; then
1472 AC_MSG_CHECKING([if the systems has expire shadow information])
1473 AC_TRY_COMPILE(
1474 [
1475#include <sys/types.h>
1476#include <shadow.h>
1477 struct spwd sp;
1478 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1479 [ sp_expire_available=yes ], []
1480 )
1481
1482 if test "x$sp_expire_available" = "xyes" ; then
1483 AC_MSG_RESULT(yes)
1484 AC_DEFINE(HAS_SHADOW_EXPIRE)
1485 else
1486 AC_MSG_RESULT(no)
1487 fi
1488fi
1489
Damien Millera22ba012000-03-02 23:09:20 +11001490# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001491if test ! -z "$IPADDR_IN_DISPLAY" ; then
1492 DISPLAY_HACK_MSG="yes"
1493 AC_DEFINE(IPADDR_IN_DISPLAY)
1494else
1495 DISPLAY_HACK_MSG="no"
1496 AC_ARG_WITH(ipaddr-display,
1497 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1498 [
1499 if test "x$withval" != "xno" ; then
1500 AC_DEFINE(IPADDR_IN_DISPLAY)
1501 DISPLAY_HACK_MSG="yes"
1502 fi
1503 ]
1504 )
1505fi
Damien Miller76112de1999-12-21 11:18:08 +11001506
Damien Millera22ba012000-03-02 23:09:20 +11001507# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001508SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001509AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001510 [ --with-default-path=PATH Specify default \$PATH environment for server],
1511 [
1512 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001513 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001514 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001515 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001516 ],
1517 [
1518 AC_TRY_RUN(
1519 [
1520/* find out what STDPATH is */
1521#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001522#ifdef HAVE_PATHS_H
1523# include <paths.h>
1524#endif
1525#ifndef _PATH_STDPATH
1526# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1527#endif
1528#include <sys/types.h>
1529#include <sys/stat.h>
1530#include <fcntl.h>
1531#define DATA "conftest.stdpath"
1532
1533main()
1534{
1535 FILE *fd;
1536 int rc;
1537
1538 fd = fopen(DATA,"w");
1539 if(fd == NULL)
1540 exit(1);
1541
1542 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1543 exit(1);
1544
1545 exit(0);
1546}
1547 ], [ user_path=`cat conftest.stdpath` ],
1548 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1549 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1550 )
1551# make sure $bindir is in USER_PATH so scp will work
1552 t_bindir=`eval echo ${bindir}`
1553 case $t_bindir in
1554 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1555 esac
1556 case $t_bindir in
1557 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1558 esac
1559 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1560 if test $? -ne 0 ; then
1561 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1562 if test $? -ne 0 ; then
1563 user_path=$user_path:$t_bindir
1564 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1565 fi
1566 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001567 ]
1568)
Tim Rice59ea0a02001-03-10 13:50:45 -08001569AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1570AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001571
Damien Millera22ba012000-03-02 23:09:20 +11001572# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001573IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001574AC_ARG_WITH(ipv4-default,
1575 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1576 [
1577 if test "x$withval" != "xno" ; then
1578 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001579 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001580 fi
1581 ]
1582)
1583
Damien Miller61e50f12000-05-08 20:49:37 +10001584AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001585IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001586AC_ARG_WITH(4in6,
1587 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1588 [
1589 if test "x$withval" != "xno" ; then
1590 AC_MSG_RESULT(yes)
1591 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001592 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001593 else
1594 AC_MSG_RESULT(no)
1595 fi
1596 ],[
1597 if test "x$inet6_default_4in6" = "xyes"; then
1598 AC_MSG_RESULT([yes (default)])
1599 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001600 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001601 else
1602 AC_MSG_RESULT([no (default)])
1603 fi
1604 ]
1605)
1606
Damien Miller60396b02001-02-18 17:01:00 +11001607# Whether to enable BSD auth support
1608AC_ARG_WITH(bsd-auth,
1609 [ --with-bsd-auth Enable BSD auth support],
1610 [
1611 if test "x$withval" != "xno" ; then
1612 AC_DEFINE(BSD_AUTH)
1613 bsd_auth=yes
1614 fi
1615 ]
1616)
1617
Damien Miller78315eb2000-09-29 23:01:36 +11001618AC_MSG_CHECKING(whether to install ssh as suid root)
1619AC_ARG_ENABLE(suid-ssh,
1620[ --enable-suid-ssh Install ssh as suid root (default)
1621 --disable-suid-ssh Install ssh without suid bit],
1622[ case "$enableval" in
1623 no)
1624 AC_MSG_RESULT(no)
1625 SSHMODE=0711
1626 ;;
1627 *) AC_MSG_RESULT(yes)
1628 SSHMODE=04711
1629 ;;
1630 esac ],
1631 AC_MSG_RESULT(yes)
1632 SSHMODE=04711
1633)
1634AC_SUBST(SSHMODE)
1635
1636
Damien Millera22ba012000-03-02 23:09:20 +11001637# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001638piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001639AC_ARG_WITH(pid-dir,
1640 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1641 [
1642 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001643 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001644 fi
1645 ]
1646)
Damien Miller4018c192000-04-30 09:30:44 +10001647
Damien Miller78315eb2000-09-29 23:01:36 +11001648# make sure the directory exists
1649if test ! -d $piddir ; then
1650 piddir=`eval echo ${sysconfdir}`
1651 case $piddir in
1652 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1653 esac
1654fi
1655
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001656AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001657AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001658
andre2ff7b5d2000-06-03 14:57:40 +00001659dnl allow user to disable some login recording features
1660AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001661 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001662 [ AC_DEFINE(DISABLE_LASTLOG) ]
1663)
1664AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001665 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001666 [ AC_DEFINE(DISABLE_UTMP) ]
1667)
1668AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001669 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001670 [ AC_DEFINE(DISABLE_UTMPX) ]
1671)
1672AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001673 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001674 [ AC_DEFINE(DISABLE_WTMP) ]
1675)
1676AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001677 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001678 [ AC_DEFINE(DISABLE_WTMPX) ]
1679)
1680AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001681 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001682 [ AC_DEFINE(DISABLE_LOGIN) ]
1683)
1684AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001685 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001686 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1687)
1688AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001689 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001690 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1691)
1692AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001693 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001694 [
1695 if test "x$withval" = "xno" ; then
1696 AC_DEFINE(DISABLE_LASTLOG)
1697 else
1698 conf_lastlog_location=$withval
1699 fi
1700 ]
1701)
andre2ff7b5d2000-06-03 14:57:40 +00001702
1703dnl lastlog, [uw]tmpx? detection
1704dnl NOTE: set the paths in the platform section to avoid the
1705dnl need for command-line parameters
1706dnl lastlog and [uw]tmp are subject to a file search if all else fails
1707
1708dnl lastlog detection
1709dnl NOTE: the code itself will detect if lastlog is a directory
1710AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1711AC_TRY_COMPILE([
1712#include <sys/types.h>
1713#include <utmp.h>
1714#ifdef HAVE_LASTLOG_H
1715# include <lastlog.h>
1716#endif
Damien Miller2994e082000-06-04 15:51:47 +10001717#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001718# include <paths.h>
1719#endif
1720 ],
1721 [ char *lastlog = LASTLOG_FILE; ],
1722 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001723 [
1724 AC_MSG_RESULT(no)
1725 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1726 AC_TRY_COMPILE([
1727#include <sys/types.h>
1728#include <utmp.h>
1729#ifdef HAVE_LASTLOG_H
1730# include <lastlog.h>
1731#endif
1732#ifdef HAVE_PATHS_H
1733# include <paths.h>
1734#endif
1735 ],
1736 [ char *lastlog = _PATH_LASTLOG; ],
1737 [ AC_MSG_RESULT(yes) ],
1738 [
andree441aa32000-06-12 22:34:38 +00001739 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001740 system_lastlog_path=no
1741 ])
1742 ]
andre2ff7b5d2000-06-03 14:57:40 +00001743)
Damien Miller2994e082000-06-04 15:51:47 +10001744
andre2ff7b5d2000-06-03 14:57:40 +00001745if test -z "$conf_lastlog_location"; then
1746 if test x"$system_lastlog_path" = x"no" ; then
1747 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001748 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001749 conf_lastlog_location=$f
1750 fi
1751 done
1752 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001753 AC_MSG_WARN([** Cannot find lastlog **])
1754 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001755 fi
1756 fi
1757fi
1758
1759if test -n "$conf_lastlog_location"; then
1760 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1761fi
1762
1763dnl utmp detection
1764AC_MSG_CHECKING([if your system defines UTMP_FILE])
1765AC_TRY_COMPILE([
1766#include <sys/types.h>
1767#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001768#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001769# include <paths.h>
1770#endif
1771 ],
1772 [ char *utmp = UTMP_FILE; ],
1773 [ AC_MSG_RESULT(yes) ],
1774 [ AC_MSG_RESULT(no)
1775 system_utmp_path=no ]
1776)
1777if test -z "$conf_utmp_location"; then
1778 if test x"$system_utmp_path" = x"no" ; then
1779 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1780 if test -f $f ; then
1781 conf_utmp_location=$f
1782 fi
1783 done
1784 if test -z "$conf_utmp_location"; then
1785 AC_DEFINE(DISABLE_UTMP)
1786 fi
1787 fi
1788fi
1789if test -n "$conf_utmp_location"; then
1790 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1791fi
1792
1793dnl wtmp detection
1794AC_MSG_CHECKING([if your system defines WTMP_FILE])
1795AC_TRY_COMPILE([
1796#include <sys/types.h>
1797#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001798#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001799# include <paths.h>
1800#endif
1801 ],
1802 [ char *wtmp = WTMP_FILE; ],
1803 [ AC_MSG_RESULT(yes) ],
1804 [ AC_MSG_RESULT(no)
1805 system_wtmp_path=no ]
1806)
1807if test -z "$conf_wtmp_location"; then
1808 if test x"$system_wtmp_path" = x"no" ; then
1809 for f in /usr/adm/wtmp /var/log/wtmp; do
1810 if test -f $f ; then
1811 conf_wtmp_location=$f
1812 fi
1813 done
1814 if test -z "$conf_wtmp_location"; then
1815 AC_DEFINE(DISABLE_WTMP)
1816 fi
1817 fi
1818fi
1819if test -n "$conf_wtmp_location"; then
1820 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1821fi
1822
1823
1824dnl utmpx detection - I don't know any system so perverse as to require
1825dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1826dnl there, though.
1827AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1828AC_TRY_COMPILE([
1829#include <sys/types.h>
1830#include <utmp.h>
1831#ifdef HAVE_UTMPX_H
1832#include <utmpx.h>
1833#endif
Damien Miller2994e082000-06-04 15:51:47 +10001834#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001835# include <paths.h>
1836#endif
1837 ],
1838 [ char *utmpx = UTMPX_FILE; ],
1839 [ AC_MSG_RESULT(yes) ],
1840 [ AC_MSG_RESULT(no)
1841 system_utmpx_path=no ]
1842)
1843if test -z "$conf_utmpx_location"; then
1844 if test x"$system_utmpx_path" = x"no" ; then
1845 AC_DEFINE(DISABLE_UTMPX)
1846 fi
1847else
1848 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1849fi
1850
1851dnl wtmpx detection
1852AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1853AC_TRY_COMPILE([
1854#include <sys/types.h>
1855#include <utmp.h>
1856#ifdef HAVE_UTMPX_H
1857#include <utmpx.h>
1858#endif
Damien Miller2994e082000-06-04 15:51:47 +10001859#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001860# include <paths.h>
1861#endif
1862 ],
1863 [ char *wtmpx = WTMPX_FILE; ],
1864 [ AC_MSG_RESULT(yes) ],
1865 [ AC_MSG_RESULT(no)
1866 system_wtmpx_path=no ]
1867)
1868if test -z "$conf_wtmpx_location"; then
1869 if test x"$system_wtmpx_path" = x"no" ; then
1870 AC_DEFINE(DISABLE_WTMPX)
1871 fi
1872else
1873 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1874fi
1875
Damien Miller4018c192000-04-30 09:30:44 +10001876
1877# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001878entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001879AC_ARG_WITH(entropy-timeout,
1880 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1881 [
1882 if test "x$withval" != "xno" ; then
1883 entropy_timeout=$withval
1884 fi
1885 ]
1886)
1887AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1888
1889
Damien Miller29ea30d2000-03-17 10:54:15 +11001890if test ! -z "$blibpath" ; then
1891 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1892 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1893fi
1894
Damien Millerbac2d8a2000-09-05 16:13:06 +11001895AC_EXEEXT
1896
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001897AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001898
Damien Miller7b22d652000-06-18 14:07:04 +10001899# Print summary of options
1900
1901if test x$MANTYPE = x'$(CATMAN)' ; then
1902 MAN_MSG=cat
1903else
1904 MAN_MSG=man
1905fi
1906if test ! -z "$RANDOM_POOL" ; then
1907 RAND_MSG="Device ($RANDOM_POOL)"
1908else
Damien Millerd0ccb982001-03-04 00:29:20 +11001909 if test ! -z "$PRNGD_PORT" ; then
1910 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1911 elif test ! -z "$PRNGD_SOCKET" ; then
1912 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001913 else
1914 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001915 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001916 fi
1917fi
1918
1919# Someone please show me a better way :)
1920A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1921B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1922C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1923D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001924E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001925F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1926G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001927H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001928
1929echo ""
1930echo "OpenSSH configured has been configured with the following options."
1931echo " User binaries: $B"
1932echo " System binaries: $C"
1933echo " Configuration files: $D"
1934echo " Askpass program: $E"
1935echo " Manual pages: $F"
1936echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001937echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001938echo " Random number collection: $RAND_MSG"
1939echo " Manpage format: $MAN_MSG"
1940echo " PAM support: ${PAM_MSG}"
1941echo " KerberosIV support: $KRB4_MSG"
1942echo " AFS support: $AFS_MSG"
1943echo " S/KEY support: $SKEY_MSG"
1944echo " TCP Wrappers support: $TCPW_MSG"
1945echo " MD5 password support: $MD5_MSG"
1946echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1947echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1948echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1949
Damien Miller60396b02001-02-18 17:01:00 +11001950if test ! -z "$bsd_auth"; then
1951 echo " BSD Auth support: yes"
1952fi
1953
Damien Miller7b22d652000-06-18 14:07:04 +10001954echo ""
1955
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001956echo " Host: ${host}"
1957echo " Compiler: ${CC}"
1958echo " Compiler flags: ${CFLAGS}"
1959echo "Preprocessor flags: ${CPPFLAGS}"
1960echo " Linker flags: ${LDFLAGS}"
1961echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001962
1963echo ""
1964
Damien Miller82cf0ce2000-12-20 13:34:48 +11001965if test "x$PAM_MSG" = "xyes" ; then
1966 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1967 echo "otherwise password authentication may fail. Example PAM control files"
1968 echo "can be found in the contrib/ subdirectory"
1969 echo ""
1970fi
1971
Damien Miller6f9c3372000-10-25 10:06:04 +11001972if test ! -z "$BUILTIN_RNG" ; then
1973 echo "WARNING: you are using the builtin random number collection service."
1974 echo "Please read WARNING.RNG and request that your OS vendor includes"
1975 echo "/dev/random in future versions of their OS."
1976 echo ""
1977fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001978
1979if test ! -z "$NO_SFTP"; then
1980 echo "sftp-server will be disabled. Your compiler does not support"
1981 echo "64bit integers."
1982 echo ""
1983fi
Damien Miller60396b02001-02-18 17:01:00 +11001984