blob: 3d5389cced421384ec7f3c5b481f61d3f858f970 [file] [log] [blame]
Tim Riceae477e92003-09-12 18:15:15 -07001# $Id: configure.ac,v 1.153 2003/09/13 01:15:15 tim 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.
Darren Tucker167bd9c2003-09-07 12:34:54 +100012AC_PROG_AWK
Damien Millerab18c411999-11-11 10:40:23 +110013AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100014AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110015AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000016AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070017AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080018AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110019AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100020AC_PATH_PROG(ENT, ent)
21AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110022AC_PATH_PROG(TEST_MINUS_S_SH, bash)
23AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
24AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070025AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110026
Damien Millere8bb4502001-09-25 16:39:35 +100027# System features
28AC_SYS_LARGEFILE
29
Damien Miller3f62aba2000-11-29 11:56:35 +110030if test -z "$AR" ; then
31 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
32fi
33
Damien Millerad833b32000-08-23 10:46:23 +100034# Use LOGIN_PROGRAM from environment if possible
35if test ! -z "$LOGIN_PROGRAM" ; then
36 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
37else
38 # Search for login
39 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
40 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
41 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
42 fi
43fi
44
Damien Miller166bd442000-03-16 10:48:25 +110045if test -z "$LD" ; then
46 LD=$CC
47fi
48AC_SUBST(LD)
49
Damien Miller166bd442000-03-16 10:48:25 +110050AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100051if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
52 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110053fi
54
Damien Millera22ba012000-03-02 23:09:20 +110055# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110056case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110057*-*-aix*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000058 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110059 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100060 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
61 if (test -z "$blibpath"); then
62 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110063 fi
Damien Millereab4bae2003-04-29 23:22:40 +100064 saved_LDFLAGS="$LDFLAGS"
65 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
66 if (test -z "$blibflags"); then
67 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
68 AC_TRY_LINK([], [], [blibflags=$tryflags])
69 fi
70 done
71 if (test -z "$blibflags"); then
72 AC_MSG_RESULT(not found)
73 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
74 else
75 AC_MSG_RESULT($blibflags)
76 fi
77 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100078 dnl Check for authenticate. Might be in libs.a on older AIXes
79 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070080 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100081 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070082 LIBS="$LIBS -ls"
83 ])
84 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100085 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
86 AC_CHECK_DECL(loginfailed,
87 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
88 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100089 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +100090 [(void)loginfailed("user","host","tty",0);],
91 [AC_MSG_RESULT(yes)
92 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +100093 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +100094 )],
95 [],
96 [#include <usersec.h>]
97 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +100098 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +110099 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +1000100 AC_DEFINE(BROKEN_REALPATH)
Darren Tucker9f18be62003-09-06 16:44:39 +1000101 AC_DEFINE(SETEUID_BREAKS_SETUID)
102 AC_DEFINE(BROKEN_SETREUID)
103 AC_DEFINE(BROKEN_SETREGID)
andre60f3c982000-06-03 16:18:19 +0000104 dnl AIX handles lastlog as part of its login message
105 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000106 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000107 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100108 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100109*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100110 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800111 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100112 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000113 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100114 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100115 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000116 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000117 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700118 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000119 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100120 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000121*-*-dgux*)
122 AC_DEFINE(IP_TOS_IS_BROKEN)
123 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000124*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000125 AC_MSG_CHECKING(if we have working getaddrinfo)
126 AC_TRY_RUN([#include <mach-o/dyld.h>
127main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
128 exit(0);
129 else
130 exit(1);
131}], [AC_MSG_RESULT(working)],
132 [AC_MSG_RESULT(buggy)
133 AC_DEFINE(BROKEN_GETADDRINFO)],
134 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000135 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000136*-*-hpux10.26)
137 if test -z "$GCC"; then
138 CFLAGS="$CFLAGS -Ae"
139 fi
140 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
141 IPADDR_IN_DISPLAY=yes
142 AC_DEFINE(HAVE_SECUREWARE)
143 AC_DEFINE(USE_PIPES)
144 AC_DEFINE(LOGIN_NO_ENDOPT)
145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
146 AC_DEFINE(DISABLE_SHADOW)
147 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000148 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000149 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700150 LIBS="$LIBS -lsec -lsecpw"
151 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000152 disable_ptmx_check=yes
153 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100154*-*-hpux10*)
155 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000156 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100157 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000158 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100159 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000160 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000161 AC_DEFINE(LOGIN_NO_ENDOPT)
162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100163 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100164 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000165 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000166 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700167 LIBS="$LIBS -lsec"
168 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100169 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000170*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000171 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100172 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100173 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100174 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000175 AC_DEFINE(LOGIN_NO_ENDOPT)
176 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100177 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100178 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000179 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000180 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700181 LIBS="$LIBS -lsec"
182 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000183 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100184*-*-irix5*)
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 Miller11fa2cc2000-08-16 10:35:58 +1000188 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000189 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000190 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100191 ;;
192*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000194 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100195 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000196 AC_DEFINE(WITH_IRIX_ARRAY)
197 AC_DEFINE(WITH_IRIX_PROJECT)
198 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000199 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000200 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000201 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000202 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100203 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100204*-*-linux*)
205 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100206 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000207 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100208 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000209 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000210 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000211 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100212 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000213 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000214 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000215 AC_DEFINE(BROKEN_CMSG_TYPE)
216 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000217 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100218 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000219mips-sony-bsd|mips-sony-newsos4)
220 AC_DEFINE(HAVE_NEWS4)
221 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000222 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100223*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000224 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100225 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100226 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100227*-*-freebsd*)
228 check_for_libcrypt_later=1
229 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000230*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000231 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100232 conf_utmp_location=/etc/utmp
233 conf_wtmp_location=/usr/adm/wtmp
234 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000235 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000236 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000237 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100238 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000240 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000241 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100242*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000243 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000244 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100245 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100246 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000247 AC_DEFINE(LOGIN_NEEDS_UTMPX)
248 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000249 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000250 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000251 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
252 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000253 # hardwire lastlog location (can't detect it on some versions)
254 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000255 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
256 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
257 if test "$sol2ver" -ge 8; then
258 AC_MSG_RESULT(yes)
259 AC_DEFINE(DISABLE_UTMP)
260 AC_DEFINE(DISABLE_WTMP)
261 else
262 AC_MSG_RESULT(no)
263 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100264 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000265*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000266 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000267 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100268 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000269 conf_utmp_location=/etc/utmp
270 conf_wtmp_location=/var/adm/wtmp
271 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000272 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000273 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000274*-ncr-sysv*)
275 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
276 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700277 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000278 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000279 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000280 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000281*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000282 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700283 # /usr/ucblib MUST NOT be searched on ReliantUNIX
284 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100285 IPADDR_IN_DISPLAY=yes
286 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000287 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000288 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700289 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
290 # Attention: always take care to bind libsocket and libnsl before libc,
291 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000292 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100293*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000294 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100295 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100296 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700297 AC_DEFINE(SETEUID_BREAKS_SETUID)
298 AC_DEFINE(BROKEN_SETREUID)
299 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100300 ;;
301*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000302 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100303 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100304 AC_DEFINE(USE_PIPES)
Tim Riced546a842003-09-11 22:24:36 -0700305 AC_DEFINE(SETEUID_BREAKS_SETUID)
306 AC_DEFINE(BROKEN_SETREUID)
307 AC_DEFINE(BROKEN_SETREGID)
Damien Miller78315eb2000-09-29 23:01:36 +1100308 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100309*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000310 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100311 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100312 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100313*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000314 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100315 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700316 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100317 RANLIB=true
318 no_dev_ptmx=1
319 AC_DEFINE(BROKEN_SYS_TERMIO_H)
320 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000321 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000322 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100323 AC_DEFINE(BROKEN_SAVED_UIDS)
Tim Riceae477e92003-09-12 18:15:15 -0700324 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100325 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700326 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700327 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100328 ;;
329*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800330 if test -z "$GCC"; then
331 CFLAGS="$CFLAGS -belf"
332 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000333 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000334 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100335 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000336 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100337 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000338 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000339 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700340 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700341 AC_DEFINE(SETEUID_BREAKS_SETUID)
342 AC_DEFINE(BROKEN_SETREUID)
343 AC_DEFINE(BROKEN_SETREGID)
Tim Riceae477e92003-09-12 18:15:15 -0700344 AC_DEFINE(WITH_ABBREV_NO_TTY)
Damien Miller217f5672001-02-16 12:12:41 +1100345 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700346 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000347 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000348*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000349 AC_DEFINE(USE_PIPES)
350 AC_DEFINE(DISABLE_FD_PASSING)
351 LDFLAGS="$LDFLAGS"
352 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
353 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000354 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000355*-*-unicosmp*)
356 AC_DEFINE(WITH_ABBREV_NO_TTY)
357 AC_DEFINE(USE_PIPES)
358 AC_DEFINE(DISABLE_FD_PASSING)
359 LDFLAGS="$LDFLAGS"
360 LIBS="$LIBS -lgen -lacid"
361 MANTYPE=cat
362 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000363*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000364 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700365 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700366 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000367 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
368 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
369 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700370 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000371*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000372 AC_MSG_CHECKING(for Digital Unix SIA)
373 no_osfsia=""
374 AC_ARG_WITH(osfsia,
375 [ --with-osfsia Enable Digital Unix SIA],
376 [
377 if test "x$withval" = "xno" ; then
378 AC_MSG_RESULT(disabled)
379 no_osfsia=1
380 fi
381 ],
382 )
383 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000384 if test -f /etc/sia/matrix.conf; then
385 AC_MSG_RESULT(yes)
386 AC_DEFINE(HAVE_OSF_SIA)
387 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000388 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000389 LIBS="$LIBS -lsecurity -ldb -lm -laud"
390 else
391 AC_MSG_RESULT(no)
392 fi
393 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000394 AC_DEFINE(DISABLE_FD_PASSING)
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000395 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tuckere41bba52003-08-25 11:51:19 +1000396 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000397 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000398
399*-*-nto-qnx)
400 AC_DEFINE(USE_PIPES)
401 AC_DEFINE(NO_X11_UNIX_SOCKETS)
402 AC_DEFINE(MISSING_NFDBITS)
403 AC_DEFINE(MISSING_HOWMANY)
404 AC_DEFINE(MISSING_FD_MASK)
405 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100406esac
407
Damien Millere37bfc12000-06-05 09:37:43 +1000408# Allow user to specify flags
409AC_ARG_WITH(cflags,
410 [ --with-cflags Specify additional flags to pass to compiler],
411 [
412 if test "x$withval" != "xno" ; then
413 CFLAGS="$CFLAGS $withval"
414 fi
415 ]
416)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000417AC_ARG_WITH(cppflags,
418 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
419 [
420 if test "x$withval" != "xno"; then
421 CPPFLAGS="$CPPFLAGS $withval"
422 fi
423 ]
424)
Damien Millere37bfc12000-06-05 09:37:43 +1000425AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000426 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000427 [
428 if test "x$withval" != "xno" ; then
429 LDFLAGS="$LDFLAGS $withval"
430 fi
431 ]
432)
433AC_ARG_WITH(libs,
434 [ --with-libs Specify additional libraries to link with],
435 [
436 if test "x$withval" != "xno" ; then
437 LIBS="$LIBS $withval"
438 fi
439 ]
440)
441
Darren Tucker6eb93042003-06-29 21:30:41 +1000442AC_MSG_CHECKING(compiler and flags for sanity)
443AC_TRY_RUN([
444#include <stdio.h>
445int main(){exit(0);}
446 ],
447 [ AC_MSG_RESULT(yes) ],
448 [
449 AC_MSG_RESULT(no)
450 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
451 ]
452)
453
Tim Rice4cec93f2002-02-26 08:40:48 -0800454# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000455AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000456 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800457 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000458 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000459 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000460 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
461 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000462 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700463 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800464 util.h utime.h utmp.h utmpx.h)
465
Damien Millera22ba012000-03-02 23:09:20 +1100466# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700467AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
468AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000469
Damien Millerdf288022001-02-18 13:07:07 +1100470dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700471if test "x$with_tcp_wrappers" != "xno" ; then
472 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
473 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
474 fi
475fi
Damien Millerdf288022001-02-18 13:07:07 +1100476
Tim Rice1e1ef642003-09-11 22:19:31 -0700477dnl IRIX and Solaris 2.5.1 have dirname() in libgen
478AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
479 AC_CHECK_LIB(gen, dirname,[
480 AC_CACHE_CHECK([for broken dirname],
481 ac_cv_have_broken_dirname, [
482 save_LIBS="$LIBS"
483 LIBS="$LIBS -lgen"
484 AC_TRY_RUN(
485 [
486#include <libgen.h>
487#include <string.h>
488
489int main(int argc, char **argv) {
490 char *s, buf[32];
491
492 strncpy(buf,"/etc", 32);
493 s = dirname(buf);
494 if (!s || strncmp(s, "/", 32) != 0) {
495 exit(1);
496 } else {
497 exit(0);
498 }
499}
500 ],
501 [ ac_cv_have_broken_dirname="no" ],
502 [ ac_cv_have_broken_dirname="yes" ]
503 )
504 LIBS="$save_LIBS"
505 ])
506 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
507 LIBS="$LIBS -lgen"
508 AC_DEFINE(HAVE_DIRNAME)
509 AC_CHECK_HEADERS(libgen.h)
510 fi
511 ])
512])
513
514AC_CHECK_FUNC(getspnam, ,
515 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
516AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
517
Damien Miller150c8b52002-02-13 23:06:56 +1100518AC_ARG_WITH(rpath,
519 [ --without-rpath Disable auto-added -R linker paths],
520 [
521 if test "x$withval" = "xno" ; then
522 need_dash_r=""
523 fi
524 if test "x$withval" = "xyes" ; then
525 need_dash_r=1
526 fi
527 ]
528)
529
Tim Rice13aae5e2001-10-21 17:53:58 -0700530dnl zlib is required
531AC_ARG_WITH(zlib,
532 [ --with-zlib=PATH Use zlib in PATH],
533 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000534 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100535 AC_MSG_ERROR([*** zlib is required ***])
536 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700537 if test -d "$withval/lib"; then
538 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700539 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700540 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700541 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700542 fi
543 else
544 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700545 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700546 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700547 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700548 fi
549 fi
550 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700551 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700552 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700553 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700554 fi
555 ]
556)
557
Tim Rice17b93e52001-10-23 22:36:54 -0700558AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100559
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000560dnl UnixWare 2.x
561AC_CHECK_FUNC(strcasecmp,
562 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
563)
564AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700565 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
566 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000567)
Damien Millerab18c411999-11-11 10:40:23 +1100568
Tim Ricee589a292001-11-03 11:09:32 -0800569dnl Checks for libutil functions
570AC_CHECK_HEADERS(libutil.h)
571AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
572AC_CHECK_FUNCS(logout updwtmp logwtmp)
573
Ben Lindstrom8697e082001-02-24 21:41:10 +0000574AC_FUNC_STRFTIME
575
Damien Miller3c027682001-03-14 11:39:45 +1100576# Check for ALTDIRFUNC glob() extension
577AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
578AC_EGREP_CPP(FOUNDIT,
579 [
580 #include <glob.h>
581 #ifdef GLOB_ALTDIRFUNC
582 FOUNDIT
583 #endif
584 ],
585 [
586 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
587 AC_MSG_RESULT(yes)
588 ],
589 [
590 AC_MSG_RESULT(no)
591 ]
592)
Damien Millerab18c411999-11-11 10:40:23 +1100593
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000594# Check for g.gl_matchc glob() extension
595AC_MSG_CHECKING(for gl_matchc field in glob_t)
596AC_EGREP_CPP(FOUNDIT,
597 [
598 #include <glob.h>
599 int main(void){glob_t g; g.gl_matchc = 1;}
600 ],
601 [
602 AC_DEFINE(GLOB_HAS_GL_MATCHC)
603 AC_MSG_RESULT(yes)
604 ],
605 [
606 AC_MSG_RESULT(no)
607 ]
608)
609
Damien Miller18bb4732001-03-28 14:35:30 +1000610AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
611AC_TRY_RUN(
612 [
613#include <sys/types.h>
614#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700615int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000616 ],
617 [AC_MSG_RESULT(yes)],
618 [
619 AC_MSG_RESULT(no)
620 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
621 ]
622)
623
Damien Millerc547bf12001-02-16 10:18:12 +1100624# Check whether user wants S/Key support
625SKEY_MSG="no"
626AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700627 [ --with-skey[[=PATH]] Enable S/Key support
628 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100629 [
630 if test "x$withval" != "xno" ; then
631
632 if test "x$withval" != "xyes" ; then
633 CPPFLAGS="$CPPFLAGS -I${withval}/include"
634 LDFLAGS="$LDFLAGS -L${withval}/lib"
635 fi
636
637 AC_DEFINE(SKEY)
638 LIBS="-lskey $LIBS"
639 SKEY_MSG="yes"
640
Tim Rice4cec93f2002-02-26 08:40:48 -0800641 AC_MSG_CHECKING([for s/key support])
642 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100643 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800644#include <stdio.h>
645#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700646int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800647 ],
648 [AC_MSG_RESULT(yes)],
649 [
650 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100651 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
652 ])
653 fi
654 ]
655)
656
657# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700658TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100659AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700660 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
661 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100662 [
663 if test "x$withval" != "xno" ; then
664 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700665 saved_LDFLAGS="$LDFLAGS"
666 saved_CPPFLAGS="$CPPFLAGS"
667 if test -n "${withval}" -a "${withval}" != "yes"; then
668 if test -d "${withval}/lib"; then
669 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700670 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700671 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700672 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700673 fi
674 else
675 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700676 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700677 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700678 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700679 fi
680 fi
681 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700682 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700683 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700684 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700685 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700686 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800687 LIBWRAP="-lwrap"
688 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100689 AC_MSG_CHECKING(for libwrap)
690 AC_TRY_LINK(
691 [
692#include <tcpd.h>
693 int deny_severity = 0, allow_severity = 0;
694 ],
695 [hosts_access(0);],
696 [
697 AC_MSG_RESULT(yes)
698 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800699 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700700 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100701 ],
702 [
703 AC_MSG_ERROR([*** libwrap missing])
704 ]
705 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800706 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100707 fi
708 ]
709)
710
Damien Millerfe1f1432003-02-24 15:45:42 +1100711dnl Checks for library functions. Please keep in alphabetical order
712AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000713 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
714 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100715 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000716 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100717 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000718 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
719 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
720 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000721 setproctitle setregid setresgid setresuid setreuid setrlimit \
722 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerb2427c82003-09-10 15:22:44 +1000723 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000724 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100725)
Tim Rice13aae5e2001-10-21 17:53:58 -0700726
Damien Millercd6853c2003-01-28 11:33:42 +1100727AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
728
Darren Tuckerf1159b52003-07-07 19:44:01 +1000729dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000730AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000731AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000732
Darren Tuckerb2427c82003-09-10 15:22:44 +1000733dnl tcsendbreak might be a macro
734AC_CHECK_DECL(tcsendbreak,
735 [AC_DEFINE(HAVE_TCSENDBREAK)],
736 [AC_CHECK_FUNCS(tcsendbreak)],
737 [#include <termios.h>]
738)
739
Damien Millerad833b32000-08-23 10:46:23 +1000740dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000741AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000742dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000743AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000744AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000745dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000746AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000747AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100748
Damien Miller04f80141999-11-19 15:32:34 +1100749AC_CHECK_FUNC(daemon,
750 [AC_DEFINE(HAVE_DAEMON)],
751 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
752)
753
Damien Miller9fb07e42000-03-05 16:22:59 +1100754AC_CHECK_FUNC(getpagesize,
755 [AC_DEFINE(HAVE_GETPAGESIZE)],
756 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
757)
758
Damien Millercb170cb2000-07-01 16:52:55 +1000759# Check for broken snprintf
760if test "x$ac_cv_func_snprintf" = "xyes" ; then
761 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
762 AC_TRY_RUN(
763 [
764#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700765int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000766 ],
767 [AC_MSG_RESULT(yes)],
768 [
769 AC_MSG_RESULT(no)
770 AC_DEFINE(BROKEN_SNPRINTF)
771 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
772 ]
773 )
774fi
775
Damien Millere8328192003-01-07 15:18:32 +1100776dnl see whether mkstemp() requires XXXXXX
777if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
778AC_MSG_CHECKING([for (overly) strict mkstemp])
779AC_TRY_RUN(
780 [
781#include <stdlib.h>
782main() { char template[]="conftest.mkstemp-test";
783if (mkstemp(template) == -1)
784 exit(1);
785unlink(template); exit(0);
786}
787 ],
788 [
789 AC_MSG_RESULT(no)
790 ],
791 [
792 AC_MSG_RESULT(yes)
793 AC_DEFINE(HAVE_STRICT_MKSTEMP)
794 ],
795 [
796 AC_MSG_RESULT(yes)
797 AC_DEFINE(HAVE_STRICT_MKSTEMP)
798 ]
799)
800fi
801
Darren Tucker70a3d552003-08-21 17:58:29 +1000802dnl make sure that openpty does not reacquire controlling terminal
803if test ! -z "$check_for_openpty_ctty_bug"; then
804 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
805 AC_TRY_RUN(
806 [
807#include <stdio.h>
808#include <sys/fcntl.h>
809#include <sys/types.h>
810#include <sys/wait.h>
811
812int
813main()
814{
815 pid_t pid;
816 int fd, ptyfd, ttyfd, status;
817
818 pid = fork();
819 if (pid < 0) { /* failed */
820 exit(1);
821 } else if (pid > 0) { /* parent */
822 waitpid(pid, &status, 0);
823 if (WIFEXITED(status))
824 exit(WEXITSTATUS(status));
825 else
826 exit(2);
827 } else { /* child */
828 close(0); close(1); close(2);
829 setsid();
830 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
831 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
832 if (fd >= 0)
833 exit(3); /* Acquired ctty: broken */
834 else
835 exit(0); /* Did not acquire ctty: OK */
836 }
837}
838 ],
839 [
840 AC_MSG_RESULT(yes)
841 ],
842 [
843 AC_MSG_RESULT(no)
844 AC_DEFINE(SSHD_ACQUIRES_CTTY)
845 ]
846 )
847fi
848
Damien Miller606f8802000-09-16 15:39:56 +1100849AC_FUNC_GETPGRP
850
Damien Millera64b57a2001-01-17 10:44:13 +1100851# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000852PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100853AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100854 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100855 [
Damien Millera64b57a2001-01-17 10:44:13 +1100856 if test "x$withval" != "xno" ; then
857 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
858 AC_MSG_ERROR([PAM headers not found])
859 fi
860
861 AC_CHECK_LIB(dl, dlopen, , )
862 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
863 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000864 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100865
866 disable_shadow=yes
867 PAM_MSG="yes"
868
869 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800870 if test $ac_cv_lib_dl_dlopen = yes; then
871 LIBPAM="-lpam -ldl"
872 else
873 LIBPAM="-lpam"
874 fi
875 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100876 fi
877 ]
878)
Damien Millera22ba012000-03-02 23:09:20 +1100879
Damien Millera64b57a2001-01-17 10:44:13 +1100880# Check for older PAM
881if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100882 # Check PAM strerror arguments (old PAM)
883 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
884 AC_TRY_COMPILE(
885 [
Damien Miller81171112000-04-23 11:14:01 +1000886#include <stdlib.h>
887#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100888 ],
889 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
890 [AC_MSG_RESULT(no)],
891 [
892 AC_DEFINE(HAVE_OLD_PAM)
893 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000894 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100895 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100896 )
Damien Millera22ba012000-03-02 23:09:20 +1100897fi
898
Damien Millerfc93d4b2002-09-04 23:26:29 +1000899# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
900# because the system crypt() is more featureful.
901if test "x$check_for_libcrypt_before" = "x1"; then
902 AC_CHECK_LIB(crypt, crypt)
903fi
904
Tim Riceaef73712002-05-11 13:17:42 -0700905# Search for OpenSSL
906saved_CPPFLAGS="$CPPFLAGS"
907saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100908AC_ARG_WITH(ssl-dir,
909 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
910 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000911 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700912 if test -d "$withval/lib"; then
913 if test -n "${need_dash_r}"; then
914 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
915 else
916 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
917 fi
918 else
919 if test -n "${need_dash_r}"; then
920 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
921 else
922 LDFLAGS="-L${withval} ${LDFLAGS}"
923 fi
924 fi
925 if test -d "$withval/include"; then
926 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
927 else
928 CPPFLAGS="-I${withval} ${CPPFLAGS}"
929 fi
Damien Millera22ba012000-03-02 23:09:20 +1100930 fi
931 ]
932)
Tim Riceaef73712002-05-11 13:17:42 -0700933LIBS="$LIBS -lcrypto"
934AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000935 [
Tim Riceaef73712002-05-11 13:17:42 -0700936 dnl Check default openssl install dir
937 if test -n "${need_dash_r}"; then
938 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000939 else
Tim Riceaef73712002-05-11 13:17:42 -0700940 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000941 fi
Tim Riceaef73712002-05-11 13:17:42 -0700942 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
943 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
944 [
945 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
946 ]
947 )
948 ]
949)
950
Tim Riced730b782002-08-13 18:52:10 -0700951# Determine OpenSSL header version
952AC_MSG_CHECKING([OpenSSL header version])
953AC_TRY_RUN(
954 [
955#include <stdio.h>
956#include <string.h>
957#include <openssl/opensslv.h>
958#define DATA "conftest.sslincver"
959int main(void) {
960 FILE *fd;
961 int rc;
962
963 fd = fopen(DATA,"w");
964 if(fd == NULL)
965 exit(1);
966
967 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
968 exit(1);
969
970 exit(0);
971}
972 ],
973 [
974 ssl_header_ver=`cat conftest.sslincver`
975 AC_MSG_RESULT($ssl_header_ver)
976 ],
977 [
978 AC_MSG_RESULT(not found)
979 AC_MSG_ERROR(OpenSSL version header not found.)
980 ]
981)
982
983# Determine OpenSSL library version
984AC_MSG_CHECKING([OpenSSL library version])
985AC_TRY_RUN(
986 [
987#include <stdio.h>
988#include <string.h>
989#include <openssl/opensslv.h>
990#include <openssl/crypto.h>
991#define DATA "conftest.ssllibver"
992int main(void) {
993 FILE *fd;
994 int rc;
995
996 fd = fopen(DATA,"w");
997 if(fd == NULL)
998 exit(1);
999
1000 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1001 exit(1);
1002
1003 exit(0);
1004}
1005 ],
1006 [
1007 ssl_library_ver=`cat conftest.ssllibver`
1008 AC_MSG_RESULT($ssl_library_ver)
1009 ],
1010 [
1011 AC_MSG_RESULT(not found)
1012 AC_MSG_ERROR(OpenSSL library not found.)
1013 ]
1014)
Damien Millera22ba012000-03-02 23:09:20 +11001015
Damien Millerec932372002-01-22 22:16:03 +11001016# Sanity check OpenSSL headers
1017AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1018AC_TRY_RUN(
1019 [
1020#include <string.h>
1021#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001022int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001023 ],
1024 [
1025 AC_MSG_RESULT(yes)
1026 ],
1027 [
1028 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001029 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1030Check config.log for details.
1031Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001032 ]
1033)
1034
Damien Millera64b57a2001-01-17 10:44:13 +11001035# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1036# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001037if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001038 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001039fi
1040
Damien Miller6c21c512002-01-22 21:57:53 +11001041
1042### Configure cryptographic random number support
1043
1044# Check wheter OpenSSL seeds itself
1045AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1046AC_TRY_RUN(
1047 [
1048#include <string.h>
1049#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001050int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001051 ],
1052 [
1053 OPENSSL_SEEDS_ITSELF=yes
1054 AC_MSG_RESULT(yes)
1055 ],
1056 [
1057 AC_MSG_RESULT(no)
1058 # Default to use of the rand helper if OpenSSL doesn't
1059 # seed itself
1060 USE_RAND_HELPER=yes
1061 ]
1062)
1063
1064
1065# Do we want to force the use of the rand helper?
1066AC_ARG_WITH(rand-helper,
1067 [ --with-rand-helper Use subprocess to gather strong randomness ],
1068 [
1069 if test "x$withval" = "xno" ; then
1070 # Force use of OpenSSL's internal RNG, even if
1071 # the previous test showed it to be unseeded.
1072 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1073 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1074 OPENSSL_SEEDS_ITSELF=yes
1075 USE_RAND_HELPER=""
1076 fi
1077 else
1078 USE_RAND_HELPER=yes
1079 fi
1080 ],
1081)
1082
1083# Which randomness source do we use?
1084if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1085 # OpenSSL only
1086 AC_DEFINE(OPENSSL_PRNG_ONLY)
1087 RAND_MSG="OpenSSL internal ONLY"
1088 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001089elif test ! -z "$USE_RAND_HELPER" ; then
1090 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001091 RAND_MSG="ssh-rand-helper"
1092 INSTALL_SSH_RAND_HELPER="yes"
1093fi
1094AC_SUBST(INSTALL_SSH_RAND_HELPER)
1095
1096### Configuration of ssh-rand-helper
1097
1098# PRNGD TCP socket
1099AC_ARG_WITH(prngd-port,
1100 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1101 [
Damien Millere996d722002-01-23 11:20:59 +11001102 case "$withval" in
1103 no)
1104 withval=""
1105 ;;
1106 [[0-9]]*)
1107 ;;
1108 *)
1109 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1110 ;;
1111 esac
1112 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001113 PRNGD_PORT="$withval"
1114 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1115 fi
1116 ]
1117)
1118
1119# PRNGD Unix domain socket
1120AC_ARG_WITH(prngd-socket,
1121 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1122 [
Damien Millere996d722002-01-23 11:20:59 +11001123 case "$withval" in
1124 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001125 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001126 ;;
1127 no)
1128 withval=""
1129 ;;
1130 /*)
1131 ;;
1132 *)
1133 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1134 ;;
1135 esac
1136
1137 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001138 if test ! -z "$PRNGD_PORT" ; then
1139 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1140 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001141 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001142 AC_MSG_WARN(Entropy socket is not readable)
1143 fi
1144 PRNGD_SOCKET="$withval"
1145 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1146 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001147 ],
1148 [
1149 # Check for existing socket only if we don't have a random device already
1150 if test "$USE_RAND_HELPER" = yes ; then
1151 AC_MSG_CHECKING(for PRNGD/EGD socket)
1152 # Insert other locations here
1153 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1154 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1155 PRNGD_SOCKET="$sock"
1156 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1157 break;
1158 fi
1159 done
1160 if test ! -z "$PRNGD_SOCKET" ; then
1161 AC_MSG_RESULT($PRNGD_SOCKET)
1162 else
1163 AC_MSG_RESULT(not found)
1164 fi
1165 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001166 ]
1167)
1168
1169# Change default command timeout for hashing entropy source
1170entropy_timeout=200
1171AC_ARG_WITH(entropy-timeout,
1172 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1173 [
1174 if test "x$withval" != "xno" ; then
1175 entropy_timeout=$withval
1176 fi
1177 ]
1178)
Damien Miller6c21c512002-01-22 21:57:53 +11001179AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1180
Damien Millerd3f6ad22002-06-25 10:24:47 +10001181SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001182AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001183 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001184 [
1185 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001186 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001187 fi
1188 ]
1189)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001190AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1191AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001192
Tim Rice88f2ab52002-03-17 12:17:34 -08001193# We do this little dance with the search path to insure
1194# that programs that we select for use by installed programs
1195# (which may be run by the super-user) come from trusted
1196# locations before they come from the user's private area.
1197# This should help avoid accidentally configuring some
1198# random version of a program in someone's personal bin.
1199
1200OPATH=$PATH
1201PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001202test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001203test -d /sbin && PATH=$PATH:/sbin
1204test -d /usr/sbin && PATH=$PATH:/usr/sbin
1205PATH=$PATH:/etc:$OPATH
1206
Damien Miller6c21c512002-01-22 21:57:53 +11001207# These programs are used by the command hashing source to gather entropy
1208OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1209OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1210OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1211OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1212OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1213OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1214OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1215OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1216OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1217OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1218OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1219OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1220OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1221OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1222OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1223OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001224# restore PATH
1225PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001226
1227# Where does ssh-rand-helper get its randomness from?
1228INSTALL_SSH_PRNG_CMDS=""
1229if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1230 if test ! -z "$PRNGD_PORT" ; then
1231 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1232 elif test ! -z "$PRNGD_SOCKET" ; then
1233 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1234 else
1235 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1236 RAND_HELPER_CMDHASH=yes
1237 INSTALL_SSH_PRNG_CMDS="yes"
1238 fi
1239fi
1240AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1241
1242
Ben Lindstromb5628642000-10-18 00:02:25 +00001243# Cheap hack to ensure NEWS-OS libraries are arranged right.
1244if test ! -z "$SONY" ; then
1245 LIBS="$LIBS -liberty";
1246fi
1247
Damien Millera22ba012000-03-02 23:09:20 +11001248# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001249AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001250AC_CHECK_SIZEOF(short int, 2)
1251AC_CHECK_SIZEOF(int, 4)
1252AC_CHECK_SIZEOF(long int, 4)
1253AC_CHECK_SIZEOF(long long int, 8)
1254
Damien Millerfa2bb692002-04-23 23:22:25 +10001255# Sanity check long long for some platforms (AIX)
1256if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1257 ac_cv_sizeof_long_long_int=0
1258fi
1259
Damien Millera22ba012000-03-02 23:09:20 +11001260# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001261AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1262 AC_TRY_COMPILE(
1263 [ #include <sys/types.h> ],
1264 [ u_int a; a = 1;],
1265 [ ac_cv_have_u_int="yes" ],
1266 [ ac_cv_have_u_int="no" ]
1267 )
1268])
1269if test "x$ac_cv_have_u_int" = "xyes" ; then
1270 AC_DEFINE(HAVE_U_INT)
1271 have_u_int=1
1272fi
1273
Damien Miller61e50f12000-05-08 20:49:37 +10001274AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1275 AC_TRY_COMPILE(
1276 [ #include <sys/types.h> ],
1277 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1278 [ ac_cv_have_intxx_t="yes" ],
1279 [ ac_cv_have_intxx_t="no" ]
1280 )
1281])
1282if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1283 AC_DEFINE(HAVE_INTXX_T)
1284 have_intxx_t=1
1285fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001286
1287if (test -z "$have_intxx_t" && \
1288 test "x$ac_cv_header_stdint_h" = "xyes")
1289then
1290 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1291 AC_TRY_COMPILE(
1292 [ #include <stdint.h> ],
1293 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1294 [
1295 AC_DEFINE(HAVE_INTXX_T)
1296 AC_MSG_RESULT(yes)
1297 ],
1298 [ AC_MSG_RESULT(no) ]
1299 )
1300fi
1301
Damien Miller578783e2000-09-23 14:12:24 +11001302AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1303 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001304 [
1305#include <sys/types.h>
1306#ifdef HAVE_STDINT_H
1307# include <stdint.h>
1308#endif
1309#include <sys/socket.h>
1310#ifdef HAVE_SYS_BITYPES_H
1311# include <sys/bitypes.h>
1312#endif
1313 ],
Damien Miller578783e2000-09-23 14:12:24 +11001314 [ int64_t a; a = 1;],
1315 [ ac_cv_have_int64_t="yes" ],
1316 [ ac_cv_have_int64_t="no" ]
1317 )
1318])
1319if test "x$ac_cv_have_int64_t" = "xyes" ; then
1320 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001321fi
1322
Damien Miller61e50f12000-05-08 20:49:37 +10001323AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1324 AC_TRY_COMPILE(
1325 [ #include <sys/types.h> ],
1326 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1327 [ ac_cv_have_u_intxx_t="yes" ],
1328 [ ac_cv_have_u_intxx_t="no" ]
1329 )
1330])
1331if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1332 AC_DEFINE(HAVE_U_INTXX_T)
1333 have_u_intxx_t=1
1334fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001335
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001336if test -z "$have_u_intxx_t" ; then
1337 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1338 AC_TRY_COMPILE(
1339 [ #include <sys/socket.h> ],
1340 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1341 [
1342 AC_DEFINE(HAVE_U_INTXX_T)
1343 AC_MSG_RESULT(yes)
1344 ],
1345 [ AC_MSG_RESULT(no) ]
1346 )
1347fi
1348
Damien Miller578783e2000-09-23 14:12:24 +11001349AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1350 AC_TRY_COMPILE(
1351 [ #include <sys/types.h> ],
1352 [ u_int64_t a; a = 1;],
1353 [ ac_cv_have_u_int64_t="yes" ],
1354 [ ac_cv_have_u_int64_t="no" ]
1355 )
1356])
1357if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1358 AC_DEFINE(HAVE_U_INT64_T)
1359 have_u_int64_t=1
1360fi
1361
Tim Rice4cec93f2002-02-26 08:40:48 -08001362if test -z "$have_u_int64_t" ; then
1363 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1364 AC_TRY_COMPILE(
1365 [ #include <sys/bitypes.h> ],
1366 [ u_int64_t a; a = 1],
1367 [
1368 AC_DEFINE(HAVE_U_INT64_T)
1369 AC_MSG_RESULT(yes)
1370 ],
1371 [ AC_MSG_RESULT(no) ]
1372 )
1373fi
1374
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001375if test -z "$have_u_intxx_t" ; then
1376 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1377 AC_TRY_COMPILE(
1378 [
1379#include <sys/types.h>
1380 ],
1381 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1382 [ ac_cv_have_uintxx_t="yes" ],
1383 [ ac_cv_have_uintxx_t="no" ]
1384 )
1385 ])
1386 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1387 AC_DEFINE(HAVE_UINTXX_T)
1388 fi
1389fi
1390
1391if test -z "$have_uintxx_t" ; then
1392 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1393 AC_TRY_COMPILE(
1394 [ #include <stdint.h> ],
1395 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1396 [
1397 AC_DEFINE(HAVE_UINTXX_T)
1398 AC_MSG_RESULT(yes)
1399 ],
1400 [ AC_MSG_RESULT(no) ]
1401 )
1402fi
1403
Damien Milleredb82922000-06-20 13:25:52 +10001404if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1405 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001406then
1407 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1408 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001409 [
1410#include <sys/bitypes.h>
1411 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001412 [
Damien Miller70494d12000-04-03 15:57:06 +10001413 int8_t a; int16_t b; int32_t c;
1414 u_int8_t e; u_int16_t f; u_int32_t g;
1415 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001416 ],
1417 [
1418 AC_DEFINE(HAVE_U_INTXX_T)
1419 AC_DEFINE(HAVE_INTXX_T)
1420 AC_MSG_RESULT(yes)
1421 ],
1422 [AC_MSG_RESULT(no)]
1423 )
1424fi
1425
Damien Miller58be7382001-09-15 21:31:54 +10001426
1427AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1428 AC_TRY_COMPILE(
1429 [
1430#include <sys/types.h>
1431 ],
1432 [ u_char foo; foo = 125; ],
1433 [ ac_cv_have_u_char="yes" ],
1434 [ ac_cv_have_u_char="no" ]
1435 )
1436])
1437if test "x$ac_cv_have_u_char" = "xyes" ; then
1438 AC_DEFINE(HAVE_U_CHAR)
1439fi
1440
Tim Rice13aae5e2001-10-21 17:53:58 -07001441TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001442
Tim Rice200a5c02002-02-26 22:12:34 -08001443AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001444
Damien Miller61e50f12000-05-08 20:49:37 +10001445AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1446 AC_TRY_COMPILE(
1447 [
1448#include <sys/types.h>
1449 ],
1450 [ size_t foo; foo = 1235; ],
1451 [ ac_cv_have_size_t="yes" ],
1452 [ ac_cv_have_size_t="no" ]
1453 )
1454])
1455if test "x$ac_cv_have_size_t" = "xyes" ; then
1456 AC_DEFINE(HAVE_SIZE_T)
1457fi
Damien Miller95058511999-12-29 10:36:45 +11001458
Damien Miller615f9392000-05-17 22:53:33 +10001459AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1460 AC_TRY_COMPILE(
1461 [
1462#include <sys/types.h>
1463 ],
1464 [ ssize_t foo; foo = 1235; ],
1465 [ ac_cv_have_ssize_t="yes" ],
1466 [ ac_cv_have_ssize_t="no" ]
1467 )
1468])
1469if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1470 AC_DEFINE(HAVE_SSIZE_T)
1471fi
1472
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001473AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1474 AC_TRY_COMPILE(
1475 [
1476#include <time.h>
1477 ],
1478 [ clock_t foo; foo = 1235; ],
1479 [ ac_cv_have_clock_t="yes" ],
1480 [ ac_cv_have_clock_t="no" ]
1481 )
1482])
1483if test "x$ac_cv_have_clock_t" = "xyes" ; then
1484 AC_DEFINE(HAVE_CLOCK_T)
1485fi
1486
Damien Millerb54b40e2000-06-23 08:23:34 +10001487AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1488 AC_TRY_COMPILE(
1489 [
1490#include <sys/types.h>
1491#include <sys/socket.h>
1492 ],
1493 [ sa_family_t foo; foo = 1235; ],
1494 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001495 [ AC_TRY_COMPILE(
1496 [
1497#include <sys/types.h>
1498#include <sys/socket.h>
1499#include <netinet/in.h>
1500 ],
1501 [ sa_family_t foo; foo = 1235; ],
1502 [ ac_cv_have_sa_family_t="yes" ],
1503
Damien Millerb54b40e2000-06-23 08:23:34 +10001504 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001505 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001506 )
1507])
1508if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1509 AC_DEFINE(HAVE_SA_FAMILY_T)
1510fi
1511
Damien Miller0f91b4e2000-06-18 15:43:25 +10001512AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1513 AC_TRY_COMPILE(
1514 [
1515#include <sys/types.h>
1516 ],
1517 [ pid_t foo; foo = 1235; ],
1518 [ ac_cv_have_pid_t="yes" ],
1519 [ ac_cv_have_pid_t="no" ]
1520 )
1521])
1522if test "x$ac_cv_have_pid_t" = "xyes" ; then
1523 AC_DEFINE(HAVE_PID_T)
1524fi
1525
1526AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1527 AC_TRY_COMPILE(
1528 [
1529#include <sys/types.h>
1530 ],
1531 [ mode_t foo; foo = 1235; ],
1532 [ ac_cv_have_mode_t="yes" ],
1533 [ ac_cv_have_mode_t="no" ]
1534 )
1535])
1536if test "x$ac_cv_have_mode_t" = "xyes" ; then
1537 AC_DEFINE(HAVE_MODE_T)
1538fi
1539
Damien Miller61e50f12000-05-08 20:49:37 +10001540
1541AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1542 AC_TRY_COMPILE(
1543 [
Damien Miller81171112000-04-23 11:14:01 +10001544#include <sys/types.h>
1545#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001546 ],
1547 [ struct sockaddr_storage s; ],
1548 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1549 [ ac_cv_have_struct_sockaddr_storage="no" ]
1550 )
1551])
1552if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1553 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1554fi
Damien Miller34132e52000-01-14 15:45:46 +11001555
Damien Miller61e50f12000-05-08 20:49:37 +10001556AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1557 AC_TRY_COMPILE(
1558 [
Damien Miller7b22d652000-06-18 14:07:04 +10001559#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001560#include <netinet/in.h>
1561 ],
1562 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1563 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1564 [ ac_cv_have_struct_sockaddr_in6="no" ]
1565 )
1566])
1567if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1568 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1569fi
Damien Miller34132e52000-01-14 15:45:46 +11001570
Damien Miller61e50f12000-05-08 20:49:37 +10001571AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1572 AC_TRY_COMPILE(
1573 [
Damien Miller7b22d652000-06-18 14:07:04 +10001574#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001575#include <netinet/in.h>
1576 ],
1577 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1578 [ ac_cv_have_struct_in6_addr="yes" ],
1579 [ ac_cv_have_struct_in6_addr="no" ]
1580 )
1581])
1582if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1583 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1584fi
Damien Miller34132e52000-01-14 15:45:46 +11001585
Damien Miller61e50f12000-05-08 20:49:37 +10001586AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1587 AC_TRY_COMPILE(
1588 [
Damien Miller81171112000-04-23 11:14:01 +10001589#include <sys/types.h>
1590#include <sys/socket.h>
1591#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001592 ],
1593 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1594 [ ac_cv_have_struct_addrinfo="yes" ],
1595 [ ac_cv_have_struct_addrinfo="no" ]
1596 )
1597])
1598if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1599 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1600fi
1601
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001602AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1603 AC_TRY_COMPILE(
1604 [ #include <sys/time.h> ],
1605 [ struct timeval tv; tv.tv_sec = 1;],
1606 [ ac_cv_have_struct_timeval="yes" ],
1607 [ ac_cv_have_struct_timeval="no" ]
1608 )
1609])
1610if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1611 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1612 have_struct_timeval=1
1613fi
1614
Tim Rice4e4dc562003-03-18 10:21:40 -08001615AC_CHECK_TYPES(struct timespec)
1616
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001617# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001618if test "x$ac_cv_have_int64_t" = "xno" -a \
1619 "x$ac_cv_sizeof_long_int" != "x8" -a \
1620 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001621 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1622 echo "an alternative compiler (I.E., GCC) before continuing."
1623 echo ""
1624 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001625else
1626dnl test snprintf (broken on SCO w/gcc)
1627 AC_TRY_RUN(
1628 [
1629#include <stdio.h>
1630#include <string.h>
1631#ifdef HAVE_SNPRINTF
1632main()
1633{
1634 char buf[50];
1635 char expected_out[50];
1636 int mazsize = 50 ;
1637#if (SIZEOF_LONG_INT == 8)
1638 long int num = 0x7fffffffffffffff;
1639#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001640 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001641#endif
1642 strcpy(expected_out, "9223372036854775807");
1643 snprintf(buf, mazsize, "%lld", num);
1644 if(strcmp(buf, expected_out) != 0)
1645 exit(1);
1646 exit(0);
1647}
1648#else
1649main() { exit(0); }
1650#endif
1651 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1652 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001653fi
1654
Damien Miller78315eb2000-09-29 23:01:36 +11001655dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001656OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1657OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1658OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1659OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1660OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001661OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001662OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1663OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001664OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001665OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1666OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1667OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1668OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001669OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1670OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1671OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1672OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001673
1674AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001675
Damien Miller61e50f12000-05-08 20:49:37 +10001676AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1677 ac_cv_have_ss_family_in_struct_ss, [
1678 AC_TRY_COMPILE(
1679 [
Damien Miller81171112000-04-23 11:14:01 +10001680#include <sys/types.h>
1681#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001682 ],
1683 [ struct sockaddr_storage s; s.ss_family = 1; ],
1684 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1685 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1686 )
1687])
1688if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1689 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1690fi
1691
Damien Miller61e50f12000-05-08 20:49:37 +10001692AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1693 ac_cv_have___ss_family_in_struct_ss, [
1694 AC_TRY_COMPILE(
1695 [
Damien Miller81171112000-04-23 11:14:01 +10001696#include <sys/types.h>
1697#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001698 ],
1699 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1700 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1701 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1702 )
1703])
1704if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1705 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1706fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001707
Damien Millerad833b32000-08-23 10:46:23 +10001708AC_CACHE_CHECK([for pw_class field in struct passwd],
1709 ac_cv_have_pw_class_in_struct_passwd, [
1710 AC_TRY_COMPILE(
1711 [
Damien Millerad833b32000-08-23 10:46:23 +10001712#include <pwd.h>
1713 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001714 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001715 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1716 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1717 )
1718])
1719if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1720 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1721fi
1722
Kevin Steves82456952001-06-22 21:14:18 +00001723AC_CACHE_CHECK([for pw_expire field in struct passwd],
1724 ac_cv_have_pw_expire_in_struct_passwd, [
1725 AC_TRY_COMPILE(
1726 [
1727#include <pwd.h>
1728 ],
1729 [ struct passwd p; p.pw_expire = 0; ],
1730 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1731 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1732 )
1733])
1734if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1735 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1736fi
1737
1738AC_CACHE_CHECK([for pw_change field in struct passwd],
1739 ac_cv_have_pw_change_in_struct_passwd, [
1740 AC_TRY_COMPILE(
1741 [
1742#include <pwd.h>
1743 ],
1744 [ struct passwd p; p.pw_change = 0; ],
1745 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1746 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1747 )
1748])
1749if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1750 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1751fi
Damien Miller61e50f12000-05-08 20:49:37 +10001752
Tim Rice28bbb0c2002-05-27 17:37:32 -07001753dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001754AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1755 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001756 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001757 [
Tim Riceae49fe62002-04-12 10:26:21 -07001758#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001759#include <sys/socket.h>
1760#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001761int main() {
1762#ifdef msg_accrights
1763exit(1);
1764#endif
1765struct msghdr m;
1766m.msg_accrights = 0;
1767exit(0);
1768}
Kevin Steves939c9db2002-03-22 17:23:25 +00001769 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001770 [ ac_cv_have_accrights_in_msghdr="yes" ],
1771 [ ac_cv_have_accrights_in_msghdr="no" ]
1772 )
1773])
1774if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1775 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1776fi
1777
Kevin Stevesa44e0352002-04-07 16:18:03 +00001778AC_CACHE_CHECK([for msg_control field in struct msghdr],
1779 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001780 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001781 [
Tim Riceae49fe62002-04-12 10:26:21 -07001782#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001783#include <sys/socket.h>
1784#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001785int main() {
1786#ifdef msg_control
1787exit(1);
1788#endif
1789struct msghdr m;
1790m.msg_control = 0;
1791exit(0);
1792}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001793 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001794 [ ac_cv_have_control_in_msghdr="yes" ],
1795 [ ac_cv_have_control_in_msghdr="no" ]
1796 )
1797])
1798if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1799 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1800fi
1801
Damien Miller61e50f12000-05-08 20:49:37 +10001802AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1803 AC_TRY_LINK([],
1804 [ extern char *__progname; printf("%s", __progname); ],
1805 [ ac_cv_libc_defines___progname="yes" ],
1806 [ ac_cv_libc_defines___progname="no" ]
1807 )
1808])
1809if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1810 AC_DEFINE(HAVE___PROGNAME)
1811fi
1812
Kevin Steves4846f4a2002-03-22 18:19:53 +00001813AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1814 AC_TRY_LINK([
1815#include <stdio.h>
1816],
1817 [ printf("%s", __FUNCTION__); ],
1818 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1819 [ ac_cv_cc_implements___FUNCTION__="no" ]
1820 )
1821])
1822if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1823 AC_DEFINE(HAVE___FUNCTION__)
1824fi
1825
1826AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1827 AC_TRY_LINK([
1828#include <stdio.h>
1829],
1830 [ printf("%s", __func__); ],
1831 [ ac_cv_cc_implements___func__="yes" ],
1832 [ ac_cv_cc_implements___func__="no" ]
1833 )
1834])
1835if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1836 AC_DEFINE(HAVE___func__)
1837fi
1838
Damien Miller4f8e6692001-07-14 13:22:53 +10001839AC_CACHE_CHECK([whether getopt has optreset support],
1840 ac_cv_have_getopt_optreset, [
1841 AC_TRY_LINK(
1842 [
1843#include <getopt.h>
1844 ],
1845 [ extern int optreset; optreset = 0; ],
1846 [ ac_cv_have_getopt_optreset="yes" ],
1847 [ ac_cv_have_getopt_optreset="no" ]
1848 )
1849])
1850if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1851 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1852fi
Damien Millera22ba012000-03-02 23:09:20 +11001853
Damien Millerecbb26d2000-07-15 14:59:14 +10001854AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1855 AC_TRY_LINK([],
1856 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1857 [ ac_cv_libc_defines_sys_errlist="yes" ],
1858 [ ac_cv_libc_defines_sys_errlist="no" ]
1859 )
1860])
1861if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1862 AC_DEFINE(HAVE_SYS_ERRLIST)
1863fi
1864
1865
Damien Miller11fa2cc2000-08-16 10:35:58 +10001866AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1867 AC_TRY_LINK([],
1868 [ extern int sys_nerr; printf("%i", sys_nerr);],
1869 [ ac_cv_libc_defines_sys_nerr="yes" ],
1870 [ ac_cv_libc_defines_sys_nerr="no" ]
1871 )
1872])
1873if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1874 AC_DEFINE(HAVE_SYS_NERR)
1875fi
1876
Damien Miller85de5802001-09-18 14:01:11 +10001877SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001878# Check whether user wants sectok support
1879AC_ARG_WITH(sectok,
1880 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001881 [
1882 if test "x$withval" != "xno" ; then
1883 if test "x$withval" != "xyes" ; then
1884 CPPFLAGS="$CPPFLAGS -I${withval}"
1885 LDFLAGS="$LDFLAGS -L${withval}"
1886 if test ! -z "$need_dash_r" ; then
1887 LDFLAGS="$LDFLAGS -R${withval}"
1888 fi
1889 if test ! -z "$blibpath" ; then
1890 blibpath="$blibpath:${withval}"
1891 fi
1892 fi
1893 AC_CHECK_HEADERS(sectok.h)
1894 if test "$ac_cv_header_sectok_h" != yes; then
1895 AC_MSG_ERROR(Can't find sectok.h)
1896 fi
1897 AC_CHECK_LIB(sectok, sectok_open)
1898 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1899 AC_MSG_ERROR(Can't find libsectok)
1900 fi
1901 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001902 AC_DEFINE(USE_SECTOK)
1903 SCARD_MSG="yes, using sectok"
1904 fi
1905 ]
1906)
1907
1908# Check whether user wants OpenSC support
1909AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001910 AC_HELP_STRING([--with-opensc=PFX],
1911 [Enable smartcard support using OpenSC]),
1912 opensc_config_prefix="$withval", opensc_config_prefix="")
1913if test x$opensc_config_prefix != x ; then
1914 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1915 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1916 if test "$OPENSC_CONFIG" != "no"; then
1917 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1918 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1919 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1920 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1921 AC_DEFINE(SMARTCARD)
1922 AC_DEFINE(USE_OPENSC)
1923 SCARD_MSG="yes, using OpenSC"
1924 fi
1925fi
Damien Miller85de5802001-09-18 14:01:11 +10001926
Damien Miller7abe09b2003-05-15 10:53:49 +10001927# Check whether user wants DNS support
1928DNS_MSG="no"
1929AC_ARG_WITH(dns,
1930 [ --with-dns Support for fetching keys from DNS (experimental)],
1931 [
1932 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001933 DNS_MSG="yes"
1934 AC_DEFINE(DNS)
1935 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001936 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1937 [
1938 # Needed by our getrrsetbyname()
1939 AC_SEARCH_LIBS(res_query, resolv)
1940 AC_SEARCH_LIBS(dn_expand, resolv)
Tim Rice0ac16a42003-09-08 06:33:33 -07001941 AC_CHECK_FUNCS(_getshort _getlong)
Tim Riceb284e162003-09-08 14:35:16 -07001942 AC_CHECK_MEMBER(HEADER.ad,
1943 [AC_DEFINE(HAVE_HEADER_AD)],,
1944 [#include <arpa/nameser.h>])
Damien Miller200d0a72003-06-30 19:21:36 +10001945 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001946 fi
1947 ]
1948)
1949
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001950# Check whether user wants Kerberos 5 support
1951KRB5_MSG="no"
1952AC_ARG_WITH(kerberos5,
1953 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1954 [
1955 if test "x$withval" != "xno" ; then
1956 if test "x$withval" = "xyes" ; then
1957 KRB5ROOT="/usr/local"
1958 else
1959 KRB5ROOT=${withval}
1960 fi
1961 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1962 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1963 AC_DEFINE(KRB5)
1964 KRB5_MSG="yes"
1965 AC_MSG_CHECKING(whether we are using Heimdal)
1966 AC_TRY_COMPILE([ #include <krb5.h> ],
1967 [ char *tmp = heimdal_version; ],
1968 [ AC_MSG_RESULT(yes)
1969 AC_DEFINE(HEIMDAL)
1970 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1971 ],
1972 [ AC_MSG_RESULT(no)
1973 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1974 ]
1975 )
1976 if test ! -z "$need_dash_r" ; then
1977 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1978 fi
1979 if test ! -z "$blibpath" ; then
1980 blibpath="$blibpath:${KRB5ROOT}/lib"
1981 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001982 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001983
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001984 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1985 [ AC_DEFINE(GSSAPI)
1986 K5LIBS="-lgssapi $K5LIBS" ],
1987 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1988 [ AC_DEFINE(GSSAPI)
1989 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1990 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1991 $K5LIBS)
1992 ],
1993 $K5LIBS)
1994
1995 AC_CHECK_HEADER(gssapi.h, ,
1996 [ unset ac_cv_header_gssapi_h
1997 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1998 AC_CHECK_HEADERS(gssapi.h, ,
1999 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2000 )
2001 ]
2002 )
2003
2004 oldCPP="$CPPFLAGS"
2005 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2006 AC_CHECK_HEADER(gssapi_krb5.h, ,
2007 [ CPPFLAGS="$oldCPP" ])
2008
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002009 KRB5=yes
2010 fi
2011 ]
2012)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002013LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002014
Damien Millera22ba012000-03-02 23:09:20 +11002015# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002016
Damien Millerf58c6722002-05-13 13:15:42 +10002017PRIVSEP_PATH=/var/empty
2018AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002019 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002020 [
2021 if test "x$withval" != "$no" ; then
2022 PRIVSEP_PATH=$withval
2023 fi
2024 ]
2025)
2026AC_SUBST(PRIVSEP_PATH)
2027
Damien Millera22ba012000-03-02 23:09:20 +11002028AC_ARG_WITH(xauth,
2029 [ --with-xauth=PATH Specify path to xauth program ],
2030 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002031 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002032 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002033 fi
2034 ],
2035 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002036 TestPath="$PATH"
2037 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2038 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2039 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2040 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2041 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002042 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002043 xauth_path="/usr/openwin/bin/xauth"
2044 fi
2045 ]
2046)
2047
Damien Miller7d901272003-01-13 16:55:22 +11002048STRIP_OPT=-s
2049AC_ARG_ENABLE(strip,
2050 [ --disable-strip Disable calling strip(1) on install],
2051 [
2052 if test "x$enableval" = "xno" ; then
2053 STRIP_OPT=
2054 fi
2055 ]
2056)
2057AC_SUBST(STRIP_OPT)
2058
Damien Millera19cf472000-11-29 13:28:50 +11002059if test -z "$xauth_path" ; then
2060 XAUTH_PATH="undefined"
2061 AC_SUBST(XAUTH_PATH)
2062else
Damien Millera22ba012000-03-02 23:09:20 +11002063 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002064 XAUTH_PATH=$xauth_path
2065 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002066fi
Damien Millera22ba012000-03-02 23:09:20 +11002067
2068# Check for mail directory (last resort if we cannot get it from headers)
2069if test ! -z "$MAIL" ; then
2070 maildir=`dirname $MAIL`
2071 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2072fi
2073
Damien Millera22ba012000-03-02 23:09:20 +11002074if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002075 if test "x$disable_ptmx_check" != "xyes" ; then
2076 AC_CHECK_FILE("/dev/ptmx",
2077 [
2078 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2079 have_dev_ptmx=1
2080 ]
2081 )
2082 fi
Damien Millera22ba012000-03-02 23:09:20 +11002083fi
Damien Miller204ad072000-03-02 23:56:12 +11002084AC_CHECK_FILE("/dev/ptc",
2085 [
2086 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2087 have_dev_ptc=1
2088 ]
2089)
2090
Damien Millera22ba012000-03-02 23:09:20 +11002091# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002092AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002093 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002094 [
Damien Miller897741e2001-04-16 10:41:46 +10002095 case "$withval" in
2096 man|cat|doc)
2097 MANTYPE=$withval
2098 ;;
2099 *)
2100 AC_MSG_ERROR(invalid man type: $withval)
2101 ;;
2102 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002103 ]
2104)
Ben Lindstrombc709922001-04-18 18:04:21 +00002105if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002106 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2107 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002108 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2109 MANTYPE=doc
2110 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2111 MANTYPE=man
2112 else
2113 MANTYPE=cat
2114 fi
2115fi
Damien Miller670a4b82000-01-22 13:53:11 +11002116AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002117if test "$MANTYPE" = "doc"; then
2118 mansubdir=man;
2119else
2120 mansubdir=$MANTYPE;
2121fi
2122AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002123
Damien Millera22ba012000-03-02 23:09:20 +11002124# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002125MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002126AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002127 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002128 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002129 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002130 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002131 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002132 fi
2133 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002134)
2135
Damien Millera22ba012000-03-02 23:09:20 +11002136# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002137AC_ARG_WITH(shadow,
2138 [ --without-shadow Disable shadow password support],
2139 [
2140 if test "x$withval" = "xno" ; then
2141 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002142 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002143 fi
2144 ]
2145)
2146
Damien Miller1f335fb2000-06-26 11:31:33 +10002147if test -z "$disable_shadow" ; then
2148 AC_MSG_CHECKING([if the systems has expire shadow information])
2149 AC_TRY_COMPILE(
2150 [
2151#include <sys/types.h>
2152#include <shadow.h>
2153 struct spwd sp;
2154 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2155 [ sp_expire_available=yes ], []
2156 )
2157
2158 if test "x$sp_expire_available" = "xyes" ; then
2159 AC_MSG_RESULT(yes)
2160 AC_DEFINE(HAS_SHADOW_EXPIRE)
2161 else
2162 AC_MSG_RESULT(no)
2163 fi
2164fi
2165
Damien Millera22ba012000-03-02 23:09:20 +11002166# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002167if test ! -z "$IPADDR_IN_DISPLAY" ; then
2168 DISPLAY_HACK_MSG="yes"
2169 AC_DEFINE(IPADDR_IN_DISPLAY)
2170else
2171 DISPLAY_HACK_MSG="no"
2172 AC_ARG_WITH(ipaddr-display,
2173 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2174 [
2175 if test "x$withval" != "xno" ; then
2176 AC_DEFINE(IPADDR_IN_DISPLAY)
2177 DISPLAY_HACK_MSG="yes"
2178 fi
2179 ]
2180 )
2181fi
Damien Miller76112de1999-12-21 11:18:08 +11002182
Tim Rice43a1c132002-04-17 21:19:14 -07002183dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2184if test $ac_cv_func_login_getcapbool = "yes" -a \
2185 $ac_cv_header_login_cap_h = "yes" ; then
2186 USES_LOGIN_CONF=yes
2187fi
Damien Millera22ba012000-03-02 23:09:20 +11002188# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002189SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002190AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002191 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002192 [
Tim Rice43a1c132002-04-17 21:19:14 -07002193 if test "$USES_LOGIN_CONF" = "yes" ; then
2194 AC_MSG_WARN([
2195--with-default-path=PATH has no effect on this system.
2196Edit /etc/login.conf instead.])
2197 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002198 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002199 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002200 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002201 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002202 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2203 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2204 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002205 AC_TRY_RUN(
2206 [
2207/* find out what STDPATH is */
2208#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002209#ifdef HAVE_PATHS_H
2210# include <paths.h>
2211#endif
2212#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002213# ifdef _PATH_USERPATH /* Irix */
2214# define _PATH_STDPATH _PATH_USERPATH
2215# else
2216# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2217# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002218#endif
2219#include <sys/types.h>
2220#include <sys/stat.h>
2221#include <fcntl.h>
2222#define DATA "conftest.stdpath"
2223
2224main()
2225{
2226 FILE *fd;
2227 int rc;
2228
2229 fd = fopen(DATA,"w");
2230 if(fd == NULL)
2231 exit(1);
2232
2233 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2234 exit(1);
2235
2236 exit(0);
2237}
2238 ], [ user_path=`cat conftest.stdpath` ],
2239 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2240 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2241 )
2242# make sure $bindir is in USER_PATH so scp will work
2243 t_bindir=`eval echo ${bindir}`
2244 case $t_bindir in
2245 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2246 esac
2247 case $t_bindir in
2248 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2249 esac
2250 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2251 if test $? -ne 0 ; then
2252 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2253 if test $? -ne 0 ; then
2254 user_path=$user_path:$t_bindir
2255 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2256 fi
2257 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002258 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002259)
Tim Rice43a1c132002-04-17 21:19:14 -07002260if test "$USES_LOGIN_CONF" != "yes" ; then
2261 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2262 AC_SUBST(user_path)
2263fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002264
Damien Millera18bbd32002-05-13 10:48:57 +10002265# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002266AC_ARG_WITH(superuser-path,
2267 [ --with-superuser-path= Specify different path for super-user],
2268 [
2269 if test "x$withval" != "xno" ; then
2270 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2271 superuser_path=$withval
2272 fi
2273 ]
2274)
2275
2276
Damien Miller61e50f12000-05-08 20:49:37 +10002277AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002278IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002279AC_ARG_WITH(4in6,
2280 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2281 [
2282 if test "x$withval" != "xno" ; then
2283 AC_MSG_RESULT(yes)
2284 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002285 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002286 else
2287 AC_MSG_RESULT(no)
2288 fi
2289 ],[
2290 if test "x$inet6_default_4in6" = "xyes"; then
2291 AC_MSG_RESULT([yes (default)])
2292 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002293 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002294 else
2295 AC_MSG_RESULT([no (default)])
2296 fi
2297 ]
2298)
2299
Damien Miller60396b02001-02-18 17:01:00 +11002300# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002301BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002302AC_ARG_WITH(bsd-auth,
2303 [ --with-bsd-auth Enable BSD auth support],
2304 [
2305 if test "x$withval" != "xno" ; then
2306 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002307 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002308 fi
2309 ]
2310)
2311
Damien Millera22ba012000-03-02 23:09:20 +11002312# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002313piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002314# make sure the directory exists
2315if test ! -d $piddir ; then
2316 piddir=`eval echo ${sysconfdir}`
2317 case $piddir in
2318 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2319 esac
2320fi
2321
Tim Rice88f2ab52002-03-17 12:17:34 -08002322AC_ARG_WITH(pid-dir,
2323 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2324 [
2325 if test "x$withval" != "xno" ; then
2326 piddir=$withval
2327 if test ! -d $piddir ; then
2328 AC_MSG_WARN([** no $piddir directory on this system **])
2329 fi
2330 fi
2331 ]
2332)
2333
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002334AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002335AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002336
andre2ff7b5d2000-06-03 14:57:40 +00002337dnl allow user to disable some login recording features
2338AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002339 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002340 [
2341 if test "x$enableval" = "xno" ; then
2342 AC_DEFINE(DISABLE_LASTLOG)
2343 fi
2344 ]
andre2ff7b5d2000-06-03 14:57:40 +00002345)
2346AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002347 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002348 [
2349 if test "x$enableval" = "xno" ; then
2350 AC_DEFINE(DISABLE_UTMP)
2351 fi
2352 ]
andre2ff7b5d2000-06-03 14:57:40 +00002353)
2354AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002355 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002356 [
2357 if test "x$enableval" = "xno" ; then
2358 AC_DEFINE(DISABLE_UTMPX)
2359 fi
2360 ]
andre2ff7b5d2000-06-03 14:57:40 +00002361)
2362AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002363 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002364 [
2365 if test "x$enableval" = "xno" ; then
2366 AC_DEFINE(DISABLE_WTMP)
2367 fi
2368 ]
andre2ff7b5d2000-06-03 14:57:40 +00002369)
2370AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002371 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002372 [
2373 if test "x$enableval" = "xno" ; then
2374 AC_DEFINE(DISABLE_WTMPX)
2375 fi
2376 ]
andre2ff7b5d2000-06-03 14:57:40 +00002377)
2378AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002379 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002380 [
2381 if test "x$enableval" = "xno" ; then
2382 AC_DEFINE(DISABLE_LOGIN)
2383 fi
2384 ]
andre2ff7b5d2000-06-03 14:57:40 +00002385)
2386AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002387 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002388 [
2389 if test "x$enableval" = "xno" ; then
2390 AC_DEFINE(DISABLE_PUTUTLINE)
2391 fi
2392 ]
andre2ff7b5d2000-06-03 14:57:40 +00002393)
2394AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002395 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002396 [
2397 if test "x$enableval" = "xno" ; then
2398 AC_DEFINE(DISABLE_PUTUTXLINE)
2399 fi
2400 ]
andre2ff7b5d2000-06-03 14:57:40 +00002401)
2402AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002403 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002404 [
2405 if test "x$withval" = "xno" ; then
2406 AC_DEFINE(DISABLE_LASTLOG)
2407 else
2408 conf_lastlog_location=$withval
2409 fi
2410 ]
2411)
andre2ff7b5d2000-06-03 14:57:40 +00002412
2413dnl lastlog, [uw]tmpx? detection
2414dnl NOTE: set the paths in the platform section to avoid the
2415dnl need for command-line parameters
2416dnl lastlog and [uw]tmp are subject to a file search if all else fails
2417
2418dnl lastlog detection
2419dnl NOTE: the code itself will detect if lastlog is a directory
2420AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2421AC_TRY_COMPILE([
2422#include <sys/types.h>
2423#include <utmp.h>
2424#ifdef HAVE_LASTLOG_H
2425# include <lastlog.h>
2426#endif
Damien Miller2994e082000-06-04 15:51:47 +10002427#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002428# include <paths.h>
2429#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002430#ifdef HAVE_LOGIN_H
2431# include <login.h>
2432#endif
andre2ff7b5d2000-06-03 14:57:40 +00002433 ],
2434 [ char *lastlog = LASTLOG_FILE; ],
2435 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002436 [
2437 AC_MSG_RESULT(no)
2438 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2439 AC_TRY_COMPILE([
2440#include <sys/types.h>
2441#include <utmp.h>
2442#ifdef HAVE_LASTLOG_H
2443# include <lastlog.h>
2444#endif
2445#ifdef HAVE_PATHS_H
2446# include <paths.h>
2447#endif
2448 ],
2449 [ char *lastlog = _PATH_LASTLOG; ],
2450 [ AC_MSG_RESULT(yes) ],
2451 [
andree441aa32000-06-12 22:34:38 +00002452 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002453 system_lastlog_path=no
2454 ])
2455 ]
andre2ff7b5d2000-06-03 14:57:40 +00002456)
Damien Miller2994e082000-06-04 15:51:47 +10002457
andre2ff7b5d2000-06-03 14:57:40 +00002458if test -z "$conf_lastlog_location"; then
2459 if test x"$system_lastlog_path" = x"no" ; then
2460 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002461 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002462 conf_lastlog_location=$f
2463 fi
2464 done
2465 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002466 AC_MSG_WARN([** Cannot find lastlog **])
2467 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002468 fi
2469 fi
2470fi
2471
2472if test -n "$conf_lastlog_location"; then
2473 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2474fi
2475
2476dnl utmp detection
2477AC_MSG_CHECKING([if your system defines UTMP_FILE])
2478AC_TRY_COMPILE([
2479#include <sys/types.h>
2480#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002481#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002482# include <paths.h>
2483#endif
2484 ],
2485 [ char *utmp = UTMP_FILE; ],
2486 [ AC_MSG_RESULT(yes) ],
2487 [ AC_MSG_RESULT(no)
2488 system_utmp_path=no ]
2489)
2490if test -z "$conf_utmp_location"; then
2491 if test x"$system_utmp_path" = x"no" ; then
2492 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2493 if test -f $f ; then
2494 conf_utmp_location=$f
2495 fi
2496 done
2497 if test -z "$conf_utmp_location"; then
2498 AC_DEFINE(DISABLE_UTMP)
2499 fi
2500 fi
2501fi
2502if test -n "$conf_utmp_location"; then
2503 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2504fi
2505
2506dnl wtmp detection
2507AC_MSG_CHECKING([if your system defines WTMP_FILE])
2508AC_TRY_COMPILE([
2509#include <sys/types.h>
2510#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002511#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002512# include <paths.h>
2513#endif
2514 ],
2515 [ char *wtmp = WTMP_FILE; ],
2516 [ AC_MSG_RESULT(yes) ],
2517 [ AC_MSG_RESULT(no)
2518 system_wtmp_path=no ]
2519)
2520if test -z "$conf_wtmp_location"; then
2521 if test x"$system_wtmp_path" = x"no" ; then
2522 for f in /usr/adm/wtmp /var/log/wtmp; do
2523 if test -f $f ; then
2524 conf_wtmp_location=$f
2525 fi
2526 done
2527 if test -z "$conf_wtmp_location"; then
2528 AC_DEFINE(DISABLE_WTMP)
2529 fi
2530 fi
2531fi
2532if test -n "$conf_wtmp_location"; then
2533 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2534fi
2535
2536
2537dnl utmpx detection - I don't know any system so perverse as to require
2538dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2539dnl there, though.
2540AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2541AC_TRY_COMPILE([
2542#include <sys/types.h>
2543#include <utmp.h>
2544#ifdef HAVE_UTMPX_H
2545#include <utmpx.h>
2546#endif
Damien Miller2994e082000-06-04 15:51:47 +10002547#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002548# include <paths.h>
2549#endif
2550 ],
2551 [ char *utmpx = UTMPX_FILE; ],
2552 [ AC_MSG_RESULT(yes) ],
2553 [ AC_MSG_RESULT(no)
2554 system_utmpx_path=no ]
2555)
2556if test -z "$conf_utmpx_location"; then
2557 if test x"$system_utmpx_path" = x"no" ; then
2558 AC_DEFINE(DISABLE_UTMPX)
2559 fi
2560else
2561 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2562fi
2563
2564dnl wtmpx detection
2565AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2566AC_TRY_COMPILE([
2567#include <sys/types.h>
2568#include <utmp.h>
2569#ifdef HAVE_UTMPX_H
2570#include <utmpx.h>
2571#endif
Damien Miller2994e082000-06-04 15:51:47 +10002572#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002573# include <paths.h>
2574#endif
2575 ],
2576 [ char *wtmpx = WTMPX_FILE; ],
2577 [ AC_MSG_RESULT(yes) ],
2578 [ AC_MSG_RESULT(no)
2579 system_wtmpx_path=no ]
2580)
2581if test -z "$conf_wtmpx_location"; then
2582 if test x"$system_wtmpx_path" = x"no" ; then
2583 AC_DEFINE(DISABLE_WTMPX)
2584 fi
2585else
2586 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2587fi
2588
Damien Miller4018c192000-04-30 09:30:44 +10002589
Damien Miller29ea30d2000-03-17 10:54:15 +11002590if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002591 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2592 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002593fi
2594
Tim Rice4cec93f2002-02-26 08:40:48 -08002595dnl remove pam and dl because they are in $LIBPAM
2596if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002597 LIBS=`echo $LIBS | sed 's/-lpam //'`
2598fi
2599if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2600 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002601fi
2602
Damien Millerbac2d8a2000-09-05 16:13:06 +11002603AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002604AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2605AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002606
Damien Miller7b22d652000-06-18 14:07:04 +10002607# Print summary of options
2608
Damien Miller7b22d652000-06-18 14:07:04 +10002609# Someone please show me a better way :)
2610A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2611B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2612C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2613D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002614E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002615F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002616G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002617H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2618I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2619J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002620
2621echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002622echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002623echo " User binaries: $B"
2624echo " System binaries: $C"
2625echo " Configuration files: $D"
2626echo " Askpass program: $E"
2627echo " Manual pages: $F"
2628echo " PID file: $G"
2629echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002630if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002631echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002632else
Damien Millerf58c6722002-05-13 13:15:42 +10002633echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002634fi
Damien Millera18bbd32002-05-13 10:48:57 +10002635if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002636echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002637fi
Damien Millerf58c6722002-05-13 13:15:42 +10002638echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002639echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002640echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002641echo " KerberosV support: $KRB5_MSG"
2642echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002643echo " S/KEY support: $SKEY_MSG"
2644echo " TCP Wrappers support: $TCPW_MSG"
2645echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002646echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002647echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2648echo " BSD Auth support: $BSD_AUTH_MSG"
2649echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002650if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002651echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002652fi
2653
Damien Miller7b22d652000-06-18 14:07:04 +10002654echo ""
2655
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002656echo " Host: ${host}"
2657echo " Compiler: ${CC}"
2658echo " Compiler flags: ${CFLAGS}"
2659echo "Preprocessor flags: ${CPPFLAGS}"
2660echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002661echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002662
2663echo ""
2664
Damien Miller82cf0ce2000-12-20 13:34:48 +11002665if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002666 echo "PAM is enabled. You may need to install a PAM control file "
2667 echo "for sshd, otherwise password authentication may fail. "
2668 echo "Example PAM control files can be found in the contrib/ "
2669 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002670 echo ""
2671fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002672
Damien Miller6c21c512002-01-22 21:57:53 +11002673if test ! -z "$RAND_HELPER_CMDHASH" ; then
2674 echo "WARNING: you are using the builtin random number collection "
2675 echo "service. Please read WARNING.RNG and request that your OS "
2676 echo "vendor includes kernel-based random number collection in "
2677 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002678 echo ""
2679fi
Damien Miller60396b02001-02-18 17:01:00 +11002680