blob: a0bd057ff8dfe73de97043e0c5d2b2c10993d116 [file] [log] [blame]
Tim Riced546a842003-09-11 22:24:36 -07001# $Id: configure.ac,v 1.152 2003/09/12 05:24:36 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)
Damien Miller217f5672001-02-16 12:12:41 +1100324 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700325 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700326 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100327 ;;
328*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800329 if test -z "$GCC"; then
330 CFLAGS="$CFLAGS -belf"
331 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000332 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000333 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100334 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000335 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100336 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000337 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000338 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700339 AC_DEFINE(DISABLE_FD_PASSING)
Tim Riced546a842003-09-11 22:24:36 -0700340 AC_DEFINE(SETEUID_BREAKS_SETUID)
341 AC_DEFINE(BROKEN_SETREUID)
342 AC_DEFINE(BROKEN_SETREGID)
Damien Miller217f5672001-02-16 12:12:41 +1100343 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700344 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000345 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000346*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000347 AC_DEFINE(USE_PIPES)
348 AC_DEFINE(DISABLE_FD_PASSING)
349 LDFLAGS="$LDFLAGS"
350 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
351 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000352 ;;
Darren Tucker9f7ffc52003-09-10 11:39:05 +1000353*-*-unicosmp*)
354 AC_DEFINE(WITH_ABBREV_NO_TTY)
355 AC_DEFINE(USE_PIPES)
356 AC_DEFINE(DISABLE_FD_PASSING)
357 LDFLAGS="$LDFLAGS"
358 LIBS="$LIBS -lgen -lacid"
359 MANTYPE=cat
360 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000361*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000362 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700363 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700364 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000365 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
366 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
367 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700368 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000369*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000370 AC_MSG_CHECKING(for Digital Unix SIA)
371 no_osfsia=""
372 AC_ARG_WITH(osfsia,
373 [ --with-osfsia Enable Digital Unix SIA],
374 [
375 if test "x$withval" = "xno" ; then
376 AC_MSG_RESULT(disabled)
377 no_osfsia=1
378 fi
379 ],
380 )
381 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000382 if test -f /etc/sia/matrix.conf; then
383 AC_MSG_RESULT(yes)
384 AC_DEFINE(HAVE_OSF_SIA)
385 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000386 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000387 LIBS="$LIBS -lsecurity -ldb -lm -laud"
388 else
389 AC_MSG_RESULT(no)
390 fi
391 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000392 AC_DEFINE(DISABLE_FD_PASSING)
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000393 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tuckere41bba52003-08-25 11:51:19 +1000394 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000395 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000396
397*-*-nto-qnx)
398 AC_DEFINE(USE_PIPES)
399 AC_DEFINE(NO_X11_UNIX_SOCKETS)
400 AC_DEFINE(MISSING_NFDBITS)
401 AC_DEFINE(MISSING_HOWMANY)
402 AC_DEFINE(MISSING_FD_MASK)
403 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100404esac
405
Damien Millere37bfc12000-06-05 09:37:43 +1000406# Allow user to specify flags
407AC_ARG_WITH(cflags,
408 [ --with-cflags Specify additional flags to pass to compiler],
409 [
410 if test "x$withval" != "xno" ; then
411 CFLAGS="$CFLAGS $withval"
412 fi
413 ]
414)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000415AC_ARG_WITH(cppflags,
416 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
417 [
418 if test "x$withval" != "xno"; then
419 CPPFLAGS="$CPPFLAGS $withval"
420 fi
421 ]
422)
Damien Millere37bfc12000-06-05 09:37:43 +1000423AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000424 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000425 [
426 if test "x$withval" != "xno" ; then
427 LDFLAGS="$LDFLAGS $withval"
428 fi
429 ]
430)
431AC_ARG_WITH(libs,
432 [ --with-libs Specify additional libraries to link with],
433 [
434 if test "x$withval" != "xno" ; then
435 LIBS="$LIBS $withval"
436 fi
437 ]
438)
439
Darren Tucker6eb93042003-06-29 21:30:41 +1000440AC_MSG_CHECKING(compiler and flags for sanity)
441AC_TRY_RUN([
442#include <stdio.h>
443int main(){exit(0);}
444 ],
445 [ AC_MSG_RESULT(yes) ],
446 [
447 AC_MSG_RESULT(no)
448 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
449 ]
450)
451
Tim Rice4cec93f2002-02-26 08:40:48 -0800452# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000453AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Darren Tuckerc82afd52003-09-11 14:42:55 +1000454 getopt.h glob.h ia.h lastlog.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800455 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000456 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000457 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000458 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
459 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000460 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700461 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800462 util.h utime.h utmp.h utmpx.h)
463
Damien Millera22ba012000-03-02 23:09:20 +1100464# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700465AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
466AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000467
Damien Millerdf288022001-02-18 13:07:07 +1100468dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700469if test "x$with_tcp_wrappers" != "xno" ; then
470 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
471 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
472 fi
473fi
Damien Millerdf288022001-02-18 13:07:07 +1100474
Tim Rice1e1ef642003-09-11 22:19:31 -0700475dnl IRIX and Solaris 2.5.1 have dirname() in libgen
476AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
477 AC_CHECK_LIB(gen, dirname,[
478 AC_CACHE_CHECK([for broken dirname],
479 ac_cv_have_broken_dirname, [
480 save_LIBS="$LIBS"
481 LIBS="$LIBS -lgen"
482 AC_TRY_RUN(
483 [
484#include <libgen.h>
485#include <string.h>
486
487int main(int argc, char **argv) {
488 char *s, buf[32];
489
490 strncpy(buf,"/etc", 32);
491 s = dirname(buf);
492 if (!s || strncmp(s, "/", 32) != 0) {
493 exit(1);
494 } else {
495 exit(0);
496 }
497}
498 ],
499 [ ac_cv_have_broken_dirname="no" ],
500 [ ac_cv_have_broken_dirname="yes" ]
501 )
502 LIBS="$save_LIBS"
503 ])
504 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
505 LIBS="$LIBS -lgen"
506 AC_DEFINE(HAVE_DIRNAME)
507 AC_CHECK_HEADERS(libgen.h)
508 fi
509 ])
510])
511
512AC_CHECK_FUNC(getspnam, ,
513 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
514AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
515
Damien Miller150c8b52002-02-13 23:06:56 +1100516AC_ARG_WITH(rpath,
517 [ --without-rpath Disable auto-added -R linker paths],
518 [
519 if test "x$withval" = "xno" ; then
520 need_dash_r=""
521 fi
522 if test "x$withval" = "xyes" ; then
523 need_dash_r=1
524 fi
525 ]
526)
527
Tim Rice13aae5e2001-10-21 17:53:58 -0700528dnl zlib is required
529AC_ARG_WITH(zlib,
530 [ --with-zlib=PATH Use zlib in PATH],
531 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000532 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100533 AC_MSG_ERROR([*** zlib is required ***])
534 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700535 if test -d "$withval/lib"; then
536 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700537 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700538 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700539 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700540 fi
541 else
542 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700543 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700544 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700545 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700546 fi
547 fi
548 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700549 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700550 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700551 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700552 fi
553 ]
554)
555
Tim Rice17b93e52001-10-23 22:36:54 -0700556AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100557
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000558dnl UnixWare 2.x
559AC_CHECK_FUNC(strcasecmp,
560 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
561)
562AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700563 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
564 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000565)
Damien Millerab18c411999-11-11 10:40:23 +1100566
Tim Ricee589a292001-11-03 11:09:32 -0800567dnl Checks for libutil functions
568AC_CHECK_HEADERS(libutil.h)
569AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
570AC_CHECK_FUNCS(logout updwtmp logwtmp)
571
Ben Lindstrom8697e082001-02-24 21:41:10 +0000572AC_FUNC_STRFTIME
573
Damien Miller3c027682001-03-14 11:39:45 +1100574# Check for ALTDIRFUNC glob() extension
575AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
576AC_EGREP_CPP(FOUNDIT,
577 [
578 #include <glob.h>
579 #ifdef GLOB_ALTDIRFUNC
580 FOUNDIT
581 #endif
582 ],
583 [
584 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
585 AC_MSG_RESULT(yes)
586 ],
587 [
588 AC_MSG_RESULT(no)
589 ]
590)
Damien Millerab18c411999-11-11 10:40:23 +1100591
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000592# Check for g.gl_matchc glob() extension
593AC_MSG_CHECKING(for gl_matchc field in glob_t)
594AC_EGREP_CPP(FOUNDIT,
595 [
596 #include <glob.h>
597 int main(void){glob_t g; g.gl_matchc = 1;}
598 ],
599 [
600 AC_DEFINE(GLOB_HAS_GL_MATCHC)
601 AC_MSG_RESULT(yes)
602 ],
603 [
604 AC_MSG_RESULT(no)
605 ]
606)
607
Damien Miller18bb4732001-03-28 14:35:30 +1000608AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
609AC_TRY_RUN(
610 [
611#include <sys/types.h>
612#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700613int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000614 ],
615 [AC_MSG_RESULT(yes)],
616 [
617 AC_MSG_RESULT(no)
618 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
619 ]
620)
621
Damien Millerc547bf12001-02-16 10:18:12 +1100622# Check whether user wants S/Key support
623SKEY_MSG="no"
624AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700625 [ --with-skey[[=PATH]] Enable S/Key support
626 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100627 [
628 if test "x$withval" != "xno" ; then
629
630 if test "x$withval" != "xyes" ; then
631 CPPFLAGS="$CPPFLAGS -I${withval}/include"
632 LDFLAGS="$LDFLAGS -L${withval}/lib"
633 fi
634
635 AC_DEFINE(SKEY)
636 LIBS="-lskey $LIBS"
637 SKEY_MSG="yes"
638
Tim Rice4cec93f2002-02-26 08:40:48 -0800639 AC_MSG_CHECKING([for s/key support])
640 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100641 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800642#include <stdio.h>
643#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700644int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800645 ],
646 [AC_MSG_RESULT(yes)],
647 [
648 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100649 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
650 ])
651 fi
652 ]
653)
654
655# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700656TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100657AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700658 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
659 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100660 [
661 if test "x$withval" != "xno" ; then
662 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700663 saved_LDFLAGS="$LDFLAGS"
664 saved_CPPFLAGS="$CPPFLAGS"
665 if test -n "${withval}" -a "${withval}" != "yes"; then
666 if test -d "${withval}/lib"; then
667 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700668 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700669 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700670 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700671 fi
672 else
673 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700674 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700675 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700676 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700677 fi
678 fi
679 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700680 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700681 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700682 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700683 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700684 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800685 LIBWRAP="-lwrap"
686 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100687 AC_MSG_CHECKING(for libwrap)
688 AC_TRY_LINK(
689 [
690#include <tcpd.h>
691 int deny_severity = 0, allow_severity = 0;
692 ],
693 [hosts_access(0);],
694 [
695 AC_MSG_RESULT(yes)
696 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800697 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700698 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100699 ],
700 [
701 AC_MSG_ERROR([*** libwrap missing])
702 ]
703 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800704 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100705 fi
706 ]
707)
708
Damien Millerfe1f1432003-02-24 15:45:42 +1100709dnl Checks for library functions. Please keep in alphabetical order
710AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000711 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
712 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100713 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000714 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100715 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000716 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
717 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
718 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000719 setproctitle setregid setresgid setresuid setreuid setrlimit \
720 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerb2427c82003-09-10 15:22:44 +1000721 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000722 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100723)
Tim Rice13aae5e2001-10-21 17:53:58 -0700724
Damien Millercd6853c2003-01-28 11:33:42 +1100725AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
726
Darren Tuckerf1159b52003-07-07 19:44:01 +1000727dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000728AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000729AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000730
Darren Tuckerb2427c82003-09-10 15:22:44 +1000731dnl tcsendbreak might be a macro
732AC_CHECK_DECL(tcsendbreak,
733 [AC_DEFINE(HAVE_TCSENDBREAK)],
734 [AC_CHECK_FUNCS(tcsendbreak)],
735 [#include <termios.h>]
736)
737
Damien Millerad833b32000-08-23 10:46:23 +1000738dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000739AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000740dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000741AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000742AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000743dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000744AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000745AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100746
Damien Miller04f80141999-11-19 15:32:34 +1100747AC_CHECK_FUNC(daemon,
748 [AC_DEFINE(HAVE_DAEMON)],
749 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
750)
751
Damien Miller9fb07e42000-03-05 16:22:59 +1100752AC_CHECK_FUNC(getpagesize,
753 [AC_DEFINE(HAVE_GETPAGESIZE)],
754 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
755)
756
Damien Millercb170cb2000-07-01 16:52:55 +1000757# Check for broken snprintf
758if test "x$ac_cv_func_snprintf" = "xyes" ; then
759 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
760 AC_TRY_RUN(
761 [
762#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700763int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000764 ],
765 [AC_MSG_RESULT(yes)],
766 [
767 AC_MSG_RESULT(no)
768 AC_DEFINE(BROKEN_SNPRINTF)
769 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
770 ]
771 )
772fi
773
Damien Millere8328192003-01-07 15:18:32 +1100774dnl see whether mkstemp() requires XXXXXX
775if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
776AC_MSG_CHECKING([for (overly) strict mkstemp])
777AC_TRY_RUN(
778 [
779#include <stdlib.h>
780main() { char template[]="conftest.mkstemp-test";
781if (mkstemp(template) == -1)
782 exit(1);
783unlink(template); exit(0);
784}
785 ],
786 [
787 AC_MSG_RESULT(no)
788 ],
789 [
790 AC_MSG_RESULT(yes)
791 AC_DEFINE(HAVE_STRICT_MKSTEMP)
792 ],
793 [
794 AC_MSG_RESULT(yes)
795 AC_DEFINE(HAVE_STRICT_MKSTEMP)
796 ]
797)
798fi
799
Darren Tucker70a3d552003-08-21 17:58:29 +1000800dnl make sure that openpty does not reacquire controlling terminal
801if test ! -z "$check_for_openpty_ctty_bug"; then
802 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
803 AC_TRY_RUN(
804 [
805#include <stdio.h>
806#include <sys/fcntl.h>
807#include <sys/types.h>
808#include <sys/wait.h>
809
810int
811main()
812{
813 pid_t pid;
814 int fd, ptyfd, ttyfd, status;
815
816 pid = fork();
817 if (pid < 0) { /* failed */
818 exit(1);
819 } else if (pid > 0) { /* parent */
820 waitpid(pid, &status, 0);
821 if (WIFEXITED(status))
822 exit(WEXITSTATUS(status));
823 else
824 exit(2);
825 } else { /* child */
826 close(0); close(1); close(2);
827 setsid();
828 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
829 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
830 if (fd >= 0)
831 exit(3); /* Acquired ctty: broken */
832 else
833 exit(0); /* Did not acquire ctty: OK */
834 }
835}
836 ],
837 [
838 AC_MSG_RESULT(yes)
839 ],
840 [
841 AC_MSG_RESULT(no)
842 AC_DEFINE(SSHD_ACQUIRES_CTTY)
843 ]
844 )
845fi
846
Damien Miller606f8802000-09-16 15:39:56 +1100847AC_FUNC_GETPGRP
848
Damien Millera64b57a2001-01-17 10:44:13 +1100849# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000850PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100851AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100852 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100853 [
Damien Millera64b57a2001-01-17 10:44:13 +1100854 if test "x$withval" != "xno" ; then
855 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
856 AC_MSG_ERROR([PAM headers not found])
857 fi
858
859 AC_CHECK_LIB(dl, dlopen, , )
860 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
861 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000862 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100863
864 disable_shadow=yes
865 PAM_MSG="yes"
866
867 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800868 if test $ac_cv_lib_dl_dlopen = yes; then
869 LIBPAM="-lpam -ldl"
870 else
871 LIBPAM="-lpam"
872 fi
873 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100874 fi
875 ]
876)
Damien Millera22ba012000-03-02 23:09:20 +1100877
Damien Millera64b57a2001-01-17 10:44:13 +1100878# Check for older PAM
879if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100880 # Check PAM strerror arguments (old PAM)
881 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
882 AC_TRY_COMPILE(
883 [
Damien Miller81171112000-04-23 11:14:01 +1000884#include <stdlib.h>
885#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100886 ],
887 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
888 [AC_MSG_RESULT(no)],
889 [
890 AC_DEFINE(HAVE_OLD_PAM)
891 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000892 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100893 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100894 )
Damien Millera22ba012000-03-02 23:09:20 +1100895fi
896
Damien Millerfc93d4b2002-09-04 23:26:29 +1000897# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
898# because the system crypt() is more featureful.
899if test "x$check_for_libcrypt_before" = "x1"; then
900 AC_CHECK_LIB(crypt, crypt)
901fi
902
Tim Riceaef73712002-05-11 13:17:42 -0700903# Search for OpenSSL
904saved_CPPFLAGS="$CPPFLAGS"
905saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100906AC_ARG_WITH(ssl-dir,
907 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
908 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000909 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700910 if test -d "$withval/lib"; then
911 if test -n "${need_dash_r}"; then
912 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
913 else
914 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
915 fi
916 else
917 if test -n "${need_dash_r}"; then
918 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
919 else
920 LDFLAGS="-L${withval} ${LDFLAGS}"
921 fi
922 fi
923 if test -d "$withval/include"; then
924 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
925 else
926 CPPFLAGS="-I${withval} ${CPPFLAGS}"
927 fi
Damien Millera22ba012000-03-02 23:09:20 +1100928 fi
929 ]
930)
Tim Riceaef73712002-05-11 13:17:42 -0700931LIBS="$LIBS -lcrypto"
932AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000933 [
Tim Riceaef73712002-05-11 13:17:42 -0700934 dnl Check default openssl install dir
935 if test -n "${need_dash_r}"; then
936 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000937 else
Tim Riceaef73712002-05-11 13:17:42 -0700938 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000939 fi
Tim Riceaef73712002-05-11 13:17:42 -0700940 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
941 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
942 [
943 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
944 ]
945 )
946 ]
947)
948
Tim Riced730b782002-08-13 18:52:10 -0700949# Determine OpenSSL header version
950AC_MSG_CHECKING([OpenSSL header version])
951AC_TRY_RUN(
952 [
953#include <stdio.h>
954#include <string.h>
955#include <openssl/opensslv.h>
956#define DATA "conftest.sslincver"
957int main(void) {
958 FILE *fd;
959 int rc;
960
961 fd = fopen(DATA,"w");
962 if(fd == NULL)
963 exit(1);
964
965 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
966 exit(1);
967
968 exit(0);
969}
970 ],
971 [
972 ssl_header_ver=`cat conftest.sslincver`
973 AC_MSG_RESULT($ssl_header_ver)
974 ],
975 [
976 AC_MSG_RESULT(not found)
977 AC_MSG_ERROR(OpenSSL version header not found.)
978 ]
979)
980
981# Determine OpenSSL library version
982AC_MSG_CHECKING([OpenSSL library version])
983AC_TRY_RUN(
984 [
985#include <stdio.h>
986#include <string.h>
987#include <openssl/opensslv.h>
988#include <openssl/crypto.h>
989#define DATA "conftest.ssllibver"
990int main(void) {
991 FILE *fd;
992 int rc;
993
994 fd = fopen(DATA,"w");
995 if(fd == NULL)
996 exit(1);
997
998 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
999 exit(1);
1000
1001 exit(0);
1002}
1003 ],
1004 [
1005 ssl_library_ver=`cat conftest.ssllibver`
1006 AC_MSG_RESULT($ssl_library_ver)
1007 ],
1008 [
1009 AC_MSG_RESULT(not found)
1010 AC_MSG_ERROR(OpenSSL library not found.)
1011 ]
1012)
Damien Millera22ba012000-03-02 23:09:20 +11001013
Damien Millerec932372002-01-22 22:16:03 +11001014# Sanity check OpenSSL headers
1015AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1016AC_TRY_RUN(
1017 [
1018#include <string.h>
1019#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001020int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +11001021 ],
1022 [
1023 AC_MSG_RESULT(yes)
1024 ],
1025 [
1026 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001027 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1028Check config.log for details.
1029Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001030 ]
1031)
1032
Damien Millera64b57a2001-01-17 10:44:13 +11001033# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1034# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001035if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001036 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001037fi
1038
Damien Miller6c21c512002-01-22 21:57:53 +11001039
1040### Configure cryptographic random number support
1041
1042# Check wheter OpenSSL seeds itself
1043AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1044AC_TRY_RUN(
1045 [
1046#include <string.h>
1047#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001048int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001049 ],
1050 [
1051 OPENSSL_SEEDS_ITSELF=yes
1052 AC_MSG_RESULT(yes)
1053 ],
1054 [
1055 AC_MSG_RESULT(no)
1056 # Default to use of the rand helper if OpenSSL doesn't
1057 # seed itself
1058 USE_RAND_HELPER=yes
1059 ]
1060)
1061
1062
1063# Do we want to force the use of the rand helper?
1064AC_ARG_WITH(rand-helper,
1065 [ --with-rand-helper Use subprocess to gather strong randomness ],
1066 [
1067 if test "x$withval" = "xno" ; then
1068 # Force use of OpenSSL's internal RNG, even if
1069 # the previous test showed it to be unseeded.
1070 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1071 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1072 OPENSSL_SEEDS_ITSELF=yes
1073 USE_RAND_HELPER=""
1074 fi
1075 else
1076 USE_RAND_HELPER=yes
1077 fi
1078 ],
1079)
1080
1081# Which randomness source do we use?
1082if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1083 # OpenSSL only
1084 AC_DEFINE(OPENSSL_PRNG_ONLY)
1085 RAND_MSG="OpenSSL internal ONLY"
1086 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001087elif test ! -z "$USE_RAND_HELPER" ; then
1088 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001089 RAND_MSG="ssh-rand-helper"
1090 INSTALL_SSH_RAND_HELPER="yes"
1091fi
1092AC_SUBST(INSTALL_SSH_RAND_HELPER)
1093
1094### Configuration of ssh-rand-helper
1095
1096# PRNGD TCP socket
1097AC_ARG_WITH(prngd-port,
1098 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1099 [
Damien Millere996d722002-01-23 11:20:59 +11001100 case "$withval" in
1101 no)
1102 withval=""
1103 ;;
1104 [[0-9]]*)
1105 ;;
1106 *)
1107 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1108 ;;
1109 esac
1110 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001111 PRNGD_PORT="$withval"
1112 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1113 fi
1114 ]
1115)
1116
1117# PRNGD Unix domain socket
1118AC_ARG_WITH(prngd-socket,
1119 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1120 [
Damien Millere996d722002-01-23 11:20:59 +11001121 case "$withval" in
1122 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001123 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001124 ;;
1125 no)
1126 withval=""
1127 ;;
1128 /*)
1129 ;;
1130 *)
1131 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1132 ;;
1133 esac
1134
1135 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001136 if test ! -z "$PRNGD_PORT" ; then
1137 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1138 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001139 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001140 AC_MSG_WARN(Entropy socket is not readable)
1141 fi
1142 PRNGD_SOCKET="$withval"
1143 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1144 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001145 ],
1146 [
1147 # Check for existing socket only if we don't have a random device already
1148 if test "$USE_RAND_HELPER" = yes ; then
1149 AC_MSG_CHECKING(for PRNGD/EGD socket)
1150 # Insert other locations here
1151 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1152 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1153 PRNGD_SOCKET="$sock"
1154 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1155 break;
1156 fi
1157 done
1158 if test ! -z "$PRNGD_SOCKET" ; then
1159 AC_MSG_RESULT($PRNGD_SOCKET)
1160 else
1161 AC_MSG_RESULT(not found)
1162 fi
1163 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001164 ]
1165)
1166
1167# Change default command timeout for hashing entropy source
1168entropy_timeout=200
1169AC_ARG_WITH(entropy-timeout,
1170 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1171 [
1172 if test "x$withval" != "xno" ; then
1173 entropy_timeout=$withval
1174 fi
1175 ]
1176)
Damien Miller6c21c512002-01-22 21:57:53 +11001177AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1178
Damien Millerd3f6ad22002-06-25 10:24:47 +10001179SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001180AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001181 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001182 [
1183 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001184 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001185 fi
1186 ]
1187)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001188AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1189AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001190
Tim Rice88f2ab52002-03-17 12:17:34 -08001191# We do this little dance with the search path to insure
1192# that programs that we select for use by installed programs
1193# (which may be run by the super-user) come from trusted
1194# locations before they come from the user's private area.
1195# This should help avoid accidentally configuring some
1196# random version of a program in someone's personal bin.
1197
1198OPATH=$PATH
1199PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001200test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001201test -d /sbin && PATH=$PATH:/sbin
1202test -d /usr/sbin && PATH=$PATH:/usr/sbin
1203PATH=$PATH:/etc:$OPATH
1204
Damien Miller6c21c512002-01-22 21:57:53 +11001205# These programs are used by the command hashing source to gather entropy
1206OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1207OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1208OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1209OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1210OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1211OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1212OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1213OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1214OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1215OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1216OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1217OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1218OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1219OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1220OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1221OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001222# restore PATH
1223PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001224
1225# Where does ssh-rand-helper get its randomness from?
1226INSTALL_SSH_PRNG_CMDS=""
1227if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1228 if test ! -z "$PRNGD_PORT" ; then
1229 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1230 elif test ! -z "$PRNGD_SOCKET" ; then
1231 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1232 else
1233 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1234 RAND_HELPER_CMDHASH=yes
1235 INSTALL_SSH_PRNG_CMDS="yes"
1236 fi
1237fi
1238AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1239
1240
Ben Lindstromb5628642000-10-18 00:02:25 +00001241# Cheap hack to ensure NEWS-OS libraries are arranged right.
1242if test ! -z "$SONY" ; then
1243 LIBS="$LIBS -liberty";
1244fi
1245
Damien Millera22ba012000-03-02 23:09:20 +11001246# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001247AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001248AC_CHECK_SIZEOF(short int, 2)
1249AC_CHECK_SIZEOF(int, 4)
1250AC_CHECK_SIZEOF(long int, 4)
1251AC_CHECK_SIZEOF(long long int, 8)
1252
Damien Millerfa2bb692002-04-23 23:22:25 +10001253# Sanity check long long for some platforms (AIX)
1254if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1255 ac_cv_sizeof_long_long_int=0
1256fi
1257
Damien Millera22ba012000-03-02 23:09:20 +11001258# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001259AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1260 AC_TRY_COMPILE(
1261 [ #include <sys/types.h> ],
1262 [ u_int a; a = 1;],
1263 [ ac_cv_have_u_int="yes" ],
1264 [ ac_cv_have_u_int="no" ]
1265 )
1266])
1267if test "x$ac_cv_have_u_int" = "xyes" ; then
1268 AC_DEFINE(HAVE_U_INT)
1269 have_u_int=1
1270fi
1271
Damien Miller61e50f12000-05-08 20:49:37 +10001272AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1273 AC_TRY_COMPILE(
1274 [ #include <sys/types.h> ],
1275 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1276 [ ac_cv_have_intxx_t="yes" ],
1277 [ ac_cv_have_intxx_t="no" ]
1278 )
1279])
1280if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1281 AC_DEFINE(HAVE_INTXX_T)
1282 have_intxx_t=1
1283fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001284
1285if (test -z "$have_intxx_t" && \
1286 test "x$ac_cv_header_stdint_h" = "xyes")
1287then
1288 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1289 AC_TRY_COMPILE(
1290 [ #include <stdint.h> ],
1291 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1292 [
1293 AC_DEFINE(HAVE_INTXX_T)
1294 AC_MSG_RESULT(yes)
1295 ],
1296 [ AC_MSG_RESULT(no) ]
1297 )
1298fi
1299
Damien Miller578783e2000-09-23 14:12:24 +11001300AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1301 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001302 [
1303#include <sys/types.h>
1304#ifdef HAVE_STDINT_H
1305# include <stdint.h>
1306#endif
1307#include <sys/socket.h>
1308#ifdef HAVE_SYS_BITYPES_H
1309# include <sys/bitypes.h>
1310#endif
1311 ],
Damien Miller578783e2000-09-23 14:12:24 +11001312 [ int64_t a; a = 1;],
1313 [ ac_cv_have_int64_t="yes" ],
1314 [ ac_cv_have_int64_t="no" ]
1315 )
1316])
1317if test "x$ac_cv_have_int64_t" = "xyes" ; then
1318 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001319fi
1320
Damien Miller61e50f12000-05-08 20:49:37 +10001321AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1322 AC_TRY_COMPILE(
1323 [ #include <sys/types.h> ],
1324 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1325 [ ac_cv_have_u_intxx_t="yes" ],
1326 [ ac_cv_have_u_intxx_t="no" ]
1327 )
1328])
1329if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1330 AC_DEFINE(HAVE_U_INTXX_T)
1331 have_u_intxx_t=1
1332fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001333
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001334if test -z "$have_u_intxx_t" ; then
1335 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1336 AC_TRY_COMPILE(
1337 [ #include <sys/socket.h> ],
1338 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1339 [
1340 AC_DEFINE(HAVE_U_INTXX_T)
1341 AC_MSG_RESULT(yes)
1342 ],
1343 [ AC_MSG_RESULT(no) ]
1344 )
1345fi
1346
Damien Miller578783e2000-09-23 14:12:24 +11001347AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1348 AC_TRY_COMPILE(
1349 [ #include <sys/types.h> ],
1350 [ u_int64_t a; a = 1;],
1351 [ ac_cv_have_u_int64_t="yes" ],
1352 [ ac_cv_have_u_int64_t="no" ]
1353 )
1354])
1355if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1356 AC_DEFINE(HAVE_U_INT64_T)
1357 have_u_int64_t=1
1358fi
1359
Tim Rice4cec93f2002-02-26 08:40:48 -08001360if test -z "$have_u_int64_t" ; then
1361 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1362 AC_TRY_COMPILE(
1363 [ #include <sys/bitypes.h> ],
1364 [ u_int64_t a; a = 1],
1365 [
1366 AC_DEFINE(HAVE_U_INT64_T)
1367 AC_MSG_RESULT(yes)
1368 ],
1369 [ AC_MSG_RESULT(no) ]
1370 )
1371fi
1372
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001373if test -z "$have_u_intxx_t" ; then
1374 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1375 AC_TRY_COMPILE(
1376 [
1377#include <sys/types.h>
1378 ],
1379 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1380 [ ac_cv_have_uintxx_t="yes" ],
1381 [ ac_cv_have_uintxx_t="no" ]
1382 )
1383 ])
1384 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1385 AC_DEFINE(HAVE_UINTXX_T)
1386 fi
1387fi
1388
1389if test -z "$have_uintxx_t" ; then
1390 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1391 AC_TRY_COMPILE(
1392 [ #include <stdint.h> ],
1393 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1394 [
1395 AC_DEFINE(HAVE_UINTXX_T)
1396 AC_MSG_RESULT(yes)
1397 ],
1398 [ AC_MSG_RESULT(no) ]
1399 )
1400fi
1401
Damien Milleredb82922000-06-20 13:25:52 +10001402if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1403 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001404then
1405 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1406 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001407 [
1408#include <sys/bitypes.h>
1409 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001410 [
Damien Miller70494d12000-04-03 15:57:06 +10001411 int8_t a; int16_t b; int32_t c;
1412 u_int8_t e; u_int16_t f; u_int32_t g;
1413 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001414 ],
1415 [
1416 AC_DEFINE(HAVE_U_INTXX_T)
1417 AC_DEFINE(HAVE_INTXX_T)
1418 AC_MSG_RESULT(yes)
1419 ],
1420 [AC_MSG_RESULT(no)]
1421 )
1422fi
1423
Damien Miller58be7382001-09-15 21:31:54 +10001424
1425AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1426 AC_TRY_COMPILE(
1427 [
1428#include <sys/types.h>
1429 ],
1430 [ u_char foo; foo = 125; ],
1431 [ ac_cv_have_u_char="yes" ],
1432 [ ac_cv_have_u_char="no" ]
1433 )
1434])
1435if test "x$ac_cv_have_u_char" = "xyes" ; then
1436 AC_DEFINE(HAVE_U_CHAR)
1437fi
1438
Tim Rice13aae5e2001-10-21 17:53:58 -07001439TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001440
Tim Rice200a5c02002-02-26 22:12:34 -08001441AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001442
Damien Miller61e50f12000-05-08 20:49:37 +10001443AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1444 AC_TRY_COMPILE(
1445 [
1446#include <sys/types.h>
1447 ],
1448 [ size_t foo; foo = 1235; ],
1449 [ ac_cv_have_size_t="yes" ],
1450 [ ac_cv_have_size_t="no" ]
1451 )
1452])
1453if test "x$ac_cv_have_size_t" = "xyes" ; then
1454 AC_DEFINE(HAVE_SIZE_T)
1455fi
Damien Miller95058511999-12-29 10:36:45 +11001456
Damien Miller615f9392000-05-17 22:53:33 +10001457AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1458 AC_TRY_COMPILE(
1459 [
1460#include <sys/types.h>
1461 ],
1462 [ ssize_t foo; foo = 1235; ],
1463 [ ac_cv_have_ssize_t="yes" ],
1464 [ ac_cv_have_ssize_t="no" ]
1465 )
1466])
1467if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1468 AC_DEFINE(HAVE_SSIZE_T)
1469fi
1470
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001471AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1472 AC_TRY_COMPILE(
1473 [
1474#include <time.h>
1475 ],
1476 [ clock_t foo; foo = 1235; ],
1477 [ ac_cv_have_clock_t="yes" ],
1478 [ ac_cv_have_clock_t="no" ]
1479 )
1480])
1481if test "x$ac_cv_have_clock_t" = "xyes" ; then
1482 AC_DEFINE(HAVE_CLOCK_T)
1483fi
1484
Damien Millerb54b40e2000-06-23 08:23:34 +10001485AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1486 AC_TRY_COMPILE(
1487 [
1488#include <sys/types.h>
1489#include <sys/socket.h>
1490 ],
1491 [ sa_family_t foo; foo = 1235; ],
1492 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001493 [ AC_TRY_COMPILE(
1494 [
1495#include <sys/types.h>
1496#include <sys/socket.h>
1497#include <netinet/in.h>
1498 ],
1499 [ sa_family_t foo; foo = 1235; ],
1500 [ ac_cv_have_sa_family_t="yes" ],
1501
Damien Millerb54b40e2000-06-23 08:23:34 +10001502 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001503 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001504 )
1505])
1506if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1507 AC_DEFINE(HAVE_SA_FAMILY_T)
1508fi
1509
Damien Miller0f91b4e2000-06-18 15:43:25 +10001510AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1511 AC_TRY_COMPILE(
1512 [
1513#include <sys/types.h>
1514 ],
1515 [ pid_t foo; foo = 1235; ],
1516 [ ac_cv_have_pid_t="yes" ],
1517 [ ac_cv_have_pid_t="no" ]
1518 )
1519])
1520if test "x$ac_cv_have_pid_t" = "xyes" ; then
1521 AC_DEFINE(HAVE_PID_T)
1522fi
1523
1524AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1525 AC_TRY_COMPILE(
1526 [
1527#include <sys/types.h>
1528 ],
1529 [ mode_t foo; foo = 1235; ],
1530 [ ac_cv_have_mode_t="yes" ],
1531 [ ac_cv_have_mode_t="no" ]
1532 )
1533])
1534if test "x$ac_cv_have_mode_t" = "xyes" ; then
1535 AC_DEFINE(HAVE_MODE_T)
1536fi
1537
Damien Miller61e50f12000-05-08 20:49:37 +10001538
1539AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1540 AC_TRY_COMPILE(
1541 [
Damien Miller81171112000-04-23 11:14:01 +10001542#include <sys/types.h>
1543#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001544 ],
1545 [ struct sockaddr_storage s; ],
1546 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1547 [ ac_cv_have_struct_sockaddr_storage="no" ]
1548 )
1549])
1550if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1551 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1552fi
Damien Miller34132e52000-01-14 15:45:46 +11001553
Damien Miller61e50f12000-05-08 20:49:37 +10001554AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1555 AC_TRY_COMPILE(
1556 [
Damien Miller7b22d652000-06-18 14:07:04 +10001557#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001558#include <netinet/in.h>
1559 ],
1560 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1561 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1562 [ ac_cv_have_struct_sockaddr_in6="no" ]
1563 )
1564])
1565if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1566 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1567fi
Damien Miller34132e52000-01-14 15:45:46 +11001568
Damien Miller61e50f12000-05-08 20:49:37 +10001569AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1570 AC_TRY_COMPILE(
1571 [
Damien Miller7b22d652000-06-18 14:07:04 +10001572#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001573#include <netinet/in.h>
1574 ],
1575 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1576 [ ac_cv_have_struct_in6_addr="yes" ],
1577 [ ac_cv_have_struct_in6_addr="no" ]
1578 )
1579])
1580if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1581 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1582fi
Damien Miller34132e52000-01-14 15:45:46 +11001583
Damien Miller61e50f12000-05-08 20:49:37 +10001584AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1585 AC_TRY_COMPILE(
1586 [
Damien Miller81171112000-04-23 11:14:01 +10001587#include <sys/types.h>
1588#include <sys/socket.h>
1589#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001590 ],
1591 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1592 [ ac_cv_have_struct_addrinfo="yes" ],
1593 [ ac_cv_have_struct_addrinfo="no" ]
1594 )
1595])
1596if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1597 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1598fi
1599
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001600AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1601 AC_TRY_COMPILE(
1602 [ #include <sys/time.h> ],
1603 [ struct timeval tv; tv.tv_sec = 1;],
1604 [ ac_cv_have_struct_timeval="yes" ],
1605 [ ac_cv_have_struct_timeval="no" ]
1606 )
1607])
1608if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1609 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1610 have_struct_timeval=1
1611fi
1612
Tim Rice4e4dc562003-03-18 10:21:40 -08001613AC_CHECK_TYPES(struct timespec)
1614
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001615# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001616if test "x$ac_cv_have_int64_t" = "xno" -a \
1617 "x$ac_cv_sizeof_long_int" != "x8" -a \
1618 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001619 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1620 echo "an alternative compiler (I.E., GCC) before continuing."
1621 echo ""
1622 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001623else
1624dnl test snprintf (broken on SCO w/gcc)
1625 AC_TRY_RUN(
1626 [
1627#include <stdio.h>
1628#include <string.h>
1629#ifdef HAVE_SNPRINTF
1630main()
1631{
1632 char buf[50];
1633 char expected_out[50];
1634 int mazsize = 50 ;
1635#if (SIZEOF_LONG_INT == 8)
1636 long int num = 0x7fffffffffffffff;
1637#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001638 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001639#endif
1640 strcpy(expected_out, "9223372036854775807");
1641 snprintf(buf, mazsize, "%lld", num);
1642 if(strcmp(buf, expected_out) != 0)
1643 exit(1);
1644 exit(0);
1645}
1646#else
1647main() { exit(0); }
1648#endif
1649 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1650 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001651fi
1652
Damien Miller78315eb2000-09-29 23:01:36 +11001653dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001654OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1655OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1656OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1657OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1658OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001659OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001660OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1661OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001662OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001663OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1664OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1665OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1666OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001667OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1668OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1669OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1670OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001671
1672AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001673
Damien Miller61e50f12000-05-08 20:49:37 +10001674AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1675 ac_cv_have_ss_family_in_struct_ss, [
1676 AC_TRY_COMPILE(
1677 [
Damien Miller81171112000-04-23 11:14:01 +10001678#include <sys/types.h>
1679#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001680 ],
1681 [ struct sockaddr_storage s; s.ss_family = 1; ],
1682 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1683 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1684 )
1685])
1686if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1687 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1688fi
1689
Damien Miller61e50f12000-05-08 20:49:37 +10001690AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1691 ac_cv_have___ss_family_in_struct_ss, [
1692 AC_TRY_COMPILE(
1693 [
Damien Miller81171112000-04-23 11:14:01 +10001694#include <sys/types.h>
1695#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001696 ],
1697 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1698 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1699 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1700 )
1701])
1702if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1703 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1704fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001705
Damien Millerad833b32000-08-23 10:46:23 +10001706AC_CACHE_CHECK([for pw_class field in struct passwd],
1707 ac_cv_have_pw_class_in_struct_passwd, [
1708 AC_TRY_COMPILE(
1709 [
Damien Millerad833b32000-08-23 10:46:23 +10001710#include <pwd.h>
1711 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001712 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001713 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1714 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1715 )
1716])
1717if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1718 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1719fi
1720
Kevin Steves82456952001-06-22 21:14:18 +00001721AC_CACHE_CHECK([for pw_expire field in struct passwd],
1722 ac_cv_have_pw_expire_in_struct_passwd, [
1723 AC_TRY_COMPILE(
1724 [
1725#include <pwd.h>
1726 ],
1727 [ struct passwd p; p.pw_expire = 0; ],
1728 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1729 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1730 )
1731])
1732if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1733 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1734fi
1735
1736AC_CACHE_CHECK([for pw_change field in struct passwd],
1737 ac_cv_have_pw_change_in_struct_passwd, [
1738 AC_TRY_COMPILE(
1739 [
1740#include <pwd.h>
1741 ],
1742 [ struct passwd p; p.pw_change = 0; ],
1743 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1744 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1745 )
1746])
1747if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1748 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1749fi
Damien Miller61e50f12000-05-08 20:49:37 +10001750
Tim Rice28bbb0c2002-05-27 17:37:32 -07001751dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001752AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1753 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001754 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001755 [
Tim Riceae49fe62002-04-12 10:26:21 -07001756#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001757#include <sys/socket.h>
1758#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001759int main() {
1760#ifdef msg_accrights
1761exit(1);
1762#endif
1763struct msghdr m;
1764m.msg_accrights = 0;
1765exit(0);
1766}
Kevin Steves939c9db2002-03-22 17:23:25 +00001767 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001768 [ ac_cv_have_accrights_in_msghdr="yes" ],
1769 [ ac_cv_have_accrights_in_msghdr="no" ]
1770 )
1771])
1772if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1773 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1774fi
1775
Kevin Stevesa44e0352002-04-07 16:18:03 +00001776AC_CACHE_CHECK([for msg_control field in struct msghdr],
1777 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001778 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001779 [
Tim Riceae49fe62002-04-12 10:26:21 -07001780#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001781#include <sys/socket.h>
1782#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001783int main() {
1784#ifdef msg_control
1785exit(1);
1786#endif
1787struct msghdr m;
1788m.msg_control = 0;
1789exit(0);
1790}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001791 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001792 [ ac_cv_have_control_in_msghdr="yes" ],
1793 [ ac_cv_have_control_in_msghdr="no" ]
1794 )
1795])
1796if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1797 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1798fi
1799
Damien Miller61e50f12000-05-08 20:49:37 +10001800AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1801 AC_TRY_LINK([],
1802 [ extern char *__progname; printf("%s", __progname); ],
1803 [ ac_cv_libc_defines___progname="yes" ],
1804 [ ac_cv_libc_defines___progname="no" ]
1805 )
1806])
1807if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1808 AC_DEFINE(HAVE___PROGNAME)
1809fi
1810
Kevin Steves4846f4a2002-03-22 18:19:53 +00001811AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1812 AC_TRY_LINK([
1813#include <stdio.h>
1814],
1815 [ printf("%s", __FUNCTION__); ],
1816 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1817 [ ac_cv_cc_implements___FUNCTION__="no" ]
1818 )
1819])
1820if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1821 AC_DEFINE(HAVE___FUNCTION__)
1822fi
1823
1824AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1825 AC_TRY_LINK([
1826#include <stdio.h>
1827],
1828 [ printf("%s", __func__); ],
1829 [ ac_cv_cc_implements___func__="yes" ],
1830 [ ac_cv_cc_implements___func__="no" ]
1831 )
1832])
1833if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1834 AC_DEFINE(HAVE___func__)
1835fi
1836
Damien Miller4f8e6692001-07-14 13:22:53 +10001837AC_CACHE_CHECK([whether getopt has optreset support],
1838 ac_cv_have_getopt_optreset, [
1839 AC_TRY_LINK(
1840 [
1841#include <getopt.h>
1842 ],
1843 [ extern int optreset; optreset = 0; ],
1844 [ ac_cv_have_getopt_optreset="yes" ],
1845 [ ac_cv_have_getopt_optreset="no" ]
1846 )
1847])
1848if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1849 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1850fi
Damien Millera22ba012000-03-02 23:09:20 +11001851
Damien Millerecbb26d2000-07-15 14:59:14 +10001852AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1853 AC_TRY_LINK([],
1854 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1855 [ ac_cv_libc_defines_sys_errlist="yes" ],
1856 [ ac_cv_libc_defines_sys_errlist="no" ]
1857 )
1858])
1859if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1860 AC_DEFINE(HAVE_SYS_ERRLIST)
1861fi
1862
1863
Damien Miller11fa2cc2000-08-16 10:35:58 +10001864AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1865 AC_TRY_LINK([],
1866 [ extern int sys_nerr; printf("%i", sys_nerr);],
1867 [ ac_cv_libc_defines_sys_nerr="yes" ],
1868 [ ac_cv_libc_defines_sys_nerr="no" ]
1869 )
1870])
1871if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1872 AC_DEFINE(HAVE_SYS_NERR)
1873fi
1874
Damien Miller85de5802001-09-18 14:01:11 +10001875SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001876# Check whether user wants sectok support
1877AC_ARG_WITH(sectok,
1878 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001879 [
1880 if test "x$withval" != "xno" ; then
1881 if test "x$withval" != "xyes" ; then
1882 CPPFLAGS="$CPPFLAGS -I${withval}"
1883 LDFLAGS="$LDFLAGS -L${withval}"
1884 if test ! -z "$need_dash_r" ; then
1885 LDFLAGS="$LDFLAGS -R${withval}"
1886 fi
1887 if test ! -z "$blibpath" ; then
1888 blibpath="$blibpath:${withval}"
1889 fi
1890 fi
1891 AC_CHECK_HEADERS(sectok.h)
1892 if test "$ac_cv_header_sectok_h" != yes; then
1893 AC_MSG_ERROR(Can't find sectok.h)
1894 fi
1895 AC_CHECK_LIB(sectok, sectok_open)
1896 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1897 AC_MSG_ERROR(Can't find libsectok)
1898 fi
1899 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001900 AC_DEFINE(USE_SECTOK)
1901 SCARD_MSG="yes, using sectok"
1902 fi
1903 ]
1904)
1905
1906# Check whether user wants OpenSC support
1907AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001908 AC_HELP_STRING([--with-opensc=PFX],
1909 [Enable smartcard support using OpenSC]),
1910 opensc_config_prefix="$withval", opensc_config_prefix="")
1911if test x$opensc_config_prefix != x ; then
1912 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1913 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1914 if test "$OPENSC_CONFIG" != "no"; then
1915 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1916 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1917 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1918 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1919 AC_DEFINE(SMARTCARD)
1920 AC_DEFINE(USE_OPENSC)
1921 SCARD_MSG="yes, using OpenSC"
1922 fi
1923fi
Damien Miller85de5802001-09-18 14:01:11 +10001924
Damien Miller7abe09b2003-05-15 10:53:49 +10001925# Check whether user wants DNS support
1926DNS_MSG="no"
1927AC_ARG_WITH(dns,
1928 [ --with-dns Support for fetching keys from DNS (experimental)],
1929 [
1930 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001931 DNS_MSG="yes"
1932 AC_DEFINE(DNS)
1933 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001934 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1935 [
1936 # Needed by our getrrsetbyname()
1937 AC_SEARCH_LIBS(res_query, resolv)
1938 AC_SEARCH_LIBS(dn_expand, resolv)
Tim Rice0ac16a42003-09-08 06:33:33 -07001939 AC_CHECK_FUNCS(_getshort _getlong)
Tim Riceb284e162003-09-08 14:35:16 -07001940 AC_CHECK_MEMBER(HEADER.ad,
1941 [AC_DEFINE(HAVE_HEADER_AD)],,
1942 [#include <arpa/nameser.h>])
Damien Miller200d0a72003-06-30 19:21:36 +10001943 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001944 fi
1945 ]
1946)
1947
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001948# Check whether user wants Kerberos 5 support
1949KRB5_MSG="no"
1950AC_ARG_WITH(kerberos5,
1951 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1952 [
1953 if test "x$withval" != "xno" ; then
1954 if test "x$withval" = "xyes" ; then
1955 KRB5ROOT="/usr/local"
1956 else
1957 KRB5ROOT=${withval}
1958 fi
1959 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1960 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1961 AC_DEFINE(KRB5)
1962 KRB5_MSG="yes"
1963 AC_MSG_CHECKING(whether we are using Heimdal)
1964 AC_TRY_COMPILE([ #include <krb5.h> ],
1965 [ char *tmp = heimdal_version; ],
1966 [ AC_MSG_RESULT(yes)
1967 AC_DEFINE(HEIMDAL)
1968 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1969 ],
1970 [ AC_MSG_RESULT(no)
1971 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1972 ]
1973 )
1974 if test ! -z "$need_dash_r" ; then
1975 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1976 fi
1977 if test ! -z "$blibpath" ; then
1978 blibpath="$blibpath:${KRB5ROOT}/lib"
1979 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001980 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001981
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001982 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1983 [ AC_DEFINE(GSSAPI)
1984 K5LIBS="-lgssapi $K5LIBS" ],
1985 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1986 [ AC_DEFINE(GSSAPI)
1987 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1988 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1989 $K5LIBS)
1990 ],
1991 $K5LIBS)
1992
1993 AC_CHECK_HEADER(gssapi.h, ,
1994 [ unset ac_cv_header_gssapi_h
1995 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1996 AC_CHECK_HEADERS(gssapi.h, ,
1997 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1998 )
1999 ]
2000 )
2001
2002 oldCPP="$CPPFLAGS"
2003 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2004 AC_CHECK_HEADER(gssapi_krb5.h, ,
2005 [ CPPFLAGS="$oldCPP" ])
2006
Damien Millerfd4c9ee2002-04-13 11:04:40 +10002007 KRB5=yes
2008 fi
2009 ]
2010)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10002011LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10002012
Damien Millera22ba012000-03-02 23:09:20 +11002013# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11002014
Damien Millerf58c6722002-05-13 13:15:42 +10002015PRIVSEP_PATH=/var/empty
2016AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07002017 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10002018 [
2019 if test "x$withval" != "$no" ; then
2020 PRIVSEP_PATH=$withval
2021 fi
2022 ]
2023)
2024AC_SUBST(PRIVSEP_PATH)
2025
Damien Millera22ba012000-03-02 23:09:20 +11002026AC_ARG_WITH(xauth,
2027 [ --with-xauth=PATH Specify path to xauth program ],
2028 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002029 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002030 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002031 fi
2032 ],
2033 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002034 TestPath="$PATH"
2035 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2036 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2037 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2038 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2039 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002040 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002041 xauth_path="/usr/openwin/bin/xauth"
2042 fi
2043 ]
2044)
2045
Damien Miller7d901272003-01-13 16:55:22 +11002046STRIP_OPT=-s
2047AC_ARG_ENABLE(strip,
2048 [ --disable-strip Disable calling strip(1) on install],
2049 [
2050 if test "x$enableval" = "xno" ; then
2051 STRIP_OPT=
2052 fi
2053 ]
2054)
2055AC_SUBST(STRIP_OPT)
2056
Damien Millera19cf472000-11-29 13:28:50 +11002057if test -z "$xauth_path" ; then
2058 XAUTH_PATH="undefined"
2059 AC_SUBST(XAUTH_PATH)
2060else
Damien Millera22ba012000-03-02 23:09:20 +11002061 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002062 XAUTH_PATH=$xauth_path
2063 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002064fi
Damien Millera22ba012000-03-02 23:09:20 +11002065
2066# Check for mail directory (last resort if we cannot get it from headers)
2067if test ! -z "$MAIL" ; then
2068 maildir=`dirname $MAIL`
2069 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2070fi
2071
Damien Millera22ba012000-03-02 23:09:20 +11002072if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002073 if test "x$disable_ptmx_check" != "xyes" ; then
2074 AC_CHECK_FILE("/dev/ptmx",
2075 [
2076 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2077 have_dev_ptmx=1
2078 ]
2079 )
2080 fi
Damien Millera22ba012000-03-02 23:09:20 +11002081fi
Damien Miller204ad072000-03-02 23:56:12 +11002082AC_CHECK_FILE("/dev/ptc",
2083 [
2084 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2085 have_dev_ptc=1
2086 ]
2087)
2088
Damien Millera22ba012000-03-02 23:09:20 +11002089# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002090AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002091 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002092 [
Damien Miller897741e2001-04-16 10:41:46 +10002093 case "$withval" in
2094 man|cat|doc)
2095 MANTYPE=$withval
2096 ;;
2097 *)
2098 AC_MSG_ERROR(invalid man type: $withval)
2099 ;;
2100 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002101 ]
2102)
Ben Lindstrombc709922001-04-18 18:04:21 +00002103if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002104 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2105 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002106 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2107 MANTYPE=doc
2108 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2109 MANTYPE=man
2110 else
2111 MANTYPE=cat
2112 fi
2113fi
Damien Miller670a4b82000-01-22 13:53:11 +11002114AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002115if test "$MANTYPE" = "doc"; then
2116 mansubdir=man;
2117else
2118 mansubdir=$MANTYPE;
2119fi
2120AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002121
Damien Millera22ba012000-03-02 23:09:20 +11002122# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002123MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002124AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002125 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002126 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002127 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002128 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002129 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002130 fi
2131 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002132)
2133
Damien Millera22ba012000-03-02 23:09:20 +11002134# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002135AC_ARG_WITH(shadow,
2136 [ --without-shadow Disable shadow password support],
2137 [
2138 if test "x$withval" = "xno" ; then
2139 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002140 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002141 fi
2142 ]
2143)
2144
Damien Miller1f335fb2000-06-26 11:31:33 +10002145if test -z "$disable_shadow" ; then
2146 AC_MSG_CHECKING([if the systems has expire shadow information])
2147 AC_TRY_COMPILE(
2148 [
2149#include <sys/types.h>
2150#include <shadow.h>
2151 struct spwd sp;
2152 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2153 [ sp_expire_available=yes ], []
2154 )
2155
2156 if test "x$sp_expire_available" = "xyes" ; then
2157 AC_MSG_RESULT(yes)
2158 AC_DEFINE(HAS_SHADOW_EXPIRE)
2159 else
2160 AC_MSG_RESULT(no)
2161 fi
2162fi
2163
Damien Millera22ba012000-03-02 23:09:20 +11002164# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002165if test ! -z "$IPADDR_IN_DISPLAY" ; then
2166 DISPLAY_HACK_MSG="yes"
2167 AC_DEFINE(IPADDR_IN_DISPLAY)
2168else
2169 DISPLAY_HACK_MSG="no"
2170 AC_ARG_WITH(ipaddr-display,
2171 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2172 [
2173 if test "x$withval" != "xno" ; then
2174 AC_DEFINE(IPADDR_IN_DISPLAY)
2175 DISPLAY_HACK_MSG="yes"
2176 fi
2177 ]
2178 )
2179fi
Damien Miller76112de1999-12-21 11:18:08 +11002180
Tim Rice43a1c132002-04-17 21:19:14 -07002181dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2182if test $ac_cv_func_login_getcapbool = "yes" -a \
2183 $ac_cv_header_login_cap_h = "yes" ; then
2184 USES_LOGIN_CONF=yes
2185fi
Damien Millera22ba012000-03-02 23:09:20 +11002186# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002187SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002188AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002189 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002190 [
Tim Rice43a1c132002-04-17 21:19:14 -07002191 if test "$USES_LOGIN_CONF" = "yes" ; then
2192 AC_MSG_WARN([
2193--with-default-path=PATH has no effect on this system.
2194Edit /etc/login.conf instead.])
2195 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002196 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002197 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002198 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002199 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002200 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2201 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2202 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002203 AC_TRY_RUN(
2204 [
2205/* find out what STDPATH is */
2206#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002207#ifdef HAVE_PATHS_H
2208# include <paths.h>
2209#endif
2210#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002211# ifdef _PATH_USERPATH /* Irix */
2212# define _PATH_STDPATH _PATH_USERPATH
2213# else
2214# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2215# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002216#endif
2217#include <sys/types.h>
2218#include <sys/stat.h>
2219#include <fcntl.h>
2220#define DATA "conftest.stdpath"
2221
2222main()
2223{
2224 FILE *fd;
2225 int rc;
2226
2227 fd = fopen(DATA,"w");
2228 if(fd == NULL)
2229 exit(1);
2230
2231 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2232 exit(1);
2233
2234 exit(0);
2235}
2236 ], [ user_path=`cat conftest.stdpath` ],
2237 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2238 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2239 )
2240# make sure $bindir is in USER_PATH so scp will work
2241 t_bindir=`eval echo ${bindir}`
2242 case $t_bindir in
2243 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2244 esac
2245 case $t_bindir in
2246 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2247 esac
2248 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2249 if test $? -ne 0 ; then
2250 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2251 if test $? -ne 0 ; then
2252 user_path=$user_path:$t_bindir
2253 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2254 fi
2255 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002256 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002257)
Tim Rice43a1c132002-04-17 21:19:14 -07002258if test "$USES_LOGIN_CONF" != "yes" ; then
2259 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2260 AC_SUBST(user_path)
2261fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002262
Damien Millera18bbd32002-05-13 10:48:57 +10002263# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002264AC_ARG_WITH(superuser-path,
2265 [ --with-superuser-path= Specify different path for super-user],
2266 [
2267 if test "x$withval" != "xno" ; then
2268 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2269 superuser_path=$withval
2270 fi
2271 ]
2272)
2273
2274
Damien Miller61e50f12000-05-08 20:49:37 +10002275AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002276IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002277AC_ARG_WITH(4in6,
2278 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2279 [
2280 if test "x$withval" != "xno" ; then
2281 AC_MSG_RESULT(yes)
2282 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002283 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002284 else
2285 AC_MSG_RESULT(no)
2286 fi
2287 ],[
2288 if test "x$inet6_default_4in6" = "xyes"; then
2289 AC_MSG_RESULT([yes (default)])
2290 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002291 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002292 else
2293 AC_MSG_RESULT([no (default)])
2294 fi
2295 ]
2296)
2297
Damien Miller60396b02001-02-18 17:01:00 +11002298# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002299BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002300AC_ARG_WITH(bsd-auth,
2301 [ --with-bsd-auth Enable BSD auth support],
2302 [
2303 if test "x$withval" != "xno" ; then
2304 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002305 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002306 fi
2307 ]
2308)
2309
Damien Millera22ba012000-03-02 23:09:20 +11002310# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002311piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002312# make sure the directory exists
2313if test ! -d $piddir ; then
2314 piddir=`eval echo ${sysconfdir}`
2315 case $piddir in
2316 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2317 esac
2318fi
2319
Tim Rice88f2ab52002-03-17 12:17:34 -08002320AC_ARG_WITH(pid-dir,
2321 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2322 [
2323 if test "x$withval" != "xno" ; then
2324 piddir=$withval
2325 if test ! -d $piddir ; then
2326 AC_MSG_WARN([** no $piddir directory on this system **])
2327 fi
2328 fi
2329 ]
2330)
2331
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002332AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002333AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002334
andre2ff7b5d2000-06-03 14:57:40 +00002335dnl allow user to disable some login recording features
2336AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002337 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002338 [
2339 if test "x$enableval" = "xno" ; then
2340 AC_DEFINE(DISABLE_LASTLOG)
2341 fi
2342 ]
andre2ff7b5d2000-06-03 14:57:40 +00002343)
2344AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002345 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002346 [
2347 if test "x$enableval" = "xno" ; then
2348 AC_DEFINE(DISABLE_UTMP)
2349 fi
2350 ]
andre2ff7b5d2000-06-03 14:57:40 +00002351)
2352AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002353 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002354 [
2355 if test "x$enableval" = "xno" ; then
2356 AC_DEFINE(DISABLE_UTMPX)
2357 fi
2358 ]
andre2ff7b5d2000-06-03 14:57:40 +00002359)
2360AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002361 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002362 [
2363 if test "x$enableval" = "xno" ; then
2364 AC_DEFINE(DISABLE_WTMP)
2365 fi
2366 ]
andre2ff7b5d2000-06-03 14:57:40 +00002367)
2368AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002369 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002370 [
2371 if test "x$enableval" = "xno" ; then
2372 AC_DEFINE(DISABLE_WTMPX)
2373 fi
2374 ]
andre2ff7b5d2000-06-03 14:57:40 +00002375)
2376AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002377 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002378 [
2379 if test "x$enableval" = "xno" ; then
2380 AC_DEFINE(DISABLE_LOGIN)
2381 fi
2382 ]
andre2ff7b5d2000-06-03 14:57:40 +00002383)
2384AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002385 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002386 [
2387 if test "x$enableval" = "xno" ; then
2388 AC_DEFINE(DISABLE_PUTUTLINE)
2389 fi
2390 ]
andre2ff7b5d2000-06-03 14:57:40 +00002391)
2392AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002393 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002394 [
2395 if test "x$enableval" = "xno" ; then
2396 AC_DEFINE(DISABLE_PUTUTXLINE)
2397 fi
2398 ]
andre2ff7b5d2000-06-03 14:57:40 +00002399)
2400AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002401 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002402 [
2403 if test "x$withval" = "xno" ; then
2404 AC_DEFINE(DISABLE_LASTLOG)
2405 else
2406 conf_lastlog_location=$withval
2407 fi
2408 ]
2409)
andre2ff7b5d2000-06-03 14:57:40 +00002410
2411dnl lastlog, [uw]tmpx? detection
2412dnl NOTE: set the paths in the platform section to avoid the
2413dnl need for command-line parameters
2414dnl lastlog and [uw]tmp are subject to a file search if all else fails
2415
2416dnl lastlog detection
2417dnl NOTE: the code itself will detect if lastlog is a directory
2418AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2419AC_TRY_COMPILE([
2420#include <sys/types.h>
2421#include <utmp.h>
2422#ifdef HAVE_LASTLOG_H
2423# include <lastlog.h>
2424#endif
Damien Miller2994e082000-06-04 15:51:47 +10002425#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002426# include <paths.h>
2427#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002428#ifdef HAVE_LOGIN_H
2429# include <login.h>
2430#endif
andre2ff7b5d2000-06-03 14:57:40 +00002431 ],
2432 [ char *lastlog = LASTLOG_FILE; ],
2433 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002434 [
2435 AC_MSG_RESULT(no)
2436 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2437 AC_TRY_COMPILE([
2438#include <sys/types.h>
2439#include <utmp.h>
2440#ifdef HAVE_LASTLOG_H
2441# include <lastlog.h>
2442#endif
2443#ifdef HAVE_PATHS_H
2444# include <paths.h>
2445#endif
2446 ],
2447 [ char *lastlog = _PATH_LASTLOG; ],
2448 [ AC_MSG_RESULT(yes) ],
2449 [
andree441aa32000-06-12 22:34:38 +00002450 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002451 system_lastlog_path=no
2452 ])
2453 ]
andre2ff7b5d2000-06-03 14:57:40 +00002454)
Damien Miller2994e082000-06-04 15:51:47 +10002455
andre2ff7b5d2000-06-03 14:57:40 +00002456if test -z "$conf_lastlog_location"; then
2457 if test x"$system_lastlog_path" = x"no" ; then
2458 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002459 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002460 conf_lastlog_location=$f
2461 fi
2462 done
2463 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002464 AC_MSG_WARN([** Cannot find lastlog **])
2465 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002466 fi
2467 fi
2468fi
2469
2470if test -n "$conf_lastlog_location"; then
2471 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2472fi
2473
2474dnl utmp detection
2475AC_MSG_CHECKING([if your system defines UTMP_FILE])
2476AC_TRY_COMPILE([
2477#include <sys/types.h>
2478#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002479#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002480# include <paths.h>
2481#endif
2482 ],
2483 [ char *utmp = UTMP_FILE; ],
2484 [ AC_MSG_RESULT(yes) ],
2485 [ AC_MSG_RESULT(no)
2486 system_utmp_path=no ]
2487)
2488if test -z "$conf_utmp_location"; then
2489 if test x"$system_utmp_path" = x"no" ; then
2490 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2491 if test -f $f ; then
2492 conf_utmp_location=$f
2493 fi
2494 done
2495 if test -z "$conf_utmp_location"; then
2496 AC_DEFINE(DISABLE_UTMP)
2497 fi
2498 fi
2499fi
2500if test -n "$conf_utmp_location"; then
2501 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2502fi
2503
2504dnl wtmp detection
2505AC_MSG_CHECKING([if your system defines WTMP_FILE])
2506AC_TRY_COMPILE([
2507#include <sys/types.h>
2508#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002509#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002510# include <paths.h>
2511#endif
2512 ],
2513 [ char *wtmp = WTMP_FILE; ],
2514 [ AC_MSG_RESULT(yes) ],
2515 [ AC_MSG_RESULT(no)
2516 system_wtmp_path=no ]
2517)
2518if test -z "$conf_wtmp_location"; then
2519 if test x"$system_wtmp_path" = x"no" ; then
2520 for f in /usr/adm/wtmp /var/log/wtmp; do
2521 if test -f $f ; then
2522 conf_wtmp_location=$f
2523 fi
2524 done
2525 if test -z "$conf_wtmp_location"; then
2526 AC_DEFINE(DISABLE_WTMP)
2527 fi
2528 fi
2529fi
2530if test -n "$conf_wtmp_location"; then
2531 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2532fi
2533
2534
2535dnl utmpx detection - I don't know any system so perverse as to require
2536dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2537dnl there, though.
2538AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2539AC_TRY_COMPILE([
2540#include <sys/types.h>
2541#include <utmp.h>
2542#ifdef HAVE_UTMPX_H
2543#include <utmpx.h>
2544#endif
Damien Miller2994e082000-06-04 15:51:47 +10002545#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002546# include <paths.h>
2547#endif
2548 ],
2549 [ char *utmpx = UTMPX_FILE; ],
2550 [ AC_MSG_RESULT(yes) ],
2551 [ AC_MSG_RESULT(no)
2552 system_utmpx_path=no ]
2553)
2554if test -z "$conf_utmpx_location"; then
2555 if test x"$system_utmpx_path" = x"no" ; then
2556 AC_DEFINE(DISABLE_UTMPX)
2557 fi
2558else
2559 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2560fi
2561
2562dnl wtmpx detection
2563AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2564AC_TRY_COMPILE([
2565#include <sys/types.h>
2566#include <utmp.h>
2567#ifdef HAVE_UTMPX_H
2568#include <utmpx.h>
2569#endif
Damien Miller2994e082000-06-04 15:51:47 +10002570#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002571# include <paths.h>
2572#endif
2573 ],
2574 [ char *wtmpx = WTMPX_FILE; ],
2575 [ AC_MSG_RESULT(yes) ],
2576 [ AC_MSG_RESULT(no)
2577 system_wtmpx_path=no ]
2578)
2579if test -z "$conf_wtmpx_location"; then
2580 if test x"$system_wtmpx_path" = x"no" ; then
2581 AC_DEFINE(DISABLE_WTMPX)
2582 fi
2583else
2584 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2585fi
2586
Damien Miller4018c192000-04-30 09:30:44 +10002587
Damien Miller29ea30d2000-03-17 10:54:15 +11002588if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002589 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2590 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002591fi
2592
Tim Rice4cec93f2002-02-26 08:40:48 -08002593dnl remove pam and dl because they are in $LIBPAM
2594if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002595 LIBS=`echo $LIBS | sed 's/-lpam //'`
2596fi
2597if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2598 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002599fi
2600
Damien Millerbac2d8a2000-09-05 16:13:06 +11002601AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002602AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2603AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002604
Damien Miller7b22d652000-06-18 14:07:04 +10002605# Print summary of options
2606
Damien Miller7b22d652000-06-18 14:07:04 +10002607# Someone please show me a better way :)
2608A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2609B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2610C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2611D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002612E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002613F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002614G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002615H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2616I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2617J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002618
2619echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002620echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002621echo " User binaries: $B"
2622echo " System binaries: $C"
2623echo " Configuration files: $D"
2624echo " Askpass program: $E"
2625echo " Manual pages: $F"
2626echo " PID file: $G"
2627echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002628if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002629echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002630else
Damien Millerf58c6722002-05-13 13:15:42 +10002631echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002632fi
Damien Millera18bbd32002-05-13 10:48:57 +10002633if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002634echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002635fi
Damien Millerf58c6722002-05-13 13:15:42 +10002636echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002637echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002638echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002639echo " KerberosV support: $KRB5_MSG"
2640echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002641echo " S/KEY support: $SKEY_MSG"
2642echo " TCP Wrappers support: $TCPW_MSG"
2643echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002644echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002645echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2646echo " BSD Auth support: $BSD_AUTH_MSG"
2647echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002648if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002649echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002650fi
2651
Damien Miller7b22d652000-06-18 14:07:04 +10002652echo ""
2653
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002654echo " Host: ${host}"
2655echo " Compiler: ${CC}"
2656echo " Compiler flags: ${CFLAGS}"
2657echo "Preprocessor flags: ${CPPFLAGS}"
2658echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002659echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002660
2661echo ""
2662
Damien Miller82cf0ce2000-12-20 13:34:48 +11002663if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002664 echo "PAM is enabled. You may need to install a PAM control file "
2665 echo "for sshd, otherwise password authentication may fail. "
2666 echo "Example PAM control files can be found in the contrib/ "
2667 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002668 echo ""
2669fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002670
Damien Miller6c21c512002-01-22 21:57:53 +11002671if test ! -z "$RAND_HELPER_CMDHASH" ; then
2672 echo "WARNING: you are using the builtin random number collection "
2673 echo "service. Please read WARNING.RNG and request that your OS "
2674 echo "vendor includes kernel-based random number collection in "
2675 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002676 echo ""
2677fi
Damien Miller60396b02001-02-18 17:01:00 +11002678