blob: 9559bcb7e6ec9047914f299bf1660a400f1e1e02 [file] [log] [blame]
Darren Tucker167bd9c2003-09-07 12:34:54 +10001# $Id: configure.ac,v 1.145 2003/09/07 02:34:54 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
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)
Damien Miller78315eb2000-09-29 23:01:36 +1100297 ;;
298*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000299 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100300 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100301 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100302 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100303*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000304 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100306 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100307*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000308 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100309 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700310 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100311 RANLIB=true
312 no_dev_ptmx=1
313 AC_DEFINE(BROKEN_SYS_TERMIO_H)
314 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000315 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000316 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100317 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100318 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700319 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700320 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100321 ;;
322*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800323 if test -z "$GCC"; then
324 CFLAGS="$CFLAGS -belf"
325 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000326 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000327 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100328 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000329 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100330 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000331 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000332 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700333 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100334 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700335 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000336 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000337*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000338 AC_DEFINE(USE_PIPES)
339 AC_DEFINE(DISABLE_FD_PASSING)
340 LDFLAGS="$LDFLAGS"
341 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
342 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000343 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000344*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000345 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700346 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700347 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000348 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
349 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
350 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700351 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000352*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000353 AC_MSG_CHECKING(for Digital Unix SIA)
354 no_osfsia=""
355 AC_ARG_WITH(osfsia,
356 [ --with-osfsia Enable Digital Unix SIA],
357 [
358 if test "x$withval" = "xno" ; then
359 AC_MSG_RESULT(disabled)
360 no_osfsia=1
361 fi
362 ],
363 )
364 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000365 if test -f /etc/sia/matrix.conf; then
366 AC_MSG_RESULT(yes)
367 AC_DEFINE(HAVE_OSF_SIA)
368 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000369 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000370 LIBS="$LIBS -lsecurity -ldb -lm -laud"
371 else
372 AC_MSG_RESULT(no)
373 fi
374 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000375 AC_DEFINE(DISABLE_FD_PASSING)
Darren Tucker3c8e1e12003-08-25 13:27:40 +1000376 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tuckere41bba52003-08-25 11:51:19 +1000377 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000378 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000379
380*-*-nto-qnx)
381 AC_DEFINE(USE_PIPES)
382 AC_DEFINE(NO_X11_UNIX_SOCKETS)
383 AC_DEFINE(MISSING_NFDBITS)
384 AC_DEFINE(MISSING_HOWMANY)
385 AC_DEFINE(MISSING_FD_MASK)
386 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100387esac
388
Damien Millere37bfc12000-06-05 09:37:43 +1000389# Allow user to specify flags
390AC_ARG_WITH(cflags,
391 [ --with-cflags Specify additional flags to pass to compiler],
392 [
393 if test "x$withval" != "xno" ; then
394 CFLAGS="$CFLAGS $withval"
395 fi
396 ]
397)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000398AC_ARG_WITH(cppflags,
399 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
400 [
401 if test "x$withval" != "xno"; then
402 CPPFLAGS="$CPPFLAGS $withval"
403 fi
404 ]
405)
Damien Millere37bfc12000-06-05 09:37:43 +1000406AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000407 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000408 [
409 if test "x$withval" != "xno" ; then
410 LDFLAGS="$LDFLAGS $withval"
411 fi
412 ]
413)
414AC_ARG_WITH(libs,
415 [ --with-libs Specify additional libraries to link with],
416 [
417 if test "x$withval" != "xno" ; then
418 LIBS="$LIBS $withval"
419 fi
420 ]
421)
422
Darren Tucker6eb93042003-06-29 21:30:41 +1000423AC_MSG_CHECKING(compiler and flags for sanity)
424AC_TRY_RUN([
425#include <stdio.h>
426int main(){exit(0);}
427 ],
428 [ AC_MSG_RESULT(yes) ],
429 [
430 AC_MSG_RESULT(no)
431 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
432 ]
433)
434
Tim Rice4cec93f2002-02-26 08:40:48 -0800435# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000436AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100437 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800438 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000439 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000440 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000441 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
442 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000443 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700444 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800445 util.h utime.h utmp.h utmpx.h)
446
Damien Millera22ba012000-03-02 23:09:20 +1100447# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700448AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
449AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000450
Damien Millerdf288022001-02-18 13:07:07 +1100451dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700452if test "x$with_tcp_wrappers" != "xno" ; then
453 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
454 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
455 fi
456fi
Damien Millerdf288022001-02-18 13:07:07 +1100457
Tim Rice13aae5e2001-10-21 17:53:58 -0700458AC_CHECK_FUNC(getspnam, ,
459 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700460
Damien Miller150c8b52002-02-13 23:06:56 +1100461AC_ARG_WITH(rpath,
462 [ --without-rpath Disable auto-added -R linker paths],
463 [
464 if test "x$withval" = "xno" ; then
465 need_dash_r=""
466 fi
467 if test "x$withval" = "xyes" ; then
468 need_dash_r=1
469 fi
470 ]
471)
472
Tim Rice13aae5e2001-10-21 17:53:58 -0700473dnl zlib is required
474AC_ARG_WITH(zlib,
475 [ --with-zlib=PATH Use zlib in PATH],
476 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000477 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100478 AC_MSG_ERROR([*** zlib is required ***])
479 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700480 if test -d "$withval/lib"; then
481 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700482 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700483 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700484 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700485 fi
486 else
487 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700488 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700489 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700490 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700491 fi
492 fi
493 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700494 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700495 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700496 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700497 fi
498 ]
499)
500
Tim Rice17b93e52001-10-23 22:36:54 -0700501AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100502
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000503dnl UnixWare 2.x
504AC_CHECK_FUNC(strcasecmp,
505 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
506)
507AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700508 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
509 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000510)
Damien Millerab18c411999-11-11 10:40:23 +1100511
Tim Ricee589a292001-11-03 11:09:32 -0800512dnl Checks for libutil functions
513AC_CHECK_HEADERS(libutil.h)
514AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
515AC_CHECK_FUNCS(logout updwtmp logwtmp)
516
Ben Lindstrom8697e082001-02-24 21:41:10 +0000517AC_FUNC_STRFTIME
518
Damien Miller3c027682001-03-14 11:39:45 +1100519# Check for ALTDIRFUNC glob() extension
520AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
521AC_EGREP_CPP(FOUNDIT,
522 [
523 #include <glob.h>
524 #ifdef GLOB_ALTDIRFUNC
525 FOUNDIT
526 #endif
527 ],
528 [
529 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
530 AC_MSG_RESULT(yes)
531 ],
532 [
533 AC_MSG_RESULT(no)
534 ]
535)
Damien Millerab18c411999-11-11 10:40:23 +1100536
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000537# Check for g.gl_matchc glob() extension
538AC_MSG_CHECKING(for gl_matchc field in glob_t)
539AC_EGREP_CPP(FOUNDIT,
540 [
541 #include <glob.h>
542 int main(void){glob_t g; g.gl_matchc = 1;}
543 ],
544 [
545 AC_DEFINE(GLOB_HAS_GL_MATCHC)
546 AC_MSG_RESULT(yes)
547 ],
548 [
549 AC_MSG_RESULT(no)
550 ]
551)
552
Damien Miller18bb4732001-03-28 14:35:30 +1000553AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
554AC_TRY_RUN(
555 [
556#include <sys/types.h>
557#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700558int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000559 ],
560 [AC_MSG_RESULT(yes)],
561 [
562 AC_MSG_RESULT(no)
563 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
564 ]
565)
566
Damien Millerc547bf12001-02-16 10:18:12 +1100567# Check whether user wants S/Key support
568SKEY_MSG="no"
569AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700570 [ --with-skey[[=PATH]] Enable S/Key support
571 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100572 [
573 if test "x$withval" != "xno" ; then
574
575 if test "x$withval" != "xyes" ; then
576 CPPFLAGS="$CPPFLAGS -I${withval}/include"
577 LDFLAGS="$LDFLAGS -L${withval}/lib"
578 fi
579
580 AC_DEFINE(SKEY)
581 LIBS="-lskey $LIBS"
582 SKEY_MSG="yes"
583
Tim Rice4cec93f2002-02-26 08:40:48 -0800584 AC_MSG_CHECKING([for s/key support])
585 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100586 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800587#include <stdio.h>
588#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700589int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800590 ],
591 [AC_MSG_RESULT(yes)],
592 [
593 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100594 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
595 ])
596 fi
597 ]
598)
599
600# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700601TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100602AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700603 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
604 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100605 [
606 if test "x$withval" != "xno" ; then
607 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700608 saved_LDFLAGS="$LDFLAGS"
609 saved_CPPFLAGS="$CPPFLAGS"
610 if test -n "${withval}" -a "${withval}" != "yes"; then
611 if test -d "${withval}/lib"; then
612 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700613 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700614 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700615 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 fi
617 else
618 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700619 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700620 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700621 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 fi
623 fi
624 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700625 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700626 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700627 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700628 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700629 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800630 LIBWRAP="-lwrap"
631 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100632 AC_MSG_CHECKING(for libwrap)
633 AC_TRY_LINK(
634 [
635#include <tcpd.h>
636 int deny_severity = 0, allow_severity = 0;
637 ],
638 [hosts_access(0);],
639 [
640 AC_MSG_RESULT(yes)
641 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800642 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700643 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100644 ],
645 [
646 AC_MSG_ERROR([*** libwrap missing])
647 ]
648 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800649 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100650 fi
651 ]
652)
653
Damien Millerfe1f1432003-02-24 15:45:42 +1100654dnl Checks for library functions. Please keep in alphabetical order
655AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000656 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
657 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100658 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000659 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100660 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000661 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
662 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
663 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000664 setproctitle setregid setresgid setresuid setreuid setrlimit \
665 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000666 strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
667 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100668)
Tim Rice13aae5e2001-10-21 17:53:58 -0700669
Damien Millercd6853c2003-01-28 11:33:42 +1100670AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000671AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100672
Darren Tuckerf1159b52003-07-07 19:44:01 +1000673dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000674AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000675AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000676
Tim Rice13aae5e2001-10-21 17:53:58 -0700677dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700678AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700679 AC_CHECK_LIB(gen, dirname,[
680 AC_CACHE_CHECK([for broken dirname],
681 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700682 save_LIBS="$LIBS"
683 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700684 AC_TRY_RUN(
685 [
686#include <libgen.h>
687#include <string.h>
688
689int main(int argc, char **argv) {
690 char *s, buf[32];
691
692 strncpy(buf,"/etc", 32);
693 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700694 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700695 exit(1);
696 } else {
697 exit(0);
698 }
699}
700 ],
701 [ ac_cv_have_broken_dirname="no" ],
702 [ ac_cv_have_broken_dirname="yes" ]
703 )
Tim Rice17b93e52001-10-23 22:36:54 -0700704 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700705 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700706 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700707 LIBS="$LIBS -lgen"
708 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700709 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700710 fi
711 ])
712])
713
Damien Millerad833b32000-08-23 10:46:23 +1000714dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000715AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000716dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000717AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000718AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000719dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000720AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000721AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100722
Damien Miller04f80141999-11-19 15:32:34 +1100723AC_CHECK_FUNC(daemon,
724 [AC_DEFINE(HAVE_DAEMON)],
725 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
726)
727
Damien Miller9fb07e42000-03-05 16:22:59 +1100728AC_CHECK_FUNC(getpagesize,
729 [AC_DEFINE(HAVE_GETPAGESIZE)],
730 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
731)
732
Damien Millercb170cb2000-07-01 16:52:55 +1000733# Check for broken snprintf
734if test "x$ac_cv_func_snprintf" = "xyes" ; then
735 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
736 AC_TRY_RUN(
737 [
738#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700739int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000740 ],
741 [AC_MSG_RESULT(yes)],
742 [
743 AC_MSG_RESULT(no)
744 AC_DEFINE(BROKEN_SNPRINTF)
745 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
746 ]
747 )
748fi
749
Damien Millere8328192003-01-07 15:18:32 +1100750dnl see whether mkstemp() requires XXXXXX
751if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
752AC_MSG_CHECKING([for (overly) strict mkstemp])
753AC_TRY_RUN(
754 [
755#include <stdlib.h>
756main() { char template[]="conftest.mkstemp-test";
757if (mkstemp(template) == -1)
758 exit(1);
759unlink(template); exit(0);
760}
761 ],
762 [
763 AC_MSG_RESULT(no)
764 ],
765 [
766 AC_MSG_RESULT(yes)
767 AC_DEFINE(HAVE_STRICT_MKSTEMP)
768 ],
769 [
770 AC_MSG_RESULT(yes)
771 AC_DEFINE(HAVE_STRICT_MKSTEMP)
772 ]
773)
774fi
775
Darren Tucker70a3d552003-08-21 17:58:29 +1000776dnl make sure that openpty does not reacquire controlling terminal
777if test ! -z "$check_for_openpty_ctty_bug"; then
778 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
779 AC_TRY_RUN(
780 [
781#include <stdio.h>
782#include <sys/fcntl.h>
783#include <sys/types.h>
784#include <sys/wait.h>
785
786int
787main()
788{
789 pid_t pid;
790 int fd, ptyfd, ttyfd, status;
791
792 pid = fork();
793 if (pid < 0) { /* failed */
794 exit(1);
795 } else if (pid > 0) { /* parent */
796 waitpid(pid, &status, 0);
797 if (WIFEXITED(status))
798 exit(WEXITSTATUS(status));
799 else
800 exit(2);
801 } else { /* child */
802 close(0); close(1); close(2);
803 setsid();
804 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
805 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
806 if (fd >= 0)
807 exit(3); /* Acquired ctty: broken */
808 else
809 exit(0); /* Did not acquire ctty: OK */
810 }
811}
812 ],
813 [
814 AC_MSG_RESULT(yes)
815 ],
816 [
817 AC_MSG_RESULT(no)
818 AC_DEFINE(SSHD_ACQUIRES_CTTY)
819 ]
820 )
821fi
822
Damien Miller606f8802000-09-16 15:39:56 +1100823AC_FUNC_GETPGRP
824
Damien Millera64b57a2001-01-17 10:44:13 +1100825# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000826PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100827AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100828 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100829 [
Damien Millera64b57a2001-01-17 10:44:13 +1100830 if test "x$withval" != "xno" ; then
831 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
832 AC_MSG_ERROR([PAM headers not found])
833 fi
834
835 AC_CHECK_LIB(dl, dlopen, , )
836 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
837 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000838 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100839
840 disable_shadow=yes
841 PAM_MSG="yes"
842
843 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800844 if test $ac_cv_lib_dl_dlopen = yes; then
845 LIBPAM="-lpam -ldl"
846 else
847 LIBPAM="-lpam"
848 fi
849 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100850 fi
851 ]
852)
Damien Millera22ba012000-03-02 23:09:20 +1100853
Damien Millera64b57a2001-01-17 10:44:13 +1100854# Check for older PAM
855if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100856 # Check PAM strerror arguments (old PAM)
857 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
858 AC_TRY_COMPILE(
859 [
Damien Miller81171112000-04-23 11:14:01 +1000860#include <stdlib.h>
861#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100862 ],
863 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
864 [AC_MSG_RESULT(no)],
865 [
866 AC_DEFINE(HAVE_OLD_PAM)
867 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000868 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100869 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100870 )
Damien Millera22ba012000-03-02 23:09:20 +1100871fi
872
Damien Millerfc93d4b2002-09-04 23:26:29 +1000873# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
874# because the system crypt() is more featureful.
875if test "x$check_for_libcrypt_before" = "x1"; then
876 AC_CHECK_LIB(crypt, crypt)
877fi
878
Tim Riceaef73712002-05-11 13:17:42 -0700879# Search for OpenSSL
880saved_CPPFLAGS="$CPPFLAGS"
881saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100882AC_ARG_WITH(ssl-dir,
883 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
884 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000885 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700886 if test -d "$withval/lib"; then
887 if test -n "${need_dash_r}"; then
888 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
889 else
890 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
891 fi
892 else
893 if test -n "${need_dash_r}"; then
894 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
895 else
896 LDFLAGS="-L${withval} ${LDFLAGS}"
897 fi
898 fi
899 if test -d "$withval/include"; then
900 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
901 else
902 CPPFLAGS="-I${withval} ${CPPFLAGS}"
903 fi
Damien Millera22ba012000-03-02 23:09:20 +1100904 fi
905 ]
906)
Tim Riceaef73712002-05-11 13:17:42 -0700907LIBS="$LIBS -lcrypto"
908AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000909 [
Tim Riceaef73712002-05-11 13:17:42 -0700910 dnl Check default openssl install dir
911 if test -n "${need_dash_r}"; then
912 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000913 else
Tim Riceaef73712002-05-11 13:17:42 -0700914 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000915 fi
Tim Riceaef73712002-05-11 13:17:42 -0700916 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
917 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
918 [
919 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
920 ]
921 )
922 ]
923)
924
Tim Riced730b782002-08-13 18:52:10 -0700925# Determine OpenSSL header version
926AC_MSG_CHECKING([OpenSSL header version])
927AC_TRY_RUN(
928 [
929#include <stdio.h>
930#include <string.h>
931#include <openssl/opensslv.h>
932#define DATA "conftest.sslincver"
933int main(void) {
934 FILE *fd;
935 int rc;
936
937 fd = fopen(DATA,"w");
938 if(fd == NULL)
939 exit(1);
940
941 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
942 exit(1);
943
944 exit(0);
945}
946 ],
947 [
948 ssl_header_ver=`cat conftest.sslincver`
949 AC_MSG_RESULT($ssl_header_ver)
950 ],
951 [
952 AC_MSG_RESULT(not found)
953 AC_MSG_ERROR(OpenSSL version header not found.)
954 ]
955)
956
957# Determine OpenSSL library version
958AC_MSG_CHECKING([OpenSSL library version])
959AC_TRY_RUN(
960 [
961#include <stdio.h>
962#include <string.h>
963#include <openssl/opensslv.h>
964#include <openssl/crypto.h>
965#define DATA "conftest.ssllibver"
966int main(void) {
967 FILE *fd;
968 int rc;
969
970 fd = fopen(DATA,"w");
971 if(fd == NULL)
972 exit(1);
973
974 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
975 exit(1);
976
977 exit(0);
978}
979 ],
980 [
981 ssl_library_ver=`cat conftest.ssllibver`
982 AC_MSG_RESULT($ssl_library_ver)
983 ],
984 [
985 AC_MSG_RESULT(not found)
986 AC_MSG_ERROR(OpenSSL library not found.)
987 ]
988)
Damien Millera22ba012000-03-02 23:09:20 +1100989
Damien Millerec932372002-01-22 22:16:03 +1100990# Sanity check OpenSSL headers
991AC_MSG_CHECKING([whether OpenSSL's headers match the library])
992AC_TRY_RUN(
993 [
994#include <string.h>
995#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700996int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100997 ],
998 [
999 AC_MSG_RESULT(yes)
1000 ],
1001 [
1002 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +10001003 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1004Check config.log for details.
1005Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001006 ]
1007)
1008
Damien Millera64b57a2001-01-17 10:44:13 +11001009# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1010# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001011if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001012 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001013fi
1014
Damien Miller6c21c512002-01-22 21:57:53 +11001015
1016### Configure cryptographic random number support
1017
1018# Check wheter OpenSSL seeds itself
1019AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1020AC_TRY_RUN(
1021 [
1022#include <string.h>
1023#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001024int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001025 ],
1026 [
1027 OPENSSL_SEEDS_ITSELF=yes
1028 AC_MSG_RESULT(yes)
1029 ],
1030 [
1031 AC_MSG_RESULT(no)
1032 # Default to use of the rand helper if OpenSSL doesn't
1033 # seed itself
1034 USE_RAND_HELPER=yes
1035 ]
1036)
1037
1038
1039# Do we want to force the use of the rand helper?
1040AC_ARG_WITH(rand-helper,
1041 [ --with-rand-helper Use subprocess to gather strong randomness ],
1042 [
1043 if test "x$withval" = "xno" ; then
1044 # Force use of OpenSSL's internal RNG, even if
1045 # the previous test showed it to be unseeded.
1046 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1047 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1048 OPENSSL_SEEDS_ITSELF=yes
1049 USE_RAND_HELPER=""
1050 fi
1051 else
1052 USE_RAND_HELPER=yes
1053 fi
1054 ],
1055)
1056
1057# Which randomness source do we use?
1058if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1059 # OpenSSL only
1060 AC_DEFINE(OPENSSL_PRNG_ONLY)
1061 RAND_MSG="OpenSSL internal ONLY"
1062 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001063elif test ! -z "$USE_RAND_HELPER" ; then
1064 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001065 RAND_MSG="ssh-rand-helper"
1066 INSTALL_SSH_RAND_HELPER="yes"
1067fi
1068AC_SUBST(INSTALL_SSH_RAND_HELPER)
1069
1070### Configuration of ssh-rand-helper
1071
1072# PRNGD TCP socket
1073AC_ARG_WITH(prngd-port,
1074 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1075 [
Damien Millere996d722002-01-23 11:20:59 +11001076 case "$withval" in
1077 no)
1078 withval=""
1079 ;;
1080 [[0-9]]*)
1081 ;;
1082 *)
1083 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1084 ;;
1085 esac
1086 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001087 PRNGD_PORT="$withval"
1088 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1089 fi
1090 ]
1091)
1092
1093# PRNGD Unix domain socket
1094AC_ARG_WITH(prngd-socket,
1095 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1096 [
Damien Millere996d722002-01-23 11:20:59 +11001097 case "$withval" in
1098 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001099 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001100 ;;
1101 no)
1102 withval=""
1103 ;;
1104 /*)
1105 ;;
1106 *)
1107 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1108 ;;
1109 esac
1110
1111 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001112 if test ! -z "$PRNGD_PORT" ; then
1113 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1114 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001115 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001116 AC_MSG_WARN(Entropy socket is not readable)
1117 fi
1118 PRNGD_SOCKET="$withval"
1119 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1120 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001121 ],
1122 [
1123 # Check for existing socket only if we don't have a random device already
1124 if test "$USE_RAND_HELPER" = yes ; then
1125 AC_MSG_CHECKING(for PRNGD/EGD socket)
1126 # Insert other locations here
1127 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1128 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1129 PRNGD_SOCKET="$sock"
1130 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1131 break;
1132 fi
1133 done
1134 if test ! -z "$PRNGD_SOCKET" ; then
1135 AC_MSG_RESULT($PRNGD_SOCKET)
1136 else
1137 AC_MSG_RESULT(not found)
1138 fi
1139 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001140 ]
1141)
1142
1143# Change default command timeout for hashing entropy source
1144entropy_timeout=200
1145AC_ARG_WITH(entropy-timeout,
1146 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1147 [
1148 if test "x$withval" != "xno" ; then
1149 entropy_timeout=$withval
1150 fi
1151 ]
1152)
Damien Miller6c21c512002-01-22 21:57:53 +11001153AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1154
Damien Millerd3f6ad22002-06-25 10:24:47 +10001155SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001156AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001157 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001158 [
1159 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001160 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001161 fi
1162 ]
1163)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001164AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1165AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001166
Tim Rice88f2ab52002-03-17 12:17:34 -08001167# We do this little dance with the search path to insure
1168# that programs that we select for use by installed programs
1169# (which may be run by the super-user) come from trusted
1170# locations before they come from the user's private area.
1171# This should help avoid accidentally configuring some
1172# random version of a program in someone's personal bin.
1173
1174OPATH=$PATH
1175PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001176test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001177test -d /sbin && PATH=$PATH:/sbin
1178test -d /usr/sbin && PATH=$PATH:/usr/sbin
1179PATH=$PATH:/etc:$OPATH
1180
Damien Miller6c21c512002-01-22 21:57:53 +11001181# These programs are used by the command hashing source to gather entropy
1182OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1183OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1184OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1185OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1186OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1187OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1188OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1189OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1190OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1191OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1192OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1193OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1194OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1195OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1196OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1197OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001198# restore PATH
1199PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001200
1201# Where does ssh-rand-helper get its randomness from?
1202INSTALL_SSH_PRNG_CMDS=""
1203if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1204 if test ! -z "$PRNGD_PORT" ; then
1205 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1206 elif test ! -z "$PRNGD_SOCKET" ; then
1207 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1208 else
1209 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1210 RAND_HELPER_CMDHASH=yes
1211 INSTALL_SSH_PRNG_CMDS="yes"
1212 fi
1213fi
1214AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1215
1216
Ben Lindstromb5628642000-10-18 00:02:25 +00001217# Cheap hack to ensure NEWS-OS libraries are arranged right.
1218if test ! -z "$SONY" ; then
1219 LIBS="$LIBS -liberty";
1220fi
1221
Damien Millera22ba012000-03-02 23:09:20 +11001222# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001223AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001224AC_CHECK_SIZEOF(short int, 2)
1225AC_CHECK_SIZEOF(int, 4)
1226AC_CHECK_SIZEOF(long int, 4)
1227AC_CHECK_SIZEOF(long long int, 8)
1228
Damien Millerfa2bb692002-04-23 23:22:25 +10001229# Sanity check long long for some platforms (AIX)
1230if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1231 ac_cv_sizeof_long_long_int=0
1232fi
1233
Damien Millera22ba012000-03-02 23:09:20 +11001234# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001235AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1236 AC_TRY_COMPILE(
1237 [ #include <sys/types.h> ],
1238 [ u_int a; a = 1;],
1239 [ ac_cv_have_u_int="yes" ],
1240 [ ac_cv_have_u_int="no" ]
1241 )
1242])
1243if test "x$ac_cv_have_u_int" = "xyes" ; then
1244 AC_DEFINE(HAVE_U_INT)
1245 have_u_int=1
1246fi
1247
Damien Miller61e50f12000-05-08 20:49:37 +10001248AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1249 AC_TRY_COMPILE(
1250 [ #include <sys/types.h> ],
1251 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1252 [ ac_cv_have_intxx_t="yes" ],
1253 [ ac_cv_have_intxx_t="no" ]
1254 )
1255])
1256if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1257 AC_DEFINE(HAVE_INTXX_T)
1258 have_intxx_t=1
1259fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001260
1261if (test -z "$have_intxx_t" && \
1262 test "x$ac_cv_header_stdint_h" = "xyes")
1263then
1264 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1265 AC_TRY_COMPILE(
1266 [ #include <stdint.h> ],
1267 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1268 [
1269 AC_DEFINE(HAVE_INTXX_T)
1270 AC_MSG_RESULT(yes)
1271 ],
1272 [ AC_MSG_RESULT(no) ]
1273 )
1274fi
1275
Damien Miller578783e2000-09-23 14:12:24 +11001276AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1277 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001278 [
1279#include <sys/types.h>
1280#ifdef HAVE_STDINT_H
1281# include <stdint.h>
1282#endif
1283#include <sys/socket.h>
1284#ifdef HAVE_SYS_BITYPES_H
1285# include <sys/bitypes.h>
1286#endif
1287 ],
Damien Miller578783e2000-09-23 14:12:24 +11001288 [ int64_t a; a = 1;],
1289 [ ac_cv_have_int64_t="yes" ],
1290 [ ac_cv_have_int64_t="no" ]
1291 )
1292])
1293if test "x$ac_cv_have_int64_t" = "xyes" ; then
1294 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001295fi
1296
Damien Miller61e50f12000-05-08 20:49:37 +10001297AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1298 AC_TRY_COMPILE(
1299 [ #include <sys/types.h> ],
1300 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1301 [ ac_cv_have_u_intxx_t="yes" ],
1302 [ ac_cv_have_u_intxx_t="no" ]
1303 )
1304])
1305if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1306 AC_DEFINE(HAVE_U_INTXX_T)
1307 have_u_intxx_t=1
1308fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001309
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001310if test -z "$have_u_intxx_t" ; then
1311 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1312 AC_TRY_COMPILE(
1313 [ #include <sys/socket.h> ],
1314 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1315 [
1316 AC_DEFINE(HAVE_U_INTXX_T)
1317 AC_MSG_RESULT(yes)
1318 ],
1319 [ AC_MSG_RESULT(no) ]
1320 )
1321fi
1322
Damien Miller578783e2000-09-23 14:12:24 +11001323AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1324 AC_TRY_COMPILE(
1325 [ #include <sys/types.h> ],
1326 [ u_int64_t a; a = 1;],
1327 [ ac_cv_have_u_int64_t="yes" ],
1328 [ ac_cv_have_u_int64_t="no" ]
1329 )
1330])
1331if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1332 AC_DEFINE(HAVE_U_INT64_T)
1333 have_u_int64_t=1
1334fi
1335
Tim Rice4cec93f2002-02-26 08:40:48 -08001336if test -z "$have_u_int64_t" ; then
1337 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1338 AC_TRY_COMPILE(
1339 [ #include <sys/bitypes.h> ],
1340 [ u_int64_t a; a = 1],
1341 [
1342 AC_DEFINE(HAVE_U_INT64_T)
1343 AC_MSG_RESULT(yes)
1344 ],
1345 [ AC_MSG_RESULT(no) ]
1346 )
1347fi
1348
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001349if test -z "$have_u_intxx_t" ; then
1350 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1351 AC_TRY_COMPILE(
1352 [
1353#include <sys/types.h>
1354 ],
1355 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1356 [ ac_cv_have_uintxx_t="yes" ],
1357 [ ac_cv_have_uintxx_t="no" ]
1358 )
1359 ])
1360 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1361 AC_DEFINE(HAVE_UINTXX_T)
1362 fi
1363fi
1364
1365if test -z "$have_uintxx_t" ; then
1366 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1367 AC_TRY_COMPILE(
1368 [ #include <stdint.h> ],
1369 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1370 [
1371 AC_DEFINE(HAVE_UINTXX_T)
1372 AC_MSG_RESULT(yes)
1373 ],
1374 [ AC_MSG_RESULT(no) ]
1375 )
1376fi
1377
Damien Milleredb82922000-06-20 13:25:52 +10001378if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1379 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001380then
1381 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1382 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001383 [
1384#include <sys/bitypes.h>
1385 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001386 [
Damien Miller70494d12000-04-03 15:57:06 +10001387 int8_t a; int16_t b; int32_t c;
1388 u_int8_t e; u_int16_t f; u_int32_t g;
1389 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001390 ],
1391 [
1392 AC_DEFINE(HAVE_U_INTXX_T)
1393 AC_DEFINE(HAVE_INTXX_T)
1394 AC_MSG_RESULT(yes)
1395 ],
1396 [AC_MSG_RESULT(no)]
1397 )
1398fi
1399
Damien Miller58be7382001-09-15 21:31:54 +10001400
1401AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1402 AC_TRY_COMPILE(
1403 [
1404#include <sys/types.h>
1405 ],
1406 [ u_char foo; foo = 125; ],
1407 [ ac_cv_have_u_char="yes" ],
1408 [ ac_cv_have_u_char="no" ]
1409 )
1410])
1411if test "x$ac_cv_have_u_char" = "xyes" ; then
1412 AC_DEFINE(HAVE_U_CHAR)
1413fi
1414
Tim Rice13aae5e2001-10-21 17:53:58 -07001415TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001416
Tim Rice200a5c02002-02-26 22:12:34 -08001417AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001418
Damien Miller61e50f12000-05-08 20:49:37 +10001419AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1420 AC_TRY_COMPILE(
1421 [
1422#include <sys/types.h>
1423 ],
1424 [ size_t foo; foo = 1235; ],
1425 [ ac_cv_have_size_t="yes" ],
1426 [ ac_cv_have_size_t="no" ]
1427 )
1428])
1429if test "x$ac_cv_have_size_t" = "xyes" ; then
1430 AC_DEFINE(HAVE_SIZE_T)
1431fi
Damien Miller95058511999-12-29 10:36:45 +11001432
Damien Miller615f9392000-05-17 22:53:33 +10001433AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1434 AC_TRY_COMPILE(
1435 [
1436#include <sys/types.h>
1437 ],
1438 [ ssize_t foo; foo = 1235; ],
1439 [ ac_cv_have_ssize_t="yes" ],
1440 [ ac_cv_have_ssize_t="no" ]
1441 )
1442])
1443if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1444 AC_DEFINE(HAVE_SSIZE_T)
1445fi
1446
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001447AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1448 AC_TRY_COMPILE(
1449 [
1450#include <time.h>
1451 ],
1452 [ clock_t foo; foo = 1235; ],
1453 [ ac_cv_have_clock_t="yes" ],
1454 [ ac_cv_have_clock_t="no" ]
1455 )
1456])
1457if test "x$ac_cv_have_clock_t" = "xyes" ; then
1458 AC_DEFINE(HAVE_CLOCK_T)
1459fi
1460
Damien Millerb54b40e2000-06-23 08:23:34 +10001461AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1462 AC_TRY_COMPILE(
1463 [
1464#include <sys/types.h>
1465#include <sys/socket.h>
1466 ],
1467 [ sa_family_t foo; foo = 1235; ],
1468 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001469 [ AC_TRY_COMPILE(
1470 [
1471#include <sys/types.h>
1472#include <sys/socket.h>
1473#include <netinet/in.h>
1474 ],
1475 [ sa_family_t foo; foo = 1235; ],
1476 [ ac_cv_have_sa_family_t="yes" ],
1477
Damien Millerb54b40e2000-06-23 08:23:34 +10001478 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001479 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001480 )
1481])
1482if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1483 AC_DEFINE(HAVE_SA_FAMILY_T)
1484fi
1485
Damien Miller0f91b4e2000-06-18 15:43:25 +10001486AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1487 AC_TRY_COMPILE(
1488 [
1489#include <sys/types.h>
1490 ],
1491 [ pid_t foo; foo = 1235; ],
1492 [ ac_cv_have_pid_t="yes" ],
1493 [ ac_cv_have_pid_t="no" ]
1494 )
1495])
1496if test "x$ac_cv_have_pid_t" = "xyes" ; then
1497 AC_DEFINE(HAVE_PID_T)
1498fi
1499
1500AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1501 AC_TRY_COMPILE(
1502 [
1503#include <sys/types.h>
1504 ],
1505 [ mode_t foo; foo = 1235; ],
1506 [ ac_cv_have_mode_t="yes" ],
1507 [ ac_cv_have_mode_t="no" ]
1508 )
1509])
1510if test "x$ac_cv_have_mode_t" = "xyes" ; then
1511 AC_DEFINE(HAVE_MODE_T)
1512fi
1513
Damien Miller61e50f12000-05-08 20:49:37 +10001514
1515AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1516 AC_TRY_COMPILE(
1517 [
Damien Miller81171112000-04-23 11:14:01 +10001518#include <sys/types.h>
1519#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001520 ],
1521 [ struct sockaddr_storage s; ],
1522 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1523 [ ac_cv_have_struct_sockaddr_storage="no" ]
1524 )
1525])
1526if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1527 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1528fi
Damien Miller34132e52000-01-14 15:45:46 +11001529
Damien Miller61e50f12000-05-08 20:49:37 +10001530AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1531 AC_TRY_COMPILE(
1532 [
Damien Miller7b22d652000-06-18 14:07:04 +10001533#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001534#include <netinet/in.h>
1535 ],
1536 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1537 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1538 [ ac_cv_have_struct_sockaddr_in6="no" ]
1539 )
1540])
1541if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1542 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1543fi
Damien Miller34132e52000-01-14 15:45:46 +11001544
Damien Miller61e50f12000-05-08 20:49:37 +10001545AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1546 AC_TRY_COMPILE(
1547 [
Damien Miller7b22d652000-06-18 14:07:04 +10001548#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001549#include <netinet/in.h>
1550 ],
1551 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1552 [ ac_cv_have_struct_in6_addr="yes" ],
1553 [ ac_cv_have_struct_in6_addr="no" ]
1554 )
1555])
1556if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1557 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1558fi
Damien Miller34132e52000-01-14 15:45:46 +11001559
Damien Miller61e50f12000-05-08 20:49:37 +10001560AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1561 AC_TRY_COMPILE(
1562 [
Damien Miller81171112000-04-23 11:14:01 +10001563#include <sys/types.h>
1564#include <sys/socket.h>
1565#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001566 ],
1567 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1568 [ ac_cv_have_struct_addrinfo="yes" ],
1569 [ ac_cv_have_struct_addrinfo="no" ]
1570 )
1571])
1572if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1573 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1574fi
1575
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001576AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1577 AC_TRY_COMPILE(
1578 [ #include <sys/time.h> ],
1579 [ struct timeval tv; tv.tv_sec = 1;],
1580 [ ac_cv_have_struct_timeval="yes" ],
1581 [ ac_cv_have_struct_timeval="no" ]
1582 )
1583])
1584if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1585 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1586 have_struct_timeval=1
1587fi
1588
Tim Rice4e4dc562003-03-18 10:21:40 -08001589AC_CHECK_TYPES(struct timespec)
1590
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001591# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001592if test "x$ac_cv_have_int64_t" = "xno" -a \
1593 "x$ac_cv_sizeof_long_int" != "x8" -a \
1594 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001595 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1596 echo "an alternative compiler (I.E., GCC) before continuing."
1597 echo ""
1598 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001599else
1600dnl test snprintf (broken on SCO w/gcc)
1601 AC_TRY_RUN(
1602 [
1603#include <stdio.h>
1604#include <string.h>
1605#ifdef HAVE_SNPRINTF
1606main()
1607{
1608 char buf[50];
1609 char expected_out[50];
1610 int mazsize = 50 ;
1611#if (SIZEOF_LONG_INT == 8)
1612 long int num = 0x7fffffffffffffff;
1613#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001614 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001615#endif
1616 strcpy(expected_out, "9223372036854775807");
1617 snprintf(buf, mazsize, "%lld", num);
1618 if(strcmp(buf, expected_out) != 0)
1619 exit(1);
1620 exit(0);
1621}
1622#else
1623main() { exit(0); }
1624#endif
1625 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1626 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001627fi
1628
Damien Miller78315eb2000-09-29 23:01:36 +11001629dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001630OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1631OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1632OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1633OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1634OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001635OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001636OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1637OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001638OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001639OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1640OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1641OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1642OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001643OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1644OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1645OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1646OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001647
1648AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001649
Damien Miller61e50f12000-05-08 20:49:37 +10001650AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1651 ac_cv_have_ss_family_in_struct_ss, [
1652 AC_TRY_COMPILE(
1653 [
Damien Miller81171112000-04-23 11:14:01 +10001654#include <sys/types.h>
1655#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001656 ],
1657 [ struct sockaddr_storage s; s.ss_family = 1; ],
1658 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1659 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1660 )
1661])
1662if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1663 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1664fi
1665
Damien Miller61e50f12000-05-08 20:49:37 +10001666AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1667 ac_cv_have___ss_family_in_struct_ss, [
1668 AC_TRY_COMPILE(
1669 [
Damien Miller81171112000-04-23 11:14:01 +10001670#include <sys/types.h>
1671#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001672 ],
1673 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1674 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1675 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1676 )
1677])
1678if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1679 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1680fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001681
Damien Millerad833b32000-08-23 10:46:23 +10001682AC_CACHE_CHECK([for pw_class field in struct passwd],
1683 ac_cv_have_pw_class_in_struct_passwd, [
1684 AC_TRY_COMPILE(
1685 [
Damien Millerad833b32000-08-23 10:46:23 +10001686#include <pwd.h>
1687 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001688 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001689 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1690 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1691 )
1692])
1693if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1694 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1695fi
1696
Kevin Steves82456952001-06-22 21:14:18 +00001697AC_CACHE_CHECK([for pw_expire field in struct passwd],
1698 ac_cv_have_pw_expire_in_struct_passwd, [
1699 AC_TRY_COMPILE(
1700 [
1701#include <pwd.h>
1702 ],
1703 [ struct passwd p; p.pw_expire = 0; ],
1704 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1705 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1706 )
1707])
1708if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1709 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1710fi
1711
1712AC_CACHE_CHECK([for pw_change field in struct passwd],
1713 ac_cv_have_pw_change_in_struct_passwd, [
1714 AC_TRY_COMPILE(
1715 [
1716#include <pwd.h>
1717 ],
1718 [ struct passwd p; p.pw_change = 0; ],
1719 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1720 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1721 )
1722])
1723if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1724 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1725fi
Damien Miller61e50f12000-05-08 20:49:37 +10001726
Tim Rice28bbb0c2002-05-27 17:37:32 -07001727dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001728AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1729 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001730 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001731 [
Tim Riceae49fe62002-04-12 10:26:21 -07001732#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001733#include <sys/socket.h>
1734#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001735int main() {
1736#ifdef msg_accrights
1737exit(1);
1738#endif
1739struct msghdr m;
1740m.msg_accrights = 0;
1741exit(0);
1742}
Kevin Steves939c9db2002-03-22 17:23:25 +00001743 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001744 [ ac_cv_have_accrights_in_msghdr="yes" ],
1745 [ ac_cv_have_accrights_in_msghdr="no" ]
1746 )
1747])
1748if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1749 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1750fi
1751
Kevin Stevesa44e0352002-04-07 16:18:03 +00001752AC_CACHE_CHECK([for msg_control field in struct msghdr],
1753 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001754 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001755 [
Tim Riceae49fe62002-04-12 10:26:21 -07001756#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001757#include <sys/socket.h>
1758#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001759int main() {
1760#ifdef msg_control
1761exit(1);
1762#endif
1763struct msghdr m;
1764m.msg_control = 0;
1765exit(0);
1766}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001767 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001768 [ ac_cv_have_control_in_msghdr="yes" ],
1769 [ ac_cv_have_control_in_msghdr="no" ]
1770 )
1771])
1772if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1773 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1774fi
1775
Damien Miller61e50f12000-05-08 20:49:37 +10001776AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1777 AC_TRY_LINK([],
1778 [ extern char *__progname; printf("%s", __progname); ],
1779 [ ac_cv_libc_defines___progname="yes" ],
1780 [ ac_cv_libc_defines___progname="no" ]
1781 )
1782])
1783if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1784 AC_DEFINE(HAVE___PROGNAME)
1785fi
1786
Kevin Steves4846f4a2002-03-22 18:19:53 +00001787AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1788 AC_TRY_LINK([
1789#include <stdio.h>
1790],
1791 [ printf("%s", __FUNCTION__); ],
1792 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1793 [ ac_cv_cc_implements___FUNCTION__="no" ]
1794 )
1795])
1796if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1797 AC_DEFINE(HAVE___FUNCTION__)
1798fi
1799
1800AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1801 AC_TRY_LINK([
1802#include <stdio.h>
1803],
1804 [ printf("%s", __func__); ],
1805 [ ac_cv_cc_implements___func__="yes" ],
1806 [ ac_cv_cc_implements___func__="no" ]
1807 )
1808])
1809if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1810 AC_DEFINE(HAVE___func__)
1811fi
1812
Damien Miller4f8e6692001-07-14 13:22:53 +10001813AC_CACHE_CHECK([whether getopt has optreset support],
1814 ac_cv_have_getopt_optreset, [
1815 AC_TRY_LINK(
1816 [
1817#include <getopt.h>
1818 ],
1819 [ extern int optreset; optreset = 0; ],
1820 [ ac_cv_have_getopt_optreset="yes" ],
1821 [ ac_cv_have_getopt_optreset="no" ]
1822 )
1823])
1824if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1825 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1826fi
Damien Millera22ba012000-03-02 23:09:20 +11001827
Damien Millerecbb26d2000-07-15 14:59:14 +10001828AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1829 AC_TRY_LINK([],
1830 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1831 [ ac_cv_libc_defines_sys_errlist="yes" ],
1832 [ ac_cv_libc_defines_sys_errlist="no" ]
1833 )
1834])
1835if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1836 AC_DEFINE(HAVE_SYS_ERRLIST)
1837fi
1838
1839
Damien Miller11fa2cc2000-08-16 10:35:58 +10001840AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1841 AC_TRY_LINK([],
1842 [ extern int sys_nerr; printf("%i", sys_nerr);],
1843 [ ac_cv_libc_defines_sys_nerr="yes" ],
1844 [ ac_cv_libc_defines_sys_nerr="no" ]
1845 )
1846])
1847if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1848 AC_DEFINE(HAVE_SYS_NERR)
1849fi
1850
Damien Miller85de5802001-09-18 14:01:11 +10001851SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001852# Check whether user wants sectok support
1853AC_ARG_WITH(sectok,
1854 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001855 [
1856 if test "x$withval" != "xno" ; then
1857 if test "x$withval" != "xyes" ; then
1858 CPPFLAGS="$CPPFLAGS -I${withval}"
1859 LDFLAGS="$LDFLAGS -L${withval}"
1860 if test ! -z "$need_dash_r" ; then
1861 LDFLAGS="$LDFLAGS -R${withval}"
1862 fi
1863 if test ! -z "$blibpath" ; then
1864 blibpath="$blibpath:${withval}"
1865 fi
1866 fi
1867 AC_CHECK_HEADERS(sectok.h)
1868 if test "$ac_cv_header_sectok_h" != yes; then
1869 AC_MSG_ERROR(Can't find sectok.h)
1870 fi
1871 AC_CHECK_LIB(sectok, sectok_open)
1872 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1873 AC_MSG_ERROR(Can't find libsectok)
1874 fi
1875 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001876 AC_DEFINE(USE_SECTOK)
1877 SCARD_MSG="yes, using sectok"
1878 fi
1879 ]
1880)
1881
1882# Check whether user wants OpenSC support
1883AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001884 AC_HELP_STRING([--with-opensc=PFX],
1885 [Enable smartcard support using OpenSC]),
1886 opensc_config_prefix="$withval", opensc_config_prefix="")
1887if test x$opensc_config_prefix != x ; then
1888 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1889 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1890 if test "$OPENSC_CONFIG" != "no"; then
1891 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1892 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1893 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1894 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1895 AC_DEFINE(SMARTCARD)
1896 AC_DEFINE(USE_OPENSC)
1897 SCARD_MSG="yes, using OpenSC"
1898 fi
1899fi
Damien Miller85de5802001-09-18 14:01:11 +10001900
Damien Miller7abe09b2003-05-15 10:53:49 +10001901# Check whether user wants DNS support
1902DNS_MSG="no"
1903AC_ARG_WITH(dns,
1904 [ --with-dns Support for fetching keys from DNS (experimental)],
1905 [
1906 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001907 DNS_MSG="yes"
1908 AC_DEFINE(DNS)
1909 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001910 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1911 [
1912 # Needed by our getrrsetbyname()
1913 AC_SEARCH_LIBS(res_query, resolv)
1914 AC_SEARCH_LIBS(dn_expand, resolv)
1915 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001916 fi
1917 ]
1918)
1919
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001920# Check whether user wants Kerberos 5 support
1921KRB5_MSG="no"
1922AC_ARG_WITH(kerberos5,
1923 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1924 [
1925 if test "x$withval" != "xno" ; then
1926 if test "x$withval" = "xyes" ; then
1927 KRB5ROOT="/usr/local"
1928 else
1929 KRB5ROOT=${withval}
1930 fi
1931 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1932 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1933 AC_DEFINE(KRB5)
1934 KRB5_MSG="yes"
1935 AC_MSG_CHECKING(whether we are using Heimdal)
1936 AC_TRY_COMPILE([ #include <krb5.h> ],
1937 [ char *tmp = heimdal_version; ],
1938 [ AC_MSG_RESULT(yes)
1939 AC_DEFINE(HEIMDAL)
1940 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1941 ],
1942 [ AC_MSG_RESULT(no)
1943 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1944 ]
1945 )
1946 if test ! -z "$need_dash_r" ; then
1947 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1948 fi
1949 if test ! -z "$blibpath" ; then
1950 blibpath="$blibpath:${KRB5ROOT}/lib"
1951 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001952 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001953
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001954 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1955 [ AC_DEFINE(GSSAPI)
1956 K5LIBS="-lgssapi $K5LIBS" ],
1957 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1958 [ AC_DEFINE(GSSAPI)
1959 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1960 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1961 $K5LIBS)
1962 ],
1963 $K5LIBS)
1964
1965 AC_CHECK_HEADER(gssapi.h, ,
1966 [ unset ac_cv_header_gssapi_h
1967 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1968 AC_CHECK_HEADERS(gssapi.h, ,
1969 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1970 )
1971 ]
1972 )
1973
1974 oldCPP="$CPPFLAGS"
1975 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1976 AC_CHECK_HEADER(gssapi_krb5.h, ,
1977 [ CPPFLAGS="$oldCPP" ])
1978
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001979 KRB5=yes
1980 fi
1981 ]
1982)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10001983LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001984
Damien Millera22ba012000-03-02 23:09:20 +11001985# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001986
Damien Millerf58c6722002-05-13 13:15:42 +10001987PRIVSEP_PATH=/var/empty
1988AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001989 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001990 [
1991 if test "x$withval" != "$no" ; then
1992 PRIVSEP_PATH=$withval
1993 fi
1994 ]
1995)
1996AC_SUBST(PRIVSEP_PATH)
1997
Damien Millera22ba012000-03-02 23:09:20 +11001998AC_ARG_WITH(xauth,
1999 [ --with-xauth=PATH Specify path to xauth program ],
2000 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00002001 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10002002 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11002003 fi
2004 ],
2005 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002006 TestPath="$PATH"
2007 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2008 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2009 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2010 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2011 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002012 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002013 xauth_path="/usr/openwin/bin/xauth"
2014 fi
2015 ]
2016)
2017
Damien Miller7d901272003-01-13 16:55:22 +11002018STRIP_OPT=-s
2019AC_ARG_ENABLE(strip,
2020 [ --disable-strip Disable calling strip(1) on install],
2021 [
2022 if test "x$enableval" = "xno" ; then
2023 STRIP_OPT=
2024 fi
2025 ]
2026)
2027AC_SUBST(STRIP_OPT)
2028
Damien Millera19cf472000-11-29 13:28:50 +11002029if test -z "$xauth_path" ; then
2030 XAUTH_PATH="undefined"
2031 AC_SUBST(XAUTH_PATH)
2032else
Damien Millera22ba012000-03-02 23:09:20 +11002033 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002034 XAUTH_PATH=$xauth_path
2035 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002036fi
Damien Millera22ba012000-03-02 23:09:20 +11002037
2038# Check for mail directory (last resort if we cannot get it from headers)
2039if test ! -z "$MAIL" ; then
2040 maildir=`dirname $MAIL`
2041 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2042fi
2043
Damien Millera22ba012000-03-02 23:09:20 +11002044if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002045 if test "x$disable_ptmx_check" != "xyes" ; then
2046 AC_CHECK_FILE("/dev/ptmx",
2047 [
2048 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2049 have_dev_ptmx=1
2050 ]
2051 )
2052 fi
Damien Millera22ba012000-03-02 23:09:20 +11002053fi
Damien Miller204ad072000-03-02 23:56:12 +11002054AC_CHECK_FILE("/dev/ptc",
2055 [
2056 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2057 have_dev_ptc=1
2058 ]
2059)
2060
Damien Millera22ba012000-03-02 23:09:20 +11002061# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002062AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002063 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002064 [
Damien Miller897741e2001-04-16 10:41:46 +10002065 case "$withval" in
2066 man|cat|doc)
2067 MANTYPE=$withval
2068 ;;
2069 *)
2070 AC_MSG_ERROR(invalid man type: $withval)
2071 ;;
2072 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002073 ]
2074)
Ben Lindstrombc709922001-04-18 18:04:21 +00002075if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002076 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2077 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002078 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2079 MANTYPE=doc
2080 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2081 MANTYPE=man
2082 else
2083 MANTYPE=cat
2084 fi
2085fi
Damien Miller670a4b82000-01-22 13:53:11 +11002086AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002087if test "$MANTYPE" = "doc"; then
2088 mansubdir=man;
2089else
2090 mansubdir=$MANTYPE;
2091fi
2092AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002093
Damien Millera22ba012000-03-02 23:09:20 +11002094# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002095MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002096AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002097 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002098 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002099 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002100 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002101 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002102 fi
2103 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002104)
2105
Damien Millera22ba012000-03-02 23:09:20 +11002106# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002107AC_ARG_WITH(shadow,
2108 [ --without-shadow Disable shadow password support],
2109 [
2110 if test "x$withval" = "xno" ; then
2111 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002112 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002113 fi
2114 ]
2115)
2116
Damien Miller1f335fb2000-06-26 11:31:33 +10002117if test -z "$disable_shadow" ; then
2118 AC_MSG_CHECKING([if the systems has expire shadow information])
2119 AC_TRY_COMPILE(
2120 [
2121#include <sys/types.h>
2122#include <shadow.h>
2123 struct spwd sp;
2124 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2125 [ sp_expire_available=yes ], []
2126 )
2127
2128 if test "x$sp_expire_available" = "xyes" ; then
2129 AC_MSG_RESULT(yes)
2130 AC_DEFINE(HAS_SHADOW_EXPIRE)
2131 else
2132 AC_MSG_RESULT(no)
2133 fi
2134fi
2135
Damien Millera22ba012000-03-02 23:09:20 +11002136# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002137if test ! -z "$IPADDR_IN_DISPLAY" ; then
2138 DISPLAY_HACK_MSG="yes"
2139 AC_DEFINE(IPADDR_IN_DISPLAY)
2140else
2141 DISPLAY_HACK_MSG="no"
2142 AC_ARG_WITH(ipaddr-display,
2143 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2144 [
2145 if test "x$withval" != "xno" ; then
2146 AC_DEFINE(IPADDR_IN_DISPLAY)
2147 DISPLAY_HACK_MSG="yes"
2148 fi
2149 ]
2150 )
2151fi
Damien Miller76112de1999-12-21 11:18:08 +11002152
Tim Rice43a1c132002-04-17 21:19:14 -07002153dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2154if test $ac_cv_func_login_getcapbool = "yes" -a \
2155 $ac_cv_header_login_cap_h = "yes" ; then
2156 USES_LOGIN_CONF=yes
2157fi
Damien Millera22ba012000-03-02 23:09:20 +11002158# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002159SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002160AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002161 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002162 [
Tim Rice43a1c132002-04-17 21:19:14 -07002163 if test "$USES_LOGIN_CONF" = "yes" ; then
2164 AC_MSG_WARN([
2165--with-default-path=PATH has no effect on this system.
2166Edit /etc/login.conf instead.])
2167 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002168 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002169 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002170 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002171 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002172 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2173 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2174 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002175 AC_TRY_RUN(
2176 [
2177/* find out what STDPATH is */
2178#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002179#ifdef HAVE_PATHS_H
2180# include <paths.h>
2181#endif
2182#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002183# ifdef _PATH_USERPATH /* Irix */
2184# define _PATH_STDPATH _PATH_USERPATH
2185# else
2186# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2187# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002188#endif
2189#include <sys/types.h>
2190#include <sys/stat.h>
2191#include <fcntl.h>
2192#define DATA "conftest.stdpath"
2193
2194main()
2195{
2196 FILE *fd;
2197 int rc;
2198
2199 fd = fopen(DATA,"w");
2200 if(fd == NULL)
2201 exit(1);
2202
2203 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2204 exit(1);
2205
2206 exit(0);
2207}
2208 ], [ user_path=`cat conftest.stdpath` ],
2209 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2210 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2211 )
2212# make sure $bindir is in USER_PATH so scp will work
2213 t_bindir=`eval echo ${bindir}`
2214 case $t_bindir in
2215 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2216 esac
2217 case $t_bindir in
2218 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2219 esac
2220 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2221 if test $? -ne 0 ; then
2222 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2223 if test $? -ne 0 ; then
2224 user_path=$user_path:$t_bindir
2225 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2226 fi
2227 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002228 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002229)
Tim Rice43a1c132002-04-17 21:19:14 -07002230if test "$USES_LOGIN_CONF" != "yes" ; then
2231 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2232 AC_SUBST(user_path)
2233fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002234
Damien Millera18bbd32002-05-13 10:48:57 +10002235# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002236AC_ARG_WITH(superuser-path,
2237 [ --with-superuser-path= Specify different path for super-user],
2238 [
2239 if test "x$withval" != "xno" ; then
2240 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2241 superuser_path=$withval
2242 fi
2243 ]
2244)
2245
2246
Damien Miller61e50f12000-05-08 20:49:37 +10002247AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002248IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002249AC_ARG_WITH(4in6,
2250 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2251 [
2252 if test "x$withval" != "xno" ; then
2253 AC_MSG_RESULT(yes)
2254 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002255 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002256 else
2257 AC_MSG_RESULT(no)
2258 fi
2259 ],[
2260 if test "x$inet6_default_4in6" = "xyes"; then
2261 AC_MSG_RESULT([yes (default)])
2262 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002263 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002264 else
2265 AC_MSG_RESULT([no (default)])
2266 fi
2267 ]
2268)
2269
Damien Miller60396b02001-02-18 17:01:00 +11002270# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002271BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002272AC_ARG_WITH(bsd-auth,
2273 [ --with-bsd-auth Enable BSD auth support],
2274 [
2275 if test "x$withval" != "xno" ; then
2276 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002277 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002278 fi
2279 ]
2280)
2281
Damien Millera22ba012000-03-02 23:09:20 +11002282# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002283piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002284# make sure the directory exists
2285if test ! -d $piddir ; then
2286 piddir=`eval echo ${sysconfdir}`
2287 case $piddir in
2288 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2289 esac
2290fi
2291
Tim Rice88f2ab52002-03-17 12:17:34 -08002292AC_ARG_WITH(pid-dir,
2293 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2294 [
2295 if test "x$withval" != "xno" ; then
2296 piddir=$withval
2297 if test ! -d $piddir ; then
2298 AC_MSG_WARN([** no $piddir directory on this system **])
2299 fi
2300 fi
2301 ]
2302)
2303
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002304AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002305AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002306
andre2ff7b5d2000-06-03 14:57:40 +00002307dnl allow user to disable some login recording features
2308AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002309 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002310 [
2311 if test "x$enableval" = "xno" ; then
2312 AC_DEFINE(DISABLE_LASTLOG)
2313 fi
2314 ]
andre2ff7b5d2000-06-03 14:57:40 +00002315)
2316AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002317 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002318 [
2319 if test "x$enableval" = "xno" ; then
2320 AC_DEFINE(DISABLE_UTMP)
2321 fi
2322 ]
andre2ff7b5d2000-06-03 14:57:40 +00002323)
2324AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002325 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002326 [
2327 if test "x$enableval" = "xno" ; then
2328 AC_DEFINE(DISABLE_UTMPX)
2329 fi
2330 ]
andre2ff7b5d2000-06-03 14:57:40 +00002331)
2332AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002333 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002334 [
2335 if test "x$enableval" = "xno" ; then
2336 AC_DEFINE(DISABLE_WTMP)
2337 fi
2338 ]
andre2ff7b5d2000-06-03 14:57:40 +00002339)
2340AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002341 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002342 [
2343 if test "x$enableval" = "xno" ; then
2344 AC_DEFINE(DISABLE_WTMPX)
2345 fi
2346 ]
andre2ff7b5d2000-06-03 14:57:40 +00002347)
2348AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002349 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002350 [
2351 if test "x$enableval" = "xno" ; then
2352 AC_DEFINE(DISABLE_LOGIN)
2353 fi
2354 ]
andre2ff7b5d2000-06-03 14:57:40 +00002355)
2356AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002357 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002358 [
2359 if test "x$enableval" = "xno" ; then
2360 AC_DEFINE(DISABLE_PUTUTLINE)
2361 fi
2362 ]
andre2ff7b5d2000-06-03 14:57:40 +00002363)
2364AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002365 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002366 [
2367 if test "x$enableval" = "xno" ; then
2368 AC_DEFINE(DISABLE_PUTUTXLINE)
2369 fi
2370 ]
andre2ff7b5d2000-06-03 14:57:40 +00002371)
2372AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002373 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002374 [
2375 if test "x$withval" = "xno" ; then
2376 AC_DEFINE(DISABLE_LASTLOG)
2377 else
2378 conf_lastlog_location=$withval
2379 fi
2380 ]
2381)
andre2ff7b5d2000-06-03 14:57:40 +00002382
2383dnl lastlog, [uw]tmpx? detection
2384dnl NOTE: set the paths in the platform section to avoid the
2385dnl need for command-line parameters
2386dnl lastlog and [uw]tmp are subject to a file search if all else fails
2387
2388dnl lastlog detection
2389dnl NOTE: the code itself will detect if lastlog is a directory
2390AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2391AC_TRY_COMPILE([
2392#include <sys/types.h>
2393#include <utmp.h>
2394#ifdef HAVE_LASTLOG_H
2395# include <lastlog.h>
2396#endif
Damien Miller2994e082000-06-04 15:51:47 +10002397#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002398# include <paths.h>
2399#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002400#ifdef HAVE_LOGIN_H
2401# include <login.h>
2402#endif
andre2ff7b5d2000-06-03 14:57:40 +00002403 ],
2404 [ char *lastlog = LASTLOG_FILE; ],
2405 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002406 [
2407 AC_MSG_RESULT(no)
2408 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2409 AC_TRY_COMPILE([
2410#include <sys/types.h>
2411#include <utmp.h>
2412#ifdef HAVE_LASTLOG_H
2413# include <lastlog.h>
2414#endif
2415#ifdef HAVE_PATHS_H
2416# include <paths.h>
2417#endif
2418 ],
2419 [ char *lastlog = _PATH_LASTLOG; ],
2420 [ AC_MSG_RESULT(yes) ],
2421 [
andree441aa32000-06-12 22:34:38 +00002422 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002423 system_lastlog_path=no
2424 ])
2425 ]
andre2ff7b5d2000-06-03 14:57:40 +00002426)
Damien Miller2994e082000-06-04 15:51:47 +10002427
andre2ff7b5d2000-06-03 14:57:40 +00002428if test -z "$conf_lastlog_location"; then
2429 if test x"$system_lastlog_path" = x"no" ; then
2430 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002431 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002432 conf_lastlog_location=$f
2433 fi
2434 done
2435 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002436 AC_MSG_WARN([** Cannot find lastlog **])
2437 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002438 fi
2439 fi
2440fi
2441
2442if test -n "$conf_lastlog_location"; then
2443 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2444fi
2445
2446dnl utmp detection
2447AC_MSG_CHECKING([if your system defines UTMP_FILE])
2448AC_TRY_COMPILE([
2449#include <sys/types.h>
2450#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002451#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002452# include <paths.h>
2453#endif
2454 ],
2455 [ char *utmp = UTMP_FILE; ],
2456 [ AC_MSG_RESULT(yes) ],
2457 [ AC_MSG_RESULT(no)
2458 system_utmp_path=no ]
2459)
2460if test -z "$conf_utmp_location"; then
2461 if test x"$system_utmp_path" = x"no" ; then
2462 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2463 if test -f $f ; then
2464 conf_utmp_location=$f
2465 fi
2466 done
2467 if test -z "$conf_utmp_location"; then
2468 AC_DEFINE(DISABLE_UTMP)
2469 fi
2470 fi
2471fi
2472if test -n "$conf_utmp_location"; then
2473 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2474fi
2475
2476dnl wtmp detection
2477AC_MSG_CHECKING([if your system defines WTMP_FILE])
2478AC_TRY_COMPILE([
2479#include <sys/types.h>
2480#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002481#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002482# include <paths.h>
2483#endif
2484 ],
2485 [ char *wtmp = WTMP_FILE; ],
2486 [ AC_MSG_RESULT(yes) ],
2487 [ AC_MSG_RESULT(no)
2488 system_wtmp_path=no ]
2489)
2490if test -z "$conf_wtmp_location"; then
2491 if test x"$system_wtmp_path" = x"no" ; then
2492 for f in /usr/adm/wtmp /var/log/wtmp; do
2493 if test -f $f ; then
2494 conf_wtmp_location=$f
2495 fi
2496 done
2497 if test -z "$conf_wtmp_location"; then
2498 AC_DEFINE(DISABLE_WTMP)
2499 fi
2500 fi
2501fi
2502if test -n "$conf_wtmp_location"; then
2503 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2504fi
2505
2506
2507dnl utmpx detection - I don't know any system so perverse as to require
2508dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2509dnl there, though.
2510AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2511AC_TRY_COMPILE([
2512#include <sys/types.h>
2513#include <utmp.h>
2514#ifdef HAVE_UTMPX_H
2515#include <utmpx.h>
2516#endif
Damien Miller2994e082000-06-04 15:51:47 +10002517#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002518# include <paths.h>
2519#endif
2520 ],
2521 [ char *utmpx = UTMPX_FILE; ],
2522 [ AC_MSG_RESULT(yes) ],
2523 [ AC_MSG_RESULT(no)
2524 system_utmpx_path=no ]
2525)
2526if test -z "$conf_utmpx_location"; then
2527 if test x"$system_utmpx_path" = x"no" ; then
2528 AC_DEFINE(DISABLE_UTMPX)
2529 fi
2530else
2531 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2532fi
2533
2534dnl wtmpx detection
2535AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2536AC_TRY_COMPILE([
2537#include <sys/types.h>
2538#include <utmp.h>
2539#ifdef HAVE_UTMPX_H
2540#include <utmpx.h>
2541#endif
Damien Miller2994e082000-06-04 15:51:47 +10002542#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002543# include <paths.h>
2544#endif
2545 ],
2546 [ char *wtmpx = WTMPX_FILE; ],
2547 [ AC_MSG_RESULT(yes) ],
2548 [ AC_MSG_RESULT(no)
2549 system_wtmpx_path=no ]
2550)
2551if test -z "$conf_wtmpx_location"; then
2552 if test x"$system_wtmpx_path" = x"no" ; then
2553 AC_DEFINE(DISABLE_WTMPX)
2554 fi
2555else
2556 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2557fi
2558
Damien Miller4018c192000-04-30 09:30:44 +10002559
Damien Miller29ea30d2000-03-17 10:54:15 +11002560if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002561 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2562 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002563fi
2564
Tim Rice4cec93f2002-02-26 08:40:48 -08002565dnl remove pam and dl because they are in $LIBPAM
2566if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002567 LIBS=`echo $LIBS | sed 's/-lpam //'`
2568fi
2569if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2570 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002571fi
2572
Damien Millerbac2d8a2000-09-05 16:13:06 +11002573AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002574AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2575AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002576
Damien Miller7b22d652000-06-18 14:07:04 +10002577# Print summary of options
2578
Damien Miller7b22d652000-06-18 14:07:04 +10002579# Someone please show me a better way :)
2580A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2581B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2582C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2583D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002584E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002585F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002586G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002587H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2588I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2589J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002590
2591echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002592echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002593echo " User binaries: $B"
2594echo " System binaries: $C"
2595echo " Configuration files: $D"
2596echo " Askpass program: $E"
2597echo " Manual pages: $F"
2598echo " PID file: $G"
2599echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002600if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002601echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002602else
Damien Millerf58c6722002-05-13 13:15:42 +10002603echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002604fi
Damien Millera18bbd32002-05-13 10:48:57 +10002605if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002606echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002607fi
Damien Millerf58c6722002-05-13 13:15:42 +10002608echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002609echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002610echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002611echo " KerberosV support: $KRB5_MSG"
2612echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002613echo " S/KEY support: $SKEY_MSG"
2614echo " TCP Wrappers support: $TCPW_MSG"
2615echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002616echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002617echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2618echo " BSD Auth support: $BSD_AUTH_MSG"
2619echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002620if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002621echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002622fi
2623
Damien Miller7b22d652000-06-18 14:07:04 +10002624echo ""
2625
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002626echo " Host: ${host}"
2627echo " Compiler: ${CC}"
2628echo " Compiler flags: ${CFLAGS}"
2629echo "Preprocessor flags: ${CPPFLAGS}"
2630echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002631echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002632
2633echo ""
2634
Damien Miller82cf0ce2000-12-20 13:34:48 +11002635if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002636 echo "PAM is enabled. You may need to install a PAM control file "
2637 echo "for sshd, otherwise password authentication may fail. "
2638 echo "Example PAM control files can be found in the contrib/ "
2639 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002640 echo ""
2641fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002642
Damien Miller6c21c512002-01-22 21:57:53 +11002643if test ! -z "$RAND_HELPER_CMDHASH" ; then
2644 echo "WARNING: you are using the builtin random number collection "
2645 echo "service. Please read WARNING.RNG and request that your OS "
2646 echo "vendor includes kernel-based random number collection in "
2647 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002648 echo ""
2649fi
Damien Miller60396b02001-02-18 17:01:00 +11002650