blob: bbc00e703773fd6b396b8daa2e359363b4fa98e7 [file] [log] [blame]
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001# $Id: configure.ac,v 1.143 2003/08/26 01:58:16 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 Tucker3c8e1e12003-08-25 13:27:40 +1000372 AC_DEFINE(BROKEN_GETADDRINFO)
Darren Tuckere41bba52003-08-25 11:51:19 +1000373 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
Damien Millerb8c656e2000-06-28 15:22:41 +1000374 ;;
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +0000375
376*-*-nto-qnx)
377 AC_DEFINE(USE_PIPES)
378 AC_DEFINE(NO_X11_UNIX_SOCKETS)
379 AC_DEFINE(MISSING_NFDBITS)
380 AC_DEFINE(MISSING_HOWMANY)
381 AC_DEFINE(MISSING_FD_MASK)
382 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100383esac
384
Damien Millere37bfc12000-06-05 09:37:43 +1000385# Allow user to specify flags
386AC_ARG_WITH(cflags,
387 [ --with-cflags Specify additional flags to pass to compiler],
388 [
389 if test "x$withval" != "xno" ; then
390 CFLAGS="$CFLAGS $withval"
391 fi
392 ]
393)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000394AC_ARG_WITH(cppflags,
395 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
396 [
397 if test "x$withval" != "xno"; then
398 CPPFLAGS="$CPPFLAGS $withval"
399 fi
400 ]
401)
Damien Millere37bfc12000-06-05 09:37:43 +1000402AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000403 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000404 [
405 if test "x$withval" != "xno" ; then
406 LDFLAGS="$LDFLAGS $withval"
407 fi
408 ]
409)
410AC_ARG_WITH(libs,
411 [ --with-libs Specify additional libraries to link with],
412 [
413 if test "x$withval" != "xno" ; then
414 LIBS="$LIBS $withval"
415 fi
416 ]
417)
418
Darren Tucker6eb93042003-06-29 21:30:41 +1000419AC_MSG_CHECKING(compiler and flags for sanity)
420AC_TRY_RUN([
421#include <stdio.h>
422int main(){exit(0);}
423 ],
424 [ AC_MSG_RESULT(yes) ],
425 [
426 AC_MSG_RESULT(no)
427 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
428 ]
429)
430
Tim Rice4cec93f2002-02-26 08:40:48 -0800431# Checks for header files.
Damien Miller5fe46a42003-06-05 09:53:31 +1000432AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
Damien Millerb16f8742003-02-24 12:47:15 +1100433 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800434 login_cap.h maillock.h netdb.h netgroup.h \
Damien Millerf71d2a52002-05-13 15:14:08 +1000435 netinet/in_systm.h paths.h pty.h readpassphrase.h \
Ben Lindstrom7577fd82002-03-08 03:11:07 +0000436 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
Darren Tuckera0c0b632003-07-08 20:52:12 +1000437 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
438 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
Ben Lindstrom4b0f1ad2003-02-01 04:43:34 +0000439 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
Tim Rice81ed5182002-09-25 17:38:46 -0700440 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
Tim Rice4cec93f2002-02-26 08:40:48 -0800441 util.h utime.h utmp.h utmpx.h)
442
Damien Millera22ba012000-03-02 23:09:20 +1100443# Checks for libraries.
Tim Rice13aae5e2001-10-21 17:53:58 -0700444AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
445AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000446
Damien Millerdf288022001-02-18 13:07:07 +1100447dnl SCO OS3 needs this for libwrap
Tim Rice13aae5e2001-10-21 17:53:58 -0700448if test "x$with_tcp_wrappers" != "xno" ; then
449 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
450 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
451 fi
452fi
Damien Millerdf288022001-02-18 13:07:07 +1100453
Tim Rice13aae5e2001-10-21 17:53:58 -0700454AC_CHECK_FUNC(getspnam, ,
455 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
Tim Rice13aae5e2001-10-21 17:53:58 -0700456
Damien Miller150c8b52002-02-13 23:06:56 +1100457AC_ARG_WITH(rpath,
458 [ --without-rpath Disable auto-added -R linker paths],
459 [
460 if test "x$withval" = "xno" ; then
461 need_dash_r=""
462 fi
463 if test "x$withval" = "xyes" ; then
464 need_dash_r=1
465 fi
466 ]
467)
468
Tim Rice13aae5e2001-10-21 17:53:58 -0700469dnl zlib is required
470AC_ARG_WITH(zlib,
471 [ --with-zlib=PATH Use zlib in PATH],
472 [
Kevin Steves7dc81972002-01-22 21:59:31 +0000473 if test "x$withval" = "xno" ; then
Damien Miller6c21c512002-01-22 21:57:53 +1100474 AC_MSG_ERROR([*** zlib is required ***])
475 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700476 if test -d "$withval/lib"; then
477 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700478 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700479 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700480 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700481 fi
482 else
483 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700484 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700485 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700486 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700487 fi
488 fi
489 if test -d "$withval/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700490 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700491 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700492 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700493 fi
494 ]
495)
496
Tim Rice17b93e52001-10-23 22:36:54 -0700497AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Miller6f9c3372000-10-25 10:06:04 +1100498
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000499dnl UnixWare 2.x
500AC_CHECK_FUNC(strcasecmp,
501 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
502)
503AC_CHECK_FUNC(utimes,
Tim Ricecbb90662002-07-08 19:17:10 -0700504 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
505 LIBS="$LIBS -lc89"]) ]
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000506)
Damien Millerab18c411999-11-11 10:40:23 +1100507
Tim Ricee589a292001-11-03 11:09:32 -0800508dnl Checks for libutil functions
509AC_CHECK_HEADERS(libutil.h)
510AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
511AC_CHECK_FUNCS(logout updwtmp logwtmp)
512
Ben Lindstrom8697e082001-02-24 21:41:10 +0000513AC_FUNC_STRFTIME
514
Damien Miller3c027682001-03-14 11:39:45 +1100515# Check for ALTDIRFUNC glob() extension
516AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
517AC_EGREP_CPP(FOUNDIT,
518 [
519 #include <glob.h>
520 #ifdef GLOB_ALTDIRFUNC
521 FOUNDIT
522 #endif
523 ],
524 [
525 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
526 AC_MSG_RESULT(yes)
527 ],
528 [
529 AC_MSG_RESULT(no)
530 ]
531)
Damien Millerab18c411999-11-11 10:40:23 +1100532
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000533# Check for g.gl_matchc glob() extension
534AC_MSG_CHECKING(for gl_matchc field in glob_t)
535AC_EGREP_CPP(FOUNDIT,
536 [
537 #include <glob.h>
538 int main(void){glob_t g; g.gl_matchc = 1;}
539 ],
540 [
541 AC_DEFINE(GLOB_HAS_GL_MATCHC)
542 AC_MSG_RESULT(yes)
543 ],
544 [
545 AC_MSG_RESULT(no)
546 ]
547)
548
Damien Miller18bb4732001-03-28 14:35:30 +1000549AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
550AC_TRY_RUN(
551 [
552#include <sys/types.h>
553#include <dirent.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700554int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
Damien Miller18bb4732001-03-28 14:35:30 +1000555 ],
556 [AC_MSG_RESULT(yes)],
557 [
558 AC_MSG_RESULT(no)
559 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
560 ]
561)
562
Damien Millerc547bf12001-02-16 10:18:12 +1100563# Check whether user wants S/Key support
564SKEY_MSG="no"
565AC_ARG_WITH(skey,
Tim Rice13aae5e2001-10-21 17:53:58 -0700566 [ --with-skey[[=PATH]] Enable S/Key support
567 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100568 [
569 if test "x$withval" != "xno" ; then
570
571 if test "x$withval" != "xyes" ; then
572 CPPFLAGS="$CPPFLAGS -I${withval}/include"
573 LDFLAGS="$LDFLAGS -L${withval}/lib"
574 fi
575
576 AC_DEFINE(SKEY)
577 LIBS="-lskey $LIBS"
578 SKEY_MSG="yes"
579
Tim Rice4cec93f2002-02-26 08:40:48 -0800580 AC_MSG_CHECKING([for s/key support])
581 AC_TRY_RUN(
Damien Millerc547bf12001-02-16 10:18:12 +1100582 [
Tim Rice4cec93f2002-02-26 08:40:48 -0800583#include <stdio.h>
584#include <skey.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700585int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
Tim Rice4cec93f2002-02-26 08:40:48 -0800586 ],
587 [AC_MSG_RESULT(yes)],
588 [
589 AC_MSG_RESULT(no)
Damien Millerc547bf12001-02-16 10:18:12 +1100590 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
591 ])
592 fi
593 ]
594)
595
596# Check whether user wants TCP wrappers support
Tim Rice13aae5e2001-10-21 17:53:58 -0700597TCPW_MSG="no"
Damien Millerc547bf12001-02-16 10:18:12 +1100598AC_ARG_WITH(tcp-wrappers,
Tim Rice13aae5e2001-10-21 17:53:58 -0700599 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
600 (optionally in PATH)],
Damien Millerc547bf12001-02-16 10:18:12 +1100601 [
602 if test "x$withval" != "xno" ; then
603 saved_LIBS="$LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700604 saved_LDFLAGS="$LDFLAGS"
605 saved_CPPFLAGS="$CPPFLAGS"
606 if test -n "${withval}" -a "${withval}" != "yes"; then
607 if test -d "${withval}/lib"; then
608 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700609 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700610 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700611 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700612 fi
613 else
614 if test -n "${need_dash_r}"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700615 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700616 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700617 LDFLAGS="-L${withval} ${LDFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700618 fi
619 fi
620 if test -d "${withval}/include"; then
Tim Rice02cebcd2001-10-25 10:01:30 -0700621 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700622 else
Tim Rice02cebcd2001-10-25 10:01:30 -0700623 CPPFLAGS="-I${withval} ${CPPFLAGS}"
Tim Rice13aae5e2001-10-21 17:53:58 -0700624 fi
Tim Rice13aae5e2001-10-21 17:53:58 -0700625 fi
Tim Rice4cec93f2002-02-26 08:40:48 -0800626 LIBWRAP="-lwrap"
627 LIBS="$LIBWRAP $LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100628 AC_MSG_CHECKING(for libwrap)
629 AC_TRY_LINK(
630 [
631#include <tcpd.h>
632 int deny_severity = 0, allow_severity = 0;
633 ],
634 [hosts_access(0);],
635 [
636 AC_MSG_RESULT(yes)
637 AC_DEFINE(LIBWRAP)
Tim Rice4cec93f2002-02-26 08:40:48 -0800638 AC_SUBST(LIBWRAP)
Tim Rice13aae5e2001-10-21 17:53:58 -0700639 TCPW_MSG="yes"
Damien Millerc547bf12001-02-16 10:18:12 +1100640 ],
641 [
642 AC_MSG_ERROR([*** libwrap missing])
643 ]
644 )
Tim Rice4cec93f2002-02-26 08:40:48 -0800645 LIBS="$saved_LIBS"
Damien Millerc547bf12001-02-16 10:18:12 +1100646 fi
647 ]
648)
649
Damien Millerfe1f1432003-02-24 15:45:42 +1100650dnl Checks for library functions. Please keep in alphabetical order
651AC_CHECK_FUNCS(\
Damien Miller5fe46a42003-06-05 09:53:31 +1000652 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
653 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
Damien Millerfe1f1432003-02-24 15:45:42 +1100654 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
Darren Tuckerf1159b52003-07-07 19:44:01 +1000655 getpeereid _getpty getrlimit getttyent glob inet_aton \
Damien Millerfe1f1432003-02-24 15:45:42 +1100656 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
Damien Miller1340ec22003-05-20 09:24:42 +1000657 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
658 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
659 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
Damien Miller5fe46a42003-06-05 09:53:31 +1000660 setproctitle setregid setresgid setresuid setreuid setrlimit \
661 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
Darren Tuckerf38ea772003-08-13 20:48:07 +1000662 strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
663 truncate utimes vhangup vsnprintf waitpid \
Damien Millerfe1f1432003-02-24 15:45:42 +1100664)
Tim Rice13aae5e2001-10-21 17:53:58 -0700665
Damien Millercd6853c2003-01-28 11:33:42 +1100666AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
Damien Millereab4bae2003-04-29 23:22:40 +1000667AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
Damien Millercd6853c2003-01-28 11:33:42 +1100668
Darren Tuckerf1159b52003-07-07 19:44:01 +1000669dnl Make sure prototypes are defined for these before using them.
Ben Lindstrom3e006472002-10-16 00:24:03 +0000670AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
Darren Tuckerf1159b52003-07-07 19:44:01 +1000671AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
Ben Lindstrom3e006472002-10-16 00:24:03 +0000672
Tim Rice13aae5e2001-10-21 17:53:58 -0700673dnl IRIX and Solaris 2.5.1 have dirname() in libgen
Tim Rice17b93e52001-10-23 22:36:54 -0700674AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
Tim Rice13aae5e2001-10-21 17:53:58 -0700675 AC_CHECK_LIB(gen, dirname,[
676 AC_CACHE_CHECK([for broken dirname],
677 ac_cv_have_broken_dirname, [
Tim Rice17b93e52001-10-23 22:36:54 -0700678 save_LIBS="$LIBS"
679 LIBS="$LIBS -lgen"
Tim Rice13aae5e2001-10-21 17:53:58 -0700680 AC_TRY_RUN(
681 [
682#include <libgen.h>
683#include <string.h>
684
685int main(int argc, char **argv) {
686 char *s, buf[32];
687
688 strncpy(buf,"/etc", 32);
689 s = dirname(buf);
Tim Rice17b93e52001-10-23 22:36:54 -0700690 if (!s || strncmp(s, "/", 32) != 0) {
Tim Rice13aae5e2001-10-21 17:53:58 -0700691 exit(1);
692 } else {
693 exit(0);
694 }
695}
696 ],
697 [ ac_cv_have_broken_dirname="no" ],
698 [ ac_cv_have_broken_dirname="yes" ]
699 )
Tim Rice17b93e52001-10-23 22:36:54 -0700700 LIBS="$save_LIBS"
Tim Rice13aae5e2001-10-21 17:53:58 -0700701 ])
Tim Rice17b93e52001-10-23 22:36:54 -0700702 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
Tim Rice13aae5e2001-10-21 17:53:58 -0700703 LIBS="$LIBS -lgen"
704 AC_DEFINE(HAVE_DIRNAME)
Tim Rice17b93e52001-10-23 22:36:54 -0700705 AC_CHECK_HEADERS(libgen.h)
Tim Rice13aae5e2001-10-21 17:53:58 -0700706 fi
707 ])
708])
709
Damien Millerad833b32000-08-23 10:46:23 +1000710dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000711AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000712dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000713AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000714AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000715dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000716AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000717AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100718
Damien Miller04f80141999-11-19 15:32:34 +1100719AC_CHECK_FUNC(daemon,
720 [AC_DEFINE(HAVE_DAEMON)],
721 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
722)
723
Damien Miller9fb07e42000-03-05 16:22:59 +1100724AC_CHECK_FUNC(getpagesize,
725 [AC_DEFINE(HAVE_GETPAGESIZE)],
726 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
727)
728
Damien Millercb170cb2000-07-01 16:52:55 +1000729# Check for broken snprintf
730if test "x$ac_cv_func_snprintf" = "xyes" ; then
731 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
732 AC_TRY_RUN(
733 [
734#include <stdio.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700735int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
Damien Millercb170cb2000-07-01 16:52:55 +1000736 ],
737 [AC_MSG_RESULT(yes)],
738 [
739 AC_MSG_RESULT(no)
740 AC_DEFINE(BROKEN_SNPRINTF)
741 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
742 ]
743 )
744fi
745
Damien Millere8328192003-01-07 15:18:32 +1100746dnl see whether mkstemp() requires XXXXXX
747if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
748AC_MSG_CHECKING([for (overly) strict mkstemp])
749AC_TRY_RUN(
750 [
751#include <stdlib.h>
752main() { char template[]="conftest.mkstemp-test";
753if (mkstemp(template) == -1)
754 exit(1);
755unlink(template); exit(0);
756}
757 ],
758 [
759 AC_MSG_RESULT(no)
760 ],
761 [
762 AC_MSG_RESULT(yes)
763 AC_DEFINE(HAVE_STRICT_MKSTEMP)
764 ],
765 [
766 AC_MSG_RESULT(yes)
767 AC_DEFINE(HAVE_STRICT_MKSTEMP)
768 ]
769)
770fi
771
Darren Tucker70a3d552003-08-21 17:58:29 +1000772dnl make sure that openpty does not reacquire controlling terminal
773if test ! -z "$check_for_openpty_ctty_bug"; then
774 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
775 AC_TRY_RUN(
776 [
777#include <stdio.h>
778#include <sys/fcntl.h>
779#include <sys/types.h>
780#include <sys/wait.h>
781
782int
783main()
784{
785 pid_t pid;
786 int fd, ptyfd, ttyfd, status;
787
788 pid = fork();
789 if (pid < 0) { /* failed */
790 exit(1);
791 } else if (pid > 0) { /* parent */
792 waitpid(pid, &status, 0);
793 if (WIFEXITED(status))
794 exit(WEXITSTATUS(status));
795 else
796 exit(2);
797 } else { /* child */
798 close(0); close(1); close(2);
799 setsid();
800 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
801 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
802 if (fd >= 0)
803 exit(3); /* Acquired ctty: broken */
804 else
805 exit(0); /* Did not acquire ctty: OK */
806 }
807}
808 ],
809 [
810 AC_MSG_RESULT(yes)
811 ],
812 [
813 AC_MSG_RESULT(no)
814 AC_DEFINE(SSHD_ACQUIRES_CTTY)
815 ]
816 )
817fi
818
Damien Miller606f8802000-09-16 15:39:56 +1100819AC_FUNC_GETPGRP
820
Damien Millera64b57a2001-01-17 10:44:13 +1100821# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000822PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100823AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100824 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100825 [
Damien Millera64b57a2001-01-17 10:44:13 +1100826 if test "x$withval" != "xno" ; then
827 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
828 AC_MSG_ERROR([PAM headers not found])
829 fi
830
831 AC_CHECK_LIB(dl, dlopen, , )
832 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
833 AC_CHECK_FUNCS(pam_getenvlist)
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000834 AC_CHECK_FUNCS(pam_putenv)
Damien Millera64b57a2001-01-17 10:44:13 +1100835
836 disable_shadow=yes
837 PAM_MSG="yes"
838
839 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800840 if test $ac_cv_lib_dl_dlopen = yes; then
841 LIBPAM="-lpam -ldl"
842 else
843 LIBPAM="-lpam"
844 fi
845 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100846 fi
847 ]
848)
Damien Millera22ba012000-03-02 23:09:20 +1100849
Damien Millera64b57a2001-01-17 10:44:13 +1100850# Check for older PAM
851if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100852 # Check PAM strerror arguments (old PAM)
853 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
854 AC_TRY_COMPILE(
855 [
Damien Miller81171112000-04-23 11:14:01 +1000856#include <stdlib.h>
857#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100858 ],
859 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
860 [AC_MSG_RESULT(no)],
861 [
862 AC_DEFINE(HAVE_OLD_PAM)
863 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000864 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100865 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100866 )
Damien Millera22ba012000-03-02 23:09:20 +1100867fi
868
Damien Millerfc93d4b2002-09-04 23:26:29 +1000869# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
870# because the system crypt() is more featureful.
871if test "x$check_for_libcrypt_before" = "x1"; then
872 AC_CHECK_LIB(crypt, crypt)
873fi
874
Tim Riceaef73712002-05-11 13:17:42 -0700875# Search for OpenSSL
876saved_CPPFLAGS="$CPPFLAGS"
877saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100878AC_ARG_WITH(ssl-dir,
879 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
880 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000881 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700882 if test -d "$withval/lib"; then
883 if test -n "${need_dash_r}"; then
884 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
885 else
886 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
887 fi
888 else
889 if test -n "${need_dash_r}"; then
890 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
891 else
892 LDFLAGS="-L${withval} ${LDFLAGS}"
893 fi
894 fi
895 if test -d "$withval/include"; then
896 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
897 else
898 CPPFLAGS="-I${withval} ${CPPFLAGS}"
899 fi
Damien Millera22ba012000-03-02 23:09:20 +1100900 fi
901 ]
902)
Tim Riceaef73712002-05-11 13:17:42 -0700903LIBS="$LIBS -lcrypto"
904AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000905 [
Tim Riceaef73712002-05-11 13:17:42 -0700906 dnl Check default openssl install dir
907 if test -n "${need_dash_r}"; then
908 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000909 else
Tim Riceaef73712002-05-11 13:17:42 -0700910 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000911 fi
Tim Riceaef73712002-05-11 13:17:42 -0700912 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
913 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
914 [
915 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
916 ]
917 )
918 ]
919)
920
Tim Riced730b782002-08-13 18:52:10 -0700921# Determine OpenSSL header version
922AC_MSG_CHECKING([OpenSSL header version])
923AC_TRY_RUN(
924 [
925#include <stdio.h>
926#include <string.h>
927#include <openssl/opensslv.h>
928#define DATA "conftest.sslincver"
929int main(void) {
930 FILE *fd;
931 int rc;
932
933 fd = fopen(DATA,"w");
934 if(fd == NULL)
935 exit(1);
936
937 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
938 exit(1);
939
940 exit(0);
941}
942 ],
943 [
944 ssl_header_ver=`cat conftest.sslincver`
945 AC_MSG_RESULT($ssl_header_ver)
946 ],
947 [
948 AC_MSG_RESULT(not found)
949 AC_MSG_ERROR(OpenSSL version header not found.)
950 ]
951)
952
953# Determine OpenSSL library version
954AC_MSG_CHECKING([OpenSSL library version])
955AC_TRY_RUN(
956 [
957#include <stdio.h>
958#include <string.h>
959#include <openssl/opensslv.h>
960#include <openssl/crypto.h>
961#define DATA "conftest.ssllibver"
962int main(void) {
963 FILE *fd;
964 int rc;
965
966 fd = fopen(DATA,"w");
967 if(fd == NULL)
968 exit(1);
969
970 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
971 exit(1);
972
973 exit(0);
974}
975 ],
976 [
977 ssl_library_ver=`cat conftest.ssllibver`
978 AC_MSG_RESULT($ssl_library_ver)
979 ],
980 [
981 AC_MSG_RESULT(not found)
982 AC_MSG_ERROR(OpenSSL library not found.)
983 ]
984)
Damien Millera22ba012000-03-02 23:09:20 +1100985
Damien Millerec932372002-01-22 22:16:03 +1100986# Sanity check OpenSSL headers
987AC_MSG_CHECKING([whether OpenSSL's headers match the library])
988AC_TRY_RUN(
989 [
990#include <string.h>
991#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700992int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100993 ],
994 [
995 AC_MSG_RESULT(yes)
996 ],
997 [
998 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000999 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1000Check config.log for details.
1001Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001002 ]
1003)
1004
Damien Millera64b57a2001-01-17 10:44:13 +11001005# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1006# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001007if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001008 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001009fi
1010
Damien Miller6c21c512002-01-22 21:57:53 +11001011
1012### Configure cryptographic random number support
1013
1014# Check wheter OpenSSL seeds itself
1015AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1016AC_TRY_RUN(
1017 [
1018#include <string.h>
1019#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001020int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001021 ],
1022 [
1023 OPENSSL_SEEDS_ITSELF=yes
1024 AC_MSG_RESULT(yes)
1025 ],
1026 [
1027 AC_MSG_RESULT(no)
1028 # Default to use of the rand helper if OpenSSL doesn't
1029 # seed itself
1030 USE_RAND_HELPER=yes
1031 ]
1032)
1033
1034
1035# Do we want to force the use of the rand helper?
1036AC_ARG_WITH(rand-helper,
1037 [ --with-rand-helper Use subprocess to gather strong randomness ],
1038 [
1039 if test "x$withval" = "xno" ; then
1040 # Force use of OpenSSL's internal RNG, even if
1041 # the previous test showed it to be unseeded.
1042 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1043 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1044 OPENSSL_SEEDS_ITSELF=yes
1045 USE_RAND_HELPER=""
1046 fi
1047 else
1048 USE_RAND_HELPER=yes
1049 fi
1050 ],
1051)
1052
1053# Which randomness source do we use?
1054if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1055 # OpenSSL only
1056 AC_DEFINE(OPENSSL_PRNG_ONLY)
1057 RAND_MSG="OpenSSL internal ONLY"
1058 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001059elif test ! -z "$USE_RAND_HELPER" ; then
1060 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001061 RAND_MSG="ssh-rand-helper"
1062 INSTALL_SSH_RAND_HELPER="yes"
1063fi
1064AC_SUBST(INSTALL_SSH_RAND_HELPER)
1065
1066### Configuration of ssh-rand-helper
1067
1068# PRNGD TCP socket
1069AC_ARG_WITH(prngd-port,
1070 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1071 [
Damien Millere996d722002-01-23 11:20:59 +11001072 case "$withval" in
1073 no)
1074 withval=""
1075 ;;
1076 [[0-9]]*)
1077 ;;
1078 *)
1079 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1080 ;;
1081 esac
1082 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001083 PRNGD_PORT="$withval"
1084 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1085 fi
1086 ]
1087)
1088
1089# PRNGD Unix domain socket
1090AC_ARG_WITH(prngd-socket,
1091 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1092 [
Damien Millere996d722002-01-23 11:20:59 +11001093 case "$withval" in
1094 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001095 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001096 ;;
1097 no)
1098 withval=""
1099 ;;
1100 /*)
1101 ;;
1102 *)
1103 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1104 ;;
1105 esac
1106
1107 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001108 if test ! -z "$PRNGD_PORT" ; then
1109 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1110 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001111 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001112 AC_MSG_WARN(Entropy socket is not readable)
1113 fi
1114 PRNGD_SOCKET="$withval"
1115 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1116 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001117 ],
1118 [
1119 # Check for existing socket only if we don't have a random device already
1120 if test "$USE_RAND_HELPER" = yes ; then
1121 AC_MSG_CHECKING(for PRNGD/EGD socket)
1122 # Insert other locations here
1123 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1124 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1125 PRNGD_SOCKET="$sock"
1126 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1127 break;
1128 fi
1129 done
1130 if test ! -z "$PRNGD_SOCKET" ; then
1131 AC_MSG_RESULT($PRNGD_SOCKET)
1132 else
1133 AC_MSG_RESULT(not found)
1134 fi
1135 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001136 ]
1137)
1138
1139# Change default command timeout for hashing entropy source
1140entropy_timeout=200
1141AC_ARG_WITH(entropy-timeout,
1142 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1143 [
1144 if test "x$withval" != "xno" ; then
1145 entropy_timeout=$withval
1146 fi
1147 ]
1148)
Damien Miller6c21c512002-01-22 21:57:53 +11001149AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1150
Damien Millerd3f6ad22002-06-25 10:24:47 +10001151SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001152AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001153 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001154 [
1155 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001156 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001157 fi
1158 ]
1159)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001160AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1161AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001162
Tim Rice88f2ab52002-03-17 12:17:34 -08001163# We do this little dance with the search path to insure
1164# that programs that we select for use by installed programs
1165# (which may be run by the super-user) come from trusted
1166# locations before they come from the user's private area.
1167# This should help avoid accidentally configuring some
1168# random version of a program in someone's personal bin.
1169
1170OPATH=$PATH
1171PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001172test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001173test -d /sbin && PATH=$PATH:/sbin
1174test -d /usr/sbin && PATH=$PATH:/usr/sbin
1175PATH=$PATH:/etc:$OPATH
1176
Damien Miller6c21c512002-01-22 21:57:53 +11001177# These programs are used by the command hashing source to gather entropy
1178OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1179OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1180OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1181OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1182OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1183OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1184OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1185OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1186OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1187OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1188OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1189OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1190OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1191OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1192OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1193OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001194# restore PATH
1195PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001196
1197# Where does ssh-rand-helper get its randomness from?
1198INSTALL_SSH_PRNG_CMDS=""
1199if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1200 if test ! -z "$PRNGD_PORT" ; then
1201 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1202 elif test ! -z "$PRNGD_SOCKET" ; then
1203 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1204 else
1205 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1206 RAND_HELPER_CMDHASH=yes
1207 INSTALL_SSH_PRNG_CMDS="yes"
1208 fi
1209fi
1210AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1211
1212
Ben Lindstromb5628642000-10-18 00:02:25 +00001213# Cheap hack to ensure NEWS-OS libraries are arranged right.
1214if test ! -z "$SONY" ; then
1215 LIBS="$LIBS -liberty";
1216fi
1217
Damien Millera22ba012000-03-02 23:09:20 +11001218# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001219AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001220AC_CHECK_SIZEOF(short int, 2)
1221AC_CHECK_SIZEOF(int, 4)
1222AC_CHECK_SIZEOF(long int, 4)
1223AC_CHECK_SIZEOF(long long int, 8)
1224
Damien Millerfa2bb692002-04-23 23:22:25 +10001225# Sanity check long long for some platforms (AIX)
1226if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1227 ac_cv_sizeof_long_long_int=0
1228fi
1229
Damien Millera22ba012000-03-02 23:09:20 +11001230# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001231AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1232 AC_TRY_COMPILE(
1233 [ #include <sys/types.h> ],
1234 [ u_int a; a = 1;],
1235 [ ac_cv_have_u_int="yes" ],
1236 [ ac_cv_have_u_int="no" ]
1237 )
1238])
1239if test "x$ac_cv_have_u_int" = "xyes" ; then
1240 AC_DEFINE(HAVE_U_INT)
1241 have_u_int=1
1242fi
1243
Damien Miller61e50f12000-05-08 20:49:37 +10001244AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1245 AC_TRY_COMPILE(
1246 [ #include <sys/types.h> ],
1247 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1248 [ ac_cv_have_intxx_t="yes" ],
1249 [ ac_cv_have_intxx_t="no" ]
1250 )
1251])
1252if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1253 AC_DEFINE(HAVE_INTXX_T)
1254 have_intxx_t=1
1255fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001256
1257if (test -z "$have_intxx_t" && \
1258 test "x$ac_cv_header_stdint_h" = "xyes")
1259then
1260 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1261 AC_TRY_COMPILE(
1262 [ #include <stdint.h> ],
1263 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1264 [
1265 AC_DEFINE(HAVE_INTXX_T)
1266 AC_MSG_RESULT(yes)
1267 ],
1268 [ AC_MSG_RESULT(no) ]
1269 )
1270fi
1271
Damien Miller578783e2000-09-23 14:12:24 +11001272AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1273 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001274 [
1275#include <sys/types.h>
1276#ifdef HAVE_STDINT_H
1277# include <stdint.h>
1278#endif
1279#include <sys/socket.h>
1280#ifdef HAVE_SYS_BITYPES_H
1281# include <sys/bitypes.h>
1282#endif
1283 ],
Damien Miller578783e2000-09-23 14:12:24 +11001284 [ int64_t a; a = 1;],
1285 [ ac_cv_have_int64_t="yes" ],
1286 [ ac_cv_have_int64_t="no" ]
1287 )
1288])
1289if test "x$ac_cv_have_int64_t" = "xyes" ; then
1290 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001291fi
1292
Damien Miller61e50f12000-05-08 20:49:37 +10001293AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1294 AC_TRY_COMPILE(
1295 [ #include <sys/types.h> ],
1296 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1297 [ ac_cv_have_u_intxx_t="yes" ],
1298 [ ac_cv_have_u_intxx_t="no" ]
1299 )
1300])
1301if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1302 AC_DEFINE(HAVE_U_INTXX_T)
1303 have_u_intxx_t=1
1304fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001305
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001306if test -z "$have_u_intxx_t" ; then
1307 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1308 AC_TRY_COMPILE(
1309 [ #include <sys/socket.h> ],
1310 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1311 [
1312 AC_DEFINE(HAVE_U_INTXX_T)
1313 AC_MSG_RESULT(yes)
1314 ],
1315 [ AC_MSG_RESULT(no) ]
1316 )
1317fi
1318
Damien Miller578783e2000-09-23 14:12:24 +11001319AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1320 AC_TRY_COMPILE(
1321 [ #include <sys/types.h> ],
1322 [ u_int64_t a; a = 1;],
1323 [ ac_cv_have_u_int64_t="yes" ],
1324 [ ac_cv_have_u_int64_t="no" ]
1325 )
1326])
1327if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1328 AC_DEFINE(HAVE_U_INT64_T)
1329 have_u_int64_t=1
1330fi
1331
Tim Rice4cec93f2002-02-26 08:40:48 -08001332if test -z "$have_u_int64_t" ; then
1333 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1334 AC_TRY_COMPILE(
1335 [ #include <sys/bitypes.h> ],
1336 [ u_int64_t a; a = 1],
1337 [
1338 AC_DEFINE(HAVE_U_INT64_T)
1339 AC_MSG_RESULT(yes)
1340 ],
1341 [ AC_MSG_RESULT(no) ]
1342 )
1343fi
1344
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001345if test -z "$have_u_intxx_t" ; then
1346 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1347 AC_TRY_COMPILE(
1348 [
1349#include <sys/types.h>
1350 ],
1351 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1352 [ ac_cv_have_uintxx_t="yes" ],
1353 [ ac_cv_have_uintxx_t="no" ]
1354 )
1355 ])
1356 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1357 AC_DEFINE(HAVE_UINTXX_T)
1358 fi
1359fi
1360
1361if test -z "$have_uintxx_t" ; then
1362 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1363 AC_TRY_COMPILE(
1364 [ #include <stdint.h> ],
1365 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1366 [
1367 AC_DEFINE(HAVE_UINTXX_T)
1368 AC_MSG_RESULT(yes)
1369 ],
1370 [ AC_MSG_RESULT(no) ]
1371 )
1372fi
1373
Damien Milleredb82922000-06-20 13:25:52 +10001374if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1375 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001376then
1377 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1378 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001379 [
1380#include <sys/bitypes.h>
1381 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001382 [
Damien Miller70494d12000-04-03 15:57:06 +10001383 int8_t a; int16_t b; int32_t c;
1384 u_int8_t e; u_int16_t f; u_int32_t g;
1385 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001386 ],
1387 [
1388 AC_DEFINE(HAVE_U_INTXX_T)
1389 AC_DEFINE(HAVE_INTXX_T)
1390 AC_MSG_RESULT(yes)
1391 ],
1392 [AC_MSG_RESULT(no)]
1393 )
1394fi
1395
Damien Miller58be7382001-09-15 21:31:54 +10001396
1397AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1398 AC_TRY_COMPILE(
1399 [
1400#include <sys/types.h>
1401 ],
1402 [ u_char foo; foo = 125; ],
1403 [ ac_cv_have_u_char="yes" ],
1404 [ ac_cv_have_u_char="no" ]
1405 )
1406])
1407if test "x$ac_cv_have_u_char" = "xyes" ; then
1408 AC_DEFINE(HAVE_U_CHAR)
1409fi
1410
Tim Rice13aae5e2001-10-21 17:53:58 -07001411TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001412
Tim Rice200a5c02002-02-26 22:12:34 -08001413AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001414
Damien Miller61e50f12000-05-08 20:49:37 +10001415AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1416 AC_TRY_COMPILE(
1417 [
1418#include <sys/types.h>
1419 ],
1420 [ size_t foo; foo = 1235; ],
1421 [ ac_cv_have_size_t="yes" ],
1422 [ ac_cv_have_size_t="no" ]
1423 )
1424])
1425if test "x$ac_cv_have_size_t" = "xyes" ; then
1426 AC_DEFINE(HAVE_SIZE_T)
1427fi
Damien Miller95058511999-12-29 10:36:45 +11001428
Damien Miller615f9392000-05-17 22:53:33 +10001429AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1430 AC_TRY_COMPILE(
1431 [
1432#include <sys/types.h>
1433 ],
1434 [ ssize_t foo; foo = 1235; ],
1435 [ ac_cv_have_ssize_t="yes" ],
1436 [ ac_cv_have_ssize_t="no" ]
1437 )
1438])
1439if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1440 AC_DEFINE(HAVE_SSIZE_T)
1441fi
1442
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001443AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1444 AC_TRY_COMPILE(
1445 [
1446#include <time.h>
1447 ],
1448 [ clock_t foo; foo = 1235; ],
1449 [ ac_cv_have_clock_t="yes" ],
1450 [ ac_cv_have_clock_t="no" ]
1451 )
1452])
1453if test "x$ac_cv_have_clock_t" = "xyes" ; then
1454 AC_DEFINE(HAVE_CLOCK_T)
1455fi
1456
Damien Millerb54b40e2000-06-23 08:23:34 +10001457AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1458 AC_TRY_COMPILE(
1459 [
1460#include <sys/types.h>
1461#include <sys/socket.h>
1462 ],
1463 [ sa_family_t foo; foo = 1235; ],
1464 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001465 [ AC_TRY_COMPILE(
1466 [
1467#include <sys/types.h>
1468#include <sys/socket.h>
1469#include <netinet/in.h>
1470 ],
1471 [ sa_family_t foo; foo = 1235; ],
1472 [ ac_cv_have_sa_family_t="yes" ],
1473
Damien Millerb54b40e2000-06-23 08:23:34 +10001474 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001475 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001476 )
1477])
1478if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1479 AC_DEFINE(HAVE_SA_FAMILY_T)
1480fi
1481
Damien Miller0f91b4e2000-06-18 15:43:25 +10001482AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1483 AC_TRY_COMPILE(
1484 [
1485#include <sys/types.h>
1486 ],
1487 [ pid_t foo; foo = 1235; ],
1488 [ ac_cv_have_pid_t="yes" ],
1489 [ ac_cv_have_pid_t="no" ]
1490 )
1491])
1492if test "x$ac_cv_have_pid_t" = "xyes" ; then
1493 AC_DEFINE(HAVE_PID_T)
1494fi
1495
1496AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1497 AC_TRY_COMPILE(
1498 [
1499#include <sys/types.h>
1500 ],
1501 [ mode_t foo; foo = 1235; ],
1502 [ ac_cv_have_mode_t="yes" ],
1503 [ ac_cv_have_mode_t="no" ]
1504 )
1505])
1506if test "x$ac_cv_have_mode_t" = "xyes" ; then
1507 AC_DEFINE(HAVE_MODE_T)
1508fi
1509
Damien Miller61e50f12000-05-08 20:49:37 +10001510
1511AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1512 AC_TRY_COMPILE(
1513 [
Damien Miller81171112000-04-23 11:14:01 +10001514#include <sys/types.h>
1515#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001516 ],
1517 [ struct sockaddr_storage s; ],
1518 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1519 [ ac_cv_have_struct_sockaddr_storage="no" ]
1520 )
1521])
1522if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1523 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1524fi
Damien Miller34132e52000-01-14 15:45:46 +11001525
Damien Miller61e50f12000-05-08 20:49:37 +10001526AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1527 AC_TRY_COMPILE(
1528 [
Damien Miller7b22d652000-06-18 14:07:04 +10001529#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001530#include <netinet/in.h>
1531 ],
1532 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1533 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1534 [ ac_cv_have_struct_sockaddr_in6="no" ]
1535 )
1536])
1537if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1538 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1539fi
Damien Miller34132e52000-01-14 15:45:46 +11001540
Damien Miller61e50f12000-05-08 20:49:37 +10001541AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1542 AC_TRY_COMPILE(
1543 [
Damien Miller7b22d652000-06-18 14:07:04 +10001544#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001545#include <netinet/in.h>
1546 ],
1547 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1548 [ ac_cv_have_struct_in6_addr="yes" ],
1549 [ ac_cv_have_struct_in6_addr="no" ]
1550 )
1551])
1552if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1553 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1554fi
Damien Miller34132e52000-01-14 15:45:46 +11001555
Damien Miller61e50f12000-05-08 20:49:37 +10001556AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1557 AC_TRY_COMPILE(
1558 [
Damien Miller81171112000-04-23 11:14:01 +10001559#include <sys/types.h>
1560#include <sys/socket.h>
1561#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001562 ],
1563 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1564 [ ac_cv_have_struct_addrinfo="yes" ],
1565 [ ac_cv_have_struct_addrinfo="no" ]
1566 )
1567])
1568if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1569 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1570fi
1571
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001572AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1573 AC_TRY_COMPILE(
1574 [ #include <sys/time.h> ],
1575 [ struct timeval tv; tv.tv_sec = 1;],
1576 [ ac_cv_have_struct_timeval="yes" ],
1577 [ ac_cv_have_struct_timeval="no" ]
1578 )
1579])
1580if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1581 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1582 have_struct_timeval=1
1583fi
1584
Tim Rice4e4dc562003-03-18 10:21:40 -08001585AC_CHECK_TYPES(struct timespec)
1586
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001587# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001588if test "x$ac_cv_have_int64_t" = "xno" -a \
1589 "x$ac_cv_sizeof_long_int" != "x8" -a \
1590 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001591 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1592 echo "an alternative compiler (I.E., GCC) before continuing."
1593 echo ""
1594 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001595else
1596dnl test snprintf (broken on SCO w/gcc)
1597 AC_TRY_RUN(
1598 [
1599#include <stdio.h>
1600#include <string.h>
1601#ifdef HAVE_SNPRINTF
1602main()
1603{
1604 char buf[50];
1605 char expected_out[50];
1606 int mazsize = 50 ;
1607#if (SIZEOF_LONG_INT == 8)
1608 long int num = 0x7fffffffffffffff;
1609#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001610 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001611#endif
1612 strcpy(expected_out, "9223372036854775807");
1613 snprintf(buf, mazsize, "%lld", num);
1614 if(strcmp(buf, expected_out) != 0)
1615 exit(1);
1616 exit(0);
1617}
1618#else
1619main() { exit(0); }
1620#endif
1621 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1622 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001623fi
1624
Damien Miller78315eb2000-09-29 23:01:36 +11001625dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001626OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1627OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1628OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1629OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1630OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001631OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001632OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1633OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001634OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001635OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1636OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1637OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1638OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001639OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1640OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1641OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1642OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001643
1644AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001645
Damien Miller61e50f12000-05-08 20:49:37 +10001646AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1647 ac_cv_have_ss_family_in_struct_ss, [
1648 AC_TRY_COMPILE(
1649 [
Damien Miller81171112000-04-23 11:14:01 +10001650#include <sys/types.h>
1651#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001652 ],
1653 [ struct sockaddr_storage s; s.ss_family = 1; ],
1654 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1655 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1656 )
1657])
1658if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1659 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1660fi
1661
Damien Miller61e50f12000-05-08 20:49:37 +10001662AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1663 ac_cv_have___ss_family_in_struct_ss, [
1664 AC_TRY_COMPILE(
1665 [
Damien Miller81171112000-04-23 11:14:01 +10001666#include <sys/types.h>
1667#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001668 ],
1669 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1670 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1671 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1672 )
1673])
1674if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1675 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1676fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001677
Damien Millerad833b32000-08-23 10:46:23 +10001678AC_CACHE_CHECK([for pw_class field in struct passwd],
1679 ac_cv_have_pw_class_in_struct_passwd, [
1680 AC_TRY_COMPILE(
1681 [
Damien Millerad833b32000-08-23 10:46:23 +10001682#include <pwd.h>
1683 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001684 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001685 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1686 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1687 )
1688])
1689if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1690 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1691fi
1692
Kevin Steves82456952001-06-22 21:14:18 +00001693AC_CACHE_CHECK([for pw_expire field in struct passwd],
1694 ac_cv_have_pw_expire_in_struct_passwd, [
1695 AC_TRY_COMPILE(
1696 [
1697#include <pwd.h>
1698 ],
1699 [ struct passwd p; p.pw_expire = 0; ],
1700 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1701 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1702 )
1703])
1704if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1705 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1706fi
1707
1708AC_CACHE_CHECK([for pw_change field in struct passwd],
1709 ac_cv_have_pw_change_in_struct_passwd, [
1710 AC_TRY_COMPILE(
1711 [
1712#include <pwd.h>
1713 ],
1714 [ struct passwd p; p.pw_change = 0; ],
1715 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1716 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1717 )
1718])
1719if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1720 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1721fi
Damien Miller61e50f12000-05-08 20:49:37 +10001722
Tim Rice28bbb0c2002-05-27 17:37:32 -07001723dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001724AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1725 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001726 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001727 [
Tim Riceae49fe62002-04-12 10:26:21 -07001728#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001729#include <sys/socket.h>
1730#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001731int main() {
1732#ifdef msg_accrights
1733exit(1);
1734#endif
1735struct msghdr m;
1736m.msg_accrights = 0;
1737exit(0);
1738}
Kevin Steves939c9db2002-03-22 17:23:25 +00001739 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001740 [ ac_cv_have_accrights_in_msghdr="yes" ],
1741 [ ac_cv_have_accrights_in_msghdr="no" ]
1742 )
1743])
1744if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1745 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1746fi
1747
Kevin Stevesa44e0352002-04-07 16:18:03 +00001748AC_CACHE_CHECK([for msg_control field in struct msghdr],
1749 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001750 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001751 [
Tim Riceae49fe62002-04-12 10:26:21 -07001752#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001753#include <sys/socket.h>
1754#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001755int main() {
1756#ifdef msg_control
1757exit(1);
1758#endif
1759struct msghdr m;
1760m.msg_control = 0;
1761exit(0);
1762}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001763 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001764 [ ac_cv_have_control_in_msghdr="yes" ],
1765 [ ac_cv_have_control_in_msghdr="no" ]
1766 )
1767])
1768if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1769 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1770fi
1771
Damien Miller61e50f12000-05-08 20:49:37 +10001772AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1773 AC_TRY_LINK([],
1774 [ extern char *__progname; printf("%s", __progname); ],
1775 [ ac_cv_libc_defines___progname="yes" ],
1776 [ ac_cv_libc_defines___progname="no" ]
1777 )
1778])
1779if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1780 AC_DEFINE(HAVE___PROGNAME)
1781fi
1782
Kevin Steves4846f4a2002-03-22 18:19:53 +00001783AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1784 AC_TRY_LINK([
1785#include <stdio.h>
1786],
1787 [ printf("%s", __FUNCTION__); ],
1788 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1789 [ ac_cv_cc_implements___FUNCTION__="no" ]
1790 )
1791])
1792if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1793 AC_DEFINE(HAVE___FUNCTION__)
1794fi
1795
1796AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1797 AC_TRY_LINK([
1798#include <stdio.h>
1799],
1800 [ printf("%s", __func__); ],
1801 [ ac_cv_cc_implements___func__="yes" ],
1802 [ ac_cv_cc_implements___func__="no" ]
1803 )
1804])
1805if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1806 AC_DEFINE(HAVE___func__)
1807fi
1808
Damien Miller4f8e6692001-07-14 13:22:53 +10001809AC_CACHE_CHECK([whether getopt has optreset support],
1810 ac_cv_have_getopt_optreset, [
1811 AC_TRY_LINK(
1812 [
1813#include <getopt.h>
1814 ],
1815 [ extern int optreset; optreset = 0; ],
1816 [ ac_cv_have_getopt_optreset="yes" ],
1817 [ ac_cv_have_getopt_optreset="no" ]
1818 )
1819])
1820if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1821 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1822fi
Damien Millera22ba012000-03-02 23:09:20 +11001823
Damien Millerecbb26d2000-07-15 14:59:14 +10001824AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1825 AC_TRY_LINK([],
1826 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1827 [ ac_cv_libc_defines_sys_errlist="yes" ],
1828 [ ac_cv_libc_defines_sys_errlist="no" ]
1829 )
1830])
1831if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1832 AC_DEFINE(HAVE_SYS_ERRLIST)
1833fi
1834
1835
Damien Miller11fa2cc2000-08-16 10:35:58 +10001836AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1837 AC_TRY_LINK([],
1838 [ extern int sys_nerr; printf("%i", sys_nerr);],
1839 [ ac_cv_libc_defines_sys_nerr="yes" ],
1840 [ ac_cv_libc_defines_sys_nerr="no" ]
1841 )
1842])
1843if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1844 AC_DEFINE(HAVE_SYS_NERR)
1845fi
1846
Damien Miller85de5802001-09-18 14:01:11 +10001847SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001848# Check whether user wants sectok support
1849AC_ARG_WITH(sectok,
1850 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001851 [
1852 if test "x$withval" != "xno" ; then
1853 if test "x$withval" != "xyes" ; then
1854 CPPFLAGS="$CPPFLAGS -I${withval}"
1855 LDFLAGS="$LDFLAGS -L${withval}"
1856 if test ! -z "$need_dash_r" ; then
1857 LDFLAGS="$LDFLAGS -R${withval}"
1858 fi
1859 if test ! -z "$blibpath" ; then
1860 blibpath="$blibpath:${withval}"
1861 fi
1862 fi
1863 AC_CHECK_HEADERS(sectok.h)
1864 if test "$ac_cv_header_sectok_h" != yes; then
1865 AC_MSG_ERROR(Can't find sectok.h)
1866 fi
1867 AC_CHECK_LIB(sectok, sectok_open)
1868 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1869 AC_MSG_ERROR(Can't find libsectok)
1870 fi
1871 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001872 AC_DEFINE(USE_SECTOK)
1873 SCARD_MSG="yes, using sectok"
1874 fi
1875 ]
1876)
1877
1878# Check whether user wants OpenSC support
1879AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001880 AC_HELP_STRING([--with-opensc=PFX],
1881 [Enable smartcard support using OpenSC]),
1882 opensc_config_prefix="$withval", opensc_config_prefix="")
1883if test x$opensc_config_prefix != x ; then
1884 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1885 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1886 if test "$OPENSC_CONFIG" != "no"; then
1887 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1888 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1889 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1890 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1891 AC_DEFINE(SMARTCARD)
1892 AC_DEFINE(USE_OPENSC)
1893 SCARD_MSG="yes, using OpenSC"
1894 fi
1895fi
Damien Miller85de5802001-09-18 14:01:11 +10001896
Damien Miller7abe09b2003-05-15 10:53:49 +10001897# Check whether user wants DNS support
1898DNS_MSG="no"
1899AC_ARG_WITH(dns,
1900 [ --with-dns Support for fetching keys from DNS (experimental)],
1901 [
1902 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001903 DNS_MSG="yes"
1904 AC_DEFINE(DNS)
1905 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001906 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1907 [
1908 # Needed by our getrrsetbyname()
1909 AC_SEARCH_LIBS(res_query, resolv)
1910 AC_SEARCH_LIBS(dn_expand, resolv)
1911 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001912 fi
1913 ]
1914)
1915
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001916# Check whether user wants Kerberos 5 support
1917KRB5_MSG="no"
1918AC_ARG_WITH(kerberos5,
1919 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1920 [
1921 if test "x$withval" != "xno" ; then
1922 if test "x$withval" = "xyes" ; then
1923 KRB5ROOT="/usr/local"
1924 else
1925 KRB5ROOT=${withval}
1926 fi
1927 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1928 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1929 AC_DEFINE(KRB5)
1930 KRB5_MSG="yes"
1931 AC_MSG_CHECKING(whether we are using Heimdal)
1932 AC_TRY_COMPILE([ #include <krb5.h> ],
1933 [ char *tmp = heimdal_version; ],
1934 [ AC_MSG_RESULT(yes)
1935 AC_DEFINE(HEIMDAL)
1936 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1937 ],
1938 [ AC_MSG_RESULT(no)
1939 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1940 ]
1941 )
1942 if test ! -z "$need_dash_r" ; then
1943 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1944 fi
1945 if test ! -z "$blibpath" ; then
1946 blibpath="$blibpath:${KRB5ROOT}/lib"
1947 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001948 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001949
Darren Tucker49aaf4a2003-08-26 11:58:16 +10001950 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1951 [ AC_DEFINE(GSSAPI)
1952 K5LIBS="-lgssapi $K5LIBS" ],
1953 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1954 [ AC_DEFINE(GSSAPI)
1955 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1956 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1957 $K5LIBS)
1958 ],
1959 $K5LIBS)
1960
1961 AC_CHECK_HEADER(gssapi.h, ,
1962 [ unset ac_cv_header_gssapi_h
1963 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1964 AC_CHECK_HEADERS(gssapi.h, ,
1965 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1966 )
1967 ]
1968 )
1969
1970 oldCPP="$CPPFLAGS"
1971 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1972 AC_CHECK_HEADER(gssapi_krb5.h, ,
1973 [ CPPFLAGS="$oldCPP" ])
1974
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001975 KRB5=yes
1976 fi
1977 ]
1978)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10001979LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001980
Damien Millera22ba012000-03-02 23:09:20 +11001981# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001982
Damien Millerf58c6722002-05-13 13:15:42 +10001983PRIVSEP_PATH=/var/empty
1984AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001985 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001986 [
1987 if test "x$withval" != "$no" ; then
1988 PRIVSEP_PATH=$withval
1989 fi
1990 ]
1991)
1992AC_SUBST(PRIVSEP_PATH)
1993
Damien Millera22ba012000-03-02 23:09:20 +11001994AC_ARG_WITH(xauth,
1995 [ --with-xauth=PATH Specify path to xauth program ],
1996 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001997 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001998 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001999 fi
2000 ],
2001 [
Tim Ricee22be3b2002-07-17 19:20:07 -07002002 TestPath="$PATH"
2003 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2004 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2005 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2006 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2007 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10002008 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11002009 xauth_path="/usr/openwin/bin/xauth"
2010 fi
2011 ]
2012)
2013
Damien Miller7d901272003-01-13 16:55:22 +11002014STRIP_OPT=-s
2015AC_ARG_ENABLE(strip,
2016 [ --disable-strip Disable calling strip(1) on install],
2017 [
2018 if test "x$enableval" = "xno" ; then
2019 STRIP_OPT=
2020 fi
2021 ]
2022)
2023AC_SUBST(STRIP_OPT)
2024
Damien Millera19cf472000-11-29 13:28:50 +11002025if test -z "$xauth_path" ; then
2026 XAUTH_PATH="undefined"
2027 AC_SUBST(XAUTH_PATH)
2028else
Damien Millera22ba012000-03-02 23:09:20 +11002029 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002030 XAUTH_PATH=$xauth_path
2031 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002032fi
Damien Millera22ba012000-03-02 23:09:20 +11002033
2034# Check for mail directory (last resort if we cannot get it from headers)
2035if test ! -z "$MAIL" ; then
2036 maildir=`dirname $MAIL`
2037 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2038fi
2039
Damien Millera22ba012000-03-02 23:09:20 +11002040if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002041 if test "x$disable_ptmx_check" != "xyes" ; then
2042 AC_CHECK_FILE("/dev/ptmx",
2043 [
2044 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2045 have_dev_ptmx=1
2046 ]
2047 )
2048 fi
Damien Millera22ba012000-03-02 23:09:20 +11002049fi
Damien Miller204ad072000-03-02 23:56:12 +11002050AC_CHECK_FILE("/dev/ptc",
2051 [
2052 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2053 have_dev_ptc=1
2054 ]
2055)
2056
Damien Millera22ba012000-03-02 23:09:20 +11002057# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002058AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002059 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002060 [
Damien Miller897741e2001-04-16 10:41:46 +10002061 case "$withval" in
2062 man|cat|doc)
2063 MANTYPE=$withval
2064 ;;
2065 *)
2066 AC_MSG_ERROR(invalid man type: $withval)
2067 ;;
2068 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002069 ]
2070)
Ben Lindstrombc709922001-04-18 18:04:21 +00002071if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002072 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2073 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002074 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2075 MANTYPE=doc
2076 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2077 MANTYPE=man
2078 else
2079 MANTYPE=cat
2080 fi
2081fi
Damien Miller670a4b82000-01-22 13:53:11 +11002082AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002083if test "$MANTYPE" = "doc"; then
2084 mansubdir=man;
2085else
2086 mansubdir=$MANTYPE;
2087fi
2088AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002089
Damien Millera22ba012000-03-02 23:09:20 +11002090# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002091MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002092AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002093 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002094 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002095 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002096 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002097 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002098 fi
2099 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002100)
2101
Damien Millera22ba012000-03-02 23:09:20 +11002102# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002103AC_ARG_WITH(shadow,
2104 [ --without-shadow Disable shadow password support],
2105 [
2106 if test "x$withval" = "xno" ; then
2107 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002108 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002109 fi
2110 ]
2111)
2112
Damien Miller1f335fb2000-06-26 11:31:33 +10002113if test -z "$disable_shadow" ; then
2114 AC_MSG_CHECKING([if the systems has expire shadow information])
2115 AC_TRY_COMPILE(
2116 [
2117#include <sys/types.h>
2118#include <shadow.h>
2119 struct spwd sp;
2120 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2121 [ sp_expire_available=yes ], []
2122 )
2123
2124 if test "x$sp_expire_available" = "xyes" ; then
2125 AC_MSG_RESULT(yes)
2126 AC_DEFINE(HAS_SHADOW_EXPIRE)
2127 else
2128 AC_MSG_RESULT(no)
2129 fi
2130fi
2131
Damien Millera22ba012000-03-02 23:09:20 +11002132# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002133if test ! -z "$IPADDR_IN_DISPLAY" ; then
2134 DISPLAY_HACK_MSG="yes"
2135 AC_DEFINE(IPADDR_IN_DISPLAY)
2136else
2137 DISPLAY_HACK_MSG="no"
2138 AC_ARG_WITH(ipaddr-display,
2139 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2140 [
2141 if test "x$withval" != "xno" ; then
2142 AC_DEFINE(IPADDR_IN_DISPLAY)
2143 DISPLAY_HACK_MSG="yes"
2144 fi
2145 ]
2146 )
2147fi
Damien Miller76112de1999-12-21 11:18:08 +11002148
Tim Rice43a1c132002-04-17 21:19:14 -07002149dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2150if test $ac_cv_func_login_getcapbool = "yes" -a \
2151 $ac_cv_header_login_cap_h = "yes" ; then
2152 USES_LOGIN_CONF=yes
2153fi
Damien Millera22ba012000-03-02 23:09:20 +11002154# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002155SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002156AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002157 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002158 [
Tim Rice43a1c132002-04-17 21:19:14 -07002159 if test "$USES_LOGIN_CONF" = "yes" ; then
2160 AC_MSG_WARN([
2161--with-default-path=PATH has no effect on this system.
2162Edit /etc/login.conf instead.])
2163 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002164 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002165 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002166 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002167 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002168 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2169 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2170 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002171 AC_TRY_RUN(
2172 [
2173/* find out what STDPATH is */
2174#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002175#ifdef HAVE_PATHS_H
2176# include <paths.h>
2177#endif
2178#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002179# ifdef _PATH_USERPATH /* Irix */
2180# define _PATH_STDPATH _PATH_USERPATH
2181# else
2182# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2183# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002184#endif
2185#include <sys/types.h>
2186#include <sys/stat.h>
2187#include <fcntl.h>
2188#define DATA "conftest.stdpath"
2189
2190main()
2191{
2192 FILE *fd;
2193 int rc;
2194
2195 fd = fopen(DATA,"w");
2196 if(fd == NULL)
2197 exit(1);
2198
2199 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2200 exit(1);
2201
2202 exit(0);
2203}
2204 ], [ user_path=`cat conftest.stdpath` ],
2205 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2206 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2207 )
2208# make sure $bindir is in USER_PATH so scp will work
2209 t_bindir=`eval echo ${bindir}`
2210 case $t_bindir in
2211 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2212 esac
2213 case $t_bindir in
2214 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2215 esac
2216 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2217 if test $? -ne 0 ; then
2218 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2219 if test $? -ne 0 ; then
2220 user_path=$user_path:$t_bindir
2221 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2222 fi
2223 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002224 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002225)
Tim Rice43a1c132002-04-17 21:19:14 -07002226if test "$USES_LOGIN_CONF" != "yes" ; then
2227 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2228 AC_SUBST(user_path)
2229fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002230
Damien Millera18bbd32002-05-13 10:48:57 +10002231# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002232AC_ARG_WITH(superuser-path,
2233 [ --with-superuser-path= Specify different path for super-user],
2234 [
2235 if test "x$withval" != "xno" ; then
2236 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2237 superuser_path=$withval
2238 fi
2239 ]
2240)
2241
2242
Damien Miller61e50f12000-05-08 20:49:37 +10002243AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002244IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002245AC_ARG_WITH(4in6,
2246 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2247 [
2248 if test "x$withval" != "xno" ; then
2249 AC_MSG_RESULT(yes)
2250 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002251 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002252 else
2253 AC_MSG_RESULT(no)
2254 fi
2255 ],[
2256 if test "x$inet6_default_4in6" = "xyes"; then
2257 AC_MSG_RESULT([yes (default)])
2258 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002259 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002260 else
2261 AC_MSG_RESULT([no (default)])
2262 fi
2263 ]
2264)
2265
Damien Miller60396b02001-02-18 17:01:00 +11002266# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002267BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002268AC_ARG_WITH(bsd-auth,
2269 [ --with-bsd-auth Enable BSD auth support],
2270 [
2271 if test "x$withval" != "xno" ; then
2272 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002273 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002274 fi
2275 ]
2276)
2277
Damien Millera22ba012000-03-02 23:09:20 +11002278# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002279piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002280# make sure the directory exists
2281if test ! -d $piddir ; then
2282 piddir=`eval echo ${sysconfdir}`
2283 case $piddir in
2284 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2285 esac
2286fi
2287
Tim Rice88f2ab52002-03-17 12:17:34 -08002288AC_ARG_WITH(pid-dir,
2289 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2290 [
2291 if test "x$withval" != "xno" ; then
2292 piddir=$withval
2293 if test ! -d $piddir ; then
2294 AC_MSG_WARN([** no $piddir directory on this system **])
2295 fi
2296 fi
2297 ]
2298)
2299
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002300AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002301AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002302
andre2ff7b5d2000-06-03 14:57:40 +00002303dnl allow user to disable some login recording features
2304AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002305 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002306 [
2307 if test "x$enableval" = "xno" ; then
2308 AC_DEFINE(DISABLE_LASTLOG)
2309 fi
2310 ]
andre2ff7b5d2000-06-03 14:57:40 +00002311)
2312AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002313 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002314 [
2315 if test "x$enableval" = "xno" ; then
2316 AC_DEFINE(DISABLE_UTMP)
2317 fi
2318 ]
andre2ff7b5d2000-06-03 14:57:40 +00002319)
2320AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002321 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002322 [
2323 if test "x$enableval" = "xno" ; then
2324 AC_DEFINE(DISABLE_UTMPX)
2325 fi
2326 ]
andre2ff7b5d2000-06-03 14:57:40 +00002327)
2328AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002329 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002330 [
2331 if test "x$enableval" = "xno" ; then
2332 AC_DEFINE(DISABLE_WTMP)
2333 fi
2334 ]
andre2ff7b5d2000-06-03 14:57:40 +00002335)
2336AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002337 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002338 [
2339 if test "x$enableval" = "xno" ; then
2340 AC_DEFINE(DISABLE_WTMPX)
2341 fi
2342 ]
andre2ff7b5d2000-06-03 14:57:40 +00002343)
2344AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002345 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002346 [
2347 if test "x$enableval" = "xno" ; then
2348 AC_DEFINE(DISABLE_LOGIN)
2349 fi
2350 ]
andre2ff7b5d2000-06-03 14:57:40 +00002351)
2352AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002353 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002354 [
2355 if test "x$enableval" = "xno" ; then
2356 AC_DEFINE(DISABLE_PUTUTLINE)
2357 fi
2358 ]
andre2ff7b5d2000-06-03 14:57:40 +00002359)
2360AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002361 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002362 [
2363 if test "x$enableval" = "xno" ; then
2364 AC_DEFINE(DISABLE_PUTUTXLINE)
2365 fi
2366 ]
andre2ff7b5d2000-06-03 14:57:40 +00002367)
2368AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002369 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002370 [
2371 if test "x$withval" = "xno" ; then
2372 AC_DEFINE(DISABLE_LASTLOG)
2373 else
2374 conf_lastlog_location=$withval
2375 fi
2376 ]
2377)
andre2ff7b5d2000-06-03 14:57:40 +00002378
2379dnl lastlog, [uw]tmpx? detection
2380dnl NOTE: set the paths in the platform section to avoid the
2381dnl need for command-line parameters
2382dnl lastlog and [uw]tmp are subject to a file search if all else fails
2383
2384dnl lastlog detection
2385dnl NOTE: the code itself will detect if lastlog is a directory
2386AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2387AC_TRY_COMPILE([
2388#include <sys/types.h>
2389#include <utmp.h>
2390#ifdef HAVE_LASTLOG_H
2391# include <lastlog.h>
2392#endif
Damien Miller2994e082000-06-04 15:51:47 +10002393#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002394# include <paths.h>
2395#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002396#ifdef HAVE_LOGIN_H
2397# include <login.h>
2398#endif
andre2ff7b5d2000-06-03 14:57:40 +00002399 ],
2400 [ char *lastlog = LASTLOG_FILE; ],
2401 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002402 [
2403 AC_MSG_RESULT(no)
2404 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2405 AC_TRY_COMPILE([
2406#include <sys/types.h>
2407#include <utmp.h>
2408#ifdef HAVE_LASTLOG_H
2409# include <lastlog.h>
2410#endif
2411#ifdef HAVE_PATHS_H
2412# include <paths.h>
2413#endif
2414 ],
2415 [ char *lastlog = _PATH_LASTLOG; ],
2416 [ AC_MSG_RESULT(yes) ],
2417 [
andree441aa32000-06-12 22:34:38 +00002418 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002419 system_lastlog_path=no
2420 ])
2421 ]
andre2ff7b5d2000-06-03 14:57:40 +00002422)
Damien Miller2994e082000-06-04 15:51:47 +10002423
andre2ff7b5d2000-06-03 14:57:40 +00002424if test -z "$conf_lastlog_location"; then
2425 if test x"$system_lastlog_path" = x"no" ; then
2426 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002427 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002428 conf_lastlog_location=$f
2429 fi
2430 done
2431 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002432 AC_MSG_WARN([** Cannot find lastlog **])
2433 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002434 fi
2435 fi
2436fi
2437
2438if test -n "$conf_lastlog_location"; then
2439 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2440fi
2441
2442dnl utmp detection
2443AC_MSG_CHECKING([if your system defines UTMP_FILE])
2444AC_TRY_COMPILE([
2445#include <sys/types.h>
2446#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002447#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002448# include <paths.h>
2449#endif
2450 ],
2451 [ char *utmp = UTMP_FILE; ],
2452 [ AC_MSG_RESULT(yes) ],
2453 [ AC_MSG_RESULT(no)
2454 system_utmp_path=no ]
2455)
2456if test -z "$conf_utmp_location"; then
2457 if test x"$system_utmp_path" = x"no" ; then
2458 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2459 if test -f $f ; then
2460 conf_utmp_location=$f
2461 fi
2462 done
2463 if test -z "$conf_utmp_location"; then
2464 AC_DEFINE(DISABLE_UTMP)
2465 fi
2466 fi
2467fi
2468if test -n "$conf_utmp_location"; then
2469 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2470fi
2471
2472dnl wtmp detection
2473AC_MSG_CHECKING([if your system defines WTMP_FILE])
2474AC_TRY_COMPILE([
2475#include <sys/types.h>
2476#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002477#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002478# include <paths.h>
2479#endif
2480 ],
2481 [ char *wtmp = WTMP_FILE; ],
2482 [ AC_MSG_RESULT(yes) ],
2483 [ AC_MSG_RESULT(no)
2484 system_wtmp_path=no ]
2485)
2486if test -z "$conf_wtmp_location"; then
2487 if test x"$system_wtmp_path" = x"no" ; then
2488 for f in /usr/adm/wtmp /var/log/wtmp; do
2489 if test -f $f ; then
2490 conf_wtmp_location=$f
2491 fi
2492 done
2493 if test -z "$conf_wtmp_location"; then
2494 AC_DEFINE(DISABLE_WTMP)
2495 fi
2496 fi
2497fi
2498if test -n "$conf_wtmp_location"; then
2499 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2500fi
2501
2502
2503dnl utmpx detection - I don't know any system so perverse as to require
2504dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2505dnl there, though.
2506AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2507AC_TRY_COMPILE([
2508#include <sys/types.h>
2509#include <utmp.h>
2510#ifdef HAVE_UTMPX_H
2511#include <utmpx.h>
2512#endif
Damien Miller2994e082000-06-04 15:51:47 +10002513#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002514# include <paths.h>
2515#endif
2516 ],
2517 [ char *utmpx = UTMPX_FILE; ],
2518 [ AC_MSG_RESULT(yes) ],
2519 [ AC_MSG_RESULT(no)
2520 system_utmpx_path=no ]
2521)
2522if test -z "$conf_utmpx_location"; then
2523 if test x"$system_utmpx_path" = x"no" ; then
2524 AC_DEFINE(DISABLE_UTMPX)
2525 fi
2526else
2527 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2528fi
2529
2530dnl wtmpx detection
2531AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2532AC_TRY_COMPILE([
2533#include <sys/types.h>
2534#include <utmp.h>
2535#ifdef HAVE_UTMPX_H
2536#include <utmpx.h>
2537#endif
Damien Miller2994e082000-06-04 15:51:47 +10002538#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002539# include <paths.h>
2540#endif
2541 ],
2542 [ char *wtmpx = WTMPX_FILE; ],
2543 [ AC_MSG_RESULT(yes) ],
2544 [ AC_MSG_RESULT(no)
2545 system_wtmpx_path=no ]
2546)
2547if test -z "$conf_wtmpx_location"; then
2548 if test x"$system_wtmpx_path" = x"no" ; then
2549 AC_DEFINE(DISABLE_WTMPX)
2550 fi
2551else
2552 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2553fi
2554
Damien Miller4018c192000-04-30 09:30:44 +10002555
Damien Miller29ea30d2000-03-17 10:54:15 +11002556if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002557 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2558 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002559fi
2560
Tim Rice4cec93f2002-02-26 08:40:48 -08002561dnl remove pam and dl because they are in $LIBPAM
2562if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002563 LIBS=`echo $LIBS | sed 's/-lpam //'`
2564fi
2565if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2566 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002567fi
2568
Damien Millerbac2d8a2000-09-05 16:13:06 +11002569AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002570AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2571AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002572
Damien Miller7b22d652000-06-18 14:07:04 +10002573# Print summary of options
2574
Damien Miller7b22d652000-06-18 14:07:04 +10002575# Someone please show me a better way :)
2576A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2577B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2578C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2579D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002580E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002581F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002582G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002583H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2584I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2585J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002586
2587echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002588echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002589echo " User binaries: $B"
2590echo " System binaries: $C"
2591echo " Configuration files: $D"
2592echo " Askpass program: $E"
2593echo " Manual pages: $F"
2594echo " PID file: $G"
2595echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002596if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002597echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002598else
Damien Millerf58c6722002-05-13 13:15:42 +10002599echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002600fi
Damien Millera18bbd32002-05-13 10:48:57 +10002601if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002602echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002603fi
Damien Millerf58c6722002-05-13 13:15:42 +10002604echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002605echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002606echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002607echo " KerberosV support: $KRB5_MSG"
2608echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002609echo " S/KEY support: $SKEY_MSG"
2610echo " TCP Wrappers support: $TCPW_MSG"
2611echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002612echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002613echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2614echo " BSD Auth support: $BSD_AUTH_MSG"
2615echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002616if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002617echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002618fi
2619
Damien Miller7b22d652000-06-18 14:07:04 +10002620echo ""
2621
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002622echo " Host: ${host}"
2623echo " Compiler: ${CC}"
2624echo " Compiler flags: ${CFLAGS}"
2625echo "Preprocessor flags: ${CPPFLAGS}"
2626echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002627echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002628
2629echo ""
2630
Damien Miller82cf0ce2000-12-20 13:34:48 +11002631if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002632 echo "PAM is enabled. You may need to install a PAM control file "
2633 echo "for sshd, otherwise password authentication may fail. "
2634 echo "Example PAM control files can be found in the contrib/ "
2635 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002636 echo ""
2637fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002638
Damien Miller6c21c512002-01-22 21:57:53 +11002639if test ! -z "$RAND_HELPER_CMDHASH" ; then
2640 echo "WARNING: you are using the builtin random number collection "
2641 echo "service. Please read WARNING.RNG and request that your OS "
2642 echo "vendor includes kernel-based random number collection in "
2643 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002644 echo ""
2645fi
Damien Miller60396b02001-02-18 17:01:00 +11002646