blob: 115b80a4c93a4592ad2b419f0731053be64b93b1 [file] [log] [blame]
Darren Tucker70a3d552003-08-21 17:58:29 +10001# $Id: configure.ac,v 1.140 2003/08/21 07:58:29 dtucker 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)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
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*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100059 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
60 if (test -z "$blibpath"); then
61 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110062 fi
Damien Millereab4bae2003-04-29 23:22:40 +100063 saved_LDFLAGS="$LDFLAGS"
64 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
65 if (test -z "$blibflags"); then
66 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
67 AC_TRY_LINK([], [], [blibflags=$tryflags])
68 fi
69 done
70 if (test -z "$blibflags"); then
71 AC_MSG_RESULT(not found)
72 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
73 else
74 AC_MSG_RESULT($blibflags)
75 fi
76 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100077 dnl Check for authenticate. Might be in libs.a on older AIXes
78 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070079 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100080 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070081 LIBS="$LIBS -ls"
82 ])
83 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100084 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
85 AC_CHECK_DECL(loginfailed,
86 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
87 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100088 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +100089 [(void)loginfailed("user","host","tty",0);],
90 [AC_MSG_RESULT(yes)
91 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +100092 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +100093 )],
94 [],
95 [#include <usersec.h>]
96 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +100097 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +110098 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100099 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +0000100 dnl AIX handles lastlog as part of its login message
101 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000102 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000103 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100104 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100105*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100106 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800107 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100108 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000109 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100110 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100111 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000112 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000113 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700114 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000115 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100116 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000117*-*-dgux*)
118 AC_DEFINE(IP_TOS_IS_BROKEN)
119 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000120*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000121 AC_MSG_CHECKING(if we have working getaddrinfo)
122 AC_TRY_RUN([#include <mach-o/dyld.h>
123main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
124 exit(0);
125 else
126 exit(1);
127}], [AC_MSG_RESULT(working)],
128 [AC_MSG_RESULT(buggy)
129 AC_DEFINE(BROKEN_GETADDRINFO)],
130 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000131 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000132*-*-hpux10.26)
133 if test -z "$GCC"; then
134 CFLAGS="$CFLAGS -Ae"
135 fi
136 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
137 IPADDR_IN_DISPLAY=yes
138 AC_DEFINE(HAVE_SECUREWARE)
139 AC_DEFINE(USE_PIPES)
140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
142 AC_DEFINE(DISABLE_SHADOW)
143 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000144 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700145 LIBS="$LIBS -lsec -lsecpw"
146 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000147 disable_ptmx_check=yes
148 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100149*-*-hpux10*)
150 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000151 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100152 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000153 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100154 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000155 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000156 AC_DEFINE(LOGIN_NO_ENDOPT)
157 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100158 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100159 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000160 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700161 LIBS="$LIBS -lsec"
162 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100163 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000164*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000165 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100166 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100167 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100168 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000169 AC_DEFINE(LOGIN_NO_ENDOPT)
170 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100171 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100172 AC_DEFINE(DISABLE_UTMP)
Damien Miller35276252003-06-03 10:14:28 +1000173 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700174 LIBS="$LIBS -lsec"
175 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000176 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100177*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000178 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000179 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100180 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000181 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000182 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller1808f382000-01-06 12:03:12 +1100183 ;;
184*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000185 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000186 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100187 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000188 AC_DEFINE(WITH_IRIX_ARRAY)
189 AC_DEFINE(WITH_IRIX_PROJECT)
190 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000191 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000192 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000193 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100194 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100195*-*-linux*)
196 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100197 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000198 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100199 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000200 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller35276252003-06-03 10:14:28 +1000201 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100202 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000203 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000204 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000205 AC_DEFINE(BROKEN_CMSG_TYPE)
206 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000207 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100208 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000209mips-sony-bsd|mips-sony-newsos4)
210 AC_DEFINE(HAVE_NEWS4)
211 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000212 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100213*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000214 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100215 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100216 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100217*-*-freebsd*)
218 check_for_libcrypt_later=1
219 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000220*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000221 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100222 conf_utmp_location=/etc/utmp
223 conf_wtmp_location=/usr/adm/wtmp
224 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000225 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000226 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000227 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100228 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000229 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000230 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000231 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100232*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000233 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000234 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100235 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100236 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000237 AC_DEFINE(LOGIN_NEEDS_UTMPX)
238 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000239 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckerc437cda2003-05-10 17:05:46 +1000240 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
241 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000242 # hardwire lastlog location (can't detect it on some versions)
243 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000244 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
245 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
246 if test "$sol2ver" -ge 8; then
247 AC_MSG_RESULT(yes)
248 AC_DEFINE(DISABLE_UTMP)
249 AC_DEFINE(DISABLE_WTMP)
250 else
251 AC_MSG_RESULT(no)
252 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100253 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000254*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000255 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000256 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100257 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000258 conf_utmp_location=/etc/utmp
259 conf_wtmp_location=/var/adm/wtmp
260 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000261 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000262 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000263*-ncr-sysv*)
264 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
265 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700266 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000267 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000268 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000269 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000270*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000271 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700272 # /usr/ucblib MUST NOT be searched on ReliantUNIX
273 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100274 IPADDR_IN_DISPLAY=yes
275 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000276 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000277 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700278 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
279 # Attention: always take care to bind libsocket and libnsl before libc,
280 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000281 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100282*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000283 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100284 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100285 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100286 ;;
287*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000288 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100289 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100290 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100291 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100292*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000293 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100294 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100295 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100296*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000297 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100298 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700299 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100300 RANLIB=true
301 no_dev_ptmx=1
302 AC_DEFINE(BROKEN_SYS_TERMIO_H)
303 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000304 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000305 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100306 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100307 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700308 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700309 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100310 ;;
311*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800312 if test -z "$GCC"; then
313 CFLAGS="$CFLAGS -belf"
314 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000315 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000316 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100317 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000318 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100319 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000320 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000321 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700322 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100323 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700324 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000325 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000326*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000327 AC_DEFINE(USE_PIPES)
328 AC_DEFINE(DISABLE_FD_PASSING)
329 LDFLAGS="$LDFLAGS"
330 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
331 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000332 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000333*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000334 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700335 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700336 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000337 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
338 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
339 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700340 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000341*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000342 AC_MSG_CHECKING(for Digital Unix SIA)
343 no_osfsia=""
344 AC_ARG_WITH(osfsia,
345 [ --with-osfsia Enable Digital Unix SIA],
346 [
347 if test "x$withval" = "xno" ; then
348 AC_MSG_RESULT(disabled)
349 no_osfsia=1
350 fi
351 ],
352 )
353 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000354 if test -f /etc/sia/matrix.conf; then
355 AC_MSG_RESULT(yes)
356 AC_DEFINE(HAVE_OSF_SIA)
357 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000358 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000359 LIBS="$LIBS -lsecurity -ldb -lm -laud"
360 else
361 AC_MSG_RESULT(no)
362 fi
363 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000364 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000365 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000366
367*-*-nto-qnx)
368 AC_DEFINE(USE_PIPES)
369 AC_DEFINE(NO_X11_UNIX_SOCKETS)
370 AC_DEFINE(MISSING_NFDBITS)
371 AC_DEFINE(MISSING_HOWMANY)
372 AC_DEFINE(MISSING_FD_MASK)
373 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100374esac
375
Damien Millere37bfc12000-06-05 09:37:43 +1000376# Allow user to specify flags
377AC_ARG_WITH(cflags,
378 [ --with-cflags Specify additional flags to pass to compiler],
379 [
380 if test "x$withval" != "xno" ; then
381 CFLAGS="$CFLAGS $withval"
382 fi
383 ]
384)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000385AC_ARG_WITH(cppflags,
386 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
387 [
388 if test "x$withval" != "xno"; then
389 CPPFLAGS="$CPPFLAGS $withval"
390 fi
391 ]
392)
Damien Millere37bfc12000-06-05 09:37:43 +1000393AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000394 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000395 [
396 if test "x$withval" != "xno" ; then
397 LDFLAGS="$LDFLAGS $withval"
398 fi
399 ]
400)
401AC_ARG_WITH(libs,
402 [ --with-libs Specify additional libraries to link with],
403 [
404 if test "x$withval" != "xno" ; then
405 LIBS="$LIBS $withval"
406 fi
407 ]
408)
409
Darren Tucker6eb93042003-06-29 21:30:41 +1000410AC_MSG_CHECKING(compiler and flags for sanity)
411AC_TRY_RUN([
412#include <stdio.h>
413int main(){exit(0);}
414 ],
415 [ AC_MSG_RESULT(yes) ],
416 [
417 AC_MSG_RESULT(no)
418 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
419 ]
420)
421
Tim Rice4cec93f2002-02-26 08:40:48 -0800422# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000423AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100424 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800425 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000426 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000427 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000428 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
429 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000430 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700431 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800432 util.h utime.h utmp.h utmpx.h)
433
Damien Millera22ba012000-03-02 23:09:20 +1100434# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700435AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
436AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000437
Damien Millerdf288022001-02-18 13:07:07 +1100438dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700439if test "x$with_tcp_wrappers" != "xno" ; then
440 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
441 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
442 fi
443fi
Damien Millerdf288022001-02-18 13:07:07 +1100444
Tim Rice13aae5e2001-10-21 17:53:58 -0700445AC_CHECK_FUNC(getspnam, ,
446 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700447
Damien Miller150c8b52002-02-13 23:06:56 +1100448AC_ARG_WITH(rpath,
449 [ --without-rpath Disable auto-added -R linker paths],
450 [
451 if test "x$withval" = "xno" ; then
452 need_dash_r=""
453 fi
454 if test "x$withval" = "xyes" ; then
455 need_dash_r=1
456 fi
457 ]
458)
459
Tim Rice13aae5e2001-10-21 17:53:58 -0700460dnl zlib is required
461AC_ARG_WITH(zlib,
462 [ --with-zlib=PATH Use zlib in PATH],
463 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000464 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100465 AC_MSG_ERROR([*** zlib is required ***])
466 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700467 if test -d "$withval/lib"; then
468 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700469 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700470 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700471 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700472 fi
473 else
474 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700475 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700476 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700477 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700478 fi
479 fi
480 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700481 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700482 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700483 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700484 fi
485 ]
486)
487
Tim Rice17b93e52001-10-23 22:36:54 -0700488AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100489
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000490dnl UnixWare 2.x
491AC_CHECK_FUNC(strcasecmp,
492 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
493)
494AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700495 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
496 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000497)
Damien Millerab18c411999-11-11 10:40:23 +1100498
Tim Ricee589a292001-11-03 11:09:32 -0800499dnl Checks for libutil functions
500AC_CHECK_HEADERS(libutil.h)
501AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
502AC_CHECK_FUNCS(logout updwtmp logwtmp)
503
Ben Lindstrom8697e082001-02-24 21:41:10 +0000504AC_FUNC_STRFTIME
505
Damien Miller3c027682001-03-14 11:39:45 +1100506# Check for ALTDIRFUNC glob() extension
507AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
508AC_EGREP_CPP(FOUNDIT,
509 [
510 #include <glob.h>
511 #ifdef GLOB_ALTDIRFUNC
512 FOUNDIT
513 #endif
514 ],
515 [
516 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
517 AC_MSG_RESULT(yes)
518 ],
519 [
520 AC_MSG_RESULT(no)
521 ]
522)
Damien Millerab18c411999-11-11 10:40:23 +1100523
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000524# Check for g.gl_matchc glob() extension
525AC_MSG_CHECKING(for gl_matchc field in glob_t)
526AC_EGREP_CPP(FOUNDIT,
527 [
528 #include <glob.h>
529 int main(void){glob_t g; g.gl_matchc = 1;}
530 ],
531 [
532 AC_DEFINE(GLOB_HAS_GL_MATCHC)
533 AC_MSG_RESULT(yes)
534 ],
535 [
536 AC_MSG_RESULT(no)
537 ]
538)
539
Damien Miller18bb4732001-03-28 14:35:30 +1000540AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
541AC_TRY_RUN(
542 [
543#include <sys/types.h>
544#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700545int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000546 ],
547 [AC_MSG_RESULT(yes)],
548 [
549 AC_MSG_RESULT(no)
550 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
551 ]
552)
553
Damien Millerc547bf12001-02-16 10:18:12 +1100554# Check whether user wants S/Key support
555SKEY_MSG="no"
556AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700557 [ --with-skey[[=PATH]] Enable S/Key support
558 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100559 [
560 if test "x$withval" != "xno" ; then
561
562 if test "x$withval" != "xyes" ; then
563 CPPFLAGS="$CPPFLAGS -I${withval}/include"
564 LDFLAGS="$LDFLAGS -L${withval}/lib"
565 fi
566
567 AC_DEFINE(SKEY)
568 LIBS="-lskey $LIBS"
569 SKEY_MSG="yes"
570
Tim Rice4cec93f2002-02-26 08:40:48 -0800571 AC_MSG_CHECKING([for s/key support])
572 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100573 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800574#include <stdio.h>
575#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700576int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800577 ],
578 [AC_MSG_RESULT(yes)],
579 [
580 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100581 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
582 ])
583 fi
584 ]
585)
586
587# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700588TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100589AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700590 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
591 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100592 [
593 if test "x$withval" != "xno" ; then
594 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700595 saved_LDFLAGS="$LDFLAGS"
596 saved_CPPFLAGS="$CPPFLAGS"
597 if test -n "${withval}" -a "${withval}" != "yes"; then
598 if test -d "${withval}/lib"; then
599 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700600 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700601 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700602 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700603 fi
604 else
605 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700606 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700607 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700608 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 fi
610 fi
611 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700612 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700613 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700614 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700615 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800617 LIBWRAP="-lwrap"
618 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100619 AC_MSG_CHECKING(for libwrap)
620 AC_TRY_LINK(
621 [
622#include <tcpd.h>
623 int deny_severity = 0, allow_severity = 0;
624 ],
625 [hosts_access(0);],
626 [
627 AC_MSG_RESULT(yes)
628 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800629 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700630 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100631 ],
632 [
633 AC_MSG_ERROR([*** libwrap missing])
634 ]
635 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800636 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100637 fi
638 ]
639)
640
Damien Millerfe1f1432003-02-24 15:45:42 +1100641dnl Checks for library functions. Please keep in alphabetical order
642AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000643 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
644 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100645 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000646 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100647 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000648 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
649 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
650 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000651 setproctitle setregid setresgid setresuid setreuid setrlimit \
652 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000653 strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
654 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100655)
Tim Rice13aae5e2001-10-21 17:53:58 -0700656
Damien Millercd6853c2003-01-28 11:33:42 +1100657AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000658AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100659
Darren Tuckerf1159b52003-07-07 19:44:01 +1000660dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000661AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000662AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000663
Tim Rice13aae5e2001-10-21 17:53:58 -0700664dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700665AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700666 AC_CHECK_LIB(gen, dirname,[
667 AC_CACHE_CHECK([for broken dirname],
668 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700669 save_LIBS="$LIBS"
670 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700671 AC_TRY_RUN(
672 [
673#include <libgen.h>
674#include <string.h>
675
676int main(int argc, char **argv) {
677 char *s, buf[32];
678
679 strncpy(buf,"/etc", 32);
680 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700681 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700682 exit(1);
683 } else {
684 exit(0);
685 }
686}
687 ],
688 [ ac_cv_have_broken_dirname="no" ],
689 [ ac_cv_have_broken_dirname="yes" ]
690 )
Tim Rice17b93e52001-10-23 22:36:54 -0700691 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700692 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700693 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700694 LIBS="$LIBS -lgen"
695 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700696 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700697 fi
698 ])
699])
700
Damien Millerad833b32000-08-23 10:46:23 +1000701dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000702AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000703dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000704AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000705AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000706dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000707AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000708AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100709
Damien Miller04f80141999-11-19 15:32:34 +1100710AC_CHECK_FUNC(daemon,
711 [AC_DEFINE(HAVE_DAEMON)],
712 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
713)
714
Damien Miller9fb07e42000-03-05 16:22:59 +1100715AC_CHECK_FUNC(getpagesize,
716 [AC_DEFINE(HAVE_GETPAGESIZE)],
717 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
718)
719
Damien Millercb170cb2000-07-01 16:52:55 +1000720# Check for broken snprintf
721if test "x$ac_cv_func_snprintf" = "xyes" ; then
722 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
723 AC_TRY_RUN(
724 [
725#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700726int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000727 ],
728 [AC_MSG_RESULT(yes)],
729 [
730 AC_MSG_RESULT(no)
731 AC_DEFINE(BROKEN_SNPRINTF)
732 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
733 ]
734 )
735fi
736
Damien Millere8328192003-01-07 15:18:32 +1100737dnl see whether mkstemp() requires XXXXXX
738if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
739AC_MSG_CHECKING([for (overly) strict mkstemp])
740AC_TRY_RUN(
741 [
742#include <stdlib.h>
743main() { char template[]="conftest.mkstemp-test";
744if (mkstemp(template) == -1)
745 exit(1);
746unlink(template); exit(0);
747}
748 ],
749 [
750 AC_MSG_RESULT(no)
751 ],
752 [
753 AC_MSG_RESULT(yes)
754 AC_DEFINE(HAVE_STRICT_MKSTEMP)
755 ],
756 [
757 AC_MSG_RESULT(yes)
758 AC_DEFINE(HAVE_STRICT_MKSTEMP)
759 ]
760)
761fi
762
Darren Tucker70a3d552003-08-21 17:58:29 +1000763dnl make sure that openpty does not reacquire controlling terminal
764if test ! -z "$check_for_openpty_ctty_bug"; then
765 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
766 AC_TRY_RUN(
767 [
768#include <stdio.h>
769#include <sys/fcntl.h>
770#include <sys/types.h>
771#include <sys/wait.h>
772
773int
774main()
775{
776 pid_t pid;
777 int fd, ptyfd, ttyfd, status;
778
779 pid = fork();
780 if (pid < 0) { /* failed */
781 exit(1);
782 } else if (pid > 0) { /* parent */
783 waitpid(pid, &status, 0);
784 if (WIFEXITED(status))
785 exit(WEXITSTATUS(status));
786 else
787 exit(2);
788 } else { /* child */
789 close(0); close(1); close(2);
790 setsid();
791 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
792 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
793 if (fd >= 0)
794 exit(3); /* Acquired ctty: broken */
795 else
796 exit(0); /* Did not acquire ctty: OK */
797 }
798}
799 ],
800 [
801 AC_MSG_RESULT(yes)
802 ],
803 [
804 AC_MSG_RESULT(no)
805 AC_DEFINE(SSHD_ACQUIRES_CTTY)
806 ]
807 )
808fi
809
Damien Miller606f8802000-09-16 15:39:56 +1100810AC_FUNC_GETPGRP
811
Damien Millera64b57a2001-01-17 10:44:13 +1100812# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000813PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100814AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100815 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100816 [
Damien Millera64b57a2001-01-17 10:44:13 +1100817 if test "x$withval" != "xno" ; then
818 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
819 AC_MSG_ERROR([PAM headers not found])
820 fi
821
822 AC_CHECK_LIB(dl, dlopen, , )
823 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
824 AC_CHECK_FUNCS(pam_getenvlist)
825
826 disable_shadow=yes
827 PAM_MSG="yes"
828
829 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800830 if test $ac_cv_lib_dl_dlopen = yes; then
831 LIBPAM="-lpam -ldl"
832 else
833 LIBPAM="-lpam"
834 fi
835 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100836 fi
837 ]
838)
Damien Millera22ba012000-03-02 23:09:20 +1100839
Damien Millera64b57a2001-01-17 10:44:13 +1100840# Check for older PAM
841if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100842 # Check PAM strerror arguments (old PAM)
843 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
844 AC_TRY_COMPILE(
845 [
Damien Miller81171112000-04-23 11:14:01 +1000846#include <stdlib.h>
847#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100848 ],
849 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
850 [AC_MSG_RESULT(no)],
851 [
852 AC_DEFINE(HAVE_OLD_PAM)
853 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000854 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100855 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100856 )
Damien Millera22ba012000-03-02 23:09:20 +1100857fi
858
Damien Millerfc93d4b2002-09-04 23:26:29 +1000859# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
860# because the system crypt() is more featureful.
861if test "x$check_for_libcrypt_before" = "x1"; then
862 AC_CHECK_LIB(crypt, crypt)
863fi
864
Tim Riceaef73712002-05-11 13:17:42 -0700865# Search for OpenSSL
866saved_CPPFLAGS="$CPPFLAGS"
867saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100868AC_ARG_WITH(ssl-dir,
869 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
870 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000871 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700872 if test -d "$withval/lib"; then
873 if test -n "${need_dash_r}"; then
874 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
875 else
876 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
877 fi
878 else
879 if test -n "${need_dash_r}"; then
880 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
881 else
882 LDFLAGS="-L${withval} ${LDFLAGS}"
883 fi
884 fi
885 if test -d "$withval/include"; then
886 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
887 else
888 CPPFLAGS="-I${withval} ${CPPFLAGS}"
889 fi
Damien Millera22ba012000-03-02 23:09:20 +1100890 fi
891 ]
892)
Tim Riceaef73712002-05-11 13:17:42 -0700893LIBS="$LIBS -lcrypto"
894AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000895 [
Tim Riceaef73712002-05-11 13:17:42 -0700896 dnl Check default openssl install dir
897 if test -n "${need_dash_r}"; then
898 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000899 else
Tim Riceaef73712002-05-11 13:17:42 -0700900 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000901 fi
Tim Riceaef73712002-05-11 13:17:42 -0700902 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
903 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
904 [
905 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
906 ]
907 )
908 ]
909)
910
Tim Riced730b782002-08-13 18:52:10 -0700911# Determine OpenSSL header version
912AC_MSG_CHECKING([OpenSSL header version])
913AC_TRY_RUN(
914 [
915#include <stdio.h>
916#include <string.h>
917#include <openssl/opensslv.h>
918#define DATA "conftest.sslincver"
919int main(void) {
920 FILE *fd;
921 int rc;
922
923 fd = fopen(DATA,"w");
924 if(fd == NULL)
925 exit(1);
926
927 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
928 exit(1);
929
930 exit(0);
931}
932 ],
933 [
934 ssl_header_ver=`cat conftest.sslincver`
935 AC_MSG_RESULT($ssl_header_ver)
936 ],
937 [
938 AC_MSG_RESULT(not found)
939 AC_MSG_ERROR(OpenSSL version header not found.)
940 ]
941)
942
943# Determine OpenSSL library version
944AC_MSG_CHECKING([OpenSSL library version])
945AC_TRY_RUN(
946 [
947#include <stdio.h>
948#include <string.h>
949#include <openssl/opensslv.h>
950#include <openssl/crypto.h>
951#define DATA "conftest.ssllibver"
952int main(void) {
953 FILE *fd;
954 int rc;
955
956 fd = fopen(DATA,"w");
957 if(fd == NULL)
958 exit(1);
959
960 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
961 exit(1);
962
963 exit(0);
964}
965 ],
966 [
967 ssl_library_ver=`cat conftest.ssllibver`
968 AC_MSG_RESULT($ssl_library_ver)
969 ],
970 [
971 AC_MSG_RESULT(not found)
972 AC_MSG_ERROR(OpenSSL library not found.)
973 ]
974)
Damien Millera22ba012000-03-02 23:09:20 +1100975
Damien Millerec932372002-01-22 22:16:03 +1100976# Sanity check OpenSSL headers
977AC_MSG_CHECKING([whether OpenSSL's headers match the library])
978AC_TRY_RUN(
979 [
980#include <string.h>
981#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700982int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100983 ],
984 [
985 AC_MSG_RESULT(yes)
986 ],
987 [
988 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000989 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
990Check config.log for details.
991Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +1100992 ]
993)
994
Damien Millera64b57a2001-01-17 10:44:13 +1100995# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
996# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +1000997if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100998 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100999fi
1000
Damien Miller6c21c512002-01-22 21:57:53 +11001001
1002### Configure cryptographic random number support
1003
1004# Check wheter OpenSSL seeds itself
1005AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1006AC_TRY_RUN(
1007 [
1008#include <string.h>
1009#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001010int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001011 ],
1012 [
1013 OPENSSL_SEEDS_ITSELF=yes
1014 AC_MSG_RESULT(yes)
1015 ],
1016 [
1017 AC_MSG_RESULT(no)
1018 # Default to use of the rand helper if OpenSSL doesn't
1019 # seed itself
1020 USE_RAND_HELPER=yes
1021 ]
1022)
1023
1024
1025# Do we want to force the use of the rand helper?
1026AC_ARG_WITH(rand-helper,
1027 [ --with-rand-helper Use subprocess to gather strong randomness ],
1028 [
1029 if test "x$withval" = "xno" ; then
1030 # Force use of OpenSSL's internal RNG, even if
1031 # the previous test showed it to be unseeded.
1032 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1033 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1034 OPENSSL_SEEDS_ITSELF=yes
1035 USE_RAND_HELPER=""
1036 fi
1037 else
1038 USE_RAND_HELPER=yes
1039 fi
1040 ],
1041)
1042
1043# Which randomness source do we use?
1044if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1045 # OpenSSL only
1046 AC_DEFINE(OPENSSL_PRNG_ONLY)
1047 RAND_MSG="OpenSSL internal ONLY"
1048 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001049elif test ! -z "$USE_RAND_HELPER" ; then
1050 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001051 RAND_MSG="ssh-rand-helper"
1052 INSTALL_SSH_RAND_HELPER="yes"
1053fi
1054AC_SUBST(INSTALL_SSH_RAND_HELPER)
1055
1056### Configuration of ssh-rand-helper
1057
1058# PRNGD TCP socket
1059AC_ARG_WITH(prngd-port,
1060 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1061 [
Damien Millere996d722002-01-23 11:20:59 +11001062 case "$withval" in
1063 no)
1064 withval=""
1065 ;;
1066 [[0-9]]*)
1067 ;;
1068 *)
1069 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1070 ;;
1071 esac
1072 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001073 PRNGD_PORT="$withval"
1074 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1075 fi
1076 ]
1077)
1078
1079# PRNGD Unix domain socket
1080AC_ARG_WITH(prngd-socket,
1081 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1082 [
Damien Millere996d722002-01-23 11:20:59 +11001083 case "$withval" in
1084 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001085 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001086 ;;
1087 no)
1088 withval=""
1089 ;;
1090 /*)
1091 ;;
1092 *)
1093 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1094 ;;
1095 esac
1096
1097 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001098 if test ! -z "$PRNGD_PORT" ; then
1099 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1100 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001101 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001102 AC_MSG_WARN(Entropy socket is not readable)
1103 fi
1104 PRNGD_SOCKET="$withval"
1105 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1106 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001107 ],
1108 [
1109 # Check for existing socket only if we don't have a random device already
1110 if test "$USE_RAND_HELPER" = yes ; then
1111 AC_MSG_CHECKING(for PRNGD/EGD socket)
1112 # Insert other locations here
1113 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1114 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1115 PRNGD_SOCKET="$sock"
1116 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1117 break;
1118 fi
1119 done
1120 if test ! -z "$PRNGD_SOCKET" ; then
1121 AC_MSG_RESULT($PRNGD_SOCKET)
1122 else
1123 AC_MSG_RESULT(not found)
1124 fi
1125 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001126 ]
1127)
1128
1129# Change default command timeout for hashing entropy source
1130entropy_timeout=200
1131AC_ARG_WITH(entropy-timeout,
1132 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1133 [
1134 if test "x$withval" != "xno" ; then
1135 entropy_timeout=$withval
1136 fi
1137 ]
1138)
Damien Miller6c21c512002-01-22 21:57:53 +11001139AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1140
Damien Millerd3f6ad22002-06-25 10:24:47 +10001141SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001142AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001143 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001144 [
1145 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001146 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001147 fi
1148 ]
1149)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001150AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1151AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001152
Tim Rice88f2ab52002-03-17 12:17:34 -08001153# We do this little dance with the search path to insure
1154# that programs that we select for use by installed programs
1155# (which may be run by the super-user) come from trusted
1156# locations before they come from the user's private area.
1157# This should help avoid accidentally configuring some
1158# random version of a program in someone's personal bin.
1159
1160OPATH=$PATH
1161PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001162test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001163test -d /sbin && PATH=$PATH:/sbin
1164test -d /usr/sbin && PATH=$PATH:/usr/sbin
1165PATH=$PATH:/etc:$OPATH
1166
Damien Miller6c21c512002-01-22 21:57:53 +11001167# These programs are used by the command hashing source to gather entropy
1168OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1169OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1170OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1171OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1172OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1173OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1174OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1175OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1176OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1177OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1178OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1179OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1180OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1181OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1182OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1183OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001184# restore PATH
1185PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001186
1187# Where does ssh-rand-helper get its randomness from?
1188INSTALL_SSH_PRNG_CMDS=""
1189if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1190 if test ! -z "$PRNGD_PORT" ; then
1191 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1192 elif test ! -z "$PRNGD_SOCKET" ; then
1193 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1194 else
1195 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1196 RAND_HELPER_CMDHASH=yes
1197 INSTALL_SSH_PRNG_CMDS="yes"
1198 fi
1199fi
1200AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1201
1202
Ben Lindstromb5628642000-10-18 00:02:25 +00001203# Cheap hack to ensure NEWS-OS libraries are arranged right.
1204if test ! -z "$SONY" ; then
1205 LIBS="$LIBS -liberty";
1206fi
1207
Damien Millera22ba012000-03-02 23:09:20 +11001208# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001209AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001210AC_CHECK_SIZEOF(short int, 2)
1211AC_CHECK_SIZEOF(int, 4)
1212AC_CHECK_SIZEOF(long int, 4)
1213AC_CHECK_SIZEOF(long long int, 8)
1214
Damien Millerfa2bb692002-04-23 23:22:25 +10001215# Sanity check long long for some platforms (AIX)
1216if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1217 ac_cv_sizeof_long_long_int=0
1218fi
1219
Damien Millera22ba012000-03-02 23:09:20 +11001220# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001221AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1222 AC_TRY_COMPILE(
1223 [ #include <sys/types.h> ],
1224 [ u_int a; a = 1;],
1225 [ ac_cv_have_u_int="yes" ],
1226 [ ac_cv_have_u_int="no" ]
1227 )
1228])
1229if test "x$ac_cv_have_u_int" = "xyes" ; then
1230 AC_DEFINE(HAVE_U_INT)
1231 have_u_int=1
1232fi
1233
Damien Miller61e50f12000-05-08 20:49:37 +10001234AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1235 AC_TRY_COMPILE(
1236 [ #include <sys/types.h> ],
1237 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1238 [ ac_cv_have_intxx_t="yes" ],
1239 [ ac_cv_have_intxx_t="no" ]
1240 )
1241])
1242if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1243 AC_DEFINE(HAVE_INTXX_T)
1244 have_intxx_t=1
1245fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001246
1247if (test -z "$have_intxx_t" && \
1248 test "x$ac_cv_header_stdint_h" = "xyes")
1249then
1250 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1251 AC_TRY_COMPILE(
1252 [ #include <stdint.h> ],
1253 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1254 [
1255 AC_DEFINE(HAVE_INTXX_T)
1256 AC_MSG_RESULT(yes)
1257 ],
1258 [ AC_MSG_RESULT(no) ]
1259 )
1260fi
1261
Damien Miller578783e2000-09-23 14:12:24 +11001262AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1263 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001264 [
1265#include <sys/types.h>
1266#ifdef HAVE_STDINT_H
1267# include <stdint.h>
1268#endif
1269#include <sys/socket.h>
1270#ifdef HAVE_SYS_BITYPES_H
1271# include <sys/bitypes.h>
1272#endif
1273 ],
Damien Miller578783e2000-09-23 14:12:24 +11001274 [ int64_t a; a = 1;],
1275 [ ac_cv_have_int64_t="yes" ],
1276 [ ac_cv_have_int64_t="no" ]
1277 )
1278])
1279if test "x$ac_cv_have_int64_t" = "xyes" ; then
1280 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001281fi
1282
Damien Miller61e50f12000-05-08 20:49:37 +10001283AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1284 AC_TRY_COMPILE(
1285 [ #include <sys/types.h> ],
1286 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1287 [ ac_cv_have_u_intxx_t="yes" ],
1288 [ ac_cv_have_u_intxx_t="no" ]
1289 )
1290])
1291if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1292 AC_DEFINE(HAVE_U_INTXX_T)
1293 have_u_intxx_t=1
1294fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001295
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001296if test -z "$have_u_intxx_t" ; then
1297 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1298 AC_TRY_COMPILE(
1299 [ #include <sys/socket.h> ],
1300 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1301 [
1302 AC_DEFINE(HAVE_U_INTXX_T)
1303 AC_MSG_RESULT(yes)
1304 ],
1305 [ AC_MSG_RESULT(no) ]
1306 )
1307fi
1308
Damien Miller578783e2000-09-23 14:12:24 +11001309AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1310 AC_TRY_COMPILE(
1311 [ #include <sys/types.h> ],
1312 [ u_int64_t a; a = 1;],
1313 [ ac_cv_have_u_int64_t="yes" ],
1314 [ ac_cv_have_u_int64_t="no" ]
1315 )
1316])
1317if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1318 AC_DEFINE(HAVE_U_INT64_T)
1319 have_u_int64_t=1
1320fi
1321
Tim Rice4cec93f2002-02-26 08:40:48 -08001322if test -z "$have_u_int64_t" ; then
1323 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1324 AC_TRY_COMPILE(
1325 [ #include <sys/bitypes.h> ],
1326 [ u_int64_t a; a = 1],
1327 [
1328 AC_DEFINE(HAVE_U_INT64_T)
1329 AC_MSG_RESULT(yes)
1330 ],
1331 [ AC_MSG_RESULT(no) ]
1332 )
1333fi
1334
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001335if test -z "$have_u_intxx_t" ; then
1336 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1337 AC_TRY_COMPILE(
1338 [
1339#include <sys/types.h>
1340 ],
1341 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1342 [ ac_cv_have_uintxx_t="yes" ],
1343 [ ac_cv_have_uintxx_t="no" ]
1344 )
1345 ])
1346 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1347 AC_DEFINE(HAVE_UINTXX_T)
1348 fi
1349fi
1350
1351if test -z "$have_uintxx_t" ; then
1352 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1353 AC_TRY_COMPILE(
1354 [ #include <stdint.h> ],
1355 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1356 [
1357 AC_DEFINE(HAVE_UINTXX_T)
1358 AC_MSG_RESULT(yes)
1359 ],
1360 [ AC_MSG_RESULT(no) ]
1361 )
1362fi
1363
Damien Milleredb82922000-06-20 13:25:52 +10001364if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1365 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001366then
1367 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1368 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001369 [
1370#include <sys/bitypes.h>
1371 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001372 [
Damien Miller70494d12000-04-03 15:57:06 +10001373 int8_t a; int16_t b; int32_t c;
1374 u_int8_t e; u_int16_t f; u_int32_t g;
1375 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001376 ],
1377 [
1378 AC_DEFINE(HAVE_U_INTXX_T)
1379 AC_DEFINE(HAVE_INTXX_T)
1380 AC_MSG_RESULT(yes)
1381 ],
1382 [AC_MSG_RESULT(no)]
1383 )
1384fi
1385
Damien Miller58be7382001-09-15 21:31:54 +10001386
1387AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1388 AC_TRY_COMPILE(
1389 [
1390#include <sys/types.h>
1391 ],
1392 [ u_char foo; foo = 125; ],
1393 [ ac_cv_have_u_char="yes" ],
1394 [ ac_cv_have_u_char="no" ]
1395 )
1396])
1397if test "x$ac_cv_have_u_char" = "xyes" ; then
1398 AC_DEFINE(HAVE_U_CHAR)
1399fi
1400
Tim Rice13aae5e2001-10-21 17:53:58 -07001401TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001402
Tim Rice200a5c02002-02-26 22:12:34 -08001403AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001404
Damien Miller61e50f12000-05-08 20:49:37 +10001405AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1406 AC_TRY_COMPILE(
1407 [
1408#include <sys/types.h>
1409 ],
1410 [ size_t foo; foo = 1235; ],
1411 [ ac_cv_have_size_t="yes" ],
1412 [ ac_cv_have_size_t="no" ]
1413 )
1414])
1415if test "x$ac_cv_have_size_t" = "xyes" ; then
1416 AC_DEFINE(HAVE_SIZE_T)
1417fi
Damien Miller95058511999-12-29 10:36:45 +11001418
Damien Miller615f9392000-05-17 22:53:33 +10001419AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1420 AC_TRY_COMPILE(
1421 [
1422#include <sys/types.h>
1423 ],
1424 [ ssize_t foo; foo = 1235; ],
1425 [ ac_cv_have_ssize_t="yes" ],
1426 [ ac_cv_have_ssize_t="no" ]
1427 )
1428])
1429if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1430 AC_DEFINE(HAVE_SSIZE_T)
1431fi
1432
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001433AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1434 AC_TRY_COMPILE(
1435 [
1436#include <time.h>
1437 ],
1438 [ clock_t foo; foo = 1235; ],
1439 [ ac_cv_have_clock_t="yes" ],
1440 [ ac_cv_have_clock_t="no" ]
1441 )
1442])
1443if test "x$ac_cv_have_clock_t" = "xyes" ; then
1444 AC_DEFINE(HAVE_CLOCK_T)
1445fi
1446
Damien Millerb54b40e2000-06-23 08:23:34 +10001447AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1448 AC_TRY_COMPILE(
1449 [
1450#include <sys/types.h>
1451#include <sys/socket.h>
1452 ],
1453 [ sa_family_t foo; foo = 1235; ],
1454 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001455 [ AC_TRY_COMPILE(
1456 [
1457#include <sys/types.h>
1458#include <sys/socket.h>
1459#include <netinet/in.h>
1460 ],
1461 [ sa_family_t foo; foo = 1235; ],
1462 [ ac_cv_have_sa_family_t="yes" ],
1463
Damien Millerb54b40e2000-06-23 08:23:34 +10001464 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001465 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001466 )
1467])
1468if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1469 AC_DEFINE(HAVE_SA_FAMILY_T)
1470fi
1471
Damien Miller0f91b4e2000-06-18 15:43:25 +10001472AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1473 AC_TRY_COMPILE(
1474 [
1475#include <sys/types.h>
1476 ],
1477 [ pid_t foo; foo = 1235; ],
1478 [ ac_cv_have_pid_t="yes" ],
1479 [ ac_cv_have_pid_t="no" ]
1480 )
1481])
1482if test "x$ac_cv_have_pid_t" = "xyes" ; then
1483 AC_DEFINE(HAVE_PID_T)
1484fi
1485
1486AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1487 AC_TRY_COMPILE(
1488 [
1489#include <sys/types.h>
1490 ],
1491 [ mode_t foo; foo = 1235; ],
1492 [ ac_cv_have_mode_t="yes" ],
1493 [ ac_cv_have_mode_t="no" ]
1494 )
1495])
1496if test "x$ac_cv_have_mode_t" = "xyes" ; then
1497 AC_DEFINE(HAVE_MODE_T)
1498fi
1499
Damien Miller61e50f12000-05-08 20:49:37 +10001500
1501AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1502 AC_TRY_COMPILE(
1503 [
Damien Miller81171112000-04-23 11:14:01 +10001504#include <sys/types.h>
1505#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001506 ],
1507 [ struct sockaddr_storage s; ],
1508 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1509 [ ac_cv_have_struct_sockaddr_storage="no" ]
1510 )
1511])
1512if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1513 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1514fi
Damien Miller34132e52000-01-14 15:45:46 +11001515
Damien Miller61e50f12000-05-08 20:49:37 +10001516AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1517 AC_TRY_COMPILE(
1518 [
Damien Miller7b22d652000-06-18 14:07:04 +10001519#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001520#include <netinet/in.h>
1521 ],
1522 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1523 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1524 [ ac_cv_have_struct_sockaddr_in6="no" ]
1525 )
1526])
1527if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1528 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1529fi
Damien Miller34132e52000-01-14 15:45:46 +11001530
Damien Miller61e50f12000-05-08 20:49:37 +10001531AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1532 AC_TRY_COMPILE(
1533 [
Damien Miller7b22d652000-06-18 14:07:04 +10001534#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001535#include <netinet/in.h>
1536 ],
1537 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1538 [ ac_cv_have_struct_in6_addr="yes" ],
1539 [ ac_cv_have_struct_in6_addr="no" ]
1540 )
1541])
1542if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1543 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1544fi
Damien Miller34132e52000-01-14 15:45:46 +11001545
Damien Miller61e50f12000-05-08 20:49:37 +10001546AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1547 AC_TRY_COMPILE(
1548 [
Damien Miller81171112000-04-23 11:14:01 +10001549#include <sys/types.h>
1550#include <sys/socket.h>
1551#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001552 ],
1553 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1554 [ ac_cv_have_struct_addrinfo="yes" ],
1555 [ ac_cv_have_struct_addrinfo="no" ]
1556 )
1557])
1558if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1559 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1560fi
1561
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001562AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1563 AC_TRY_COMPILE(
1564 [ #include <sys/time.h> ],
1565 [ struct timeval tv; tv.tv_sec = 1;],
1566 [ ac_cv_have_struct_timeval="yes" ],
1567 [ ac_cv_have_struct_timeval="no" ]
1568 )
1569])
1570if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1571 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1572 have_struct_timeval=1
1573fi
1574
Tim Rice4e4dc562003-03-18 10:21:40 -08001575AC_CHECK_TYPES(struct timespec)
1576
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001577# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001578if test "x$ac_cv_have_int64_t" = "xno" -a \
1579 "x$ac_cv_sizeof_long_int" != "x8" -a \
1580 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001581 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1582 echo "an alternative compiler (I.E., GCC) before continuing."
1583 echo ""
1584 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001585else
1586dnl test snprintf (broken on SCO w/gcc)
1587 AC_TRY_RUN(
1588 [
1589#include <stdio.h>
1590#include <string.h>
1591#ifdef HAVE_SNPRINTF
1592main()
1593{
1594 char buf[50];
1595 char expected_out[50];
1596 int mazsize = 50 ;
1597#if (SIZEOF_LONG_INT == 8)
1598 long int num = 0x7fffffffffffffff;
1599#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001600 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001601#endif
1602 strcpy(expected_out, "9223372036854775807");
1603 snprintf(buf, mazsize, "%lld", num);
1604 if(strcmp(buf, expected_out) != 0)
1605 exit(1);
1606 exit(0);
1607}
1608#else
1609main() { exit(0); }
1610#endif
1611 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1612 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001613fi
1614
Damien Miller78315eb2000-09-29 23:01:36 +11001615dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001616OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1617OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1618OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1619OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1620OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001621OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001622OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1623OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001624OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001625OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1626OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1627OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1628OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001629OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1630OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1631OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1632OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001633
1634AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001635
Damien Miller61e50f12000-05-08 20:49:37 +10001636AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1637 ac_cv_have_ss_family_in_struct_ss, [
1638 AC_TRY_COMPILE(
1639 [
Damien Miller81171112000-04-23 11:14:01 +10001640#include <sys/types.h>
1641#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001642 ],
1643 [ struct sockaddr_storage s; s.ss_family = 1; ],
1644 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1645 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1646 )
1647])
1648if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1649 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1650fi
1651
Damien Miller61e50f12000-05-08 20:49:37 +10001652AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1653 ac_cv_have___ss_family_in_struct_ss, [
1654 AC_TRY_COMPILE(
1655 [
Damien Miller81171112000-04-23 11:14:01 +10001656#include <sys/types.h>
1657#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001658 ],
1659 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1660 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1661 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1662 )
1663])
1664if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1665 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1666fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001667
Damien Millerad833b32000-08-23 10:46:23 +10001668AC_CACHE_CHECK([for pw_class field in struct passwd],
1669 ac_cv_have_pw_class_in_struct_passwd, [
1670 AC_TRY_COMPILE(
1671 [
Damien Millerad833b32000-08-23 10:46:23 +10001672#include <pwd.h>
1673 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001674 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001675 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1676 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1677 )
1678])
1679if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1680 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1681fi
1682
Kevin Steves82456952001-06-22 21:14:18 +00001683AC_CACHE_CHECK([for pw_expire field in struct passwd],
1684 ac_cv_have_pw_expire_in_struct_passwd, [
1685 AC_TRY_COMPILE(
1686 [
1687#include <pwd.h>
1688 ],
1689 [ struct passwd p; p.pw_expire = 0; ],
1690 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1691 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1692 )
1693])
1694if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1695 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1696fi
1697
1698AC_CACHE_CHECK([for pw_change field in struct passwd],
1699 ac_cv_have_pw_change_in_struct_passwd, [
1700 AC_TRY_COMPILE(
1701 [
1702#include <pwd.h>
1703 ],
1704 [ struct passwd p; p.pw_change = 0; ],
1705 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1706 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1707 )
1708])
1709if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1710 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1711fi
Damien Miller61e50f12000-05-08 20:49:37 +10001712
Tim Rice28bbb0c2002-05-27 17:37:32 -07001713dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001714AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1715 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001716 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001717 [
Tim Riceae49fe62002-04-12 10:26:21 -07001718#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001719#include <sys/socket.h>
1720#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001721int main() {
1722#ifdef msg_accrights
1723exit(1);
1724#endif
1725struct msghdr m;
1726m.msg_accrights = 0;
1727exit(0);
1728}
Kevin Steves939c9db2002-03-22 17:23:25 +00001729 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001730 [ ac_cv_have_accrights_in_msghdr="yes" ],
1731 [ ac_cv_have_accrights_in_msghdr="no" ]
1732 )
1733])
1734if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1735 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1736fi
1737
Kevin Stevesa44e0352002-04-07 16:18:03 +00001738AC_CACHE_CHECK([for msg_control field in struct msghdr],
1739 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001740 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001741 [
Tim Riceae49fe62002-04-12 10:26:21 -07001742#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001743#include <sys/socket.h>
1744#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001745int main() {
1746#ifdef msg_control
1747exit(1);
1748#endif
1749struct msghdr m;
1750m.msg_control = 0;
1751exit(0);
1752}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001753 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001754 [ ac_cv_have_control_in_msghdr="yes" ],
1755 [ ac_cv_have_control_in_msghdr="no" ]
1756 )
1757])
1758if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1759 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1760fi
1761
Damien Miller61e50f12000-05-08 20:49:37 +10001762AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1763 AC_TRY_LINK([],
1764 [ extern char *__progname; printf("%s", __progname); ],
1765 [ ac_cv_libc_defines___progname="yes" ],
1766 [ ac_cv_libc_defines___progname="no" ]
1767 )
1768])
1769if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1770 AC_DEFINE(HAVE___PROGNAME)
1771fi
1772
Kevin Steves4846f4a2002-03-22 18:19:53 +00001773AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1774 AC_TRY_LINK([
1775#include <stdio.h>
1776],
1777 [ printf("%s", __FUNCTION__); ],
1778 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1779 [ ac_cv_cc_implements___FUNCTION__="no" ]
1780 )
1781])
1782if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1783 AC_DEFINE(HAVE___FUNCTION__)
1784fi
1785
1786AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1787 AC_TRY_LINK([
1788#include <stdio.h>
1789],
1790 [ printf("%s", __func__); ],
1791 [ ac_cv_cc_implements___func__="yes" ],
1792 [ ac_cv_cc_implements___func__="no" ]
1793 )
1794])
1795if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1796 AC_DEFINE(HAVE___func__)
1797fi
1798
Damien Miller4f8e6692001-07-14 13:22:53 +10001799AC_CACHE_CHECK([whether getopt has optreset support],
1800 ac_cv_have_getopt_optreset, [
1801 AC_TRY_LINK(
1802 [
1803#include <getopt.h>
1804 ],
1805 [ extern int optreset; optreset = 0; ],
1806 [ ac_cv_have_getopt_optreset="yes" ],
1807 [ ac_cv_have_getopt_optreset="no" ]
1808 )
1809])
1810if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1811 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1812fi
Damien Millera22ba012000-03-02 23:09:20 +11001813
Damien Millerecbb26d2000-07-15 14:59:14 +10001814AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1815 AC_TRY_LINK([],
1816 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1817 [ ac_cv_libc_defines_sys_errlist="yes" ],
1818 [ ac_cv_libc_defines_sys_errlist="no" ]
1819 )
1820])
1821if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1822 AC_DEFINE(HAVE_SYS_ERRLIST)
1823fi
1824
1825
Damien Miller11fa2cc2000-08-16 10:35:58 +10001826AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1827 AC_TRY_LINK([],
1828 [ extern int sys_nerr; printf("%i", sys_nerr);],
1829 [ ac_cv_libc_defines_sys_nerr="yes" ],
1830 [ ac_cv_libc_defines_sys_nerr="no" ]
1831 )
1832])
1833if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1834 AC_DEFINE(HAVE_SYS_NERR)
1835fi
1836
Damien Miller85de5802001-09-18 14:01:11 +10001837SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001838# Check whether user wants sectok support
1839AC_ARG_WITH(sectok,
1840 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001841 [
1842 if test "x$withval" != "xno" ; then
1843 if test "x$withval" != "xyes" ; then
1844 CPPFLAGS="$CPPFLAGS -I${withval}"
1845 LDFLAGS="$LDFLAGS -L${withval}"
1846 if test ! -z "$need_dash_r" ; then
1847 LDFLAGS="$LDFLAGS -R${withval}"
1848 fi
1849 if test ! -z "$blibpath" ; then
1850 blibpath="$blibpath:${withval}"
1851 fi
1852 fi
1853 AC_CHECK_HEADERS(sectok.h)
1854 if test "$ac_cv_header_sectok_h" != yes; then
1855 AC_MSG_ERROR(Can't find sectok.h)
1856 fi
1857 AC_CHECK_LIB(sectok, sectok_open)
1858 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1859 AC_MSG_ERROR(Can't find libsectok)
1860 fi
1861 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001862 AC_DEFINE(USE_SECTOK)
1863 SCARD_MSG="yes, using sectok"
1864 fi
1865 ]
1866)
1867
1868# Check whether user wants OpenSC support
1869AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001870 AC_HELP_STRING([--with-opensc=PFX],
1871 [Enable smartcard support using OpenSC]),
1872 opensc_config_prefix="$withval", opensc_config_prefix="")
1873if test x$opensc_config_prefix != x ; then
1874 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1875 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1876 if test "$OPENSC_CONFIG" != "no"; then
1877 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1878 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1879 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1880 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1881 AC_DEFINE(SMARTCARD)
1882 AC_DEFINE(USE_OPENSC)
1883 SCARD_MSG="yes, using OpenSC"
1884 fi
1885fi
Damien Miller85de5802001-09-18 14:01:11 +10001886
Damien Miller7abe09b2003-05-15 10:53:49 +10001887# Check whether user wants DNS support
1888DNS_MSG="no"
1889AC_ARG_WITH(dns,
1890 [ --with-dns Support for fetching keys from DNS (experimental)],
1891 [
1892 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001893 DNS_MSG="yes"
1894 AC_DEFINE(DNS)
1895 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001896 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1897 [
1898 # Needed by our getrrsetbyname()
1899 AC_SEARCH_LIBS(res_query, resolv)
1900 AC_SEARCH_LIBS(dn_expand, resolv)
1901 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001902 fi
1903 ]
1904)
1905
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001906# Check whether user wants Kerberos 5 support
1907KRB5_MSG="no"
1908AC_ARG_WITH(kerberos5,
1909 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1910 [
1911 if test "x$withval" != "xno" ; then
1912 if test "x$withval" = "xyes" ; then
1913 KRB5ROOT="/usr/local"
1914 else
1915 KRB5ROOT=${withval}
1916 fi
1917 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1918 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1919 AC_DEFINE(KRB5)
1920 KRB5_MSG="yes"
1921 AC_MSG_CHECKING(whether we are using Heimdal)
1922 AC_TRY_COMPILE([ #include <krb5.h> ],
1923 [ char *tmp = heimdal_version; ],
1924 [ AC_MSG_RESULT(yes)
1925 AC_DEFINE(HEIMDAL)
1926 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1927 ],
1928 [ AC_MSG_RESULT(no)
1929 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1930 ]
1931 )
1932 if test ! -z "$need_dash_r" ; then
1933 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1934 fi
1935 if test ! -z "$blibpath" ; then
1936 blibpath="$blibpath:${KRB5ROOT}/lib"
1937 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001938 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001939
1940 KRB5=yes
1941 fi
1942 ]
1943)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10001944LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001945
Damien Millera22ba012000-03-02 23:09:20 +11001946# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001947
Damien Millerf58c6722002-05-13 13:15:42 +10001948PRIVSEP_PATH=/var/empty
1949AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001950 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001951 [
1952 if test "x$withval" != "$no" ; then
1953 PRIVSEP_PATH=$withval
1954 fi
1955 ]
1956)
1957AC_SUBST(PRIVSEP_PATH)
1958
Damien Millera22ba012000-03-02 23:09:20 +11001959AC_ARG_WITH(xauth,
1960 [ --with-xauth=PATH Specify path to xauth program ],
1961 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001962 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001963 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001964 fi
1965 ],
1966 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001967 TestPath="$PATH"
1968 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1969 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1970 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1971 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1972 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001973 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001974 xauth_path="/usr/openwin/bin/xauth"
1975 fi
1976 ]
1977)
1978
Damien Miller7d901272003-01-13 16:55:22 +11001979STRIP_OPT=-s
1980AC_ARG_ENABLE(strip,
1981 [ --disable-strip Disable calling strip(1) on install],
1982 [
1983 if test "x$enableval" = "xno" ; then
1984 STRIP_OPT=
1985 fi
1986 ]
1987)
1988AC_SUBST(STRIP_OPT)
1989
Damien Millera19cf472000-11-29 13:28:50 +11001990if test -z "$xauth_path" ; then
1991 XAUTH_PATH="undefined"
1992 AC_SUBST(XAUTH_PATH)
1993else
Damien Millera22ba012000-03-02 23:09:20 +11001994 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001995 XAUTH_PATH=$xauth_path
1996 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001997fi
Damien Millera22ba012000-03-02 23:09:20 +11001998
1999# Check for mail directory (last resort if we cannot get it from headers)
2000if test ! -z "$MAIL" ; then
2001 maildir=`dirname $MAIL`
2002 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2003fi
2004
Damien Millera22ba012000-03-02 23:09:20 +11002005if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002006 if test "x$disable_ptmx_check" != "xyes" ; then
2007 AC_CHECK_FILE("/dev/ptmx",
2008 [
2009 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2010 have_dev_ptmx=1
2011 ]
2012 )
2013 fi
Damien Millera22ba012000-03-02 23:09:20 +11002014fi
Damien Miller204ad072000-03-02 23:56:12 +11002015AC_CHECK_FILE("/dev/ptc",
2016 [
2017 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2018 have_dev_ptc=1
2019 ]
2020)
2021
Damien Millera22ba012000-03-02 23:09:20 +11002022# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002023AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002024 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002025 [
Damien Miller897741e2001-04-16 10:41:46 +10002026 case "$withval" in
2027 man|cat|doc)
2028 MANTYPE=$withval
2029 ;;
2030 *)
2031 AC_MSG_ERROR(invalid man type: $withval)
2032 ;;
2033 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002034 ]
2035)
Ben Lindstrombc709922001-04-18 18:04:21 +00002036if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002037 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2038 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002039 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2040 MANTYPE=doc
2041 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2042 MANTYPE=man
2043 else
2044 MANTYPE=cat
2045 fi
2046fi
Damien Miller670a4b82000-01-22 13:53:11 +11002047AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002048if test "$MANTYPE" = "doc"; then
2049 mansubdir=man;
2050else
2051 mansubdir=$MANTYPE;
2052fi
2053AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002054
Damien Millera22ba012000-03-02 23:09:20 +11002055# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002056MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002057AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002058 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002059 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002060 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002061 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002062 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002063 fi
2064 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002065)
2066
Damien Millera22ba012000-03-02 23:09:20 +11002067# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002068AC_ARG_WITH(shadow,
2069 [ --without-shadow Disable shadow password support],
2070 [
2071 if test "x$withval" = "xno" ; then
2072 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002073 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002074 fi
2075 ]
2076)
2077
Damien Miller1f335fb2000-06-26 11:31:33 +10002078if test -z "$disable_shadow" ; then
2079 AC_MSG_CHECKING([if the systems has expire shadow information])
2080 AC_TRY_COMPILE(
2081 [
2082#include <sys/types.h>
2083#include <shadow.h>
2084 struct spwd sp;
2085 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2086 [ sp_expire_available=yes ], []
2087 )
2088
2089 if test "x$sp_expire_available" = "xyes" ; then
2090 AC_MSG_RESULT(yes)
2091 AC_DEFINE(HAS_SHADOW_EXPIRE)
2092 else
2093 AC_MSG_RESULT(no)
2094 fi
2095fi
2096
Damien Millera22ba012000-03-02 23:09:20 +11002097# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002098if test ! -z "$IPADDR_IN_DISPLAY" ; then
2099 DISPLAY_HACK_MSG="yes"
2100 AC_DEFINE(IPADDR_IN_DISPLAY)
2101else
2102 DISPLAY_HACK_MSG="no"
2103 AC_ARG_WITH(ipaddr-display,
2104 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2105 [
2106 if test "x$withval" != "xno" ; then
2107 AC_DEFINE(IPADDR_IN_DISPLAY)
2108 DISPLAY_HACK_MSG="yes"
2109 fi
2110 ]
2111 )
2112fi
Damien Miller76112de1999-12-21 11:18:08 +11002113
Tim Rice43a1c132002-04-17 21:19:14 -07002114dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2115if test $ac_cv_func_login_getcapbool = "yes" -a \
2116 $ac_cv_header_login_cap_h = "yes" ; then
2117 USES_LOGIN_CONF=yes
2118fi
Damien Millera22ba012000-03-02 23:09:20 +11002119# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002120SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002121AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002122 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002123 [
Tim Rice43a1c132002-04-17 21:19:14 -07002124 if test "$USES_LOGIN_CONF" = "yes" ; then
2125 AC_MSG_WARN([
2126--with-default-path=PATH has no effect on this system.
2127Edit /etc/login.conf instead.])
2128 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002129 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002130 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002131 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002132 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002133 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2134 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2135 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002136 AC_TRY_RUN(
2137 [
2138/* find out what STDPATH is */
2139#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002140#ifdef HAVE_PATHS_H
2141# include <paths.h>
2142#endif
2143#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002144# ifdef _PATH_USERPATH /* Irix */
2145# define _PATH_STDPATH _PATH_USERPATH
2146# else
2147# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2148# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002149#endif
2150#include <sys/types.h>
2151#include <sys/stat.h>
2152#include <fcntl.h>
2153#define DATA "conftest.stdpath"
2154
2155main()
2156{
2157 FILE *fd;
2158 int rc;
2159
2160 fd = fopen(DATA,"w");
2161 if(fd == NULL)
2162 exit(1);
2163
2164 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2165 exit(1);
2166
2167 exit(0);
2168}
2169 ], [ user_path=`cat conftest.stdpath` ],
2170 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2171 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2172 )
2173# make sure $bindir is in USER_PATH so scp will work
2174 t_bindir=`eval echo ${bindir}`
2175 case $t_bindir in
2176 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2177 esac
2178 case $t_bindir in
2179 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2180 esac
2181 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2182 if test $? -ne 0 ; then
2183 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2184 if test $? -ne 0 ; then
2185 user_path=$user_path:$t_bindir
2186 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2187 fi
2188 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002189 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002190)
Tim Rice43a1c132002-04-17 21:19:14 -07002191if test "$USES_LOGIN_CONF" != "yes" ; then
2192 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2193 AC_SUBST(user_path)
2194fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002195
Damien Millera18bbd32002-05-13 10:48:57 +10002196# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002197AC_ARG_WITH(superuser-path,
2198 [ --with-superuser-path= Specify different path for super-user],
2199 [
2200 if test "x$withval" != "xno" ; then
2201 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2202 superuser_path=$withval
2203 fi
2204 ]
2205)
2206
2207
Damien Miller61e50f12000-05-08 20:49:37 +10002208AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002209IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002210AC_ARG_WITH(4in6,
2211 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2212 [
2213 if test "x$withval" != "xno" ; then
2214 AC_MSG_RESULT(yes)
2215 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002216 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002217 else
2218 AC_MSG_RESULT(no)
2219 fi
2220 ],[
2221 if test "x$inet6_default_4in6" = "xyes"; then
2222 AC_MSG_RESULT([yes (default)])
2223 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002224 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002225 else
2226 AC_MSG_RESULT([no (default)])
2227 fi
2228 ]
2229)
2230
Damien Miller60396b02001-02-18 17:01:00 +11002231# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002232BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002233AC_ARG_WITH(bsd-auth,
2234 [ --with-bsd-auth Enable BSD auth support],
2235 [
2236 if test "x$withval" != "xno" ; then
2237 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002238 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002239 fi
2240 ]
2241)
2242
Damien Millera22ba012000-03-02 23:09:20 +11002243# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002244piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002245# make sure the directory exists
2246if test ! -d $piddir ; then
2247 piddir=`eval echo ${sysconfdir}`
2248 case $piddir in
2249 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2250 esac
2251fi
2252
Tim Rice88f2ab52002-03-17 12:17:34 -08002253AC_ARG_WITH(pid-dir,
2254 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2255 [
2256 if test "x$withval" != "xno" ; then
2257 piddir=$withval
2258 if test ! -d $piddir ; then
2259 AC_MSG_WARN([** no $piddir directory on this system **])
2260 fi
2261 fi
2262 ]
2263)
2264
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002265AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002266AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002267
andre2ff7b5d2000-06-03 14:57:40 +00002268dnl allow user to disable some login recording features
2269AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002270 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002271 [
2272 if test "x$enableval" = "xno" ; then
2273 AC_DEFINE(DISABLE_LASTLOG)
2274 fi
2275 ]
andre2ff7b5d2000-06-03 14:57:40 +00002276)
2277AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002278 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002279 [
2280 if test "x$enableval" = "xno" ; then
2281 AC_DEFINE(DISABLE_UTMP)
2282 fi
2283 ]
andre2ff7b5d2000-06-03 14:57:40 +00002284)
2285AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002286 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002287 [
2288 if test "x$enableval" = "xno" ; then
2289 AC_DEFINE(DISABLE_UTMPX)
2290 fi
2291 ]
andre2ff7b5d2000-06-03 14:57:40 +00002292)
2293AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002294 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002295 [
2296 if test "x$enableval" = "xno" ; then
2297 AC_DEFINE(DISABLE_WTMP)
2298 fi
2299 ]
andre2ff7b5d2000-06-03 14:57:40 +00002300)
2301AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002302 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002303 [
2304 if test "x$enableval" = "xno" ; then
2305 AC_DEFINE(DISABLE_WTMPX)
2306 fi
2307 ]
andre2ff7b5d2000-06-03 14:57:40 +00002308)
2309AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002310 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002311 [
2312 if test "x$enableval" = "xno" ; then
2313 AC_DEFINE(DISABLE_LOGIN)
2314 fi
2315 ]
andre2ff7b5d2000-06-03 14:57:40 +00002316)
2317AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002318 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002319 [
2320 if test "x$enableval" = "xno" ; then
2321 AC_DEFINE(DISABLE_PUTUTLINE)
2322 fi
2323 ]
andre2ff7b5d2000-06-03 14:57:40 +00002324)
2325AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002326 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002327 [
2328 if test "x$enableval" = "xno" ; then
2329 AC_DEFINE(DISABLE_PUTUTXLINE)
2330 fi
2331 ]
andre2ff7b5d2000-06-03 14:57:40 +00002332)
2333AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002334 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002335 [
2336 if test "x$withval" = "xno" ; then
2337 AC_DEFINE(DISABLE_LASTLOG)
2338 else
2339 conf_lastlog_location=$withval
2340 fi
2341 ]
2342)
andre2ff7b5d2000-06-03 14:57:40 +00002343
2344dnl lastlog, [uw]tmpx? detection
2345dnl NOTE: set the paths in the platform section to avoid the
2346dnl need for command-line parameters
2347dnl lastlog and [uw]tmp are subject to a file search if all else fails
2348
2349dnl lastlog detection
2350dnl NOTE: the code itself will detect if lastlog is a directory
2351AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2352AC_TRY_COMPILE([
2353#include <sys/types.h>
2354#include <utmp.h>
2355#ifdef HAVE_LASTLOG_H
2356# include <lastlog.h>
2357#endif
Damien Miller2994e082000-06-04 15:51:47 +10002358#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002359# include <paths.h>
2360#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002361#ifdef HAVE_LOGIN_H
2362# include <login.h>
2363#endif
andre2ff7b5d2000-06-03 14:57:40 +00002364 ],
2365 [ char *lastlog = LASTLOG_FILE; ],
2366 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002367 [
2368 AC_MSG_RESULT(no)
2369 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2370 AC_TRY_COMPILE([
2371#include <sys/types.h>
2372#include <utmp.h>
2373#ifdef HAVE_LASTLOG_H
2374# include <lastlog.h>
2375#endif
2376#ifdef HAVE_PATHS_H
2377# include <paths.h>
2378#endif
2379 ],
2380 [ char *lastlog = _PATH_LASTLOG; ],
2381 [ AC_MSG_RESULT(yes) ],
2382 [
andree441aa32000-06-12 22:34:38 +00002383 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002384 system_lastlog_path=no
2385 ])
2386 ]
andre2ff7b5d2000-06-03 14:57:40 +00002387)
Damien Miller2994e082000-06-04 15:51:47 +10002388
andre2ff7b5d2000-06-03 14:57:40 +00002389if test -z "$conf_lastlog_location"; then
2390 if test x"$system_lastlog_path" = x"no" ; then
2391 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002392 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002393 conf_lastlog_location=$f
2394 fi
2395 done
2396 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002397 AC_MSG_WARN([** Cannot find lastlog **])
2398 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002399 fi
2400 fi
2401fi
2402
2403if test -n "$conf_lastlog_location"; then
2404 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2405fi
2406
2407dnl utmp detection
2408AC_MSG_CHECKING([if your system defines UTMP_FILE])
2409AC_TRY_COMPILE([
2410#include <sys/types.h>
2411#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002412#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002413# include <paths.h>
2414#endif
2415 ],
2416 [ char *utmp = UTMP_FILE; ],
2417 [ AC_MSG_RESULT(yes) ],
2418 [ AC_MSG_RESULT(no)
2419 system_utmp_path=no ]
2420)
2421if test -z "$conf_utmp_location"; then
2422 if test x"$system_utmp_path" = x"no" ; then
2423 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2424 if test -f $f ; then
2425 conf_utmp_location=$f
2426 fi
2427 done
2428 if test -z "$conf_utmp_location"; then
2429 AC_DEFINE(DISABLE_UTMP)
2430 fi
2431 fi
2432fi
2433if test -n "$conf_utmp_location"; then
2434 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2435fi
2436
2437dnl wtmp detection
2438AC_MSG_CHECKING([if your system defines WTMP_FILE])
2439AC_TRY_COMPILE([
2440#include <sys/types.h>
2441#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002442#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002443# include <paths.h>
2444#endif
2445 ],
2446 [ char *wtmp = WTMP_FILE; ],
2447 [ AC_MSG_RESULT(yes) ],
2448 [ AC_MSG_RESULT(no)
2449 system_wtmp_path=no ]
2450)
2451if test -z "$conf_wtmp_location"; then
2452 if test x"$system_wtmp_path" = x"no" ; then
2453 for f in /usr/adm/wtmp /var/log/wtmp; do
2454 if test -f $f ; then
2455 conf_wtmp_location=$f
2456 fi
2457 done
2458 if test -z "$conf_wtmp_location"; then
2459 AC_DEFINE(DISABLE_WTMP)
2460 fi
2461 fi
2462fi
2463if test -n "$conf_wtmp_location"; then
2464 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2465fi
2466
2467
2468dnl utmpx detection - I don't know any system so perverse as to require
2469dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2470dnl there, though.
2471AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2472AC_TRY_COMPILE([
2473#include <sys/types.h>
2474#include <utmp.h>
2475#ifdef HAVE_UTMPX_H
2476#include <utmpx.h>
2477#endif
Damien Miller2994e082000-06-04 15:51:47 +10002478#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002479# include <paths.h>
2480#endif
2481 ],
2482 [ char *utmpx = UTMPX_FILE; ],
2483 [ AC_MSG_RESULT(yes) ],
2484 [ AC_MSG_RESULT(no)
2485 system_utmpx_path=no ]
2486)
2487if test -z "$conf_utmpx_location"; then
2488 if test x"$system_utmpx_path" = x"no" ; then
2489 AC_DEFINE(DISABLE_UTMPX)
2490 fi
2491else
2492 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2493fi
2494
2495dnl wtmpx detection
2496AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2497AC_TRY_COMPILE([
2498#include <sys/types.h>
2499#include <utmp.h>
2500#ifdef HAVE_UTMPX_H
2501#include <utmpx.h>
2502#endif
Damien Miller2994e082000-06-04 15:51:47 +10002503#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002504# include <paths.h>
2505#endif
2506 ],
2507 [ char *wtmpx = WTMPX_FILE; ],
2508 [ AC_MSG_RESULT(yes) ],
2509 [ AC_MSG_RESULT(no)
2510 system_wtmpx_path=no ]
2511)
2512if test -z "$conf_wtmpx_location"; then
2513 if test x"$system_wtmpx_path" = x"no" ; then
2514 AC_DEFINE(DISABLE_WTMPX)
2515 fi
2516else
2517 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2518fi
2519
Damien Miller4018c192000-04-30 09:30:44 +10002520
Damien Miller29ea30d2000-03-17 10:54:15 +11002521if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002522 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2523 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002524fi
2525
Tim Rice4cec93f2002-02-26 08:40:48 -08002526dnl remove pam and dl because they are in $LIBPAM
2527if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002528 LIBS=`echo $LIBS | sed 's/-lpam //'`
2529fi
2530if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2531 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002532fi
2533
Damien Millerbac2d8a2000-09-05 16:13:06 +11002534AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002535AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2536AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002537
Damien Miller7b22d652000-06-18 14:07:04 +10002538# Print summary of options
2539
Damien Miller7b22d652000-06-18 14:07:04 +10002540# Someone please show me a better way :)
2541A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2542B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2543C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2544D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002545E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002546F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002547G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002548H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2549I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2550J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002551
2552echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002553echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002554echo " User binaries: $B"
2555echo " System binaries: $C"
2556echo " Configuration files: $D"
2557echo " Askpass program: $E"
2558echo " Manual pages: $F"
2559echo " PID file: $G"
2560echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002561if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002562echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002563else
Damien Millerf58c6722002-05-13 13:15:42 +10002564echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002565fi
Damien Millera18bbd32002-05-13 10:48:57 +10002566if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002567echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002568fi
Damien Millerf58c6722002-05-13 13:15:42 +10002569echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002570echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002571echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002572echo " KerberosV support: $KRB5_MSG"
2573echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002574echo " S/KEY support: $SKEY_MSG"
2575echo " TCP Wrappers support: $TCPW_MSG"
2576echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002577echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002578echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2579echo " BSD Auth support: $BSD_AUTH_MSG"
2580echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002581if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002582echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002583fi
2584
Damien Miller7b22d652000-06-18 14:07:04 +10002585echo ""
2586
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002587echo " Host: ${host}"
2588echo " Compiler: ${CC}"
2589echo " Compiler flags: ${CFLAGS}"
2590echo "Preprocessor flags: ${CPPFLAGS}"
2591echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002592echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002593
2594echo ""
2595
Damien Miller82cf0ce2000-12-20 13:34:48 +11002596if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002597 echo "PAM is enabled. You may need to install a PAM control file "
2598 echo "for sshd, otherwise password authentication may fail. "
2599 echo "Example PAM control files can be found in the contrib/ "
2600 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002601 echo ""
2602fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002603
Damien Miller6c21c512002-01-22 21:57:53 +11002604if test ! -z "$RAND_HELPER_CMDHASH" ; then
2605 echo "WARNING: you are using the builtin random number collection "
2606 echo "service. Please read WARNING.RNG and request that your OS "
2607 echo "vendor includes kernel-based random number collection in "
2608 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002609 echo ""
2610fi
Damien Miller60396b02001-02-18 17:01:00 +11002611