blob: 89b59eaa4260f0aa2a12c4a48950cb326d2127dd [file] [log] [blame]
Darren Tuckere41bba52003-08-25 11:51:19 +10001# $Id: configure.ac,v 1.141 2003/08/25 01:51:19 dtucker Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Tim Rice13aae5e2001-10-21 17:53:58 -07003AC_INIT
4AC_CONFIG_SRCDIR([ssh.c])
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11007AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11008AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11009AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +100010
Damien Millera22ba012000-03-02 23:09:20 +110011# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110012AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100013AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110014AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000015AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070016AC_PATH_PROGS(PERL, perl5 perl)
Tim Riced0d7a8b2003-01-08 17:22:59 -080017AC_PATH_PROG(SED, sed)
Damien Millere79334a1999-12-29 10:03:37 +110018AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100019AC_PATH_PROG(ENT, ent)
20AC_SUBST(ENT)
Damien Miller4864e8f2001-02-08 10:07:08 +110021AC_PATH_PROG(TEST_MINUS_S_SH, bash)
22AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
23AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Tim Rice0502a472002-05-08 16:04:14 -070024AC_PATH_PROG(SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110025
Damien Millere8bb4502001-09-25 16:39:35 +100026# System features
27AC_SYS_LARGEFILE
28
Damien Miller3f62aba2000-11-29 11:56:35 +110029if test -z "$AR" ; then
30 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
31fi
32
Damien Millerad833b32000-08-23 10:46:23 +100033# Use LOGIN_PROGRAM from environment if possible
34if test ! -z "$LOGIN_PROGRAM" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
36else
37 # Search for login
38 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
39 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
40 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
41 fi
42fi
43
Damien Miller166bd442000-03-16 10:48:25 +110044if test -z "$LD" ; then
45 LD=$CC
46fi
47AC_SUBST(LD)
48
Damien Miller166bd442000-03-16 10:48:25 +110049AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100050if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
51 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110052fi
53
Damien Millera22ba012000-03-02 23:09:20 +110054# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110055case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110056*-*-aix*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000057 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110058 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millereab4bae2003-04-29 23:22:40 +100059 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
60 if (test -z "$blibpath"); then
61 blibpath="/usr/lib:/lib:/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110062 fi
Damien Millereab4bae2003-04-29 23:22:40 +100063 saved_LDFLAGS="$LDFLAGS"
64 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
65 if (test -z "$blibflags"); then
66 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
67 AC_TRY_LINK([], [], [blibflags=$tryflags])
68 fi
69 done
70 if (test -z "$blibflags"); then
71 AC_MSG_RESULT(not found)
72 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
73 else
74 AC_MSG_RESULT($blibflags)
75 fi
76 LDFLAGS="$saved_LDFLAGS"
Darren Tucker5c6a91a2003-07-14 16:21:44 +100077 dnl Check for authenticate. Might be in libs.a on older AIXes
78 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
Tim Ricee958ed32002-07-05 07:12:33 -070079 [AC_CHECK_LIB(s,authenticate,
Darren Tucker5c6a91a2003-07-14 16:21:44 +100080 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
Tim Ricee958ed32002-07-05 07:12:33 -070081 LIBS="$LIBS -ls"
82 ])
83 ])
Darren Tucker5c6a91a2003-07-14 16:21:44 +100084 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
85 AC_CHECK_DECL(loginfailed,
86 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
87 AC_TRY_COMPILE(
Darren Tuckera0c0b632003-07-08 20:52:12 +100088 [#include <usersec.h>],
Darren Tucker5c6a91a2003-07-14 16:21:44 +100089 [(void)loginfailed("user","host","tty",0);],
90 [AC_MSG_RESULT(yes)
91 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
Darren Tuckera0c0b632003-07-08 20:52:12 +100092 [AC_MSG_RESULT(no)]
Darren Tucker5c6a91a2003-07-14 16:21:44 +100093 )],
94 [],
95 [#include <usersec.h>]
96 )
Darren Tuckerfc3454e2003-07-14 16:41:55 +100097 AC_CHECK_FUNCS(setauthdb)
Damien Millereca71f82000-01-20 22:38:27 +110098 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Millerf5fea442002-04-23 22:52:45 +100099 AC_DEFINE(BROKEN_REALPATH)
andre60f3c982000-06-03 16:18:19 +0000100 dnl AIX handles lastlog as part of its login message
101 AC_DEFINE(DISABLE_LASTLOG)
Kevin Steves90d5de72002-06-22 18:51:48 +0000102 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller35276252003-06-03 10:14:28 +1000103 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller75b1d102000-01-07 14:01:41 +1100104 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +1100105*-*-cygwin*)
Damien Millerc8936ac2003-02-11 10:04:03 +1100106 check_for_libcrypt_later=1
Tim Ricefe1d1002001-11-26 17:19:43 -0800107 LIBS="$LIBS /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +1100108 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +0000109 AC_DEFINE(USE_PIPES)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100110 AC_DEFINE(DISABLE_SHADOW)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100111 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +0000112 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Ben Lindstrom99a4e142002-07-09 14:06:40 +0000113 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
Tim Rice9dd30812002-07-07 13:43:36 -0700114 AC_DEFINE(DISABLE_FD_PASSING)
Ben Lindstrom837461b2002-06-12 16:57:14 +0000115 AC_DEFINE(SETGROUPS_NOOP)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100116 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +0000117*-*-dgux*)
118 AC_DEFINE(IP_TOS_IS_BROKEN)
119 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000120*-*-darwin*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000121 AC_MSG_CHECKING(if we have working getaddrinfo)
122 AC_TRY_RUN([#include <mach-o/dyld.h>
123main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
124 exit(0);
125 else
126 exit(1);
127}], [AC_MSG_RESULT(working)],
128 [AC_MSG_RESULT(buggy)
129 AC_DEFINE(BROKEN_GETADDRINFO)],
130 [AC_MSG_RESULT(assume it is working)])
Ben Lindstromfed7bb42001-07-15 18:30:42 +0000131 ;;
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000132*-*-hpux10.26)
133 if test -z "$GCC"; then
134 CFLAGS="$CFLAGS -Ae"
135 fi
136 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
137 IPADDR_IN_DISPLAY=yes
138 AC_DEFINE(HAVE_SECUREWARE)
139 AC_DEFINE(USE_PIPES)
140 AC_DEFINE(LOGIN_NO_ENDOPT)
141 AC_DEFINE(LOGIN_NEEDS_UTMPX)
142 AC_DEFINE(DISABLE_SHADOW)
143 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000144 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000145 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700146 LIBS="$LIBS -lsec -lsecpw"
147 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000148 disable_ptmx_check=yes
149 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100150*-*-hpux10*)
151 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +1000152 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +1100153 fi
Kevin Steves315f8b72001-06-28 00:24:41 +0000154 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100155 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +1000156 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000157 AC_DEFINE(LOGIN_NO_ENDOPT)
158 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100159 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100160 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000161 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000162 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700163 LIBS="$LIBS -lsec"
164 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller76112de1999-12-21 11:18:08 +1100165 ;;
Damien Miller1bead332000-04-30 00:47:29 +1000166*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000167 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +1100168 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +1100169 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +1100170 AC_DEFINE(USE_PIPES)
Kevin Steves5feaaef2002-04-23 20:45:55 +0000171 AC_DEFINE(LOGIN_NO_ENDOPT)
172 AC_DEFINE(LOGIN_NEEDS_UTMPX)
Damien Miller8a1e6a62000-09-16 15:55:52 +1100173 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +1100174 AC_DEFINE(DISABLE_UTMP)
Darren Tuckere41bba52003-08-25 11:51:19 +1000175 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
Damien Miller35276252003-06-03 10:14:28 +1000176 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Tim Ricef028f1e2002-07-19 12:41:10 -0700177 LIBS="$LIBS -lsec"
178 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
Damien Miller1bead332000-04-30 00:47:29 +1000179 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100180*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000182 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100183 PATH="$PATH:/usr/etc"
Damien Miller11fa2cc2000-08-16 10:35:58 +1000184 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000185 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000186 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Miller1808f382000-01-06 12:03:12 +1100187 ;;
188*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000189 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000190 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100191 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000192 AC_DEFINE(WITH_IRIX_ARRAY)
193 AC_DEFINE(WITH_IRIX_PROJECT)
194 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom8ff2a8d2002-04-06 18:58:31 +0000195 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Miller11fa2cc2000-08-16 10:35:58 +1000196 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerf1b9d112002-04-23 23:09:19 +1000197 AC_DEFINE(WITH_ABBREV_NO_TTY)
Darren Tuckere41bba52003-08-25 11:51:19 +1000198 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Damien Millerbeb4ba51999-12-28 15:09:35 +1100199 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100200*-*-linux*)
201 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100202 check_for_libcrypt_later=1
Darren Tucker70a3d552003-08-21 17:58:29 +1000203 check_for_openpty_ctty_bug=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100204 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000205 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000206 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
Damien Miller35276252003-06-03 10:14:28 +1000207 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
Damien Miller7bcb0892000-03-11 20:45:40 +1100208 inet6_default_4in6=yes
Darren Tucker3c016542003-05-02 20:48:21 +1000209 case `uname -r` in
Darren Tuckerc437cda2003-05-10 17:05:46 +1000210 1.*|2.0.*)
Darren Tucker3c016542003-05-02 20:48:21 +1000211 AC_DEFINE(BROKEN_CMSG_TYPE)
212 ;;
Darren Tucker3c016542003-05-02 20:48:21 +1000213 esac
Damien Millerb29ea912000-01-15 14:12:03 +1100214 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000215mips-sony-bsd|mips-sony-newsos4)
216 AC_DEFINE(HAVE_NEWS4)
217 SONY=1
Ben Lindstromb5628642000-10-18 00:02:25 +0000218 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100219*-*-netbsd*)
Damien Millerfc93d4b2002-09-04 23:26:29 +1000220 check_for_libcrypt_before=1
Damien Millera22ba012000-03-02 23:09:20 +1100221 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100222 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100223*-*-freebsd*)
224 check_for_libcrypt_later=1
225 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000226*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000227 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100228 conf_utmp_location=/etc/utmp
229 conf_wtmp_location=/usr/adm/wtmp
230 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000231 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000232 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000233 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100234 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000235 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000236 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000237 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100238*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000239 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000240 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100241 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100242 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000243 AC_DEFINE(LOGIN_NEEDS_UTMPX)
244 AC_DEFINE(LOGIN_NEEDS_TERM)
Ben Lindstrom95276712001-10-23 17:14:00 +0000245 AC_DEFINE(PAM_TTY_KLUDGE)
Darren Tuckere41bba52003-08-25 11:51:19 +1000246 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
Darren Tuckerc437cda2003-05-10 17:05:46 +1000247 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
248 AC_DEFINE(SSHD_ACQUIRES_CTTY)
andre2ff7b5d2000-06-03 14:57:40 +0000249 # hardwire lastlog location (can't detect it on some versions)
250 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000251 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
252 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
253 if test "$sol2ver" -ge 8; then
254 AC_MSG_RESULT(yes)
255 AC_DEFINE(DISABLE_UTMP)
256 AC_DEFINE(DISABLE_WTMP)
257 else
258 AC_MSG_RESULT(no)
259 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100260 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000261*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000262 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000263 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100264 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000265 conf_utmp_location=/etc/utmp
266 conf_wtmp_location=/var/adm/wtmp
267 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000268 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000269 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000270*-ncr-sysv*)
271 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
272 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700273 LIBS="$LIBS -lc89"
Kevin Steves0bd4b342002-01-05 23:24:27 +0000274 AC_DEFINE(USE_PIPES)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000275 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000276 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000277*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000278 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Tim Riceffdf4aa2001-10-27 10:45:36 -0700279 # /usr/ucblib MUST NOT be searched on ReliantUNIX
280 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100281 IPADDR_IN_DISPLAY=yes
282 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000283 AC_DEFINE(IP_TOS_IS_BROKEN)
Darren Tucker2972d6c2003-05-30 17:43:42 +1000284 AC_DEFINE(SSHD_ACQUIRES_CTTY)
Tim Riceffdf4aa2001-10-27 10:45:36 -0700285 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
286 # Attention: always take care to bind libsocket and libnsl before libc,
287 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
Damien Miller2ae714f2000-07-11 09:29:50 +1000288 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100289*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000290 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100291 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100292 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100293 ;;
294*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100296 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100297 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100298 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100299*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000300 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100301 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100302 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100303*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000304 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Tim Rice13aae5e2001-10-21 17:53:58 -0700306 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
Damien Miller5dfe9762001-02-16 12:05:39 +1100307 RANLIB=true
308 no_dev_ptmx=1
309 AC_DEFINE(BROKEN_SYS_TERMIO_H)
310 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000311 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000312 AC_DEFINE(DISABLE_SHADOW)
Damien Millerfbd884a2001-02-27 08:39:07 +1100313 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100314 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700315 MANTYPE=man
Tim Rice13aae5e2001-10-21 17:53:58 -0700316 do_sco3_extra_lib_check=yes
Damien Miller78315eb2000-09-29 23:01:36 +1100317 ;;
318*-*-sco3.2v5*)
Tim Rice89fe3f32003-01-19 20:20:24 -0800319 if test -z "$GCC"; then
320 CFLAGS="$CFLAGS -belf"
321 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000322 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000323 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100324 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000325 no_dev_ptmx=1
Damien Miller5dfe9762001-02-16 12:05:39 +1100326 AC_DEFINE(USE_PIPES)
Kevin Steves0ea1d9d2002-04-25 18:17:04 +0000327 AC_DEFINE(HAVE_SECUREWARE)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000328 AC_DEFINE(DISABLE_SHADOW)
Tim Rice9dd30812002-07-07 13:43:36 -0700329 AC_DEFINE(DISABLE_FD_PASSING)
Damien Miller217f5672001-02-16 12:12:41 +1100330 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700331 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000332 ;;
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000333*-*-unicosmk*)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000334 AC_DEFINE(USE_PIPES)
335 AC_DEFINE(DISABLE_FD_PASSING)
336 LDFLAGS="$LDFLAGS"
337 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
338 MANTYPE=cat
Ben Lindstrom762104e2002-07-23 00:00:05 +0000339 ;;
Ben Lindstromd9e08242001-07-22 19:32:00 +0000340*-*-unicos*)
Ben Lindstromd9e08242001-07-22 19:32:00 +0000341 AC_DEFINE(USE_PIPES)
Tim Rice9dd30812002-07-07 13:43:36 -0700342 AC_DEFINE(DISABLE_FD_PASSING)
Tim Rice81ed5182002-09-25 17:38:46 -0700343 AC_DEFINE(NO_SSH_LASTLOG)
Ben Lindstrom232ccf72002-07-22 23:34:25 +0000344 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
345 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
346 MANTYPE=cat
Tim Ricee991e3c2001-08-07 15:29:07 -0700347 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000348*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000349 AC_MSG_CHECKING(for Digital Unix SIA)
350 no_osfsia=""
351 AC_ARG_WITH(osfsia,
352 [ --with-osfsia Enable Digital Unix SIA],
353 [
354 if test "x$withval" = "xno" ; then
355 AC_MSG_RESULT(disabled)
356 no_osfsia=1
357 fi
358 ],
359 )
360 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000361 if test -f /etc/sia/matrix.conf; then
362 AC_MSG_RESULT(yes)
363 AC_DEFINE(HAVE_OSF_SIA)
364 AC_DEFINE(DISABLE_LOGIN)
Ben Lindstromc8c548d2003-03-21 01:18:09 +0000365 AC_DEFINE(DISABLE_FD_PASSING)
Damien Millerb8c656e2000-06-28 15:22:41 +1000366 LIBS="$LIBS -lsecurity -ldb -lm -laud"
367 else
368 AC_MSG_RESULT(no)
369 fi
370 fi
Ben Lindstromdc3c7572002-10-04 23:54:54 +0000371 AC_DEFINE(DISABLE_FD_PASSING)
Darren Tuckere41bba52003-08-25 11:51:19 +1000372 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000373 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000374
375*-*-nto-qnx)
376 AC_DEFINE(USE_PIPES)
377 AC_DEFINE(NO_X11_UNIX_SOCKETS)
378 AC_DEFINE(MISSING_NFDBITS)
379 AC_DEFINE(MISSING_HOWMANY)
380 AC_DEFINE(MISSING_FD_MASK)
381 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100382esac
383
Damien Millere37bfc12000-06-05 09:37:43 +1000384# Allow user to specify flags
385AC_ARG_WITH(cflags,
386 [ --with-cflags Specify additional flags to pass to compiler],
387 [
388 if test "x$withval" != "xno" ; then
389 CFLAGS="$CFLAGS $withval"
390 fi
391 ]
392)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000393AC_ARG_WITH(cppflags,
394 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
395 [
396 if test "x$withval" != "xno"; then
397 CPPFLAGS="$CPPFLAGS $withval"
398 fi
399 ]
400)
Damien Millere37bfc12000-06-05 09:37:43 +1000401AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000402 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000403 [
404 if test "x$withval" != "xno" ; then
405 LDFLAGS="$LDFLAGS $withval"
406 fi
407 ]
408)
409AC_ARG_WITH(libs,
410 [ --with-libs Specify additional libraries to link with],
411 [
412 if test "x$withval" != "xno" ; then
413 LIBS="$LIBS $withval"
414 fi
415 ]
416)
417
Darren Tucker6eb93042003-06-29 21:30:41 +1000418AC_MSG_CHECKING(compiler and flags for sanity)
419AC_TRY_RUN([
420#include <stdio.h>
421int main(){exit(0);}
422 ],
423 [ AC_MSG_RESULT(yes) ],
424 [
425 AC_MSG_RESULT(no)
426 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
427 ]
428)
429
Tim Rice4cec93f2002-02-26 08:40:48 -0800430# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000431AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100432 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800433 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000434 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000435 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000436 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
437 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000438 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700439 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800440 util.h utime.h utmp.h utmpx.h)
441
Damien Millera22ba012000-03-02 23:09:20 +1100442# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700443AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
444AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000445
Damien Millerdf288022001-02-18 13:07:07 +1100446dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700447if test "x$with_tcp_wrappers" != "xno" ; then
448 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
449 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
450 fi
451fi
Damien Millerdf288022001-02-18 13:07:07 +1100452
Tim Rice13aae5e2001-10-21 17:53:58 -0700453AC_CHECK_FUNC(getspnam, ,
454 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700455
Damien Miller150c8b52002-02-13 23:06:56 +1100456AC_ARG_WITH(rpath,
457 [ --without-rpath Disable auto-added -R linker paths],
458 [
459 if test "x$withval" = "xno" ; then
460 need_dash_r=""
461 fi
462 if test "x$withval" = "xyes" ; then
463 need_dash_r=1
464 fi
465 ]
466)
467
Tim Rice13aae5e2001-10-21 17:53:58 -0700468dnl zlib is required
469AC_ARG_WITH(zlib,
470 [ --with-zlib=PATH Use zlib in PATH],
471 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000472 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100473 AC_MSG_ERROR([*** zlib is required ***])
474 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700475 if test -d "$withval/lib"; then
476 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700477 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700478 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700479 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700480 fi
481 else
482 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700483 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700484 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700485 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700486 fi
487 fi
488 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700489 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700490 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700491 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700492 fi
493 ]
494)
495
Tim Rice17b93e52001-10-23 22:36:54 -0700496AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100497
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000498dnl UnixWare 2.x
499AC_CHECK_FUNC(strcasecmp,
500 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
501)
502AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700503 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
504 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000505)
Damien Millerab18c411999-11-11 10:40:23 +1100506
Tim Ricee589a292001-11-03 11:09:32 -0800507dnl Checks for libutil functions
508AC_CHECK_HEADERS(libutil.h)
509AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
510AC_CHECK_FUNCS(logout updwtmp logwtmp)
511
Ben Lindstrom8697e082001-02-24 21:41:10 +0000512AC_FUNC_STRFTIME
513
Damien Miller3c027682001-03-14 11:39:45 +1100514# Check for ALTDIRFUNC glob() extension
515AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
516AC_EGREP_CPP(FOUNDIT,
517 [
518 #include <glob.h>
519 #ifdef GLOB_ALTDIRFUNC
520 FOUNDIT
521 #endif
522 ],
523 [
524 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
525 AC_MSG_RESULT(yes)
526 ],
527 [
528 AC_MSG_RESULT(no)
529 ]
530)
Damien Millerab18c411999-11-11 10:40:23 +1100531
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000532# Check for g.gl_matchc glob() extension
533AC_MSG_CHECKING(for gl_matchc field in glob_t)
534AC_EGREP_CPP(FOUNDIT,
535 [
536 #include <glob.h>
537 int main(void){glob_t g; g.gl_matchc = 1;}
538 ],
539 [
540 AC_DEFINE(GLOB_HAS_GL_MATCHC)
541 AC_MSG_RESULT(yes)
542 ],
543 [
544 AC_MSG_RESULT(no)
545 ]
546)
547
Damien Miller18bb4732001-03-28 14:35:30 +1000548AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
549AC_TRY_RUN(
550 [
551#include <sys/types.h>
552#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700553int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000554 ],
555 [AC_MSG_RESULT(yes)],
556 [
557 AC_MSG_RESULT(no)
558 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
559 ]
560)
561
Damien Millerc547bf12001-02-16 10:18:12 +1100562# Check whether user wants S/Key support
563SKEY_MSG="no"
564AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700565 [ --with-skey[[=PATH]] Enable S/Key support
566 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100567 [
568 if test "x$withval" != "xno" ; then
569
570 if test "x$withval" != "xyes" ; then
571 CPPFLAGS="$CPPFLAGS -I${withval}/include"
572 LDFLAGS="$LDFLAGS -L${withval}/lib"
573 fi
574
575 AC_DEFINE(SKEY)
576 LIBS="-lskey $LIBS"
577 SKEY_MSG="yes"
578
Tim Rice4cec93f2002-02-26 08:40:48 -0800579 AC_MSG_CHECKING([for s/key support])
580 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100581 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800582#include <stdio.h>
583#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700584int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800585 ],
586 [AC_MSG_RESULT(yes)],
587 [
588 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100589 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
590 ])
591 fi
592 ]
593)
594
595# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700596TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100597AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700598 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
599 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100600 [
601 if test "x$withval" != "xno" ; then
602 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700603 saved_LDFLAGS="$LDFLAGS"
604 saved_CPPFLAGS="$CPPFLAGS"
605 if test -n "${withval}" -a "${withval}" != "yes"; then
606 if test -d "${withval}/lib"; then
607 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700608 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700609 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700610 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700611 fi
612 else
613 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700614 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700615 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700616 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700617 fi
618 fi
619 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700620 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700621 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700622 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700623 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800625 LIBWRAP="-lwrap"
626 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100627 AC_MSG_CHECKING(for libwrap)
628 AC_TRY_LINK(
629 [
630#include <tcpd.h>
631 int deny_severity = 0, allow_severity = 0;
632 ],
633 [hosts_access(0);],
634 [
635 AC_MSG_RESULT(yes)
636 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800637 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700638 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100639 ],
640 [
641 AC_MSG_ERROR([*** libwrap missing])
642 ]
643 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800644 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100645 fi
646 ]
647)
648
Damien Millerfe1f1432003-02-24 15:45:42 +1100649dnl Checks for library functions. Please keep in alphabetical order
650AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000651 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
652 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100653 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000654 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100655 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000656 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
657 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
658 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000659 setproctitle setregid setresgid setresuid setreuid setrlimit \
660 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000661 strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
662 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100663)
Tim Rice13aae5e2001-10-21 17:53:58 -0700664
Damien Millercd6853c2003-01-28 11:33:42 +1100665AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000666AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100667
Darren Tuckerf1159b52003-07-07 19:44:01 +1000668dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000669AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000670AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000671
Tim Rice13aae5e2001-10-21 17:53:58 -0700672dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700673AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700674 AC_CHECK_LIB(gen, dirname,[
675 AC_CACHE_CHECK([for broken dirname],
676 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700677 save_LIBS="$LIBS"
678 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700679 AC_TRY_RUN(
680 [
681#include <libgen.h>
682#include <string.h>
683
684int main(int argc, char **argv) {
685 char *s, buf[32];
686
687 strncpy(buf,"/etc", 32);
688 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700689 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700690 exit(1);
691 } else {
692 exit(0);
693 }
694}
695 ],
696 [ ac_cv_have_broken_dirname="no" ],
697 [ ac_cv_have_broken_dirname="yes" ]
698 )
Tim Rice17b93e52001-10-23 22:36:54 -0700699 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700700 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700701 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700702 LIBS="$LIBS -lgen"
703 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700704 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700705 fi
706 ])
707])
708
Damien Millerad833b32000-08-23 10:46:23 +1000709dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000710AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000711dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000712AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000713AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000714dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000715AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000716AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100717
Damien Miller04f80141999-11-19 15:32:34 +1100718AC_CHECK_FUNC(daemon,
719 [AC_DEFINE(HAVE_DAEMON)],
720 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
721)
722
Damien Miller9fb07e42000-03-05 16:22:59 +1100723AC_CHECK_FUNC(getpagesize,
724 [AC_DEFINE(HAVE_GETPAGESIZE)],
725 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
726)
727
Damien Millercb170cb2000-07-01 16:52:55 +1000728# Check for broken snprintf
729if test "x$ac_cv_func_snprintf" = "xyes" ; then
730 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
731 AC_TRY_RUN(
732 [
733#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700734int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000735 ],
736 [AC_MSG_RESULT(yes)],
737 [
738 AC_MSG_RESULT(no)
739 AC_DEFINE(BROKEN_SNPRINTF)
740 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
741 ]
742 )
743fi
744
Damien Millere8328192003-01-07 15:18:32 +1100745dnl see whether mkstemp() requires XXXXXX
746if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
747AC_MSG_CHECKING([for (overly) strict mkstemp])
748AC_TRY_RUN(
749 [
750#include <stdlib.h>
751main() { char template[]="conftest.mkstemp-test";
752if (mkstemp(template) == -1)
753 exit(1);
754unlink(template); exit(0);
755}
756 ],
757 [
758 AC_MSG_RESULT(no)
759 ],
760 [
761 AC_MSG_RESULT(yes)
762 AC_DEFINE(HAVE_STRICT_MKSTEMP)
763 ],
764 [
765 AC_MSG_RESULT(yes)
766 AC_DEFINE(HAVE_STRICT_MKSTEMP)
767 ]
768)
769fi
770
Darren Tucker70a3d552003-08-21 17:58:29 +1000771dnl make sure that openpty does not reacquire controlling terminal
772if test ! -z "$check_for_openpty_ctty_bug"; then
773 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
774 AC_TRY_RUN(
775 [
776#include <stdio.h>
777#include <sys/fcntl.h>
778#include <sys/types.h>
779#include <sys/wait.h>
780
781int
782main()
783{
784 pid_t pid;
785 int fd, ptyfd, ttyfd, status;
786
787 pid = fork();
788 if (pid < 0) { /* failed */
789 exit(1);
790 } else if (pid > 0) { /* parent */
791 waitpid(pid, &status, 0);
792 if (WIFEXITED(status))
793 exit(WEXITSTATUS(status));
794 else
795 exit(2);
796 } else { /* child */
797 close(0); close(1); close(2);
798 setsid();
799 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
800 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
801 if (fd >= 0)
802 exit(3); /* Acquired ctty: broken */
803 else
804 exit(0); /* Did not acquire ctty: OK */
805 }
806}
807 ],
808 [
809 AC_MSG_RESULT(yes)
810 ],
811 [
812 AC_MSG_RESULT(no)
813 AC_DEFINE(SSHD_ACQUIRES_CTTY)
814 ]
815 )
816fi
817
Damien Miller606f8802000-09-16 15:39:56 +1100818AC_FUNC_GETPGRP
819
Damien Millera64b57a2001-01-17 10:44:13 +1100820# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000821PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100822AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100823 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100824 [
Damien Millera64b57a2001-01-17 10:44:13 +1100825 if test "x$withval" != "xno" ; then
826 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
827 AC_MSG_ERROR([PAM headers not found])
828 fi
829
830 AC_CHECK_LIB(dl, dlopen, , )
831 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
832 AC_CHECK_FUNCS(pam_getenvlist)
833
834 disable_shadow=yes
835 PAM_MSG="yes"
836
837 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800838 if test $ac_cv_lib_dl_dlopen = yes; then
839 LIBPAM="-lpam -ldl"
840 else
841 LIBPAM="-lpam"
842 fi
843 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100844 fi
845 ]
846)
Damien Millera22ba012000-03-02 23:09:20 +1100847
Damien Millera64b57a2001-01-17 10:44:13 +1100848# Check for older PAM
849if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100850 # Check PAM strerror arguments (old PAM)
851 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
852 AC_TRY_COMPILE(
853 [
Damien Miller81171112000-04-23 11:14:01 +1000854#include <stdlib.h>
855#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100856 ],
857 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
858 [AC_MSG_RESULT(no)],
859 [
860 AC_DEFINE(HAVE_OLD_PAM)
861 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000862 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100863 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100864 )
Damien Millera22ba012000-03-02 23:09:20 +1100865fi
866
Damien Millerfc93d4b2002-09-04 23:26:29 +1000867# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
868# because the system crypt() is more featureful.
869if test "x$check_for_libcrypt_before" = "x1"; then
870 AC_CHECK_LIB(crypt, crypt)
871fi
872
Tim Riceaef73712002-05-11 13:17:42 -0700873# Search for OpenSSL
874saved_CPPFLAGS="$CPPFLAGS"
875saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100876AC_ARG_WITH(ssl-dir,
877 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
878 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000879 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700880 if test -d "$withval/lib"; then
881 if test -n "${need_dash_r}"; then
882 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
883 else
884 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
885 fi
886 else
887 if test -n "${need_dash_r}"; then
888 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
889 else
890 LDFLAGS="-L${withval} ${LDFLAGS}"
891 fi
892 fi
893 if test -d "$withval/include"; then
894 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
895 else
896 CPPFLAGS="-I${withval} ${CPPFLAGS}"
897 fi
Damien Millera22ba012000-03-02 23:09:20 +1100898 fi
899 ]
900)
Tim Riceaef73712002-05-11 13:17:42 -0700901LIBS="$LIBS -lcrypto"
902AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000903 [
Tim Riceaef73712002-05-11 13:17:42 -0700904 dnl Check default openssl install dir
905 if test -n "${need_dash_r}"; then
906 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000907 else
Tim Riceaef73712002-05-11 13:17:42 -0700908 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000909 fi
Tim Riceaef73712002-05-11 13:17:42 -0700910 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
911 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
912 [
913 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
914 ]
915 )
916 ]
917)
918
Tim Riced730b782002-08-13 18:52:10 -0700919# Determine OpenSSL header version
920AC_MSG_CHECKING([OpenSSL header version])
921AC_TRY_RUN(
922 [
923#include <stdio.h>
924#include <string.h>
925#include <openssl/opensslv.h>
926#define DATA "conftest.sslincver"
927int main(void) {
928 FILE *fd;
929 int rc;
930
931 fd = fopen(DATA,"w");
932 if(fd == NULL)
933 exit(1);
934
935 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
936 exit(1);
937
938 exit(0);
939}
940 ],
941 [
942 ssl_header_ver=`cat conftest.sslincver`
943 AC_MSG_RESULT($ssl_header_ver)
944 ],
945 [
946 AC_MSG_RESULT(not found)
947 AC_MSG_ERROR(OpenSSL version header not found.)
948 ]
949)
950
951# Determine OpenSSL library version
952AC_MSG_CHECKING([OpenSSL library version])
953AC_TRY_RUN(
954 [
955#include <stdio.h>
956#include <string.h>
957#include <openssl/opensslv.h>
958#include <openssl/crypto.h>
959#define DATA "conftest.ssllibver"
960int main(void) {
961 FILE *fd;
962 int rc;
963
964 fd = fopen(DATA,"w");
965 if(fd == NULL)
966 exit(1);
967
968 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
969 exit(1);
970
971 exit(0);
972}
973 ],
974 [
975 ssl_library_ver=`cat conftest.ssllibver`
976 AC_MSG_RESULT($ssl_library_ver)
977 ],
978 [
979 AC_MSG_RESULT(not found)
980 AC_MSG_ERROR(OpenSSL library not found.)
981 ]
982)
Damien Millera22ba012000-03-02 23:09:20 +1100983
Damien Millerec932372002-01-22 22:16:03 +1100984# Sanity check OpenSSL headers
985AC_MSG_CHECKING([whether OpenSSL's headers match the library])
986AC_TRY_RUN(
987 [
988#include <string.h>
989#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700990int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100991 ],
992 [
993 AC_MSG_RESULT(yes)
994 ],
995 [
996 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000997 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
998Check config.log for details.
999Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001000 ]
1001)
1002
Damien Millera64b57a2001-01-17 10:44:13 +11001003# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1004# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001005if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001006 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001007fi
1008
Damien Miller6c21c512002-01-22 21:57:53 +11001009
1010### Configure cryptographic random number support
1011
1012# Check wheter OpenSSL seeds itself
1013AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1014AC_TRY_RUN(
1015 [
1016#include <string.h>
1017#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001018int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001019 ],
1020 [
1021 OPENSSL_SEEDS_ITSELF=yes
1022 AC_MSG_RESULT(yes)
1023 ],
1024 [
1025 AC_MSG_RESULT(no)
1026 # Default to use of the rand helper if OpenSSL doesn't
1027 # seed itself
1028 USE_RAND_HELPER=yes
1029 ]
1030)
1031
1032
1033# Do we want to force the use of the rand helper?
1034AC_ARG_WITH(rand-helper,
1035 [ --with-rand-helper Use subprocess to gather strong randomness ],
1036 [
1037 if test "x$withval" = "xno" ; then
1038 # Force use of OpenSSL's internal RNG, even if
1039 # the previous test showed it to be unseeded.
1040 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1041 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1042 OPENSSL_SEEDS_ITSELF=yes
1043 USE_RAND_HELPER=""
1044 fi
1045 else
1046 USE_RAND_HELPER=yes
1047 fi
1048 ],
1049)
1050
1051# Which randomness source do we use?
1052if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1053 # OpenSSL only
1054 AC_DEFINE(OPENSSL_PRNG_ONLY)
1055 RAND_MSG="OpenSSL internal ONLY"
1056 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001057elif test ! -z "$USE_RAND_HELPER" ; then
1058 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001059 RAND_MSG="ssh-rand-helper"
1060 INSTALL_SSH_RAND_HELPER="yes"
1061fi
1062AC_SUBST(INSTALL_SSH_RAND_HELPER)
1063
1064### Configuration of ssh-rand-helper
1065
1066# PRNGD TCP socket
1067AC_ARG_WITH(prngd-port,
1068 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1069 [
Damien Millere996d722002-01-23 11:20:59 +11001070 case "$withval" in
1071 no)
1072 withval=""
1073 ;;
1074 [[0-9]]*)
1075 ;;
1076 *)
1077 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1078 ;;
1079 esac
1080 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001081 PRNGD_PORT="$withval"
1082 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1083 fi
1084 ]
1085)
1086
1087# PRNGD Unix domain socket
1088AC_ARG_WITH(prngd-socket,
1089 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1090 [
Damien Millere996d722002-01-23 11:20:59 +11001091 case "$withval" in
1092 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001093 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001094 ;;
1095 no)
1096 withval=""
1097 ;;
1098 /*)
1099 ;;
1100 *)
1101 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1102 ;;
1103 esac
1104
1105 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001106 if test ! -z "$PRNGD_PORT" ; then
1107 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1108 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001109 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001110 AC_MSG_WARN(Entropy socket is not readable)
1111 fi
1112 PRNGD_SOCKET="$withval"
1113 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1114 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001115 ],
1116 [
1117 # Check for existing socket only if we don't have a random device already
1118 if test "$USE_RAND_HELPER" = yes ; then
1119 AC_MSG_CHECKING(for PRNGD/EGD socket)
1120 # Insert other locations here
1121 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1122 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1123 PRNGD_SOCKET="$sock"
1124 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1125 break;
1126 fi
1127 done
1128 if test ! -z "$PRNGD_SOCKET" ; then
1129 AC_MSG_RESULT($PRNGD_SOCKET)
1130 else
1131 AC_MSG_RESULT(not found)
1132 fi
1133 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001134 ]
1135)
1136
1137# Change default command timeout for hashing entropy source
1138entropy_timeout=200
1139AC_ARG_WITH(entropy-timeout,
1140 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1141 [
1142 if test "x$withval" != "xno" ; then
1143 entropy_timeout=$withval
1144 fi
1145 ]
1146)
Damien Miller6c21c512002-01-22 21:57:53 +11001147AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1148
Damien Millerd3f6ad22002-06-25 10:24:47 +10001149SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001150AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001151 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001152 [
1153 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001154 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001155 fi
1156 ]
1157)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001158AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1159AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001160
Tim Rice88f2ab52002-03-17 12:17:34 -08001161# We do this little dance with the search path to insure
1162# that programs that we select for use by installed programs
1163# (which may be run by the super-user) come from trusted
1164# locations before they come from the user's private area.
1165# This should help avoid accidentally configuring some
1166# random version of a program in someone's personal bin.
1167
1168OPATH=$PATH
1169PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001170test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001171test -d /sbin && PATH=$PATH:/sbin
1172test -d /usr/sbin && PATH=$PATH:/usr/sbin
1173PATH=$PATH:/etc:$OPATH
1174
Damien Miller6c21c512002-01-22 21:57:53 +11001175# These programs are used by the command hashing source to gather entropy
1176OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1177OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1178OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1179OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1180OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1181OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1182OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1183OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1184OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1185OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1186OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1187OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1188OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1189OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1190OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1191OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001192# restore PATH
1193PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001194
1195# Where does ssh-rand-helper get its randomness from?
1196INSTALL_SSH_PRNG_CMDS=""
1197if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1198 if test ! -z "$PRNGD_PORT" ; then
1199 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1200 elif test ! -z "$PRNGD_SOCKET" ; then
1201 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1202 else
1203 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1204 RAND_HELPER_CMDHASH=yes
1205 INSTALL_SSH_PRNG_CMDS="yes"
1206 fi
1207fi
1208AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1209
1210
Ben Lindstromb5628642000-10-18 00:02:25 +00001211# Cheap hack to ensure NEWS-OS libraries are arranged right.
1212if test ! -z "$SONY" ; then
1213 LIBS="$LIBS -liberty";
1214fi
1215
Damien Millera22ba012000-03-02 23:09:20 +11001216# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001217AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001218AC_CHECK_SIZEOF(short int, 2)
1219AC_CHECK_SIZEOF(int, 4)
1220AC_CHECK_SIZEOF(long int, 4)
1221AC_CHECK_SIZEOF(long long int, 8)
1222
Damien Millerfa2bb692002-04-23 23:22:25 +10001223# Sanity check long long for some platforms (AIX)
1224if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1225 ac_cv_sizeof_long_long_int=0
1226fi
1227
Damien Millera22ba012000-03-02 23:09:20 +11001228# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001229AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1230 AC_TRY_COMPILE(
1231 [ #include <sys/types.h> ],
1232 [ u_int a; a = 1;],
1233 [ ac_cv_have_u_int="yes" ],
1234 [ ac_cv_have_u_int="no" ]
1235 )
1236])
1237if test "x$ac_cv_have_u_int" = "xyes" ; then
1238 AC_DEFINE(HAVE_U_INT)
1239 have_u_int=1
1240fi
1241
Damien Miller61e50f12000-05-08 20:49:37 +10001242AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1243 AC_TRY_COMPILE(
1244 [ #include <sys/types.h> ],
1245 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1246 [ ac_cv_have_intxx_t="yes" ],
1247 [ ac_cv_have_intxx_t="no" ]
1248 )
1249])
1250if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1251 AC_DEFINE(HAVE_INTXX_T)
1252 have_intxx_t=1
1253fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001254
1255if (test -z "$have_intxx_t" && \
1256 test "x$ac_cv_header_stdint_h" = "xyes")
1257then
1258 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1259 AC_TRY_COMPILE(
1260 [ #include <stdint.h> ],
1261 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1262 [
1263 AC_DEFINE(HAVE_INTXX_T)
1264 AC_MSG_RESULT(yes)
1265 ],
1266 [ AC_MSG_RESULT(no) ]
1267 )
1268fi
1269
Damien Miller578783e2000-09-23 14:12:24 +11001270AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1271 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001272 [
1273#include <sys/types.h>
1274#ifdef HAVE_STDINT_H
1275# include <stdint.h>
1276#endif
1277#include <sys/socket.h>
1278#ifdef HAVE_SYS_BITYPES_H
1279# include <sys/bitypes.h>
1280#endif
1281 ],
Damien Miller578783e2000-09-23 14:12:24 +11001282 [ int64_t a; a = 1;],
1283 [ ac_cv_have_int64_t="yes" ],
1284 [ ac_cv_have_int64_t="no" ]
1285 )
1286])
1287if test "x$ac_cv_have_int64_t" = "xyes" ; then
1288 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001289fi
1290
Damien Miller61e50f12000-05-08 20:49:37 +10001291AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1292 AC_TRY_COMPILE(
1293 [ #include <sys/types.h> ],
1294 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1295 [ ac_cv_have_u_intxx_t="yes" ],
1296 [ ac_cv_have_u_intxx_t="no" ]
1297 )
1298])
1299if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1300 AC_DEFINE(HAVE_U_INTXX_T)
1301 have_u_intxx_t=1
1302fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001303
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001304if test -z "$have_u_intxx_t" ; then
1305 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1306 AC_TRY_COMPILE(
1307 [ #include <sys/socket.h> ],
1308 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1309 [
1310 AC_DEFINE(HAVE_U_INTXX_T)
1311 AC_MSG_RESULT(yes)
1312 ],
1313 [ AC_MSG_RESULT(no) ]
1314 )
1315fi
1316
Damien Miller578783e2000-09-23 14:12:24 +11001317AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1318 AC_TRY_COMPILE(
1319 [ #include <sys/types.h> ],
1320 [ u_int64_t a; a = 1;],
1321 [ ac_cv_have_u_int64_t="yes" ],
1322 [ ac_cv_have_u_int64_t="no" ]
1323 )
1324])
1325if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1326 AC_DEFINE(HAVE_U_INT64_T)
1327 have_u_int64_t=1
1328fi
1329
Tim Rice4cec93f2002-02-26 08:40:48 -08001330if test -z "$have_u_int64_t" ; then
1331 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1332 AC_TRY_COMPILE(
1333 [ #include <sys/bitypes.h> ],
1334 [ u_int64_t a; a = 1],
1335 [
1336 AC_DEFINE(HAVE_U_INT64_T)
1337 AC_MSG_RESULT(yes)
1338 ],
1339 [ AC_MSG_RESULT(no) ]
1340 )
1341fi
1342
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001343if test -z "$have_u_intxx_t" ; then
1344 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1345 AC_TRY_COMPILE(
1346 [
1347#include <sys/types.h>
1348 ],
1349 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1350 [ ac_cv_have_uintxx_t="yes" ],
1351 [ ac_cv_have_uintxx_t="no" ]
1352 )
1353 ])
1354 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1355 AC_DEFINE(HAVE_UINTXX_T)
1356 fi
1357fi
1358
1359if test -z "$have_uintxx_t" ; then
1360 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1361 AC_TRY_COMPILE(
1362 [ #include <stdint.h> ],
1363 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1364 [
1365 AC_DEFINE(HAVE_UINTXX_T)
1366 AC_MSG_RESULT(yes)
1367 ],
1368 [ AC_MSG_RESULT(no) ]
1369 )
1370fi
1371
Damien Milleredb82922000-06-20 13:25:52 +10001372if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1373 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001374then
1375 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1376 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001377 [
1378#include <sys/bitypes.h>
1379 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001380 [
Damien Miller70494d12000-04-03 15:57:06 +10001381 int8_t a; int16_t b; int32_t c;
1382 u_int8_t e; u_int16_t f; u_int32_t g;
1383 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001384 ],
1385 [
1386 AC_DEFINE(HAVE_U_INTXX_T)
1387 AC_DEFINE(HAVE_INTXX_T)
1388 AC_MSG_RESULT(yes)
1389 ],
1390 [AC_MSG_RESULT(no)]
1391 )
1392fi
1393
Damien Miller58be7382001-09-15 21:31:54 +10001394
1395AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1396 AC_TRY_COMPILE(
1397 [
1398#include <sys/types.h>
1399 ],
1400 [ u_char foo; foo = 125; ],
1401 [ ac_cv_have_u_char="yes" ],
1402 [ ac_cv_have_u_char="no" ]
1403 )
1404])
1405if test "x$ac_cv_have_u_char" = "xyes" ; then
1406 AC_DEFINE(HAVE_U_CHAR)
1407fi
1408
Tim Rice13aae5e2001-10-21 17:53:58 -07001409TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001410
Tim Rice200a5c02002-02-26 22:12:34 -08001411AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001412
Damien Miller61e50f12000-05-08 20:49:37 +10001413AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1414 AC_TRY_COMPILE(
1415 [
1416#include <sys/types.h>
1417 ],
1418 [ size_t foo; foo = 1235; ],
1419 [ ac_cv_have_size_t="yes" ],
1420 [ ac_cv_have_size_t="no" ]
1421 )
1422])
1423if test "x$ac_cv_have_size_t" = "xyes" ; then
1424 AC_DEFINE(HAVE_SIZE_T)
1425fi
Damien Miller95058511999-12-29 10:36:45 +11001426
Damien Miller615f9392000-05-17 22:53:33 +10001427AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1428 AC_TRY_COMPILE(
1429 [
1430#include <sys/types.h>
1431 ],
1432 [ ssize_t foo; foo = 1235; ],
1433 [ ac_cv_have_ssize_t="yes" ],
1434 [ ac_cv_have_ssize_t="no" ]
1435 )
1436])
1437if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1438 AC_DEFINE(HAVE_SSIZE_T)
1439fi
1440
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001441AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1442 AC_TRY_COMPILE(
1443 [
1444#include <time.h>
1445 ],
1446 [ clock_t foo; foo = 1235; ],
1447 [ ac_cv_have_clock_t="yes" ],
1448 [ ac_cv_have_clock_t="no" ]
1449 )
1450])
1451if test "x$ac_cv_have_clock_t" = "xyes" ; then
1452 AC_DEFINE(HAVE_CLOCK_T)
1453fi
1454
Damien Millerb54b40e2000-06-23 08:23:34 +10001455AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1456 AC_TRY_COMPILE(
1457 [
1458#include <sys/types.h>
1459#include <sys/socket.h>
1460 ],
1461 [ sa_family_t foo; foo = 1235; ],
1462 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001463 [ AC_TRY_COMPILE(
1464 [
1465#include <sys/types.h>
1466#include <sys/socket.h>
1467#include <netinet/in.h>
1468 ],
1469 [ sa_family_t foo; foo = 1235; ],
1470 [ ac_cv_have_sa_family_t="yes" ],
1471
Damien Millerb54b40e2000-06-23 08:23:34 +10001472 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001473 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001474 )
1475])
1476if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1477 AC_DEFINE(HAVE_SA_FAMILY_T)
1478fi
1479
Damien Miller0f91b4e2000-06-18 15:43:25 +10001480AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1481 AC_TRY_COMPILE(
1482 [
1483#include <sys/types.h>
1484 ],
1485 [ pid_t foo; foo = 1235; ],
1486 [ ac_cv_have_pid_t="yes" ],
1487 [ ac_cv_have_pid_t="no" ]
1488 )
1489])
1490if test "x$ac_cv_have_pid_t" = "xyes" ; then
1491 AC_DEFINE(HAVE_PID_T)
1492fi
1493
1494AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1495 AC_TRY_COMPILE(
1496 [
1497#include <sys/types.h>
1498 ],
1499 [ mode_t foo; foo = 1235; ],
1500 [ ac_cv_have_mode_t="yes" ],
1501 [ ac_cv_have_mode_t="no" ]
1502 )
1503])
1504if test "x$ac_cv_have_mode_t" = "xyes" ; then
1505 AC_DEFINE(HAVE_MODE_T)
1506fi
1507
Damien Miller61e50f12000-05-08 20:49:37 +10001508
1509AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1510 AC_TRY_COMPILE(
1511 [
Damien Miller81171112000-04-23 11:14:01 +10001512#include <sys/types.h>
1513#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001514 ],
1515 [ struct sockaddr_storage s; ],
1516 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1517 [ ac_cv_have_struct_sockaddr_storage="no" ]
1518 )
1519])
1520if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1521 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1522fi
Damien Miller34132e52000-01-14 15:45:46 +11001523
Damien Miller61e50f12000-05-08 20:49:37 +10001524AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1525 AC_TRY_COMPILE(
1526 [
Damien Miller7b22d652000-06-18 14:07:04 +10001527#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001528#include <netinet/in.h>
1529 ],
1530 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1531 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1532 [ ac_cv_have_struct_sockaddr_in6="no" ]
1533 )
1534])
1535if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1536 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1537fi
Damien Miller34132e52000-01-14 15:45:46 +11001538
Damien Miller61e50f12000-05-08 20:49:37 +10001539AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1540 AC_TRY_COMPILE(
1541 [
Damien Miller7b22d652000-06-18 14:07:04 +10001542#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001543#include <netinet/in.h>
1544 ],
1545 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1546 [ ac_cv_have_struct_in6_addr="yes" ],
1547 [ ac_cv_have_struct_in6_addr="no" ]
1548 )
1549])
1550if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1551 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1552fi
Damien Miller34132e52000-01-14 15:45:46 +11001553
Damien Miller61e50f12000-05-08 20:49:37 +10001554AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1555 AC_TRY_COMPILE(
1556 [
Damien Miller81171112000-04-23 11:14:01 +10001557#include <sys/types.h>
1558#include <sys/socket.h>
1559#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001560 ],
1561 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1562 [ ac_cv_have_struct_addrinfo="yes" ],
1563 [ ac_cv_have_struct_addrinfo="no" ]
1564 )
1565])
1566if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1567 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1568fi
1569
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001570AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1571 AC_TRY_COMPILE(
1572 [ #include <sys/time.h> ],
1573 [ struct timeval tv; tv.tv_sec = 1;],
1574 [ ac_cv_have_struct_timeval="yes" ],
1575 [ ac_cv_have_struct_timeval="no" ]
1576 )
1577])
1578if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1579 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1580 have_struct_timeval=1
1581fi
1582
Tim Rice4e4dc562003-03-18 10:21:40 -08001583AC_CHECK_TYPES(struct timespec)
1584
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001585# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001586if test "x$ac_cv_have_int64_t" = "xno" -a \
1587 "x$ac_cv_sizeof_long_int" != "x8" -a \
1588 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001589 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1590 echo "an alternative compiler (I.E., GCC) before continuing."
1591 echo ""
1592 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001593else
1594dnl test snprintf (broken on SCO w/gcc)
1595 AC_TRY_RUN(
1596 [
1597#include <stdio.h>
1598#include <string.h>
1599#ifdef HAVE_SNPRINTF
1600main()
1601{
1602 char buf[50];
1603 char expected_out[50];
1604 int mazsize = 50 ;
1605#if (SIZEOF_LONG_INT == 8)
1606 long int num = 0x7fffffffffffffff;
1607#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001608 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001609#endif
1610 strcpy(expected_out, "9223372036854775807");
1611 snprintf(buf, mazsize, "%lld", num);
1612 if(strcmp(buf, expected_out) != 0)
1613 exit(1);
1614 exit(0);
1615}
1616#else
1617main() { exit(0); }
1618#endif
1619 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1620 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001621fi
1622
Damien Miller78315eb2000-09-29 23:01:36 +11001623dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001624OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1625OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1626OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1627OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1628OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001629OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001630OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1631OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001632OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001633OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1634OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1635OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1636OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001637OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1638OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1639OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1640OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001641
1642AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001643
Damien Miller61e50f12000-05-08 20:49:37 +10001644AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1645 ac_cv_have_ss_family_in_struct_ss, [
1646 AC_TRY_COMPILE(
1647 [
Damien Miller81171112000-04-23 11:14:01 +10001648#include <sys/types.h>
1649#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001650 ],
1651 [ struct sockaddr_storage s; s.ss_family = 1; ],
1652 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1653 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1654 )
1655])
1656if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1657 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1658fi
1659
Damien Miller61e50f12000-05-08 20:49:37 +10001660AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1661 ac_cv_have___ss_family_in_struct_ss, [
1662 AC_TRY_COMPILE(
1663 [
Damien Miller81171112000-04-23 11:14:01 +10001664#include <sys/types.h>
1665#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001666 ],
1667 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1668 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1669 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1670 )
1671])
1672if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1673 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1674fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001675
Damien Millerad833b32000-08-23 10:46:23 +10001676AC_CACHE_CHECK([for pw_class field in struct passwd],
1677 ac_cv_have_pw_class_in_struct_passwd, [
1678 AC_TRY_COMPILE(
1679 [
Damien Millerad833b32000-08-23 10:46:23 +10001680#include <pwd.h>
1681 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001682 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001683 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1684 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1685 )
1686])
1687if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1688 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1689fi
1690
Kevin Steves82456952001-06-22 21:14:18 +00001691AC_CACHE_CHECK([for pw_expire field in struct passwd],
1692 ac_cv_have_pw_expire_in_struct_passwd, [
1693 AC_TRY_COMPILE(
1694 [
1695#include <pwd.h>
1696 ],
1697 [ struct passwd p; p.pw_expire = 0; ],
1698 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1699 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1700 )
1701])
1702if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1703 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1704fi
1705
1706AC_CACHE_CHECK([for pw_change field in struct passwd],
1707 ac_cv_have_pw_change_in_struct_passwd, [
1708 AC_TRY_COMPILE(
1709 [
1710#include <pwd.h>
1711 ],
1712 [ struct passwd p; p.pw_change = 0; ],
1713 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1714 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1715 )
1716])
1717if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1718 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1719fi
Damien Miller61e50f12000-05-08 20:49:37 +10001720
Tim Rice28bbb0c2002-05-27 17:37:32 -07001721dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001722AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1723 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001724 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001725 [
Tim Riceae49fe62002-04-12 10:26:21 -07001726#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001727#include <sys/socket.h>
1728#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001729int main() {
1730#ifdef msg_accrights
1731exit(1);
1732#endif
1733struct msghdr m;
1734m.msg_accrights = 0;
1735exit(0);
1736}
Kevin Steves939c9db2002-03-22 17:23:25 +00001737 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001738 [ ac_cv_have_accrights_in_msghdr="yes" ],
1739 [ ac_cv_have_accrights_in_msghdr="no" ]
1740 )
1741])
1742if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1743 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1744fi
1745
Kevin Stevesa44e0352002-04-07 16:18:03 +00001746AC_CACHE_CHECK([for msg_control field in struct msghdr],
1747 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001748 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001749 [
Tim Riceae49fe62002-04-12 10:26:21 -07001750#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001751#include <sys/socket.h>
1752#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001753int main() {
1754#ifdef msg_control
1755exit(1);
1756#endif
1757struct msghdr m;
1758m.msg_control = 0;
1759exit(0);
1760}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001761 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001762 [ ac_cv_have_control_in_msghdr="yes" ],
1763 [ ac_cv_have_control_in_msghdr="no" ]
1764 )
1765])
1766if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1767 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1768fi
1769
Damien Miller61e50f12000-05-08 20:49:37 +10001770AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1771 AC_TRY_LINK([],
1772 [ extern char *__progname; printf("%s", __progname); ],
1773 [ ac_cv_libc_defines___progname="yes" ],
1774 [ ac_cv_libc_defines___progname="no" ]
1775 )
1776])
1777if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1778 AC_DEFINE(HAVE___PROGNAME)
1779fi
1780
Kevin Steves4846f4a2002-03-22 18:19:53 +00001781AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1782 AC_TRY_LINK([
1783#include <stdio.h>
1784],
1785 [ printf("%s", __FUNCTION__); ],
1786 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1787 [ ac_cv_cc_implements___FUNCTION__="no" ]
1788 )
1789])
1790if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1791 AC_DEFINE(HAVE___FUNCTION__)
1792fi
1793
1794AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1795 AC_TRY_LINK([
1796#include <stdio.h>
1797],
1798 [ printf("%s", __func__); ],
1799 [ ac_cv_cc_implements___func__="yes" ],
1800 [ ac_cv_cc_implements___func__="no" ]
1801 )
1802])
1803if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1804 AC_DEFINE(HAVE___func__)
1805fi
1806
Damien Miller4f8e6692001-07-14 13:22:53 +10001807AC_CACHE_CHECK([whether getopt has optreset support],
1808 ac_cv_have_getopt_optreset, [
1809 AC_TRY_LINK(
1810 [
1811#include <getopt.h>
1812 ],
1813 [ extern int optreset; optreset = 0; ],
1814 [ ac_cv_have_getopt_optreset="yes" ],
1815 [ ac_cv_have_getopt_optreset="no" ]
1816 )
1817])
1818if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1819 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1820fi
Damien Millera22ba012000-03-02 23:09:20 +11001821
Damien Millerecbb26d2000-07-15 14:59:14 +10001822AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1823 AC_TRY_LINK([],
1824 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1825 [ ac_cv_libc_defines_sys_errlist="yes" ],
1826 [ ac_cv_libc_defines_sys_errlist="no" ]
1827 )
1828])
1829if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1830 AC_DEFINE(HAVE_SYS_ERRLIST)
1831fi
1832
1833
Damien Miller11fa2cc2000-08-16 10:35:58 +10001834AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1835 AC_TRY_LINK([],
1836 [ extern int sys_nerr; printf("%i", sys_nerr);],
1837 [ ac_cv_libc_defines_sys_nerr="yes" ],
1838 [ ac_cv_libc_defines_sys_nerr="no" ]
1839 )
1840])
1841if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1842 AC_DEFINE(HAVE_SYS_NERR)
1843fi
1844
Damien Miller85de5802001-09-18 14:01:11 +10001845SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001846# Check whether user wants sectok support
1847AC_ARG_WITH(sectok,
1848 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001849 [
1850 if test "x$withval" != "xno" ; then
1851 if test "x$withval" != "xyes" ; then
1852 CPPFLAGS="$CPPFLAGS -I${withval}"
1853 LDFLAGS="$LDFLAGS -L${withval}"
1854 if test ! -z "$need_dash_r" ; then
1855 LDFLAGS="$LDFLAGS -R${withval}"
1856 fi
1857 if test ! -z "$blibpath" ; then
1858 blibpath="$blibpath:${withval}"
1859 fi
1860 fi
1861 AC_CHECK_HEADERS(sectok.h)
1862 if test "$ac_cv_header_sectok_h" != yes; then
1863 AC_MSG_ERROR(Can't find sectok.h)
1864 fi
1865 AC_CHECK_LIB(sectok, sectok_open)
1866 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1867 AC_MSG_ERROR(Can't find libsectok)
1868 fi
1869 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001870 AC_DEFINE(USE_SECTOK)
1871 SCARD_MSG="yes, using sectok"
1872 fi
1873 ]
1874)
1875
1876# Check whether user wants OpenSC support
1877AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001878 AC_HELP_STRING([--with-opensc=PFX],
1879 [Enable smartcard support using OpenSC]),
1880 opensc_config_prefix="$withval", opensc_config_prefix="")
1881if test x$opensc_config_prefix != x ; then
1882 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1883 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1884 if test "$OPENSC_CONFIG" != "no"; then
1885 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1886 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1887 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1888 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1889 AC_DEFINE(SMARTCARD)
1890 AC_DEFINE(USE_OPENSC)
1891 SCARD_MSG="yes, using OpenSC"
1892 fi
1893fi
Damien Miller85de5802001-09-18 14:01:11 +10001894
Damien Miller7abe09b2003-05-15 10:53:49 +10001895# Check whether user wants DNS support
1896DNS_MSG="no"
1897AC_ARG_WITH(dns,
1898 [ --with-dns Support for fetching keys from DNS (experimental)],
1899 [
1900 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001901 DNS_MSG="yes"
1902 AC_DEFINE(DNS)
1903 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001904 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1905 [
1906 # Needed by our getrrsetbyname()
1907 AC_SEARCH_LIBS(res_query, resolv)
1908 AC_SEARCH_LIBS(dn_expand, resolv)
1909 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001910 fi
1911 ]
1912)
1913
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001914# Check whether user wants Kerberos 5 support
1915KRB5_MSG="no"
1916AC_ARG_WITH(kerberos5,
1917 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1918 [
1919 if test "x$withval" != "xno" ; then
1920 if test "x$withval" = "xyes" ; then
1921 KRB5ROOT="/usr/local"
1922 else
1923 KRB5ROOT=${withval}
1924 fi
1925 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1926 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1927 AC_DEFINE(KRB5)
1928 KRB5_MSG="yes"
1929 AC_MSG_CHECKING(whether we are using Heimdal)
1930 AC_TRY_COMPILE([ #include <krb5.h> ],
1931 [ char *tmp = heimdal_version; ],
1932 [ AC_MSG_RESULT(yes)
1933 AC_DEFINE(HEIMDAL)
1934 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1935 ],
1936 [ AC_MSG_RESULT(no)
1937 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1938 ]
1939 )
1940 if test ! -z "$need_dash_r" ; then
1941 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1942 fi
1943 if test ! -z "$blibpath" ; then
1944 blibpath="$blibpath:${KRB5ROOT}/lib"
1945 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001946 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001947
1948 KRB5=yes
1949 fi
1950 ]
1951)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10001952LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001953
Damien Millera22ba012000-03-02 23:09:20 +11001954# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001955
Damien Millerf58c6722002-05-13 13:15:42 +10001956PRIVSEP_PATH=/var/empty
1957AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001958 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001959 [
1960 if test "x$withval" != "$no" ; then
1961 PRIVSEP_PATH=$withval
1962 fi
1963 ]
1964)
1965AC_SUBST(PRIVSEP_PATH)
1966
Damien Millera22ba012000-03-02 23:09:20 +11001967AC_ARG_WITH(xauth,
1968 [ --with-xauth=PATH Specify path to xauth program ],
1969 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001970 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001971 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001972 fi
1973 ],
1974 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001975 TestPath="$PATH"
1976 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1977 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1978 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1979 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1980 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001981 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001982 xauth_path="/usr/openwin/bin/xauth"
1983 fi
1984 ]
1985)
1986
Damien Miller7d901272003-01-13 16:55:22 +11001987STRIP_OPT=-s
1988AC_ARG_ENABLE(strip,
1989 [ --disable-strip Disable calling strip(1) on install],
1990 [
1991 if test "x$enableval" = "xno" ; then
1992 STRIP_OPT=
1993 fi
1994 ]
1995)
1996AC_SUBST(STRIP_OPT)
1997
Damien Millera19cf472000-11-29 13:28:50 +11001998if test -z "$xauth_path" ; then
1999 XAUTH_PATH="undefined"
2000 AC_SUBST(XAUTH_PATH)
2001else
Damien Millera22ba012000-03-02 23:09:20 +11002002 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002003 XAUTH_PATH=$xauth_path
2004 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002005fi
Damien Millera22ba012000-03-02 23:09:20 +11002006
2007# Check for mail directory (last resort if we cannot get it from headers)
2008if test ! -z "$MAIL" ; then
2009 maildir=`dirname $MAIL`
2010 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2011fi
2012
Damien Millera22ba012000-03-02 23:09:20 +11002013if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002014 if test "x$disable_ptmx_check" != "xyes" ; then
2015 AC_CHECK_FILE("/dev/ptmx",
2016 [
2017 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2018 have_dev_ptmx=1
2019 ]
2020 )
2021 fi
Damien Millera22ba012000-03-02 23:09:20 +11002022fi
Damien Miller204ad072000-03-02 23:56:12 +11002023AC_CHECK_FILE("/dev/ptc",
2024 [
2025 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2026 have_dev_ptc=1
2027 ]
2028)
2029
Damien Millera22ba012000-03-02 23:09:20 +11002030# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002031AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002032 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002033 [
Damien Miller897741e2001-04-16 10:41:46 +10002034 case "$withval" in
2035 man|cat|doc)
2036 MANTYPE=$withval
2037 ;;
2038 *)
2039 AC_MSG_ERROR(invalid man type: $withval)
2040 ;;
2041 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002042 ]
2043)
Ben Lindstrombc709922001-04-18 18:04:21 +00002044if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002045 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2046 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002047 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2048 MANTYPE=doc
2049 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2050 MANTYPE=man
2051 else
2052 MANTYPE=cat
2053 fi
2054fi
Damien Miller670a4b82000-01-22 13:53:11 +11002055AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002056if test "$MANTYPE" = "doc"; then
2057 mansubdir=man;
2058else
2059 mansubdir=$MANTYPE;
2060fi
2061AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002062
Damien Millera22ba012000-03-02 23:09:20 +11002063# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002064MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002065AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002066 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002067 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002068 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002069 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002070 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002071 fi
2072 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002073)
2074
Damien Millera22ba012000-03-02 23:09:20 +11002075# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002076AC_ARG_WITH(shadow,
2077 [ --without-shadow Disable shadow password support],
2078 [
2079 if test "x$withval" = "xno" ; then
2080 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002081 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002082 fi
2083 ]
2084)
2085
Damien Miller1f335fb2000-06-26 11:31:33 +10002086if test -z "$disable_shadow" ; then
2087 AC_MSG_CHECKING([if the systems has expire shadow information])
2088 AC_TRY_COMPILE(
2089 [
2090#include <sys/types.h>
2091#include <shadow.h>
2092 struct spwd sp;
2093 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2094 [ sp_expire_available=yes ], []
2095 )
2096
2097 if test "x$sp_expire_available" = "xyes" ; then
2098 AC_MSG_RESULT(yes)
2099 AC_DEFINE(HAS_SHADOW_EXPIRE)
2100 else
2101 AC_MSG_RESULT(no)
2102 fi
2103fi
2104
Damien Millera22ba012000-03-02 23:09:20 +11002105# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002106if test ! -z "$IPADDR_IN_DISPLAY" ; then
2107 DISPLAY_HACK_MSG="yes"
2108 AC_DEFINE(IPADDR_IN_DISPLAY)
2109else
2110 DISPLAY_HACK_MSG="no"
2111 AC_ARG_WITH(ipaddr-display,
2112 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2113 [
2114 if test "x$withval" != "xno" ; then
2115 AC_DEFINE(IPADDR_IN_DISPLAY)
2116 DISPLAY_HACK_MSG="yes"
2117 fi
2118 ]
2119 )
2120fi
Damien Miller76112de1999-12-21 11:18:08 +11002121
Tim Rice43a1c132002-04-17 21:19:14 -07002122dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2123if test $ac_cv_func_login_getcapbool = "yes" -a \
2124 $ac_cv_header_login_cap_h = "yes" ; then
2125 USES_LOGIN_CONF=yes
2126fi
Damien Millera22ba012000-03-02 23:09:20 +11002127# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002128SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002129AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002130 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002131 [
Tim Rice43a1c132002-04-17 21:19:14 -07002132 if test "$USES_LOGIN_CONF" = "yes" ; then
2133 AC_MSG_WARN([
2134--with-default-path=PATH has no effect on this system.
2135Edit /etc/login.conf instead.])
2136 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002137 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002138 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002139 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002140 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002141 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2142 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2143 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002144 AC_TRY_RUN(
2145 [
2146/* find out what STDPATH is */
2147#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002148#ifdef HAVE_PATHS_H
2149# include <paths.h>
2150#endif
2151#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002152# ifdef _PATH_USERPATH /* Irix */
2153# define _PATH_STDPATH _PATH_USERPATH
2154# else
2155# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2156# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002157#endif
2158#include <sys/types.h>
2159#include <sys/stat.h>
2160#include <fcntl.h>
2161#define DATA "conftest.stdpath"
2162
2163main()
2164{
2165 FILE *fd;
2166 int rc;
2167
2168 fd = fopen(DATA,"w");
2169 if(fd == NULL)
2170 exit(1);
2171
2172 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2173 exit(1);
2174
2175 exit(0);
2176}
2177 ], [ user_path=`cat conftest.stdpath` ],
2178 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2179 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2180 )
2181# make sure $bindir is in USER_PATH so scp will work
2182 t_bindir=`eval echo ${bindir}`
2183 case $t_bindir in
2184 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2185 esac
2186 case $t_bindir in
2187 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2188 esac
2189 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2190 if test $? -ne 0 ; then
2191 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2192 if test $? -ne 0 ; then
2193 user_path=$user_path:$t_bindir
2194 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2195 fi
2196 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002197 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002198)
Tim Rice43a1c132002-04-17 21:19:14 -07002199if test "$USES_LOGIN_CONF" != "yes" ; then
2200 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2201 AC_SUBST(user_path)
2202fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002203
Damien Millera18bbd32002-05-13 10:48:57 +10002204# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002205AC_ARG_WITH(superuser-path,
2206 [ --with-superuser-path= Specify different path for super-user],
2207 [
2208 if test "x$withval" != "xno" ; then
2209 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2210 superuser_path=$withval
2211 fi
2212 ]
2213)
2214
2215
Damien Miller61e50f12000-05-08 20:49:37 +10002216AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002217IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002218AC_ARG_WITH(4in6,
2219 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2220 [
2221 if test "x$withval" != "xno" ; then
2222 AC_MSG_RESULT(yes)
2223 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002224 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002225 else
2226 AC_MSG_RESULT(no)
2227 fi
2228 ],[
2229 if test "x$inet6_default_4in6" = "xyes"; then
2230 AC_MSG_RESULT([yes (default)])
2231 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002232 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002233 else
2234 AC_MSG_RESULT([no (default)])
2235 fi
2236 ]
2237)
2238
Damien Miller60396b02001-02-18 17:01:00 +11002239# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002240BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002241AC_ARG_WITH(bsd-auth,
2242 [ --with-bsd-auth Enable BSD auth support],
2243 [
2244 if test "x$withval" != "xno" ; then
2245 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002246 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002247 fi
2248 ]
2249)
2250
Damien Millera22ba012000-03-02 23:09:20 +11002251# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002252piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002253# make sure the directory exists
2254if test ! -d $piddir ; then
2255 piddir=`eval echo ${sysconfdir}`
2256 case $piddir in
2257 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2258 esac
2259fi
2260
Tim Rice88f2ab52002-03-17 12:17:34 -08002261AC_ARG_WITH(pid-dir,
2262 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2263 [
2264 if test "x$withval" != "xno" ; then
2265 piddir=$withval
2266 if test ! -d $piddir ; then
2267 AC_MSG_WARN([** no $piddir directory on this system **])
2268 fi
2269 fi
2270 ]
2271)
2272
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002273AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002274AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002275
andre2ff7b5d2000-06-03 14:57:40 +00002276dnl allow user to disable some login recording features
2277AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002278 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002279 [
2280 if test "x$enableval" = "xno" ; then
2281 AC_DEFINE(DISABLE_LASTLOG)
2282 fi
2283 ]
andre2ff7b5d2000-06-03 14:57:40 +00002284)
2285AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002286 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002287 [
2288 if test "x$enableval" = "xno" ; then
2289 AC_DEFINE(DISABLE_UTMP)
2290 fi
2291 ]
andre2ff7b5d2000-06-03 14:57:40 +00002292)
2293AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002294 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002295 [
2296 if test "x$enableval" = "xno" ; then
2297 AC_DEFINE(DISABLE_UTMPX)
2298 fi
2299 ]
andre2ff7b5d2000-06-03 14:57:40 +00002300)
2301AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002302 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002303 [
2304 if test "x$enableval" = "xno" ; then
2305 AC_DEFINE(DISABLE_WTMP)
2306 fi
2307 ]
andre2ff7b5d2000-06-03 14:57:40 +00002308)
2309AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002310 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002311 [
2312 if test "x$enableval" = "xno" ; then
2313 AC_DEFINE(DISABLE_WTMPX)
2314 fi
2315 ]
andre2ff7b5d2000-06-03 14:57:40 +00002316)
2317AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002318 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002319 [
2320 if test "x$enableval" = "xno" ; then
2321 AC_DEFINE(DISABLE_LOGIN)
2322 fi
2323 ]
andre2ff7b5d2000-06-03 14:57:40 +00002324)
2325AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002326 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002327 [
2328 if test "x$enableval" = "xno" ; then
2329 AC_DEFINE(DISABLE_PUTUTLINE)
2330 fi
2331 ]
andre2ff7b5d2000-06-03 14:57:40 +00002332)
2333AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002334 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002335 [
2336 if test "x$enableval" = "xno" ; then
2337 AC_DEFINE(DISABLE_PUTUTXLINE)
2338 fi
2339 ]
andre2ff7b5d2000-06-03 14:57:40 +00002340)
2341AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002342 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002343 [
2344 if test "x$withval" = "xno" ; then
2345 AC_DEFINE(DISABLE_LASTLOG)
2346 else
2347 conf_lastlog_location=$withval
2348 fi
2349 ]
2350)
andre2ff7b5d2000-06-03 14:57:40 +00002351
2352dnl lastlog, [uw]tmpx? detection
2353dnl NOTE: set the paths in the platform section to avoid the
2354dnl need for command-line parameters
2355dnl lastlog and [uw]tmp are subject to a file search if all else fails
2356
2357dnl lastlog detection
2358dnl NOTE: the code itself will detect if lastlog is a directory
2359AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2360AC_TRY_COMPILE([
2361#include <sys/types.h>
2362#include <utmp.h>
2363#ifdef HAVE_LASTLOG_H
2364# include <lastlog.h>
2365#endif
Damien Miller2994e082000-06-04 15:51:47 +10002366#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002367# include <paths.h>
2368#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002369#ifdef HAVE_LOGIN_H
2370# include <login.h>
2371#endif
andre2ff7b5d2000-06-03 14:57:40 +00002372 ],
2373 [ char *lastlog = LASTLOG_FILE; ],
2374 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002375 [
2376 AC_MSG_RESULT(no)
2377 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2378 AC_TRY_COMPILE([
2379#include <sys/types.h>
2380#include <utmp.h>
2381#ifdef HAVE_LASTLOG_H
2382# include <lastlog.h>
2383#endif
2384#ifdef HAVE_PATHS_H
2385# include <paths.h>
2386#endif
2387 ],
2388 [ char *lastlog = _PATH_LASTLOG; ],
2389 [ AC_MSG_RESULT(yes) ],
2390 [
andree441aa32000-06-12 22:34:38 +00002391 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002392 system_lastlog_path=no
2393 ])
2394 ]
andre2ff7b5d2000-06-03 14:57:40 +00002395)
Damien Miller2994e082000-06-04 15:51:47 +10002396
andre2ff7b5d2000-06-03 14:57:40 +00002397if test -z "$conf_lastlog_location"; then
2398 if test x"$system_lastlog_path" = x"no" ; then
2399 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002400 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002401 conf_lastlog_location=$f
2402 fi
2403 done
2404 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002405 AC_MSG_WARN([** Cannot find lastlog **])
2406 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002407 fi
2408 fi
2409fi
2410
2411if test -n "$conf_lastlog_location"; then
2412 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2413fi
2414
2415dnl utmp detection
2416AC_MSG_CHECKING([if your system defines UTMP_FILE])
2417AC_TRY_COMPILE([
2418#include <sys/types.h>
2419#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002420#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002421# include <paths.h>
2422#endif
2423 ],
2424 [ char *utmp = UTMP_FILE; ],
2425 [ AC_MSG_RESULT(yes) ],
2426 [ AC_MSG_RESULT(no)
2427 system_utmp_path=no ]
2428)
2429if test -z "$conf_utmp_location"; then
2430 if test x"$system_utmp_path" = x"no" ; then
2431 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2432 if test -f $f ; then
2433 conf_utmp_location=$f
2434 fi
2435 done
2436 if test -z "$conf_utmp_location"; then
2437 AC_DEFINE(DISABLE_UTMP)
2438 fi
2439 fi
2440fi
2441if test -n "$conf_utmp_location"; then
2442 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2443fi
2444
2445dnl wtmp detection
2446AC_MSG_CHECKING([if your system defines WTMP_FILE])
2447AC_TRY_COMPILE([
2448#include <sys/types.h>
2449#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002450#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002451# include <paths.h>
2452#endif
2453 ],
2454 [ char *wtmp = WTMP_FILE; ],
2455 [ AC_MSG_RESULT(yes) ],
2456 [ AC_MSG_RESULT(no)
2457 system_wtmp_path=no ]
2458)
2459if test -z "$conf_wtmp_location"; then
2460 if test x"$system_wtmp_path" = x"no" ; then
2461 for f in /usr/adm/wtmp /var/log/wtmp; do
2462 if test -f $f ; then
2463 conf_wtmp_location=$f
2464 fi
2465 done
2466 if test -z "$conf_wtmp_location"; then
2467 AC_DEFINE(DISABLE_WTMP)
2468 fi
2469 fi
2470fi
2471if test -n "$conf_wtmp_location"; then
2472 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2473fi
2474
2475
2476dnl utmpx detection - I don't know any system so perverse as to require
2477dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2478dnl there, though.
2479AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2480AC_TRY_COMPILE([
2481#include <sys/types.h>
2482#include <utmp.h>
2483#ifdef HAVE_UTMPX_H
2484#include <utmpx.h>
2485#endif
Damien Miller2994e082000-06-04 15:51:47 +10002486#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002487# include <paths.h>
2488#endif
2489 ],
2490 [ char *utmpx = UTMPX_FILE; ],
2491 [ AC_MSG_RESULT(yes) ],
2492 [ AC_MSG_RESULT(no)
2493 system_utmpx_path=no ]
2494)
2495if test -z "$conf_utmpx_location"; then
2496 if test x"$system_utmpx_path" = x"no" ; then
2497 AC_DEFINE(DISABLE_UTMPX)
2498 fi
2499else
2500 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2501fi
2502
2503dnl wtmpx detection
2504AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2505AC_TRY_COMPILE([
2506#include <sys/types.h>
2507#include <utmp.h>
2508#ifdef HAVE_UTMPX_H
2509#include <utmpx.h>
2510#endif
Damien Miller2994e082000-06-04 15:51:47 +10002511#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002512# include <paths.h>
2513#endif
2514 ],
2515 [ char *wtmpx = WTMPX_FILE; ],
2516 [ AC_MSG_RESULT(yes) ],
2517 [ AC_MSG_RESULT(no)
2518 system_wtmpx_path=no ]
2519)
2520if test -z "$conf_wtmpx_location"; then
2521 if test x"$system_wtmpx_path" = x"no" ; then
2522 AC_DEFINE(DISABLE_WTMPX)
2523 fi
2524else
2525 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2526fi
2527
Damien Miller4018c192000-04-30 09:30:44 +10002528
Damien Miller29ea30d2000-03-17 10:54:15 +11002529if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002530 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2531 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002532fi
2533
Tim Rice4cec93f2002-02-26 08:40:48 -08002534dnl remove pam and dl because they are in $LIBPAM
2535if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002536 LIBS=`echo $LIBS | sed 's/-lpam //'`
2537fi
2538if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2539 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002540fi
2541
Damien Millerbac2d8a2000-09-05 16:13:06 +11002542AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002543AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2544AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002545
Damien Miller7b22d652000-06-18 14:07:04 +10002546# Print summary of options
2547
Damien Miller7b22d652000-06-18 14:07:04 +10002548# Someone please show me a better way :)
2549A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2550B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2551C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2552D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002553E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002554F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002555G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002556H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2557I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2558J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002559
2560echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002561echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002562echo " User binaries: $B"
2563echo " System binaries: $C"
2564echo " Configuration files: $D"
2565echo " Askpass program: $E"
2566echo " Manual pages: $F"
2567echo " PID file: $G"
2568echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002569if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002570echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002571else
Damien Millerf58c6722002-05-13 13:15:42 +10002572echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002573fi
Damien Millera18bbd32002-05-13 10:48:57 +10002574if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002575echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002576fi
Damien Millerf58c6722002-05-13 13:15:42 +10002577echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002578echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002579echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002580echo " KerberosV support: $KRB5_MSG"
2581echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002582echo " S/KEY support: $SKEY_MSG"
2583echo " TCP Wrappers support: $TCPW_MSG"
2584echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002585echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002586echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2587echo " BSD Auth support: $BSD_AUTH_MSG"
2588echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002589if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002590echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002591fi
2592
Damien Miller7b22d652000-06-18 14:07:04 +10002593echo ""
2594
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002595echo " Host: ${host}"
2596echo " Compiler: ${CC}"
2597echo " Compiler flags: ${CFLAGS}"
2598echo "Preprocessor flags: ${CPPFLAGS}"
2599echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002600echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002601
2602echo ""
2603
Damien Miller82cf0ce2000-12-20 13:34:48 +11002604if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002605 echo "PAM is enabled. You may need to install a PAM control file "
2606 echo "for sshd, otherwise password authentication may fail. "
2607 echo "Example PAM control files can be found in the contrib/ "
2608 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002609 echo ""
2610fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002611
Damien Miller6c21c512002-01-22 21:57:53 +11002612if test ! -z "$RAND_HELPER_CMDHASH" ; then
2613 echo "WARNING: you are using the builtin random number collection "
2614 echo "service. Please read WARNING.RNG and request that your OS "
2615 echo "vendor includes kernel-based random number collection in "
2616 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002617 echo ""
2618fi
Damien Miller60396b02001-02-18 17:01:00 +11002619