blob: 9daf3b007e442dcc41b8a6e5d6878996f8246e7d [file] [log] [blame]
Ben Lindstromf0bfa832002-06-21 00:01:18 +00001# $Id: configure.ac,v 1.67 2002/06/21 00:01:19 mouring Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110017AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100018AC_PATH_PROG(ENT, ent)
19AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110020AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
57 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100060 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Millerfa2bb692002-04-23 23:22:25 +100061 AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
62 saved_LDFLAGS="$LDFLAGS"
63 LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
64 AC_TRY_LINK([],
65 [],
66 [
67 AC_MSG_RESULT(yes)
68 blibpath="/usr/lib:/lib:/usr/local/lib"
69 ],
70 [ AC_MSG_RESULT(no) ]
71 )
72 LDFLAGS="$saved_LDFLAGS"
Damien Miller29ea30d2000-03-17 10:54:15 +110073 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100074 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110075 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100076 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +000077 dnl AIX handles lastlog as part of its login message
78 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110079 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110080*-*-cygwin*)
Tim Ricefe1d1002001-11-26 17:19:43 -080081 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110082 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000083 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +110084 AC_DEFINE(DISABLE_SHADOW)
85 AC_DEFINE(IPV4_DEFAULT)
86 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000087 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom837461b2002-06-12 16:57:14 +000088 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110089 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000090*-*-dgux*)
91 AC_DEFINE(IP_TOS_IS_BROKEN)
92 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000093*-*-darwin*)
94 AC_DEFINE(BROKEN_GETADDRINFO)
95 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +000096*-*-hpux10.26)
97 if test -z "$GCC"; then
98 CFLAGS="$CFLAGS -Ae"
99 fi
100 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
101 IPADDR_IN_DISPLAY=yes
102 AC_DEFINE(HAVE_SECUREWARE)
103 AC_DEFINE(USE_PIPES)
104 AC_DEFINE(LOGIN_NO_ENDOPT)
105 AC_DEFINE(LOGIN_NEEDS_UTMPX)
106 AC_DEFINE(DISABLE_SHADOW)
107 AC_DEFINE(DISABLE_UTMP)
108 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
109 LIBS="$LIBS -lxnet -lsec -lsecpw"
110 disable_ptmx_check=yes
111 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100112*-*-hpux10*)
113 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000114 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100115 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000116 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100117 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000118 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000119 AC_DEFINE(LOGIN_NO_ENDOPT)
120 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100121 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100122 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000123 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +0000124 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +1100125 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000126*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000127 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100128 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100129 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100130 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000131 AC_DEFINE(LOGIN_NO_ENDOPT)
132 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100133 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100134 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +0000135 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000136 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000137 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100138*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000139 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000140 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100141 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000142 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000143 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100144 ;;
145*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000147 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100148 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000149 AC_DEFINE(WITH_IRIX_ARRAY)
150 AC_DEFINE(WITH_IRIX_PROJECT)
151 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000152 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000153 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000154 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100155 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100156*-*-linux*)
157 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100158 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100159 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000160 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100161 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100162 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000163mips-sony-bsd|mips-sony-newsos4)
164 AC_DEFINE(HAVE_NEWS4)
165 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000166 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100167*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100168 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100169 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100170*-*-freebsd*)
171 check_for_libcrypt_later=1
172 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000173*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000174 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/usr/adm/wtmp
177 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000178 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000179 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000180 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100181 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000182 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000183 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000184 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100185*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000186 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000187 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100188 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100189 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000190 AC_DEFINE(LOGIN_NEEDS_UTMPX)
191 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000192 AC_DEFINE(PAM_TTY_KLUDGE)
andre2ff7b5d2000-06-03 14:57:40 +0000193 # hardwire lastlog location (can't detect it on some versions)
194 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000195 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
196 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
197 if test "$sol2ver" -ge 8; then
198 AC_MSG_RESULT(yes)
199 AC_DEFINE(DISABLE_UTMP)
200 AC_DEFINE(DISABLE_WTMP)
201 else
202 AC_MSG_RESULT(no)
203 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100204 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000205*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000206 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000207 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100208 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000209 conf_utmp_location=/etc/utmp
210 conf_wtmp_location=/var/adm/wtmp
211 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000212 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000213 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000214*-ncr-sysv*)
215 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700217 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000218 AC_DEFINE(USE_PIPES)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000219 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000220*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000221 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700222 # /usr/ucblib MUST NOT be searched on ReliantUNIX
223 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100224 IPADDR_IN_DISPLAY=yes
225 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000226 AC_DEFINE(IP_TOS_IS_BROKEN)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700227 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
228 # Attention: always take care to bind libsocket and libnsl before libc,
229 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000230 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100231*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000232 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100235 ;;
236*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000237 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100238 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100239 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100240 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100241*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000242 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100243 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100244 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100245*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000246 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100247 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700248 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100249 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100250 RANLIB=true
251 no_dev_ptmx=1
252 AC_DEFINE(BROKEN_SYS_TERMIO_H)
253 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000254 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000255 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100256 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100257 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700258 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700259 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100260 ;;
261*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000263 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100264 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000265 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100266 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100267 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000268 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000269 AC_DEFINE(DISABLE_SHADOW)
Damien Miller217f5672001-02-16 12:12:41 +1100270 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700271 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000272 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000273*-*-unicos*)
Tim Ricee991e3c2001-08-07 15:29:07 -0700274 no_libsocket=1
275 no_libnsl=1
Ben Lindstromd9e08242001-07-22 19:32:00 +0000276 AC_DEFINE(USE_PIPES)
Tim Ricee991e3c2001-08-07 15:29:07 -0700277 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
278 LIBS="$LIBS -lgen -lrsc"
279 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000280*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000281 AC_MSG_CHECKING(for Digital Unix SIA)
282 no_osfsia=""
283 AC_ARG_WITH(osfsia,
284 [ --with-osfsia Enable Digital Unix SIA],
285 [
286 if test "x$withval" = "xno" ; then
287 AC_MSG_RESULT(disabled)
288 no_osfsia=1
289 fi
290 ],
291 )
292 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000293 if test -f /etc/sia/matrix.conf; then
294 AC_MSG_RESULT(yes)
295 AC_DEFINE(HAVE_OSF_SIA)
296 AC_DEFINE(DISABLE_LOGIN)
297 LIBS="$LIBS -lsecurity -ldb -lm -laud"
298 else
299 AC_MSG_RESULT(no)
300 fi
301 fi
302 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000303
304*-*-nto-qnx)
305 AC_DEFINE(USE_PIPES)
306 AC_DEFINE(NO_X11_UNIX_SOCKETS)
307 AC_DEFINE(MISSING_NFDBITS)
308 AC_DEFINE(MISSING_HOWMANY)
309 AC_DEFINE(MISSING_FD_MASK)
310 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100311esac
312
Damien Millere37bfc12000-06-05 09:37:43 +1000313# Allow user to specify flags
314AC_ARG_WITH(cflags,
315 [ --with-cflags Specify additional flags to pass to compiler],
316 [
317 if test "x$withval" != "xno" ; then
318 CFLAGS="$CFLAGS $withval"
319 fi
320 ]
321)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000322AC_ARG_WITH(cppflags,
323 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
324 [
325 if test "x$withval" != "xno"; then
326 CPPFLAGS="$CPPFLAGS $withval"
327 fi
328 ]
329)
Damien Millere37bfc12000-06-05 09:37:43 +1000330AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000331 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000332 [
333 if test "x$withval" != "xno" ; then
334 LDFLAGS="$LDFLAGS $withval"
335 fi
336 ]
337)
338AC_ARG_WITH(libs,
339 [ --with-libs Specify additional libraries to link with],
340 [
341 if test "x$withval" != "xno" ; then
342 LIBS="$LIBS $withval"
343 fi
344 ]
345)
346
Tim Rice4cec93f2002-02-26 08:40:48 -0800347# Checks for header files.
348AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
349 getopt.h glob.h lastlog.h limits.h login.h \
350 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000351 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000352 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800353 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
Kevin Stevesb1184bb2002-04-07 18:12:03 +0000354 sys/mman.h sys/select.h sys/stat.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800355 sys/stropts.h sys/sysmacros.h sys/time.h \
Kevin Steves117b06d2002-03-30 17:55:21 +0000356 sys/un.h time.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800357 util.h utime.h utmp.h utmpx.h)
358
Damien Millera22ba012000-03-02 23:09:20 +1100359# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700360AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
361AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000362
Damien Millerdf288022001-02-18 13:07:07 +1100363dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700364if test "x$with_tcp_wrappers" != "xno" ; then
365 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
366 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
367 fi
368fi
Damien Millerdf288022001-02-18 13:07:07 +1100369
Tim Rice13aae5e2001-10-21 17:53:58 -0700370AC_CHECK_FUNC(getspnam, ,
371 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700372
Damien Miller150c8b52002-02-13 23:06:56 +1100373AC_ARG_WITH(rpath,
374 [ --without-rpath Disable auto-added -R linker paths],
375 [
376 if test "x$withval" = "xno" ; then
377 need_dash_r=""
378 fi
379 if test "x$withval" = "xyes" ; then
380 need_dash_r=1
381 fi
382 ]
383)
384
Tim Rice13aae5e2001-10-21 17:53:58 -0700385dnl zlib is required
386AC_ARG_WITH(zlib,
387 [ --with-zlib=PATH Use zlib in PATH],
388 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000389 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100390 AC_MSG_ERROR([*** zlib is required ***])
391 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700392 if test -d "$withval/lib"; then
393 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700394 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700395 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700396 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700397 fi
398 else
399 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700400 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700401 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700402 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700403 fi
404 fi
405 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700406 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700407 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700408 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700409 fi
410 ]
411)
412
Tim Rice17b93e52001-10-23 22:36:54 -0700413AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100414
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000415dnl UnixWare 2.x
416AC_CHECK_FUNC(strcasecmp,
417 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
418)
419AC_CHECK_FUNC(utimes,
420 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
421)
Damien Millerab18c411999-11-11 10:40:23 +1100422
Tim Ricee589a292001-11-03 11:09:32 -0800423dnl Checks for libutil functions
424AC_CHECK_HEADERS(libutil.h)
425AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
426AC_CHECK_FUNCS(logout updwtmp logwtmp)
427
Ben Lindstrom8697e082001-02-24 21:41:10 +0000428AC_FUNC_STRFTIME
429
Damien Miller3c027682001-03-14 11:39:45 +1100430# Check for ALTDIRFUNC glob() extension
431AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
432AC_EGREP_CPP(FOUNDIT,
433 [
434 #include <glob.h>
435 #ifdef GLOB_ALTDIRFUNC
436 FOUNDIT
437 #endif
438 ],
439 [
440 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
441 AC_MSG_RESULT(yes)
442 ],
443 [
444 AC_MSG_RESULT(no)
445 ]
446)
Damien Millerab18c411999-11-11 10:40:23 +1100447
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000448# Check for g.gl_matchc glob() extension
449AC_MSG_CHECKING(for gl_matchc field in glob_t)
450AC_EGREP_CPP(FOUNDIT,
451 [
452 #include <glob.h>
453 int main(void){glob_t g; g.gl_matchc = 1;}
454 ],
455 [
456 AC_DEFINE(GLOB_HAS_GL_MATCHC)
457 AC_MSG_RESULT(yes)
458 ],
459 [
460 AC_MSG_RESULT(no)
461 ]
462)
463
Damien Miller18bb4732001-03-28 14:35:30 +1000464AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
465AC_TRY_RUN(
466 [
467#include <sys/types.h>
468#include <dirent.h>
469int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
470 ],
471 [AC_MSG_RESULT(yes)],
472 [
473 AC_MSG_RESULT(no)
474 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
475 ]
476)
477
Damien Millerc547bf12001-02-16 10:18:12 +1100478# Check whether user wants S/Key support
479SKEY_MSG="no"
480AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700481 [ --with-skey[[=PATH]] Enable S/Key support
482 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100483 [
484 if test "x$withval" != "xno" ; then
485
486 if test "x$withval" != "xyes" ; then
487 CPPFLAGS="$CPPFLAGS -I${withval}/include"
488 LDFLAGS="$LDFLAGS -L${withval}/lib"
489 fi
490
491 AC_DEFINE(SKEY)
492 LIBS="-lskey $LIBS"
493 SKEY_MSG="yes"
494
Tim Rice4cec93f2002-02-26 08:40:48 -0800495 AC_MSG_CHECKING([for s/key support])
496 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100497 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800498#include <stdio.h>
499#include <skey.h>
500int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
501 ],
502 [AC_MSG_RESULT(yes)],
503 [
504 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100505 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
506 ])
507 fi
508 ]
509)
510
511# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700512TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100513AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700514 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
515 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100516 [
517 if test "x$withval" != "xno" ; then
518 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700519 saved_LDFLAGS="$LDFLAGS"
520 saved_CPPFLAGS="$CPPFLAGS"
521 if test -n "${withval}" -a "${withval}" != "yes"; then
522 if test -d "${withval}/lib"; then
523 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700524 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700525 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700526 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700527 fi
528 else
529 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700530 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700531 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700532 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700533 fi
534 fi
535 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700536 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700537 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700538 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700539 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700540 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800541 LIBWRAP="-lwrap"
542 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100543 AC_MSG_CHECKING(for libwrap)
544 AC_TRY_LINK(
545 [
546#include <tcpd.h>
547 int deny_severity = 0, allow_severity = 0;
548 ],
549 [hosts_access(0);],
550 [
551 AC_MSG_RESULT(yes)
552 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800553 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700554 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100555 ],
556 [
557 AC_MSG_ERROR([*** libwrap missing])
558 ]
559 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800560 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100561 fi
562 ]
563)
564
Damien Millerad833b32000-08-23 10:46:23 +1000565dnl Checks for library functions.
Ben Lindstromfdee8ef2002-04-06 23:52:02 +0000566AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
Tim Rice13aae5e2001-10-21 17:53:58 -0700567 clock fchmod fchown freeaddrinfo futimes gai_strerror \
568 getaddrinfo getcwd getgrouplist getnameinfo getopt \
569 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
570 inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller594a71b2002-04-23 20:22:59 +1000571 mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \
572 realpath recvmsg rresvport_af sendmsg setdtablesize setegid \
Ben Lindstrom837461b2002-06-12 16:57:14 +0000573 setenv seteuid setgroups setlogin setproctitle setresgid setreuid \
Ben Lindstromf0bfa832002-06-21 00:01:18 +0000574 setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
575 socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
576 truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty)
Tim Rice13aae5e2001-10-21 17:53:58 -0700577
578dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700579AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700580 AC_CHECK_LIB(gen, dirname,[
581 AC_CACHE_CHECK([for broken dirname],
582 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700583 save_LIBS="$LIBS"
584 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700585 AC_TRY_RUN(
586 [
587#include <libgen.h>
588#include <string.h>
589
590int main(int argc, char **argv) {
591 char *s, buf[32];
592
593 strncpy(buf,"/etc", 32);
594 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700595 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700596 exit(1);
597 } else {
598 exit(0);
599 }
600}
601 ],
602 [ ac_cv_have_broken_dirname="no" ],
603 [ ac_cv_have_broken_dirname="yes" ]
604 )
Tim Rice17b93e52001-10-23 22:36:54 -0700605 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700606 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700607 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700608 LIBS="$LIBS -lgen"
609 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700610 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700611 fi
612 ])
613])
614
Damien Millerad833b32000-08-23 10:46:23 +1000615dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000616AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000617dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000618AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000619AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000620dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000621AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000622AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100623
Damien Miller04f80141999-11-19 15:32:34 +1100624AC_CHECK_FUNC(daemon,
625 [AC_DEFINE(HAVE_DAEMON)],
626 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
627)
628
Damien Miller9fb07e42000-03-05 16:22:59 +1100629AC_CHECK_FUNC(getpagesize,
630 [AC_DEFINE(HAVE_GETPAGESIZE)],
631 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
632)
633
Damien Millercb170cb2000-07-01 16:52:55 +1000634# Check for broken snprintf
635if test "x$ac_cv_func_snprintf" = "xyes" ; then
636 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
637 AC_TRY_RUN(
638 [
639#include <stdio.h>
640int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
641 ],
642 [AC_MSG_RESULT(yes)],
643 [
644 AC_MSG_RESULT(no)
645 AC_DEFINE(BROKEN_SNPRINTF)
646 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
647 ]
648 )
649fi
650
Damien Miller606f8802000-09-16 15:39:56 +1100651AC_FUNC_GETPGRP
652
Damien Millera64b57a2001-01-17 10:44:13 +1100653# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000654PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100655AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100656 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100657 [
Damien Millera64b57a2001-01-17 10:44:13 +1100658 if test "x$withval" != "xno" ; then
659 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
660 AC_MSG_ERROR([PAM headers not found])
661 fi
662
663 AC_CHECK_LIB(dl, dlopen, , )
664 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
665 AC_CHECK_FUNCS(pam_getenvlist)
666
667 disable_shadow=yes
668 PAM_MSG="yes"
669
670 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800671 if test $ac_cv_lib_dl_dlopen = yes; then
672 LIBPAM="-lpam -ldl"
673 else
674 LIBPAM="-lpam"
675 fi
676 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100677 fi
678 ]
679)
Damien Millera22ba012000-03-02 23:09:20 +1100680
Damien Millera64b57a2001-01-17 10:44:13 +1100681# Check for older PAM
682if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100683 # Check PAM strerror arguments (old PAM)
684 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
685 AC_TRY_COMPILE(
686 [
Damien Miller81171112000-04-23 11:14:01 +1000687#include <stdlib.h>
688#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100689 ],
690 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
691 [AC_MSG_RESULT(no)],
692 [
693 AC_DEFINE(HAVE_OLD_PAM)
694 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000695 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100696 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100697 )
Damien Millera22ba012000-03-02 23:09:20 +1100698fi
699
Tim Riceaef73712002-05-11 13:17:42 -0700700# Search for OpenSSL
701saved_CPPFLAGS="$CPPFLAGS"
702saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100703AC_ARG_WITH(ssl-dir,
704 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
705 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000706 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700707 if test -d "$withval/lib"; then
708 if test -n "${need_dash_r}"; then
709 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
710 else
711 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
712 fi
713 else
714 if test -n "${need_dash_r}"; then
715 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
716 else
717 LDFLAGS="-L${withval} ${LDFLAGS}"
718 fi
719 fi
720 if test -d "$withval/include"; then
721 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
722 else
723 CPPFLAGS="-I${withval} ${CPPFLAGS}"
724 fi
Damien Millera22ba012000-03-02 23:09:20 +1100725 fi
726 ]
727)
Tim Riceaef73712002-05-11 13:17:42 -0700728LIBS="$LIBS -lcrypto"
729AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000730 [
Tim Riceaef73712002-05-11 13:17:42 -0700731 dnl Check default openssl install dir
732 if test -n "${need_dash_r}"; then
733 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000734 else
Tim Riceaef73712002-05-11 13:17:42 -0700735 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000736 fi
Tim Riceaef73712002-05-11 13:17:42 -0700737 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
738 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
739 [
740 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
741 ]
742 )
743 ]
744)
745
Damien Millera22ba012000-03-02 23:09:20 +1100746
Damien Millerec932372002-01-22 22:16:03 +1100747# Sanity check OpenSSL headers
748AC_MSG_CHECKING([whether OpenSSL's headers match the library])
749AC_TRY_RUN(
750 [
751#include <string.h>
752#include <openssl/opensslv.h>
753int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
754 ],
755 [
756 AC_MSG_RESULT(yes)
757 ],
758 [
759 AC_MSG_RESULT(no)
760 AC_MSG_ERROR(Your OpenSSL headers do not match your library)
761 ]
762)
763
Damien Millera64b57a2001-01-17 10:44:13 +1100764# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
765# version in OpenSSL. Skip this for PAM
766if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100767 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100768fi
769
Damien Miller6c21c512002-01-22 21:57:53 +1100770
771### Configure cryptographic random number support
772
773# Check wheter OpenSSL seeds itself
774AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
775AC_TRY_RUN(
776 [
777#include <string.h>
778#include <openssl/rand.h>
779int main(void) { return(RAND_status() == 1 ? 0 : 1); }
780 ],
781 [
782 OPENSSL_SEEDS_ITSELF=yes
783 AC_MSG_RESULT(yes)
784 ],
785 [
786 AC_MSG_RESULT(no)
787 # Default to use of the rand helper if OpenSSL doesn't
788 # seed itself
789 USE_RAND_HELPER=yes
790 ]
791)
792
793
794# Do we want to force the use of the rand helper?
795AC_ARG_WITH(rand-helper,
796 [ --with-rand-helper Use subprocess to gather strong randomness ],
797 [
798 if test "x$withval" = "xno" ; then
799 # Force use of OpenSSL's internal RNG, even if
800 # the previous test showed it to be unseeded.
801 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
802 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
803 OPENSSL_SEEDS_ITSELF=yes
804 USE_RAND_HELPER=""
805 fi
806 else
807 USE_RAND_HELPER=yes
808 fi
809 ],
810)
811
812# Which randomness source do we use?
813if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
814 # OpenSSL only
815 AC_DEFINE(OPENSSL_PRNG_ONLY)
816 RAND_MSG="OpenSSL internal ONLY"
817 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -0800818elif test ! -z "$USE_RAND_HELPER" ; then
819 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +1100820 RAND_MSG="ssh-rand-helper"
821 INSTALL_SSH_RAND_HELPER="yes"
822fi
823AC_SUBST(INSTALL_SSH_RAND_HELPER)
824
825### Configuration of ssh-rand-helper
826
827# PRNGD TCP socket
828AC_ARG_WITH(prngd-port,
829 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
830 [
Damien Millere996d722002-01-23 11:20:59 +1100831 case "$withval" in
832 no)
833 withval=""
834 ;;
835 [[0-9]]*)
836 ;;
837 *)
838 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
839 ;;
840 esac
841 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100842 PRNGD_PORT="$withval"
843 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
844 fi
845 ]
846)
847
848# PRNGD Unix domain socket
849AC_ARG_WITH(prngd-socket,
850 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
851 [
Damien Millere996d722002-01-23 11:20:59 +1100852 case "$withval" in
853 yes)
Damien Miller6c21c512002-01-22 21:57:53 +1100854 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +1100855 ;;
856 no)
857 withval=""
858 ;;
859 /*)
860 ;;
861 *)
862 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
863 ;;
864 esac
865
866 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100867 if test ! -z "$PRNGD_PORT" ; then
868 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
869 fi
Damien Miller6385ba02002-01-23 08:12:36 +1100870 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100871 AC_MSG_WARN(Entropy socket is not readable)
872 fi
873 PRNGD_SOCKET="$withval"
874 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
875 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800876 ],
877 [
878 # Check for existing socket only if we don't have a random device already
879 if test "$USE_RAND_HELPER" = yes ; then
880 AC_MSG_CHECKING(for PRNGD/EGD socket)
881 # Insert other locations here
882 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
883 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
884 PRNGD_SOCKET="$sock"
885 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
886 break;
887 fi
888 done
889 if test ! -z "$PRNGD_SOCKET" ; then
890 AC_MSG_RESULT($PRNGD_SOCKET)
891 else
892 AC_MSG_RESULT(not found)
893 fi
894 fi
Damien Miller6c21c512002-01-22 21:57:53 +1100895 ]
896)
897
898# Change default command timeout for hashing entropy source
899entropy_timeout=200
900AC_ARG_WITH(entropy-timeout,
901 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
902 [
903 if test "x$withval" != "xno" ; then
904 entropy_timeout=$withval
905 fi
906 ]
907)
Damien Miller6c21c512002-01-22 21:57:53 +1100908AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
909
Kevin Steves7ff91122002-04-07 19:22:54 +0000910ssh_privsep_user=sshd
911AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +0000912 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +0000913 [
914 if test -n "$withval"; then
915 ssh_privsep_user=$withval
916 fi
917 ]
918)
Kevin Steves4e0bb522002-04-07 19:44:14 +0000919AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$ssh_privsep_user")
Kevin Steves7ff91122002-04-07 19:22:54 +0000920
Tim Rice88f2ab52002-03-17 12:17:34 -0800921# We do this little dance with the search path to insure
922# that programs that we select for use by installed programs
923# (which may be run by the super-user) come from trusted
924# locations before they come from the user's private area.
925# This should help avoid accidentally configuring some
926# random version of a program in someone's personal bin.
927
928OPATH=$PATH
929PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -0700930test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -0800931test -d /sbin && PATH=$PATH:/sbin
932test -d /usr/sbin && PATH=$PATH:/usr/sbin
933PATH=$PATH:/etc:$OPATH
934
Damien Miller6c21c512002-01-22 21:57:53 +1100935# These programs are used by the command hashing source to gather entropy
936OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
937OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
938OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
939OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
940OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
941OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
942OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
943OSSH_PATH_ENTROPY_PROG(PROG_W, w)
944OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
945OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
946OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
947OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
948OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
949OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
950OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
951OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -0800952# restore PATH
953PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +1100954
955# Where does ssh-rand-helper get its randomness from?
956INSTALL_SSH_PRNG_CMDS=""
957if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
958 if test ! -z "$PRNGD_PORT" ; then
959 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
960 elif test ! -z "$PRNGD_SOCKET" ; then
961 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
962 else
963 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
964 RAND_HELPER_CMDHASH=yes
965 INSTALL_SSH_PRNG_CMDS="yes"
966 fi
967fi
968AC_SUBST(INSTALL_SSH_PRNG_CMDS)
969
970
Ben Lindstromb5628642000-10-18 00:02:25 +0000971# Cheap hack to ensure NEWS-OS libraries are arranged right.
972if test ! -z "$SONY" ; then
973 LIBS="$LIBS -liberty";
974fi
975
Damien Millera22ba012000-03-02 23:09:20 +1100976# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100977AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100978AC_CHECK_SIZEOF(short int, 2)
979AC_CHECK_SIZEOF(int, 4)
980AC_CHECK_SIZEOF(long int, 4)
981AC_CHECK_SIZEOF(long long int, 8)
982
Damien Millerfa2bb692002-04-23 23:22:25 +1000983# Sanity check long long for some platforms (AIX)
984if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
985 ac_cv_sizeof_long_long_int=0
986fi
987
Damien Millera22ba012000-03-02 23:09:20 +1100988# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100989AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
990 AC_TRY_COMPILE(
991 [ #include <sys/types.h> ],
992 [ u_int a; a = 1;],
993 [ ac_cv_have_u_int="yes" ],
994 [ ac_cv_have_u_int="no" ]
995 )
996])
997if test "x$ac_cv_have_u_int" = "xyes" ; then
998 AC_DEFINE(HAVE_U_INT)
999 have_u_int=1
1000fi
1001
Damien Miller61e50f12000-05-08 20:49:37 +10001002AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1003 AC_TRY_COMPILE(
1004 [ #include <sys/types.h> ],
1005 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1006 [ ac_cv_have_intxx_t="yes" ],
1007 [ ac_cv_have_intxx_t="no" ]
1008 )
1009])
1010if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1011 AC_DEFINE(HAVE_INTXX_T)
1012 have_intxx_t=1
1013fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001014
1015if (test -z "$have_intxx_t" && \
1016 test "x$ac_cv_header_stdint_h" = "xyes")
1017then
1018 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1019 AC_TRY_COMPILE(
1020 [ #include <stdint.h> ],
1021 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1022 [
1023 AC_DEFINE(HAVE_INTXX_T)
1024 AC_MSG_RESULT(yes)
1025 ],
1026 [ AC_MSG_RESULT(no) ]
1027 )
1028fi
1029
Damien Miller578783e2000-09-23 14:12:24 +11001030AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1031 AC_TRY_COMPILE(
1032 [ #include <sys/types.h> ],
1033 [ int64_t a; a = 1;],
1034 [ ac_cv_have_int64_t="yes" ],
1035 [ ac_cv_have_int64_t="no" ]
1036 )
1037])
1038if test "x$ac_cv_have_int64_t" = "xyes" ; then
1039 AC_DEFINE(HAVE_INT64_T)
1040 have_int64_t=1
1041fi
1042
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001043if test -z "$have_int64_t" ; then
1044 AC_MSG_CHECKING([for int64_t type in sys/socket.h])
1045 AC_TRY_COMPILE(
1046 [ #include <sys/socket.h> ],
1047 [ int64_t a; a = 1],
1048 [
1049 AC_DEFINE(HAVE_INT64_T)
1050 AC_MSG_RESULT(yes)
1051 ],
1052 [ AC_MSG_RESULT(no) ]
1053 )
1054fi
1055
Tim Rice4cec93f2002-02-26 08:40:48 -08001056if test -z "$have_int64_t" ; then
1057 AC_MSG_CHECKING([for int64_t type in sys/bitypes.h])
1058 AC_TRY_COMPILE(
1059 [ #include <sys/bitypes.h> ],
1060 [ int64_t a; a = 1],
1061 [
1062 AC_DEFINE(HAVE_INT64_T)
1063 AC_MSG_RESULT(yes)
1064 ],
1065 [ AC_MSG_RESULT(no) ]
1066 )
1067fi
1068
Damien Miller61e50f12000-05-08 20:49:37 +10001069AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1070 AC_TRY_COMPILE(
1071 [ #include <sys/types.h> ],
1072 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1073 [ ac_cv_have_u_intxx_t="yes" ],
1074 [ ac_cv_have_u_intxx_t="no" ]
1075 )
1076])
1077if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1078 AC_DEFINE(HAVE_U_INTXX_T)
1079 have_u_intxx_t=1
1080fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001081
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001082if test -z "$have_u_intxx_t" ; then
1083 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1084 AC_TRY_COMPILE(
1085 [ #include <sys/socket.h> ],
1086 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1087 [
1088 AC_DEFINE(HAVE_U_INTXX_T)
1089 AC_MSG_RESULT(yes)
1090 ],
1091 [ AC_MSG_RESULT(no) ]
1092 )
1093fi
1094
Damien Miller578783e2000-09-23 14:12:24 +11001095AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1096 AC_TRY_COMPILE(
1097 [ #include <sys/types.h> ],
1098 [ u_int64_t a; a = 1;],
1099 [ ac_cv_have_u_int64_t="yes" ],
1100 [ ac_cv_have_u_int64_t="no" ]
1101 )
1102])
1103if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1104 AC_DEFINE(HAVE_U_INT64_T)
1105 have_u_int64_t=1
1106fi
1107
Tim Rice4cec93f2002-02-26 08:40:48 -08001108if test -z "$have_u_int64_t" ; then
1109 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1110 AC_TRY_COMPILE(
1111 [ #include <sys/bitypes.h> ],
1112 [ u_int64_t a; a = 1],
1113 [
1114 AC_DEFINE(HAVE_U_INT64_T)
1115 AC_MSG_RESULT(yes)
1116 ],
1117 [ AC_MSG_RESULT(no) ]
1118 )
1119fi
1120
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001121if test -z "$have_u_intxx_t" ; then
1122 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1123 AC_TRY_COMPILE(
1124 [
1125#include <sys/types.h>
1126 ],
1127 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1128 [ ac_cv_have_uintxx_t="yes" ],
1129 [ ac_cv_have_uintxx_t="no" ]
1130 )
1131 ])
1132 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1133 AC_DEFINE(HAVE_UINTXX_T)
1134 fi
1135fi
1136
1137if test -z "$have_uintxx_t" ; then
1138 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1139 AC_TRY_COMPILE(
1140 [ #include <stdint.h> ],
1141 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1142 [
1143 AC_DEFINE(HAVE_UINTXX_T)
1144 AC_MSG_RESULT(yes)
1145 ],
1146 [ AC_MSG_RESULT(no) ]
1147 )
1148fi
1149
Damien Milleredb82922000-06-20 13:25:52 +10001150if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1151 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001152then
1153 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1154 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001155 [
1156#include <sys/bitypes.h>
1157 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001158 [
Damien Miller70494d12000-04-03 15:57:06 +10001159 int8_t a; int16_t b; int32_t c;
1160 u_int8_t e; u_int16_t f; u_int32_t g;
1161 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001162 ],
1163 [
1164 AC_DEFINE(HAVE_U_INTXX_T)
1165 AC_DEFINE(HAVE_INTXX_T)
1166 AC_MSG_RESULT(yes)
1167 ],
1168 [AC_MSG_RESULT(no)]
1169 )
1170fi
1171
Damien Miller58be7382001-09-15 21:31:54 +10001172
1173AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1174 AC_TRY_COMPILE(
1175 [
1176#include <sys/types.h>
1177 ],
1178 [ u_char foo; foo = 125; ],
1179 [ ac_cv_have_u_char="yes" ],
1180 [ ac_cv_have_u_char="no" ]
1181 )
1182])
1183if test "x$ac_cv_have_u_char" = "xyes" ; then
1184 AC_DEFINE(HAVE_U_CHAR)
1185fi
1186
Tim Rice13aae5e2001-10-21 17:53:58 -07001187TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001188
Tim Rice200a5c02002-02-26 22:12:34 -08001189AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001190
Damien Miller61e50f12000-05-08 20:49:37 +10001191AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1192 AC_TRY_COMPILE(
1193 [
1194#include <sys/types.h>
1195 ],
1196 [ size_t foo; foo = 1235; ],
1197 [ ac_cv_have_size_t="yes" ],
1198 [ ac_cv_have_size_t="no" ]
1199 )
1200])
1201if test "x$ac_cv_have_size_t" = "xyes" ; then
1202 AC_DEFINE(HAVE_SIZE_T)
1203fi
Damien Miller95058511999-12-29 10:36:45 +11001204
Damien Miller615f9392000-05-17 22:53:33 +10001205AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1206 AC_TRY_COMPILE(
1207 [
1208#include <sys/types.h>
1209 ],
1210 [ ssize_t foo; foo = 1235; ],
1211 [ ac_cv_have_ssize_t="yes" ],
1212 [ ac_cv_have_ssize_t="no" ]
1213 )
1214])
1215if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1216 AC_DEFINE(HAVE_SSIZE_T)
1217fi
1218
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001219AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1220 AC_TRY_COMPILE(
1221 [
1222#include <time.h>
1223 ],
1224 [ clock_t foo; foo = 1235; ],
1225 [ ac_cv_have_clock_t="yes" ],
1226 [ ac_cv_have_clock_t="no" ]
1227 )
1228])
1229if test "x$ac_cv_have_clock_t" = "xyes" ; then
1230 AC_DEFINE(HAVE_CLOCK_T)
1231fi
1232
Damien Millerb54b40e2000-06-23 08:23:34 +10001233AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1234 AC_TRY_COMPILE(
1235 [
1236#include <sys/types.h>
1237#include <sys/socket.h>
1238 ],
1239 [ sa_family_t foo; foo = 1235; ],
1240 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001241 [ AC_TRY_COMPILE(
1242 [
1243#include <sys/types.h>
1244#include <sys/socket.h>
1245#include <netinet/in.h>
1246 ],
1247 [ sa_family_t foo; foo = 1235; ],
1248 [ ac_cv_have_sa_family_t="yes" ],
1249
Damien Millerb54b40e2000-06-23 08:23:34 +10001250 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001251 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001252 )
1253])
1254if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1255 AC_DEFINE(HAVE_SA_FAMILY_T)
1256fi
1257
Damien Miller0f91b4e2000-06-18 15:43:25 +10001258AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1259 AC_TRY_COMPILE(
1260 [
1261#include <sys/types.h>
1262 ],
1263 [ pid_t foo; foo = 1235; ],
1264 [ ac_cv_have_pid_t="yes" ],
1265 [ ac_cv_have_pid_t="no" ]
1266 )
1267])
1268if test "x$ac_cv_have_pid_t" = "xyes" ; then
1269 AC_DEFINE(HAVE_PID_T)
1270fi
1271
1272AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1273 AC_TRY_COMPILE(
1274 [
1275#include <sys/types.h>
1276 ],
1277 [ mode_t foo; foo = 1235; ],
1278 [ ac_cv_have_mode_t="yes" ],
1279 [ ac_cv_have_mode_t="no" ]
1280 )
1281])
1282if test "x$ac_cv_have_mode_t" = "xyes" ; then
1283 AC_DEFINE(HAVE_MODE_T)
1284fi
1285
Damien Miller61e50f12000-05-08 20:49:37 +10001286
1287AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1288 AC_TRY_COMPILE(
1289 [
Damien Miller81171112000-04-23 11:14:01 +10001290#include <sys/types.h>
1291#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001292 ],
1293 [ struct sockaddr_storage s; ],
1294 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1295 [ ac_cv_have_struct_sockaddr_storage="no" ]
1296 )
1297])
1298if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1299 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1300fi
Damien Miller34132e52000-01-14 15:45:46 +11001301
Damien Miller61e50f12000-05-08 20:49:37 +10001302AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1303 AC_TRY_COMPILE(
1304 [
Damien Miller7b22d652000-06-18 14:07:04 +10001305#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001306#include <netinet/in.h>
1307 ],
1308 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1309 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1310 [ ac_cv_have_struct_sockaddr_in6="no" ]
1311 )
1312])
1313if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1314 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1315fi
Damien Miller34132e52000-01-14 15:45:46 +11001316
Damien Miller61e50f12000-05-08 20:49:37 +10001317AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1318 AC_TRY_COMPILE(
1319 [
Damien Miller7b22d652000-06-18 14:07:04 +10001320#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001321#include <netinet/in.h>
1322 ],
1323 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1324 [ ac_cv_have_struct_in6_addr="yes" ],
1325 [ ac_cv_have_struct_in6_addr="no" ]
1326 )
1327])
1328if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1329 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1330fi
Damien Miller34132e52000-01-14 15:45:46 +11001331
Damien Miller61e50f12000-05-08 20:49:37 +10001332AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1333 AC_TRY_COMPILE(
1334 [
Damien Miller81171112000-04-23 11:14:01 +10001335#include <sys/types.h>
1336#include <sys/socket.h>
1337#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001338 ],
1339 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1340 [ ac_cv_have_struct_addrinfo="yes" ],
1341 [ ac_cv_have_struct_addrinfo="no" ]
1342 )
1343])
1344if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1345 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1346fi
1347
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001348AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1349 AC_TRY_COMPILE(
1350 [ #include <sys/time.h> ],
1351 [ struct timeval tv; tv.tv_sec = 1;],
1352 [ ac_cv_have_struct_timeval="yes" ],
1353 [ ac_cv_have_struct_timeval="no" ]
1354 )
1355])
1356if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1357 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1358 have_struct_timeval=1
1359fi
1360
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001361# If we don't have int64_t then we can't compile sftp-server. So don't
1362# even attempt to do it.
1363if test "x$ac_cv_have_int64_t" = "xno" -a \
1364 "x$ac_cv_sizeof_long_int" != "x8" -a \
1365 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1366 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001367else
1368dnl test snprintf (broken on SCO w/gcc)
1369 AC_TRY_RUN(
1370 [
1371#include <stdio.h>
1372#include <string.h>
1373#ifdef HAVE_SNPRINTF
1374main()
1375{
1376 char buf[50];
1377 char expected_out[50];
1378 int mazsize = 50 ;
1379#if (SIZEOF_LONG_INT == 8)
1380 long int num = 0x7fffffffffffffff;
1381#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001382 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001383#endif
1384 strcpy(expected_out, "9223372036854775807");
1385 snprintf(buf, mazsize, "%lld", num);
1386 if(strcmp(buf, expected_out) != 0)
1387 exit(1);
1388 exit(0);
1389}
1390#else
1391main() { exit(0); }
1392#endif
1393 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1394 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001395fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001396AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001397
Damien Miller78315eb2000-09-29 23:01:36 +11001398dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001399OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1400OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1401OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1402OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1403OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001404OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001405OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1406OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001407OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001408OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1409OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1410OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1411OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001412OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1413OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1414OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1415OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001416
1417AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001418
Damien Miller61e50f12000-05-08 20:49:37 +10001419AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1420 ac_cv_have_ss_family_in_struct_ss, [
1421 AC_TRY_COMPILE(
1422 [
Damien Miller81171112000-04-23 11:14:01 +10001423#include <sys/types.h>
1424#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001425 ],
1426 [ struct sockaddr_storage s; s.ss_family = 1; ],
1427 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1428 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1429 )
1430])
1431if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1432 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1433fi
1434
Damien Miller61e50f12000-05-08 20:49:37 +10001435AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1436 ac_cv_have___ss_family_in_struct_ss, [
1437 AC_TRY_COMPILE(
1438 [
Damien Miller81171112000-04-23 11:14:01 +10001439#include <sys/types.h>
1440#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001441 ],
1442 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1443 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1444 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1445 )
1446])
1447if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1448 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1449fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001450
Damien Millerad833b32000-08-23 10:46:23 +10001451AC_CACHE_CHECK([for pw_class field in struct passwd],
1452 ac_cv_have_pw_class_in_struct_passwd, [
1453 AC_TRY_COMPILE(
1454 [
Damien Millerad833b32000-08-23 10:46:23 +10001455#include <pwd.h>
1456 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001457 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001458 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1459 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1460 )
1461])
1462if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1463 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1464fi
1465
Kevin Steves82456952001-06-22 21:14:18 +00001466AC_CACHE_CHECK([for pw_expire field in struct passwd],
1467 ac_cv_have_pw_expire_in_struct_passwd, [
1468 AC_TRY_COMPILE(
1469 [
1470#include <pwd.h>
1471 ],
1472 [ struct passwd p; p.pw_expire = 0; ],
1473 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1474 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1475 )
1476])
1477if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1478 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1479fi
1480
1481AC_CACHE_CHECK([for pw_change field in struct passwd],
1482 ac_cv_have_pw_change_in_struct_passwd, [
1483 AC_TRY_COMPILE(
1484 [
1485#include <pwd.h>
1486 ],
1487 [ struct passwd p; p.pw_change = 0; ],
1488 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1489 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1490 )
1491])
1492if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1493 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1494fi
Damien Miller61e50f12000-05-08 20:49:37 +10001495
Tim Rice28bbb0c2002-05-27 17:37:32 -07001496dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001497AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1498 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001499 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001500 [
Tim Riceae49fe62002-04-12 10:26:21 -07001501#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001502#include <sys/socket.h>
1503#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001504int main() {
1505#ifdef msg_accrights
1506exit(1);
1507#endif
1508struct msghdr m;
1509m.msg_accrights = 0;
1510exit(0);
1511}
Kevin Steves939c9db2002-03-22 17:23:25 +00001512 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001513 [ ac_cv_have_accrights_in_msghdr="yes" ],
1514 [ ac_cv_have_accrights_in_msghdr="no" ]
1515 )
1516])
1517if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1518 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1519fi
1520
Kevin Stevesa44e0352002-04-07 16:18:03 +00001521AC_CACHE_CHECK([for msg_control field in struct msghdr],
1522 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001523 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001524 [
Tim Riceae49fe62002-04-12 10:26:21 -07001525#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001526#include <sys/socket.h>
1527#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001528int main() {
1529#ifdef msg_control
1530exit(1);
1531#endif
1532struct msghdr m;
1533m.msg_control = 0;
1534exit(0);
1535}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001536 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001537 [ ac_cv_have_control_in_msghdr="yes" ],
1538 [ ac_cv_have_control_in_msghdr="no" ]
1539 )
1540])
1541if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1542 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1543fi
1544
Damien Miller61e50f12000-05-08 20:49:37 +10001545AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1546 AC_TRY_LINK([],
1547 [ extern char *__progname; printf("%s", __progname); ],
1548 [ ac_cv_libc_defines___progname="yes" ],
1549 [ ac_cv_libc_defines___progname="no" ]
1550 )
1551])
1552if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1553 AC_DEFINE(HAVE___PROGNAME)
1554fi
1555
Kevin Steves4846f4a2002-03-22 18:19:53 +00001556AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1557 AC_TRY_LINK([
1558#include <stdio.h>
1559],
1560 [ printf("%s", __FUNCTION__); ],
1561 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1562 [ ac_cv_cc_implements___FUNCTION__="no" ]
1563 )
1564])
1565if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1566 AC_DEFINE(HAVE___FUNCTION__)
1567fi
1568
1569AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1570 AC_TRY_LINK([
1571#include <stdio.h>
1572],
1573 [ printf("%s", __func__); ],
1574 [ ac_cv_cc_implements___func__="yes" ],
1575 [ ac_cv_cc_implements___func__="no" ]
1576 )
1577])
1578if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1579 AC_DEFINE(HAVE___func__)
1580fi
1581
Damien Miller4f8e6692001-07-14 13:22:53 +10001582AC_CACHE_CHECK([whether getopt has optreset support],
1583 ac_cv_have_getopt_optreset, [
1584 AC_TRY_LINK(
1585 [
1586#include <getopt.h>
1587 ],
1588 [ extern int optreset; optreset = 0; ],
1589 [ ac_cv_have_getopt_optreset="yes" ],
1590 [ ac_cv_have_getopt_optreset="no" ]
1591 )
1592])
1593if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1594 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1595fi
Damien Millera22ba012000-03-02 23:09:20 +11001596
Damien Millerecbb26d2000-07-15 14:59:14 +10001597AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1598 AC_TRY_LINK([],
1599 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1600 [ ac_cv_libc_defines_sys_errlist="yes" ],
1601 [ ac_cv_libc_defines_sys_errlist="no" ]
1602 )
1603])
1604if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1605 AC_DEFINE(HAVE_SYS_ERRLIST)
1606fi
1607
1608
Damien Miller11fa2cc2000-08-16 10:35:58 +10001609AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1610 AC_TRY_LINK([],
1611 [ extern int sys_nerr; printf("%i", sys_nerr);],
1612 [ ac_cv_libc_defines_sys_nerr="yes" ],
1613 [ ac_cv_libc_defines_sys_nerr="no" ]
1614 )
1615])
1616if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1617 AC_DEFINE(HAVE_SYS_NERR)
1618fi
1619
Damien Miller85de5802001-09-18 14:01:11 +10001620SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001621
1622# Check whether user wants sectok support
1623AC_ARG_WITH(sectok,
1624 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001625 [
1626 if test "x$withval" != "xno" ; then
1627 if test "x$withval" != "xyes" ; then
1628 CPPFLAGS="$CPPFLAGS -I${withval}"
1629 LDFLAGS="$LDFLAGS -L${withval}"
1630 if test ! -z "$need_dash_r" ; then
1631 LDFLAGS="$LDFLAGS -R${withval}"
1632 fi
1633 if test ! -z "$blibpath" ; then
1634 blibpath="$blibpath:${withval}"
1635 fi
1636 fi
1637 AC_CHECK_HEADERS(sectok.h)
1638 if test "$ac_cv_header_sectok_h" != yes; then
1639 AC_MSG_ERROR(Can't find sectok.h)
1640 fi
1641 AC_CHECK_LIB(sectok, sectok_open)
1642 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1643 AC_MSG_ERROR(Can't find libsectok)
1644 fi
1645 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001646 AC_DEFINE(USE_SECTOK)
1647 SCARD_MSG="yes, using sectok"
1648 fi
1649 ]
1650)
1651
1652# Check whether user wants OpenSC support
1653AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001654 AC_HELP_STRING([--with-opensc=PFX],
1655 [Enable smartcard support using OpenSC]),
1656 opensc_config_prefix="$withval", opensc_config_prefix="")
1657if test x$opensc_config_prefix != x ; then
1658 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1659 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1660 if test "$OPENSC_CONFIG" != "no"; then
1661 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1662 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1663 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1664 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1665 AC_DEFINE(SMARTCARD)
1666 AC_DEFINE(USE_OPENSC)
1667 SCARD_MSG="yes, using OpenSC"
1668 fi
1669fi
Damien Miller85de5802001-09-18 14:01:11 +10001670
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001671# Check whether user wants Kerberos 5 support
1672KRB5_MSG="no"
1673AC_ARG_WITH(kerberos5,
1674 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1675 [
1676 if test "x$withval" != "xno" ; then
1677 if test "x$withval" = "xyes" ; then
1678 KRB5ROOT="/usr/local"
1679 else
1680 KRB5ROOT=${withval}
1681 fi
1682 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1683 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1684 AC_DEFINE(KRB5)
1685 KRB5_MSG="yes"
1686 AC_MSG_CHECKING(whether we are using Heimdal)
1687 AC_TRY_COMPILE([ #include <krb5.h> ],
1688 [ char *tmp = heimdal_version; ],
1689 [ AC_MSG_RESULT(yes)
1690 AC_DEFINE(HEIMDAL)
1691 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1692 ],
1693 [ AC_MSG_RESULT(no)
1694 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1695 ]
1696 )
1697 if test ! -z "$need_dash_r" ; then
1698 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1699 fi
1700 if test ! -z "$blibpath" ; then
1701 blibpath="$blibpath:${KRB5ROOT}/lib"
1702 fi
1703 AC_CHECK_LIB(resolv, dn_expand, , )
1704
1705 KRB5=yes
1706 fi
1707 ]
1708)
1709# Check whether user wants Kerberos 4 support
Damien Millerc79bc0d2001-03-28 13:03:42 +10001710KRB4_MSG="no"
1711AC_ARG_WITH(kerberos4,
1712 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1713 [
1714 if test "x$withval" != "xno" ; then
Damien Millerc79bc0d2001-03-28 13:03:42 +10001715 if test "x$withval" != "xyes" ; then
1716 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1717 LDFLAGS="$LDFLAGS -L${withval}/lib"
1718 if test ! -z "$need_dash_r" ; then
1719 LDFLAGS="$LDFLAGS -R${withval}/lib"
1720 fi
1721 if test ! -z "$blibpath" ; then
1722 blibpath="$blibpath:${withval}/lib"
1723 fi
1724 else
1725 if test -d /usr/include/kerberosIV ; then
1726 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1727 fi
1728 fi
1729
1730 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001731 if test "$ac_cv_header_krb_h" != yes; then
1732 AC_MSG_WARN([Cannot find krb.h, build may fail])
1733 fi
Damien Miller98344742001-03-28 14:37:06 +10001734 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001735 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001736 AC_CHECK_LIB(krb4, main)
1737 if test "$ac_cv_lib_krb4_main" != yes; then
1738 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1739 else
1740 KLIBS="-lkrb4"
1741 fi
1742 else
1743 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001744 fi
Damien Miller98344742001-03-28 14:37:06 +10001745 AC_CHECK_LIB(des, des_cbc_encrypt)
1746 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1747 AC_CHECK_LIB(des425, des_cbc_encrypt)
1748 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1749 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1750 else
1751 KLIBS="-ldes425"
1752 fi
1753 else
1754 KLIBS="-ldes"
1755 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001756 AC_CHECK_LIB(resolv, dn_expand, , )
1757 KRB4=yes
1758 KRB4_MSG="yes"
1759 AC_DEFINE(KRB4)
1760 fi
1761 ]
1762)
1763
1764# Check whether user wants AFS support
1765AFS_MSG="no"
1766AC_ARG_WITH(afs,
1767 [ --with-afs=PATH Enable AFS support],
1768 [
1769 if test "x$withval" != "xno" ; then
1770
1771 if test "x$withval" != "xyes" ; then
1772 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1773 LDFLAGS="$LDFLAGS -L${withval}/lib"
1774 fi
1775
1776 if test -z "$KRB4" ; then
1777 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1778 fi
1779
1780 LIBS="-lkafs $LIBS"
1781 if test ! -z "$AFS_LIBS" ; then
1782 LIBS="$LIBS $AFS_LIBS"
1783 fi
1784 AC_DEFINE(AFS)
1785 AFS_MSG="yes"
1786 fi
1787 ]
1788)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001789LIBS="$LIBS $KLIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001790
Damien Millera22ba012000-03-02 23:09:20 +11001791# Looking for programs, paths and files
1792AC_ARG_WITH(rsh,
1793 [ --with-rsh=PATH Specify path to remote shell program ],
1794 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001795 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001796 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001797 fi
1798 ],
1799 [
1800 AC_PATH_PROG(rsh_path, rsh)
1801 ]
1802)
1803
Damien Millerf58c6722002-05-13 13:15:42 +10001804PRIVSEP_PATH=/var/empty
1805AC_ARG_WITH(privsep-path,
Damien Miller74cc5bb2002-05-22 11:02:15 +10001806 [ --with-privsep-path=xxx Path for privilege separation chroot ],
Damien Millerf58c6722002-05-13 13:15:42 +10001807 [
1808 if test "x$withval" != "$no" ; then
1809 PRIVSEP_PATH=$withval
1810 fi
1811 ]
1812)
1813AC_SUBST(PRIVSEP_PATH)
1814
Damien Millera22ba012000-03-02 23:09:20 +11001815AC_ARG_WITH(xauth,
1816 [ --with-xauth=PATH Specify path to xauth program ],
1817 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001818 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001819 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001820 fi
1821 ],
1822 [
Damien Miller78315eb2000-09-29 23:01:36 +11001823 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 +10001824 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001825 xauth_path="/usr/openwin/bin/xauth"
1826 fi
1827 ]
1828)
1829
Damien Millera19cf472000-11-29 13:28:50 +11001830if test -z "$xauth_path" ; then
1831 XAUTH_PATH="undefined"
1832 AC_SUBST(XAUTH_PATH)
1833else
Damien Millera22ba012000-03-02 23:09:20 +11001834 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001835 XAUTH_PATH=$xauth_path
1836 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001837fi
1838if test ! -z "$rsh_path" ; then
1839 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1840fi
1841
1842# Check for mail directory (last resort if we cannot get it from headers)
1843if test ! -z "$MAIL" ; then
1844 maildir=`dirname $MAIL`
1845 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1846fi
1847
Damien Millera22ba012000-03-02 23:09:20 +11001848if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00001849 if test "x$disable_ptmx_check" != "xyes" ; then
1850 AC_CHECK_FILE("/dev/ptmx",
1851 [
1852 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1853 have_dev_ptmx=1
1854 ]
1855 )
1856 fi
Damien Millera22ba012000-03-02 23:09:20 +11001857fi
Damien Miller204ad072000-03-02 23:56:12 +11001858AC_CHECK_FILE("/dev/ptc",
1859 [
1860 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1861 have_dev_ptc=1
1862 ]
1863)
1864
Damien Millera22ba012000-03-02 23:09:20 +11001865# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001866AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001867 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001868 [
Damien Miller897741e2001-04-16 10:41:46 +10001869 case "$withval" in
1870 man|cat|doc)
1871 MANTYPE=$withval
1872 ;;
1873 *)
1874 AC_MSG_ERROR(invalid man type: $withval)
1875 ;;
1876 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001877 ]
1878)
Ben Lindstrombc709922001-04-18 18:04:21 +00001879if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001880 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001881 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1882 MANTYPE=doc
1883 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1884 MANTYPE=man
1885 else
1886 MANTYPE=cat
1887 fi
1888fi
Damien Miller670a4b82000-01-22 13:53:11 +11001889AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001890if test "$MANTYPE" = "doc"; then
1891 mansubdir=man;
1892else
1893 mansubdir=$MANTYPE;
1894fi
1895AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001896
Damien Millera22ba012000-03-02 23:09:20 +11001897# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001898MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001899AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001900 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001901 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001902 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001903 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001904 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001905 fi
1906 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001907)
1908
Damien Millera22ba012000-03-02 23:09:20 +11001909# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001910AC_ARG_WITH(shadow,
1911 [ --without-shadow Disable shadow password support],
1912 [
1913 if test "x$withval" = "xno" ; then
1914 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001915 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001916 fi
1917 ]
1918)
1919
Damien Miller1f335fb2000-06-26 11:31:33 +10001920if test -z "$disable_shadow" ; then
1921 AC_MSG_CHECKING([if the systems has expire shadow information])
1922 AC_TRY_COMPILE(
1923 [
1924#include <sys/types.h>
1925#include <shadow.h>
1926 struct spwd sp;
1927 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1928 [ sp_expire_available=yes ], []
1929 )
1930
1931 if test "x$sp_expire_available" = "xyes" ; then
1932 AC_MSG_RESULT(yes)
1933 AC_DEFINE(HAS_SHADOW_EXPIRE)
1934 else
1935 AC_MSG_RESULT(no)
1936 fi
1937fi
1938
Damien Millera22ba012000-03-02 23:09:20 +11001939# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001940if test ! -z "$IPADDR_IN_DISPLAY" ; then
1941 DISPLAY_HACK_MSG="yes"
1942 AC_DEFINE(IPADDR_IN_DISPLAY)
1943else
1944 DISPLAY_HACK_MSG="no"
1945 AC_ARG_WITH(ipaddr-display,
1946 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1947 [
1948 if test "x$withval" != "xno" ; then
1949 AC_DEFINE(IPADDR_IN_DISPLAY)
1950 DISPLAY_HACK_MSG="yes"
1951 fi
1952 ]
1953 )
1954fi
Damien Miller76112de1999-12-21 11:18:08 +11001955
Tim Rice43a1c132002-04-17 21:19:14 -07001956dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
1957if test $ac_cv_func_login_getcapbool = "yes" -a \
1958 $ac_cv_header_login_cap_h = "yes" ; then
1959 USES_LOGIN_CONF=yes
1960fi
Damien Millera22ba012000-03-02 23:09:20 +11001961# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001962SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001963AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10001964 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11001965 [
Tim Rice43a1c132002-04-17 21:19:14 -07001966 if test "$USES_LOGIN_CONF" = "yes" ; then
1967 AC_MSG_WARN([
1968--with-default-path=PATH has no effect on this system.
1969Edit /etc/login.conf instead.])
1970 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001971 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001972 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001973 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001974 ],
Tim Rice43a1c132002-04-17 21:19:14 -07001975 [ if test "$USES_LOGIN_CONF" = "yes" ; then
1976 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
1977 else
Tim Rice59ea0a02001-03-10 13:50:45 -08001978 AC_TRY_RUN(
1979 [
1980/* find out what STDPATH is */
1981#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001982#ifdef HAVE_PATHS_H
1983# include <paths.h>
1984#endif
1985#ifndef _PATH_STDPATH
1986# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1987#endif
1988#include <sys/types.h>
1989#include <sys/stat.h>
1990#include <fcntl.h>
1991#define DATA "conftest.stdpath"
1992
1993main()
1994{
1995 FILE *fd;
1996 int rc;
1997
1998 fd = fopen(DATA,"w");
1999 if(fd == NULL)
2000 exit(1);
2001
2002 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2003 exit(1);
2004
2005 exit(0);
2006}
2007 ], [ user_path=`cat conftest.stdpath` ],
2008 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2009 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2010 )
2011# make sure $bindir is in USER_PATH so scp will work
2012 t_bindir=`eval echo ${bindir}`
2013 case $t_bindir in
2014 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2015 esac
2016 case $t_bindir in
2017 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2018 esac
2019 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2020 if test $? -ne 0 ; then
2021 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2022 if test $? -ne 0 ; then
2023 user_path=$user_path:$t_bindir
2024 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2025 fi
2026 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002027 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002028)
Tim Rice43a1c132002-04-17 21:19:14 -07002029if test "$USES_LOGIN_CONF" != "yes" ; then
2030 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2031 AC_SUBST(user_path)
2032fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002033
Damien Millera18bbd32002-05-13 10:48:57 +10002034# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002035AC_ARG_WITH(superuser-path,
2036 [ --with-superuser-path= Specify different path for super-user],
2037 [
2038 if test "x$withval" != "xno" ; then
2039 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2040 superuser_path=$withval
2041 fi
2042 ]
2043)
2044
2045
Damien Millera22ba012000-03-02 23:09:20 +11002046# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10002047IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11002048AC_ARG_WITH(ipv4-default,
2049 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2050 [
2051 if test "x$withval" != "xno" ; then
2052 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10002053 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11002054 fi
2055 ]
2056)
2057
Damien Miller61e50f12000-05-08 20:49:37 +10002058AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002059IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002060AC_ARG_WITH(4in6,
2061 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2062 [
2063 if test "x$withval" != "xno" ; then
2064 AC_MSG_RESULT(yes)
2065 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002066 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002067 else
2068 AC_MSG_RESULT(no)
2069 fi
2070 ],[
2071 if test "x$inet6_default_4in6" = "xyes"; then
2072 AC_MSG_RESULT([yes (default)])
2073 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002074 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002075 else
2076 AC_MSG_RESULT([no (default)])
2077 fi
2078 ]
2079)
2080
Damien Miller60396b02001-02-18 17:01:00 +11002081# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002082BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002083AC_ARG_WITH(bsd-auth,
2084 [ --with-bsd-auth Enable BSD auth support],
2085 [
2086 if test "x$withval" != "xno" ; then
2087 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002088 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002089 fi
2090 ]
2091)
2092
Damien Millera22ba012000-03-02 23:09:20 +11002093# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002094piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002095# make sure the directory exists
2096if test ! -d $piddir ; then
2097 piddir=`eval echo ${sysconfdir}`
2098 case $piddir in
2099 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2100 esac
2101fi
2102
Tim Rice88f2ab52002-03-17 12:17:34 -08002103AC_ARG_WITH(pid-dir,
2104 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2105 [
2106 if test "x$withval" != "xno" ; then
2107 piddir=$withval
2108 if test ! -d $piddir ; then
2109 AC_MSG_WARN([** no $piddir directory on this system **])
2110 fi
2111 fi
2112 ]
2113)
2114
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002115AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002116AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002117
andre2ff7b5d2000-06-03 14:57:40 +00002118dnl allow user to disable some login recording features
2119AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002120 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002121 [ AC_DEFINE(DISABLE_LASTLOG) ]
2122)
2123AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002124 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002125 [ AC_DEFINE(DISABLE_UTMP) ]
2126)
2127AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002128 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002129 [ AC_DEFINE(DISABLE_UTMPX) ]
2130)
2131AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002132 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002133 [ AC_DEFINE(DISABLE_WTMP) ]
2134)
2135AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002136 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002137 [ AC_DEFINE(DISABLE_WTMPX) ]
2138)
2139AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002140 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002141 [ AC_DEFINE(DISABLE_LOGIN) ]
2142)
2143AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002144 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002145 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
2146)
2147AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002148 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00002149 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
2150)
2151AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002152 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002153 [
2154 if test "x$withval" = "xno" ; then
2155 AC_DEFINE(DISABLE_LASTLOG)
2156 else
2157 conf_lastlog_location=$withval
2158 fi
2159 ]
2160)
andre2ff7b5d2000-06-03 14:57:40 +00002161
2162dnl lastlog, [uw]tmpx? detection
2163dnl NOTE: set the paths in the platform section to avoid the
2164dnl need for command-line parameters
2165dnl lastlog and [uw]tmp are subject to a file search if all else fails
2166
2167dnl lastlog detection
2168dnl NOTE: the code itself will detect if lastlog is a directory
2169AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2170AC_TRY_COMPILE([
2171#include <sys/types.h>
2172#include <utmp.h>
2173#ifdef HAVE_LASTLOG_H
2174# include <lastlog.h>
2175#endif
Damien Miller2994e082000-06-04 15:51:47 +10002176#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002177# include <paths.h>
2178#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002179#ifdef HAVE_LOGIN_H
2180# include <login.h>
2181#endif
andre2ff7b5d2000-06-03 14:57:40 +00002182 ],
2183 [ char *lastlog = LASTLOG_FILE; ],
2184 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002185 [
2186 AC_MSG_RESULT(no)
2187 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2188 AC_TRY_COMPILE([
2189#include <sys/types.h>
2190#include <utmp.h>
2191#ifdef HAVE_LASTLOG_H
2192# include <lastlog.h>
2193#endif
2194#ifdef HAVE_PATHS_H
2195# include <paths.h>
2196#endif
2197 ],
2198 [ char *lastlog = _PATH_LASTLOG; ],
2199 [ AC_MSG_RESULT(yes) ],
2200 [
andree441aa32000-06-12 22:34:38 +00002201 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002202 system_lastlog_path=no
2203 ])
2204 ]
andre2ff7b5d2000-06-03 14:57:40 +00002205)
Damien Miller2994e082000-06-04 15:51:47 +10002206
andre2ff7b5d2000-06-03 14:57:40 +00002207if test -z "$conf_lastlog_location"; then
2208 if test x"$system_lastlog_path" = x"no" ; then
2209 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002210 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002211 conf_lastlog_location=$f
2212 fi
2213 done
2214 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002215 AC_MSG_WARN([** Cannot find lastlog **])
2216 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002217 fi
2218 fi
2219fi
2220
2221if test -n "$conf_lastlog_location"; then
2222 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2223fi
2224
2225dnl utmp detection
2226AC_MSG_CHECKING([if your system defines UTMP_FILE])
2227AC_TRY_COMPILE([
2228#include <sys/types.h>
2229#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002230#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002231# include <paths.h>
2232#endif
2233 ],
2234 [ char *utmp = UTMP_FILE; ],
2235 [ AC_MSG_RESULT(yes) ],
2236 [ AC_MSG_RESULT(no)
2237 system_utmp_path=no ]
2238)
2239if test -z "$conf_utmp_location"; then
2240 if test x"$system_utmp_path" = x"no" ; then
2241 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2242 if test -f $f ; then
2243 conf_utmp_location=$f
2244 fi
2245 done
2246 if test -z "$conf_utmp_location"; then
2247 AC_DEFINE(DISABLE_UTMP)
2248 fi
2249 fi
2250fi
2251if test -n "$conf_utmp_location"; then
2252 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2253fi
2254
2255dnl wtmp detection
2256AC_MSG_CHECKING([if your system defines WTMP_FILE])
2257AC_TRY_COMPILE([
2258#include <sys/types.h>
2259#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002260#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002261# include <paths.h>
2262#endif
2263 ],
2264 [ char *wtmp = WTMP_FILE; ],
2265 [ AC_MSG_RESULT(yes) ],
2266 [ AC_MSG_RESULT(no)
2267 system_wtmp_path=no ]
2268)
2269if test -z "$conf_wtmp_location"; then
2270 if test x"$system_wtmp_path" = x"no" ; then
2271 for f in /usr/adm/wtmp /var/log/wtmp; do
2272 if test -f $f ; then
2273 conf_wtmp_location=$f
2274 fi
2275 done
2276 if test -z "$conf_wtmp_location"; then
2277 AC_DEFINE(DISABLE_WTMP)
2278 fi
2279 fi
2280fi
2281if test -n "$conf_wtmp_location"; then
2282 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2283fi
2284
2285
2286dnl utmpx detection - I don't know any system so perverse as to require
2287dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2288dnl there, though.
2289AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2290AC_TRY_COMPILE([
2291#include <sys/types.h>
2292#include <utmp.h>
2293#ifdef HAVE_UTMPX_H
2294#include <utmpx.h>
2295#endif
Damien Miller2994e082000-06-04 15:51:47 +10002296#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002297# include <paths.h>
2298#endif
2299 ],
2300 [ char *utmpx = UTMPX_FILE; ],
2301 [ AC_MSG_RESULT(yes) ],
2302 [ AC_MSG_RESULT(no)
2303 system_utmpx_path=no ]
2304)
2305if test -z "$conf_utmpx_location"; then
2306 if test x"$system_utmpx_path" = x"no" ; then
2307 AC_DEFINE(DISABLE_UTMPX)
2308 fi
2309else
2310 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2311fi
2312
2313dnl wtmpx detection
2314AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2315AC_TRY_COMPILE([
2316#include <sys/types.h>
2317#include <utmp.h>
2318#ifdef HAVE_UTMPX_H
2319#include <utmpx.h>
2320#endif
Damien Miller2994e082000-06-04 15:51:47 +10002321#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002322# include <paths.h>
2323#endif
2324 ],
2325 [ char *wtmpx = WTMPX_FILE; ],
2326 [ AC_MSG_RESULT(yes) ],
2327 [ AC_MSG_RESULT(no)
2328 system_wtmpx_path=no ]
2329)
2330if test -z "$conf_wtmpx_location"; then
2331 if test x"$system_wtmpx_path" = x"no" ; then
2332 AC_DEFINE(DISABLE_WTMPX)
2333 fi
2334else
2335 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2336fi
2337
Damien Miller4018c192000-04-30 09:30:44 +10002338
Damien Miller29ea30d2000-03-17 10:54:15 +11002339if test ! -z "$blibpath" ; then
2340 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
2341 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
2342fi
2343
Tim Rice4cec93f2002-02-26 08:40:48 -08002344dnl remove pam and dl because they are in $LIBPAM
2345if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002346 LIBS=`echo $LIBS | sed 's/-lpam //'`
2347fi
2348if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2349 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002350fi
2351
Damien Millerbac2d8a2000-09-05 16:13:06 +11002352AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002353AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2354AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002355
Damien Miller7b22d652000-06-18 14:07:04 +10002356# Print summary of options
2357
Damien Miller7b22d652000-06-18 14:07:04 +10002358# Someone please show me a better way :)
2359A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2360B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2361C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2362D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002363E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002364F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002365G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002366H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2367I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2368J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002369
2370echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002371echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002372echo " User binaries: $B"
2373echo " System binaries: $C"
2374echo " Configuration files: $D"
2375echo " Askpass program: $E"
2376echo " Manual pages: $F"
2377echo " PID file: $G"
2378echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002379if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002380echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002381else
Damien Millerf58c6722002-05-13 13:15:42 +10002382echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002383fi
Damien Millera18bbd32002-05-13 10:48:57 +10002384if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002385echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002386fi
Damien Millerf58c6722002-05-13 13:15:42 +10002387echo " Manpage format: $MANTYPE"
2388echo " PAM support: ${PAM_MSG}"
2389echo " KerberosIV support: $KRB4_MSG"
2390echo " KerberosV support: $KRB5_MSG"
2391echo " Smartcard support: $SCARD_MSG"
2392echo " AFS support: $AFS_MSG"
2393echo " S/KEY support: $SKEY_MSG"
2394echo " TCP Wrappers support: $TCPW_MSG"
2395echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002396echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002397echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2398echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2399echo " BSD Auth support: $BSD_AUTH_MSG"
2400echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002401if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002402echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002403fi
2404
Damien Miller7b22d652000-06-18 14:07:04 +10002405echo ""
2406
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002407echo " Host: ${host}"
2408echo " Compiler: ${CC}"
2409echo " Compiler flags: ${CFLAGS}"
2410echo "Preprocessor flags: ${CPPFLAGS}"
2411echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002412echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002413
2414echo ""
2415
Damien Miller82cf0ce2000-12-20 13:34:48 +11002416if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002417 echo "PAM is enabled. You may need to install a PAM control file "
2418 echo "for sshd, otherwise password authentication may fail. "
2419 echo "Example PAM control files can be found in the contrib/ "
2420 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002421 echo ""
2422fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002423
2424if test ! -z "$NO_SFTP"; then
Damien Miller6c21c512002-01-22 21:57:53 +11002425 echo "sftp-server will be disabled. Your compiler does not "
2426 echo "support 64bit integers."
2427 echo ""
2428fi
2429
2430if test ! -z "$RAND_HELPER_CMDHASH" ; then
2431 echo "WARNING: you are using the builtin random number collection "
2432 echo "service. Please read WARNING.RNG and request that your OS "
2433 echo "vendor includes kernel-based random number collection in "
2434 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002435 echo ""
2436fi
Damien Miller60396b02001-02-18 17:01:00 +11002437