blob: 600155ccd8fc49e811ed08327211794e9dc6bc92 [file] [log] [blame]
Darren Tucker3c8e1e12003-08-25 13:27:40 +10001# $Id: configure.ac,v 1.142 2003/08/25 03:27:40 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)
834
835 disable_shadow=yes
836 PAM_MSG="yes"
837
838 AC_DEFINE(USE_PAM)
Tim Rice7d2d1f12002-02-26 22:05:11 -0800839 if test $ac_cv_lib_dl_dlopen = yes; then
840 LIBPAM="-lpam -ldl"
841 else
842 LIBPAM="-lpam"
843 fi
844 AC_SUBST(LIBPAM)
Damien Millera22ba012000-03-02 23:09:20 +1100845 fi
846 ]
847)
Damien Millera22ba012000-03-02 23:09:20 +1100848
Damien Millera64b57a2001-01-17 10:44:13 +1100849# Check for older PAM
850if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100851 # Check PAM strerror arguments (old PAM)
852 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
853 AC_TRY_COMPILE(
854 [
Damien Miller81171112000-04-23 11:14:01 +1000855#include <stdlib.h>
856#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100857 ],
858 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
859 [AC_MSG_RESULT(no)],
860 [
861 AC_DEFINE(HAVE_OLD_PAM)
862 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000863 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100864 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100865 )
Damien Millera22ba012000-03-02 23:09:20 +1100866fi
867
Damien Millerfc93d4b2002-09-04 23:26:29 +1000868# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
869# because the system crypt() is more featureful.
870if test "x$check_for_libcrypt_before" = "x1"; then
871 AC_CHECK_LIB(crypt, crypt)
872fi
873
Tim Riceaef73712002-05-11 13:17:42 -0700874# Search for OpenSSL
875saved_CPPFLAGS="$CPPFLAGS"
876saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100877AC_ARG_WITH(ssl-dir,
878 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
879 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000880 if test "x$withval" != "xno" ; then
Tim Riceaef73712002-05-11 13:17:42 -0700881 if test -d "$withval/lib"; then
882 if test -n "${need_dash_r}"; then
883 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
884 else
885 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
886 fi
887 else
888 if test -n "${need_dash_r}"; then
889 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
890 else
891 LDFLAGS="-L${withval} ${LDFLAGS}"
892 fi
893 fi
894 if test -d "$withval/include"; then
895 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
896 else
897 CPPFLAGS="-I${withval} ${CPPFLAGS}"
898 fi
Damien Millera22ba012000-03-02 23:09:20 +1100899 fi
900 ]
901)
Tim Riceaef73712002-05-11 13:17:42 -0700902LIBS="$LIBS -lcrypto"
903AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
Damien Miller3b512e12000-05-17 23:29:18 +1000904 [
Tim Riceaef73712002-05-11 13:17:42 -0700905 dnl Check default openssl install dir
906 if test -n "${need_dash_r}"; then
907 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000908 else
Tim Riceaef73712002-05-11 13:17:42 -0700909 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
Damien Miller3b512e12000-05-17 23:29:18 +1000910 fi
Tim Riceaef73712002-05-11 13:17:42 -0700911 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
912 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
913 [
914 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
915 ]
916 )
917 ]
918)
919
Tim Riced730b782002-08-13 18:52:10 -0700920# Determine OpenSSL header version
921AC_MSG_CHECKING([OpenSSL header version])
922AC_TRY_RUN(
923 [
924#include <stdio.h>
925#include <string.h>
926#include <openssl/opensslv.h>
927#define DATA "conftest.sslincver"
928int main(void) {
929 FILE *fd;
930 int rc;
931
932 fd = fopen(DATA,"w");
933 if(fd == NULL)
934 exit(1);
935
936 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
937 exit(1);
938
939 exit(0);
940}
941 ],
942 [
943 ssl_header_ver=`cat conftest.sslincver`
944 AC_MSG_RESULT($ssl_header_ver)
945 ],
946 [
947 AC_MSG_RESULT(not found)
948 AC_MSG_ERROR(OpenSSL version header not found.)
949 ]
950)
951
952# Determine OpenSSL library version
953AC_MSG_CHECKING([OpenSSL library version])
954AC_TRY_RUN(
955 [
956#include <stdio.h>
957#include <string.h>
958#include <openssl/opensslv.h>
959#include <openssl/crypto.h>
960#define DATA "conftest.ssllibver"
961int main(void) {
962 FILE *fd;
963 int rc;
964
965 fd = fopen(DATA,"w");
966 if(fd == NULL)
967 exit(1);
968
969 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
970 exit(1);
971
972 exit(0);
973}
974 ],
975 [
976 ssl_library_ver=`cat conftest.ssllibver`
977 AC_MSG_RESULT($ssl_library_ver)
978 ],
979 [
980 AC_MSG_RESULT(not found)
981 AC_MSG_ERROR(OpenSSL library not found.)
982 ]
983)
Damien Millera22ba012000-03-02 23:09:20 +1100984
Damien Millerec932372002-01-22 22:16:03 +1100985# Sanity check OpenSSL headers
986AC_MSG_CHECKING([whether OpenSSL's headers match the library])
987AC_TRY_RUN(
988 [
989#include <string.h>
990#include <openssl/opensslv.h>
Tim Rice2c961ce2002-09-23 16:54:10 -0700991int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
Damien Millerec932372002-01-22 22:16:03 +1100992 ],
993 [
994 AC_MSG_RESULT(yes)
995 ],
996 [
997 AC_MSG_RESULT(no)
Darren Tuckera0472e02003-06-24 20:22:09 +1000998 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
999Check config.log for details.
1000Also see contrib/findssl.sh for help identifying header/library mismatches.])
Damien Millerec932372002-01-22 22:16:03 +11001001 ]
1002)
1003
Damien Millera64b57a2001-01-17 10:44:13 +11001004# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1005# version in OpenSSL. Skip this for PAM
Damien Miller4f9f42a2003-05-10 19:28:02 +10001006if test "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +11001007 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +11001008fi
1009
Damien Miller6c21c512002-01-22 21:57:53 +11001010
1011### Configure cryptographic random number support
1012
1013# Check wheter OpenSSL seeds itself
1014AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1015AC_TRY_RUN(
1016 [
1017#include <string.h>
1018#include <openssl/rand.h>
Tim Rice2c961ce2002-09-23 16:54:10 -07001019int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
Damien Miller6c21c512002-01-22 21:57:53 +11001020 ],
1021 [
1022 OPENSSL_SEEDS_ITSELF=yes
1023 AC_MSG_RESULT(yes)
1024 ],
1025 [
1026 AC_MSG_RESULT(no)
1027 # Default to use of the rand helper if OpenSSL doesn't
1028 # seed itself
1029 USE_RAND_HELPER=yes
1030 ]
1031)
1032
1033
1034# Do we want to force the use of the rand helper?
1035AC_ARG_WITH(rand-helper,
1036 [ --with-rand-helper Use subprocess to gather strong randomness ],
1037 [
1038 if test "x$withval" = "xno" ; then
1039 # Force use of OpenSSL's internal RNG, even if
1040 # the previous test showed it to be unseeded.
1041 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1042 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1043 OPENSSL_SEEDS_ITSELF=yes
1044 USE_RAND_HELPER=""
1045 fi
1046 else
1047 USE_RAND_HELPER=yes
1048 fi
1049 ],
1050)
1051
1052# Which randomness source do we use?
1053if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1054 # OpenSSL only
1055 AC_DEFINE(OPENSSL_PRNG_ONLY)
1056 RAND_MSG="OpenSSL internal ONLY"
1057 INSTALL_SSH_RAND_HELPER=""
Tim Rice1e2c6002002-01-30 22:14:03 -08001058elif test ! -z "$USE_RAND_HELPER" ; then
1059 # install rand helper
Damien Miller6c21c512002-01-22 21:57:53 +11001060 RAND_MSG="ssh-rand-helper"
1061 INSTALL_SSH_RAND_HELPER="yes"
1062fi
1063AC_SUBST(INSTALL_SSH_RAND_HELPER)
1064
1065### Configuration of ssh-rand-helper
1066
1067# PRNGD TCP socket
1068AC_ARG_WITH(prngd-port,
1069 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1070 [
Damien Millere996d722002-01-23 11:20:59 +11001071 case "$withval" in
1072 no)
1073 withval=""
1074 ;;
1075 [[0-9]]*)
1076 ;;
1077 *)
1078 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1079 ;;
1080 esac
1081 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001082 PRNGD_PORT="$withval"
1083 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1084 fi
1085 ]
1086)
1087
1088# PRNGD Unix domain socket
1089AC_ARG_WITH(prngd-socket,
1090 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1091 [
Damien Millere996d722002-01-23 11:20:59 +11001092 case "$withval" in
1093 yes)
Damien Miller6c21c512002-01-22 21:57:53 +11001094 withval="/var/run/egd-pool"
Damien Millere996d722002-01-23 11:20:59 +11001095 ;;
1096 no)
1097 withval=""
1098 ;;
1099 /*)
1100 ;;
1101 *)
1102 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1103 ;;
1104 esac
1105
1106 if test ! -z "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001107 if test ! -z "$PRNGD_PORT" ; then
1108 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1109 fi
Damien Miller6385ba02002-01-23 08:12:36 +11001110 if test ! -r "$withval" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11001111 AC_MSG_WARN(Entropy socket is not readable)
1112 fi
1113 PRNGD_SOCKET="$withval"
1114 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1115 fi
Tim Rice4cec93f2002-02-26 08:40:48 -08001116 ],
1117 [
1118 # Check for existing socket only if we don't have a random device already
1119 if test "$USE_RAND_HELPER" = yes ; then
1120 AC_MSG_CHECKING(for PRNGD/EGD socket)
1121 # Insert other locations here
1122 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1123 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1124 PRNGD_SOCKET="$sock"
1125 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1126 break;
1127 fi
1128 done
1129 if test ! -z "$PRNGD_SOCKET" ; then
1130 AC_MSG_RESULT($PRNGD_SOCKET)
1131 else
1132 AC_MSG_RESULT(not found)
1133 fi
1134 fi
Damien Miller6c21c512002-01-22 21:57:53 +11001135 ]
1136)
1137
1138# Change default command timeout for hashing entropy source
1139entropy_timeout=200
1140AC_ARG_WITH(entropy-timeout,
1141 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1142 [
1143 if test "x$withval" != "xno" ; then
1144 entropy_timeout=$withval
1145 fi
1146 ]
1147)
Damien Miller6c21c512002-01-22 21:57:53 +11001148AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1149
Damien Millerd3f6ad22002-06-25 10:24:47 +10001150SSH_PRIVSEP_USER=sshd
Kevin Steves7ff91122002-04-07 19:22:54 +00001151AC_ARG_WITH(privsep-user,
Kevin Stevesc81e1292002-05-13 03:51:40 +00001152 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
Kevin Steves7ff91122002-04-07 19:22:54 +00001153 [
1154 if test -n "$withval"; then
Damien Millerd3f6ad22002-06-25 10:24:47 +10001155 SSH_PRIVSEP_USER=$withval
Kevin Steves7ff91122002-04-07 19:22:54 +00001156 fi
1157 ]
1158)
Damien Millerd3f6ad22002-06-25 10:24:47 +10001159AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1160AC_SUBST(SSH_PRIVSEP_USER)
Kevin Steves7ff91122002-04-07 19:22:54 +00001161
Tim Rice88f2ab52002-03-17 12:17:34 -08001162# We do this little dance with the search path to insure
1163# that programs that we select for use by installed programs
1164# (which may be run by the super-user) come from trusted
1165# locations before they come from the user's private area.
1166# This should help avoid accidentally configuring some
1167# random version of a program in someone's personal bin.
1168
1169OPATH=$PATH
1170PATH=/bin:/usr/bin
Tim Riceae49fe62002-04-12 10:26:21 -07001171test -h /bin 2> /dev/null && PATH=/usr/bin
Tim Rice88f2ab52002-03-17 12:17:34 -08001172test -d /sbin && PATH=$PATH:/sbin
1173test -d /usr/sbin && PATH=$PATH:/usr/sbin
1174PATH=$PATH:/etc:$OPATH
1175
Damien Miller6c21c512002-01-22 21:57:53 +11001176# These programs are used by the command hashing source to gather entropy
1177OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1178OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1179OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1180OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1181OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1182OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1183OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1184OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1185OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1186OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1187OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1188OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1189OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1190OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1191OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1192OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Tim Rice88f2ab52002-03-17 12:17:34 -08001193# restore PATH
1194PATH=$OPATH
Damien Miller6c21c512002-01-22 21:57:53 +11001195
1196# Where does ssh-rand-helper get its randomness from?
1197INSTALL_SSH_PRNG_CMDS=""
1198if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1199 if test ! -z "$PRNGD_PORT" ; then
1200 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1201 elif test ! -z "$PRNGD_SOCKET" ; then
1202 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1203 else
1204 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1205 RAND_HELPER_CMDHASH=yes
1206 INSTALL_SSH_PRNG_CMDS="yes"
1207 fi
1208fi
1209AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1210
1211
Ben Lindstromb5628642000-10-18 00:02:25 +00001212# Cheap hack to ensure NEWS-OS libraries are arranged right.
1213if test ! -z "$SONY" ; then
1214 LIBS="$LIBS -liberty";
1215fi
1216
Damien Millera22ba012000-03-02 23:09:20 +11001217# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +11001218AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +11001219AC_CHECK_SIZEOF(short int, 2)
1220AC_CHECK_SIZEOF(int, 4)
1221AC_CHECK_SIZEOF(long int, 4)
1222AC_CHECK_SIZEOF(long long int, 8)
1223
Damien Millerfa2bb692002-04-23 23:22:25 +10001224# Sanity check long long for some platforms (AIX)
1225if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1226 ac_cv_sizeof_long_long_int=0
1227fi
1228
Damien Millera22ba012000-03-02 23:09:20 +11001229# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +11001230AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1231 AC_TRY_COMPILE(
1232 [ #include <sys/types.h> ],
1233 [ u_int a; a = 1;],
1234 [ ac_cv_have_u_int="yes" ],
1235 [ ac_cv_have_u_int="no" ]
1236 )
1237])
1238if test "x$ac_cv_have_u_int" = "xyes" ; then
1239 AC_DEFINE(HAVE_U_INT)
1240 have_u_int=1
1241fi
1242
Damien Miller61e50f12000-05-08 20:49:37 +10001243AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1244 AC_TRY_COMPILE(
1245 [ #include <sys/types.h> ],
1246 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1247 [ ac_cv_have_intxx_t="yes" ],
1248 [ ac_cv_have_intxx_t="no" ]
1249 )
1250])
1251if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1252 AC_DEFINE(HAVE_INTXX_T)
1253 have_intxx_t=1
1254fi
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001255
1256if (test -z "$have_intxx_t" && \
1257 test "x$ac_cv_header_stdint_h" = "xyes")
1258then
1259 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1260 AC_TRY_COMPILE(
1261 [ #include <stdint.h> ],
1262 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1263 [
1264 AC_DEFINE(HAVE_INTXX_T)
1265 AC_MSG_RESULT(yes)
1266 ],
1267 [ AC_MSG_RESULT(no) ]
1268 )
1269fi
1270
Damien Miller578783e2000-09-23 14:12:24 +11001271AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1272 AC_TRY_COMPILE(
Tim Rice907881e2002-07-18 11:44:50 -07001273 [
1274#include <sys/types.h>
1275#ifdef HAVE_STDINT_H
1276# include <stdint.h>
1277#endif
1278#include <sys/socket.h>
1279#ifdef HAVE_SYS_BITYPES_H
1280# include <sys/bitypes.h>
1281#endif
1282 ],
Damien Miller578783e2000-09-23 14:12:24 +11001283 [ int64_t a; a = 1;],
1284 [ ac_cv_have_int64_t="yes" ],
1285 [ ac_cv_have_int64_t="no" ]
1286 )
1287])
1288if test "x$ac_cv_have_int64_t" = "xyes" ; then
1289 AC_DEFINE(HAVE_INT64_T)
Tim Rice4cec93f2002-02-26 08:40:48 -08001290fi
1291
Damien Miller61e50f12000-05-08 20:49:37 +10001292AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1293 AC_TRY_COMPILE(
1294 [ #include <sys/types.h> ],
1295 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1296 [ ac_cv_have_u_intxx_t="yes" ],
1297 [ ac_cv_have_u_intxx_t="no" ]
1298 )
1299])
1300if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1301 AC_DEFINE(HAVE_U_INTXX_T)
1302 have_u_intxx_t=1
1303fi
Damien Millerc6398ef1999-11-20 12:18:40 +11001304
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001305if test -z "$have_u_intxx_t" ; then
1306 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1307 AC_TRY_COMPILE(
1308 [ #include <sys/socket.h> ],
1309 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1310 [
1311 AC_DEFINE(HAVE_U_INTXX_T)
1312 AC_MSG_RESULT(yes)
1313 ],
1314 [ AC_MSG_RESULT(no) ]
1315 )
1316fi
1317
Damien Miller578783e2000-09-23 14:12:24 +11001318AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1319 AC_TRY_COMPILE(
1320 [ #include <sys/types.h> ],
1321 [ u_int64_t a; a = 1;],
1322 [ ac_cv_have_u_int64_t="yes" ],
1323 [ ac_cv_have_u_int64_t="no" ]
1324 )
1325])
1326if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1327 AC_DEFINE(HAVE_U_INT64_T)
1328 have_u_int64_t=1
1329fi
1330
Tim Rice4cec93f2002-02-26 08:40:48 -08001331if test -z "$have_u_int64_t" ; then
1332 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1333 AC_TRY_COMPILE(
1334 [ #include <sys/bitypes.h> ],
1335 [ u_int64_t a; a = 1],
1336 [
1337 AC_DEFINE(HAVE_U_INT64_T)
1338 AC_MSG_RESULT(yes)
1339 ],
1340 [ AC_MSG_RESULT(no) ]
1341 )
1342fi
1343
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00001344if test -z "$have_u_intxx_t" ; then
1345 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1346 AC_TRY_COMPILE(
1347 [
1348#include <sys/types.h>
1349 ],
1350 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1351 [ ac_cv_have_uintxx_t="yes" ],
1352 [ ac_cv_have_uintxx_t="no" ]
1353 )
1354 ])
1355 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1356 AC_DEFINE(HAVE_UINTXX_T)
1357 fi
1358fi
1359
1360if test -z "$have_uintxx_t" ; then
1361 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1362 AC_TRY_COMPILE(
1363 [ #include <stdint.h> ],
1364 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1365 [
1366 AC_DEFINE(HAVE_UINTXX_T)
1367 AC_MSG_RESULT(yes)
1368 ],
1369 [ AC_MSG_RESULT(no) ]
1370 )
1371fi
1372
Damien Milleredb82922000-06-20 13:25:52 +10001373if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1374 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +11001375then
1376 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1377 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +10001378 [
1379#include <sys/bitypes.h>
1380 ],
Damien Millerb29ea912000-01-15 14:12:03 +11001381 [
Damien Miller70494d12000-04-03 15:57:06 +10001382 int8_t a; int16_t b; int32_t c;
1383 u_int8_t e; u_int16_t f; u_int32_t g;
1384 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +11001385 ],
1386 [
1387 AC_DEFINE(HAVE_U_INTXX_T)
1388 AC_DEFINE(HAVE_INTXX_T)
1389 AC_MSG_RESULT(yes)
1390 ],
1391 [AC_MSG_RESULT(no)]
1392 )
1393fi
1394
Damien Miller58be7382001-09-15 21:31:54 +10001395
1396AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1397 AC_TRY_COMPILE(
1398 [
1399#include <sys/types.h>
1400 ],
1401 [ u_char foo; foo = 125; ],
1402 [ ac_cv_have_u_char="yes" ],
1403 [ ac_cv_have_u_char="no" ]
1404 )
1405])
1406if test "x$ac_cv_have_u_char" = "xyes" ; then
1407 AC_DEFINE(HAVE_U_CHAR)
1408fi
1409
Tim Rice13aae5e2001-10-21 17:53:58 -07001410TYPE_SOCKLEN_T
Damien Miller74d0d4a1999-12-29 02:24:35 +11001411
Tim Rice200a5c02002-02-26 22:12:34 -08001412AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
Tim Rice4cec93f2002-02-26 08:40:48 -08001413
Damien Miller61e50f12000-05-08 20:49:37 +10001414AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1415 AC_TRY_COMPILE(
1416 [
1417#include <sys/types.h>
1418 ],
1419 [ size_t foo; foo = 1235; ],
1420 [ ac_cv_have_size_t="yes" ],
1421 [ ac_cv_have_size_t="no" ]
1422 )
1423])
1424if test "x$ac_cv_have_size_t" = "xyes" ; then
1425 AC_DEFINE(HAVE_SIZE_T)
1426fi
Damien Miller95058511999-12-29 10:36:45 +11001427
Damien Miller615f9392000-05-17 22:53:33 +10001428AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1429 AC_TRY_COMPILE(
1430 [
1431#include <sys/types.h>
1432 ],
1433 [ ssize_t foo; foo = 1235; ],
1434 [ ac_cv_have_ssize_t="yes" ],
1435 [ ac_cv_have_ssize_t="no" ]
1436 )
1437])
1438if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1439 AC_DEFINE(HAVE_SSIZE_T)
1440fi
1441
Ben Lindstrom0d5af602001-01-09 00:50:29 +00001442AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1443 AC_TRY_COMPILE(
1444 [
1445#include <time.h>
1446 ],
1447 [ clock_t foo; foo = 1235; ],
1448 [ ac_cv_have_clock_t="yes" ],
1449 [ ac_cv_have_clock_t="no" ]
1450 )
1451])
1452if test "x$ac_cv_have_clock_t" = "xyes" ; then
1453 AC_DEFINE(HAVE_CLOCK_T)
1454fi
1455
Damien Millerb54b40e2000-06-23 08:23:34 +10001456AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1457 AC_TRY_COMPILE(
1458 [
1459#include <sys/types.h>
1460#include <sys/socket.h>
1461 ],
1462 [ sa_family_t foo; foo = 1235; ],
1463 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +11001464 [ AC_TRY_COMPILE(
1465 [
1466#include <sys/types.h>
1467#include <sys/socket.h>
1468#include <netinet/in.h>
1469 ],
1470 [ sa_family_t foo; foo = 1235; ],
1471 [ ac_cv_have_sa_family_t="yes" ],
1472
Damien Millerb54b40e2000-06-23 08:23:34 +10001473 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +11001474 )]
Damien Millerb54b40e2000-06-23 08:23:34 +10001475 )
1476])
1477if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1478 AC_DEFINE(HAVE_SA_FAMILY_T)
1479fi
1480
Damien Miller0f91b4e2000-06-18 15:43:25 +10001481AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1482 AC_TRY_COMPILE(
1483 [
1484#include <sys/types.h>
1485 ],
1486 [ pid_t foo; foo = 1235; ],
1487 [ ac_cv_have_pid_t="yes" ],
1488 [ ac_cv_have_pid_t="no" ]
1489 )
1490])
1491if test "x$ac_cv_have_pid_t" = "xyes" ; then
1492 AC_DEFINE(HAVE_PID_T)
1493fi
1494
1495AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1496 AC_TRY_COMPILE(
1497 [
1498#include <sys/types.h>
1499 ],
1500 [ mode_t foo; foo = 1235; ],
1501 [ ac_cv_have_mode_t="yes" ],
1502 [ ac_cv_have_mode_t="no" ]
1503 )
1504])
1505if test "x$ac_cv_have_mode_t" = "xyes" ; then
1506 AC_DEFINE(HAVE_MODE_T)
1507fi
1508
Damien Miller61e50f12000-05-08 20:49:37 +10001509
1510AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1511 AC_TRY_COMPILE(
1512 [
Damien Miller81171112000-04-23 11:14:01 +10001513#include <sys/types.h>
1514#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001515 ],
1516 [ struct sockaddr_storage s; ],
1517 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1518 [ ac_cv_have_struct_sockaddr_storage="no" ]
1519 )
1520])
1521if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1522 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1523fi
Damien Miller34132e52000-01-14 15:45:46 +11001524
Damien Miller61e50f12000-05-08 20:49:37 +10001525AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1526 AC_TRY_COMPILE(
1527 [
Damien Miller7b22d652000-06-18 14:07:04 +10001528#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001529#include <netinet/in.h>
1530 ],
1531 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1532 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1533 [ ac_cv_have_struct_sockaddr_in6="no" ]
1534 )
1535])
1536if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1537 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1538fi
Damien Miller34132e52000-01-14 15:45:46 +11001539
Damien Miller61e50f12000-05-08 20:49:37 +10001540AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1541 AC_TRY_COMPILE(
1542 [
Damien Miller7b22d652000-06-18 14:07:04 +10001543#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001544#include <netinet/in.h>
1545 ],
1546 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1547 [ ac_cv_have_struct_in6_addr="yes" ],
1548 [ ac_cv_have_struct_in6_addr="no" ]
1549 )
1550])
1551if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1552 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1553fi
Damien Miller34132e52000-01-14 15:45:46 +11001554
Damien Miller61e50f12000-05-08 20:49:37 +10001555AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1556 AC_TRY_COMPILE(
1557 [
Damien Miller81171112000-04-23 11:14:01 +10001558#include <sys/types.h>
1559#include <sys/socket.h>
1560#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001561 ],
1562 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1563 [ ac_cv_have_struct_addrinfo="yes" ],
1564 [ ac_cv_have_struct_addrinfo="no" ]
1565 )
1566])
1567if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1568 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1569fi
1570
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001571AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1572 AC_TRY_COMPILE(
1573 [ #include <sys/time.h> ],
1574 [ struct timeval tv; tv.tv_sec = 1;],
1575 [ ac_cv_have_struct_timeval="yes" ],
1576 [ ac_cv_have_struct_timeval="no" ]
1577 )
1578])
1579if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1580 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1581 have_struct_timeval=1
1582fi
1583
Tim Rice4e4dc562003-03-18 10:21:40 -08001584AC_CHECK_TYPES(struct timespec)
1585
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001586# We need int64_t or else certian parts of the compile will fail.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001587if test "x$ac_cv_have_int64_t" = "xno" -a \
1588 "x$ac_cv_sizeof_long_int" != "x8" -a \
1589 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +00001590 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1591 echo "an alternative compiler (I.E., GCC) before continuing."
1592 echo ""
1593 exit 1;
Tim Ricebee3f222001-03-11 17:32:12 -08001594else
1595dnl test snprintf (broken on SCO w/gcc)
1596 AC_TRY_RUN(
1597 [
1598#include <stdio.h>
1599#include <string.h>
1600#ifdef HAVE_SNPRINTF
1601main()
1602{
1603 char buf[50];
1604 char expected_out[50];
1605 int mazsize = 50 ;
1606#if (SIZEOF_LONG_INT == 8)
1607 long int num = 0x7fffffffffffffff;
1608#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001609 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001610#endif
1611 strcpy(expected_out, "9223372036854775807");
1612 snprintf(buf, mazsize, "%lld", num);
1613 if(strcmp(buf, expected_out) != 0)
1614 exit(1);
1615 exit(0);
1616}
1617#else
1618main() { exit(0); }
1619#endif
1620 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1621 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001622fi
1623
Damien Miller78315eb2000-09-29 23:01:36 +11001624dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001625OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1626OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1627OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1628OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1629OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001630OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001631OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1632OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001633OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001634OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1635OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1636OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1637OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001638OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1639OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1640OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1641OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Tim Rice13aae5e2001-10-21 17:53:58 -07001642
1643AC_CHECK_MEMBERS([struct stat.st_blksize])
andre2ff7b5d2000-06-03 14:57:40 +00001644
Damien Miller61e50f12000-05-08 20:49:37 +10001645AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1646 ac_cv_have_ss_family_in_struct_ss, [
1647 AC_TRY_COMPILE(
1648 [
Damien Miller81171112000-04-23 11:14:01 +10001649#include <sys/types.h>
1650#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001651 ],
1652 [ struct sockaddr_storage s; s.ss_family = 1; ],
1653 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1654 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1655 )
1656])
1657if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1658 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1659fi
1660
Damien Miller61e50f12000-05-08 20:49:37 +10001661AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1662 ac_cv_have___ss_family_in_struct_ss, [
1663 AC_TRY_COMPILE(
1664 [
Damien Miller81171112000-04-23 11:14:01 +10001665#include <sys/types.h>
1666#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001667 ],
1668 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1669 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1670 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1671 )
1672])
1673if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1674 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1675fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001676
Damien Millerad833b32000-08-23 10:46:23 +10001677AC_CACHE_CHECK([for pw_class field in struct passwd],
1678 ac_cv_have_pw_class_in_struct_passwd, [
1679 AC_TRY_COMPILE(
1680 [
Damien Millerad833b32000-08-23 10:46:23 +10001681#include <pwd.h>
1682 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001683 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001684 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1685 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1686 )
1687])
1688if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1689 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1690fi
1691
Kevin Steves82456952001-06-22 21:14:18 +00001692AC_CACHE_CHECK([for pw_expire field in struct passwd],
1693 ac_cv_have_pw_expire_in_struct_passwd, [
1694 AC_TRY_COMPILE(
1695 [
1696#include <pwd.h>
1697 ],
1698 [ struct passwd p; p.pw_expire = 0; ],
1699 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1700 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1701 )
1702])
1703if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1704 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1705fi
1706
1707AC_CACHE_CHECK([for pw_change field in struct passwd],
1708 ac_cv_have_pw_change_in_struct_passwd, [
1709 AC_TRY_COMPILE(
1710 [
1711#include <pwd.h>
1712 ],
1713 [ struct passwd p; p.pw_change = 0; ],
1714 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1715 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1716 )
1717])
1718if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1719 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1720fi
Damien Miller61e50f12000-05-08 20:49:37 +10001721
Tim Rice28bbb0c2002-05-27 17:37:32 -07001722dnl make sure we're using the real structure members and not defines
Kevin Steves939c9db2002-03-22 17:23:25 +00001723AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1724 ac_cv_have_accrights_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001725 AC_TRY_RUN(
Kevin Steves939c9db2002-03-22 17:23:25 +00001726 [
Tim Riceae49fe62002-04-12 10:26:21 -07001727#include <sys/types.h>
Kevin Steves939c9db2002-03-22 17:23:25 +00001728#include <sys/socket.h>
1729#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001730int main() {
1731#ifdef msg_accrights
1732exit(1);
1733#endif
1734struct msghdr m;
1735m.msg_accrights = 0;
1736exit(0);
1737}
Kevin Steves939c9db2002-03-22 17:23:25 +00001738 ],
Kevin Steves939c9db2002-03-22 17:23:25 +00001739 [ ac_cv_have_accrights_in_msghdr="yes" ],
1740 [ ac_cv_have_accrights_in_msghdr="no" ]
1741 )
1742])
1743if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1744 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1745fi
1746
Kevin Stevesa44e0352002-04-07 16:18:03 +00001747AC_CACHE_CHECK([for msg_control field in struct msghdr],
1748 ac_cv_have_control_in_msghdr, [
Tim Rice28bbb0c2002-05-27 17:37:32 -07001749 AC_TRY_RUN(
Kevin Stevesa44e0352002-04-07 16:18:03 +00001750 [
Tim Riceae49fe62002-04-12 10:26:21 -07001751#include <sys/types.h>
Kevin Stevesa44e0352002-04-07 16:18:03 +00001752#include <sys/socket.h>
1753#include <sys/uio.h>
Tim Rice28bbb0c2002-05-27 17:37:32 -07001754int main() {
1755#ifdef msg_control
1756exit(1);
1757#endif
1758struct msghdr m;
1759m.msg_control = 0;
1760exit(0);
1761}
Kevin Stevesa44e0352002-04-07 16:18:03 +00001762 ],
Kevin Stevesa44e0352002-04-07 16:18:03 +00001763 [ ac_cv_have_control_in_msghdr="yes" ],
1764 [ ac_cv_have_control_in_msghdr="no" ]
1765 )
1766])
1767if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1768 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1769fi
1770
Damien Miller61e50f12000-05-08 20:49:37 +10001771AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1772 AC_TRY_LINK([],
1773 [ extern char *__progname; printf("%s", __progname); ],
1774 [ ac_cv_libc_defines___progname="yes" ],
1775 [ ac_cv_libc_defines___progname="no" ]
1776 )
1777])
1778if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1779 AC_DEFINE(HAVE___PROGNAME)
1780fi
1781
Kevin Steves4846f4a2002-03-22 18:19:53 +00001782AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1783 AC_TRY_LINK([
1784#include <stdio.h>
1785],
1786 [ printf("%s", __FUNCTION__); ],
1787 [ ac_cv_cc_implements___FUNCTION__="yes" ],
1788 [ ac_cv_cc_implements___FUNCTION__="no" ]
1789 )
1790])
1791if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1792 AC_DEFINE(HAVE___FUNCTION__)
1793fi
1794
1795AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1796 AC_TRY_LINK([
1797#include <stdio.h>
1798],
1799 [ printf("%s", __func__); ],
1800 [ ac_cv_cc_implements___func__="yes" ],
1801 [ ac_cv_cc_implements___func__="no" ]
1802 )
1803])
1804if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1805 AC_DEFINE(HAVE___func__)
1806fi
1807
Damien Miller4f8e6692001-07-14 13:22:53 +10001808AC_CACHE_CHECK([whether getopt has optreset support],
1809 ac_cv_have_getopt_optreset, [
1810 AC_TRY_LINK(
1811 [
1812#include <getopt.h>
1813 ],
1814 [ extern int optreset; optreset = 0; ],
1815 [ ac_cv_have_getopt_optreset="yes" ],
1816 [ ac_cv_have_getopt_optreset="no" ]
1817 )
1818])
1819if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1820 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1821fi
Damien Millera22ba012000-03-02 23:09:20 +11001822
Damien Millerecbb26d2000-07-15 14:59:14 +10001823AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1824 AC_TRY_LINK([],
1825 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1826 [ ac_cv_libc_defines_sys_errlist="yes" ],
1827 [ ac_cv_libc_defines_sys_errlist="no" ]
1828 )
1829])
1830if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1831 AC_DEFINE(HAVE_SYS_ERRLIST)
1832fi
1833
1834
Damien Miller11fa2cc2000-08-16 10:35:58 +10001835AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1836 AC_TRY_LINK([],
1837 [ extern int sys_nerr; printf("%i", sys_nerr);],
1838 [ ac_cv_libc_defines_sys_nerr="yes" ],
1839 [ ac_cv_libc_defines_sys_nerr="no" ]
1840 )
1841])
1842if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1843 AC_DEFINE(HAVE_SYS_NERR)
1844fi
1845
Damien Miller85de5802001-09-18 14:01:11 +10001846SCARD_MSG="no"
Ben Lindstroma42694f2002-04-05 16:11:45 +00001847# Check whether user wants sectok support
1848AC_ARG_WITH(sectok,
1849 [ --with-sectok Enable smartcard support using libsectok],
Damien Miller85de5802001-09-18 14:01:11 +10001850 [
1851 if test "x$withval" != "xno" ; then
1852 if test "x$withval" != "xyes" ; then
1853 CPPFLAGS="$CPPFLAGS -I${withval}"
1854 LDFLAGS="$LDFLAGS -L${withval}"
1855 if test ! -z "$need_dash_r" ; then
1856 LDFLAGS="$LDFLAGS -R${withval}"
1857 fi
1858 if test ! -z "$blibpath" ; then
1859 blibpath="$blibpath:${withval}"
1860 fi
1861 fi
1862 AC_CHECK_HEADERS(sectok.h)
1863 if test "$ac_cv_header_sectok_h" != yes; then
1864 AC_MSG_ERROR(Can't find sectok.h)
1865 fi
1866 AC_CHECK_LIB(sectok, sectok_open)
1867 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
1868 AC_MSG_ERROR(Can't find libsectok)
1869 fi
1870 AC_DEFINE(SMARTCARD)
Ben Lindstroma42694f2002-04-05 16:11:45 +00001871 AC_DEFINE(USE_SECTOK)
1872 SCARD_MSG="yes, using sectok"
1873 fi
1874 ]
1875)
1876
1877# Check whether user wants OpenSC support
1878AC_ARG_WITH(opensc,
Damien Millerf6195f22002-04-23 22:48:46 +10001879 AC_HELP_STRING([--with-opensc=PFX],
1880 [Enable smartcard support using OpenSC]),
1881 opensc_config_prefix="$withval", opensc_config_prefix="")
1882if test x$opensc_config_prefix != x ; then
1883 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1884 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
1885 if test "$OPENSC_CONFIG" != "no"; then
1886 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
1887 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
1888 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
1889 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1890 AC_DEFINE(SMARTCARD)
1891 AC_DEFINE(USE_OPENSC)
1892 SCARD_MSG="yes, using OpenSC"
1893 fi
1894fi
Damien Miller85de5802001-09-18 14:01:11 +10001895
Damien Miller7abe09b2003-05-15 10:53:49 +10001896# Check whether user wants DNS support
1897DNS_MSG="no"
1898AC_ARG_WITH(dns,
1899 [ --with-dns Support for fetching keys from DNS (experimental)],
1900 [
1901 if test "x$withval" != "xno" ; then
Damien Millerd9ec3702003-05-15 12:27:08 +10001902 DNS_MSG="yes"
1903 AC_DEFINE(DNS)
1904 AC_SEARCH_LIBS(getrrsetbyname, resolv,
Damien Miller200d0a72003-06-30 19:21:36 +10001905 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1906 [
1907 # Needed by our getrrsetbyname()
1908 AC_SEARCH_LIBS(res_query, resolv)
1909 AC_SEARCH_LIBS(dn_expand, resolv)
1910 ])
Damien Miller7abe09b2003-05-15 10:53:49 +10001911 fi
1912 ]
1913)
1914
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001915# Check whether user wants Kerberos 5 support
1916KRB5_MSG="no"
1917AC_ARG_WITH(kerberos5,
1918 [ --with-kerberos5=PATH Enable Kerberos 5 support],
1919 [
1920 if test "x$withval" != "xno" ; then
1921 if test "x$withval" = "xyes" ; then
1922 KRB5ROOT="/usr/local"
1923 else
1924 KRB5ROOT=${withval}
1925 fi
1926 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1927 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1928 AC_DEFINE(KRB5)
1929 KRB5_MSG="yes"
1930 AC_MSG_CHECKING(whether we are using Heimdal)
1931 AC_TRY_COMPILE([ #include <krb5.h> ],
1932 [ char *tmp = heimdal_version; ],
1933 [ AC_MSG_RESULT(yes)
1934 AC_DEFINE(HEIMDAL)
1935 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1936 ],
1937 [ AC_MSG_RESULT(no)
1938 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1939 ]
1940 )
1941 if test ! -z "$need_dash_r" ; then
1942 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1943 fi
1944 if test ! -z "$blibpath" ; then
1945 blibpath="$blibpath:${KRB5ROOT}/lib"
1946 fi
Damien Miller200d0a72003-06-30 19:21:36 +10001947 AC_SEARCH_LIBS(dn_expand, resolv)
Damien Millerfd4c9ee2002-04-13 11:04:40 +10001948
1949 KRB5=yes
1950 fi
1951 ]
1952)
Darren Tucker6aaa58c2003-08-02 22:24:49 +10001953LIBS="$LIBS $K5LIBS"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001954
Damien Millera22ba012000-03-02 23:09:20 +11001955# Looking for programs, paths and files
Damien Millera22ba012000-03-02 23:09:20 +11001956
Damien Millerf58c6722002-05-13 13:15:42 +10001957PRIVSEP_PATH=/var/empty
1958AC_ARG_WITH(privsep-path,
Tim Ricecbb90662002-07-08 19:17:10 -07001959 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
Damien Millerf58c6722002-05-13 13:15:42 +10001960 [
1961 if test "x$withval" != "$no" ; then
1962 PRIVSEP_PATH=$withval
1963 fi
1964 ]
1965)
1966AC_SUBST(PRIVSEP_PATH)
1967
Damien Millera22ba012000-03-02 23:09:20 +11001968AC_ARG_WITH(xauth,
1969 [ --with-xauth=PATH Specify path to xauth program ],
1970 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001971 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001972 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001973 fi
1974 ],
1975 [
Tim Ricee22be3b2002-07-17 19:20:07 -07001976 TestPath="$PATH"
1977 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
1978 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
1979 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
1980 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
1981 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
Damien Milleredb82922000-06-20 13:25:52 +10001982 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001983 xauth_path="/usr/openwin/bin/xauth"
1984 fi
1985 ]
1986)
1987
Damien Miller7d901272003-01-13 16:55:22 +11001988STRIP_OPT=-s
1989AC_ARG_ENABLE(strip,
1990 [ --disable-strip Disable calling strip(1) on install],
1991 [
1992 if test "x$enableval" = "xno" ; then
1993 STRIP_OPT=
1994 fi
1995 ]
1996)
1997AC_SUBST(STRIP_OPT)
1998
Damien Millera19cf472000-11-29 13:28:50 +11001999if test -z "$xauth_path" ; then
2000 XAUTH_PATH="undefined"
2001 AC_SUBST(XAUTH_PATH)
2002else
Damien Millera22ba012000-03-02 23:09:20 +11002003 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11002004 XAUTH_PATH=$xauth_path
2005 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11002006fi
Damien Millera22ba012000-03-02 23:09:20 +11002007
2008# Check for mail directory (last resort if we cannot get it from headers)
2009if test ! -z "$MAIL" ; then
2010 maildir=`dirname $MAIL`
2011 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2012fi
2013
Damien Millera22ba012000-03-02 23:09:20 +11002014if test -z "$no_dev_ptmx" ; then
Kevin Steves0ea1d9d2002-04-25 18:17:04 +00002015 if test "x$disable_ptmx_check" != "xyes" ; then
2016 AC_CHECK_FILE("/dev/ptmx",
2017 [
2018 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2019 have_dev_ptmx=1
2020 ]
2021 )
2022 fi
Damien Millera22ba012000-03-02 23:09:20 +11002023fi
Damien Miller204ad072000-03-02 23:56:12 +11002024AC_CHECK_FILE("/dev/ptc",
2025 [
2026 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2027 have_dev_ptc=1
2028 ]
2029)
2030
Damien Millera22ba012000-03-02 23:09:20 +11002031# Options from here on. Some of these are preset by platform above
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00002032AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10002033 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11002034 [
Damien Miller897741e2001-04-16 10:41:46 +10002035 case "$withval" in
2036 man|cat|doc)
2037 MANTYPE=$withval
2038 ;;
2039 *)
2040 AC_MSG_ERROR(invalid man type: $withval)
2041 ;;
2042 esac
Damien Miller670a4b82000-01-22 13:53:11 +11002043 ]
2044)
Ben Lindstrombc709922001-04-18 18:04:21 +00002045if test -z "$MANTYPE"; then
Tim Ricee22be3b2002-07-17 19:20:07 -07002046 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2047 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
Ben Lindstrombc709922001-04-18 18:04:21 +00002048 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2049 MANTYPE=doc
2050 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2051 MANTYPE=man
2052 else
2053 MANTYPE=cat
2054 fi
2055fi
Damien Miller670a4b82000-01-22 13:53:11 +11002056AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00002057if test "$MANTYPE" = "doc"; then
2058 mansubdir=man;
2059else
2060 mansubdir=$MANTYPE;
2061fi
2062AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11002063
Damien Millera22ba012000-03-02 23:09:20 +11002064# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10002065MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11002066AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002067 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11002068 [
Damien Millerb85dcad2000-03-11 11:37:00 +11002069 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11002070 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10002071 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11002072 fi
2073 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11002074)
2075
Damien Millera22ba012000-03-02 23:09:20 +11002076# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11002077AC_ARG_WITH(shadow,
2078 [ --without-shadow Disable shadow password support],
2079 [
2080 if test "x$withval" = "xno" ; then
2081 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10002082 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11002083 fi
2084 ]
2085)
2086
Damien Miller1f335fb2000-06-26 11:31:33 +10002087if test -z "$disable_shadow" ; then
2088 AC_MSG_CHECKING([if the systems has expire shadow information])
2089 AC_TRY_COMPILE(
2090 [
2091#include <sys/types.h>
2092#include <shadow.h>
2093 struct spwd sp;
2094 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2095 [ sp_expire_available=yes ], []
2096 )
2097
2098 if test "x$sp_expire_available" = "xyes" ; then
2099 AC_MSG_RESULT(yes)
2100 AC_DEFINE(HAS_SHADOW_EXPIRE)
2101 else
2102 AC_MSG_RESULT(no)
2103 fi
2104fi
2105
Damien Millera22ba012000-03-02 23:09:20 +11002106# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11002107if test ! -z "$IPADDR_IN_DISPLAY" ; then
2108 DISPLAY_HACK_MSG="yes"
2109 AC_DEFINE(IPADDR_IN_DISPLAY)
2110else
2111 DISPLAY_HACK_MSG="no"
2112 AC_ARG_WITH(ipaddr-display,
2113 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2114 [
2115 if test "x$withval" != "xno" ; then
2116 AC_DEFINE(IPADDR_IN_DISPLAY)
2117 DISPLAY_HACK_MSG="yes"
2118 fi
2119 ]
2120 )
2121fi
Damien Miller76112de1999-12-21 11:18:08 +11002122
Tim Rice43a1c132002-04-17 21:19:14 -07002123dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2124if test $ac_cv_func_login_getcapbool = "yes" -a \
2125 $ac_cv_header_login_cap_h = "yes" ; then
2126 USES_LOGIN_CONF=yes
2127fi
Damien Millera22ba012000-03-02 23:09:20 +11002128# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10002129SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11002130AC_ARG_WITH(default-path,
Damien Millerf71d2a52002-05-13 15:14:08 +10002131 [ --with-default-path= Specify default \$PATH environment for server],
Damien Miller5a3e6831999-12-27 09:48:56 +11002132 [
Tim Rice43a1c132002-04-17 21:19:14 -07002133 if test "$USES_LOGIN_CONF" = "yes" ; then
2134 AC_MSG_WARN([
2135--with-default-path=PATH has no effect on this system.
2136Edit /etc/login.conf instead.])
2137 elif test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08002138 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10002139 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11002140 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08002141 ],
Tim Rice43a1c132002-04-17 21:19:14 -07002142 [ if test "$USES_LOGIN_CONF" = "yes" ; then
2143 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2144 else
Tim Rice59ea0a02001-03-10 13:50:45 -08002145 AC_TRY_RUN(
2146 [
2147/* find out what STDPATH is */
2148#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08002149#ifdef HAVE_PATHS_H
2150# include <paths.h>
2151#endif
2152#ifndef _PATH_STDPATH
Tim Rice1c9e6882002-11-22 13:29:01 -08002153# ifdef _PATH_USERPATH /* Irix */
2154# define _PATH_STDPATH _PATH_USERPATH
2155# else
2156# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2157# endif
Tim Rice59ea0a02001-03-10 13:50:45 -08002158#endif
2159#include <sys/types.h>
2160#include <sys/stat.h>
2161#include <fcntl.h>
2162#define DATA "conftest.stdpath"
2163
2164main()
2165{
2166 FILE *fd;
2167 int rc;
2168
2169 fd = fopen(DATA,"w");
2170 if(fd == NULL)
2171 exit(1);
2172
2173 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2174 exit(1);
2175
2176 exit(0);
2177}
2178 ], [ user_path=`cat conftest.stdpath` ],
2179 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2180 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2181 )
2182# make sure $bindir is in USER_PATH so scp will work
2183 t_bindir=`eval echo ${bindir}`
2184 case $t_bindir in
2185 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2186 esac
2187 case $t_bindir in
2188 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2189 esac
2190 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2191 if test $? -ne 0 ; then
2192 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2193 if test $? -ne 0 ; then
2194 user_path=$user_path:$t_bindir
2195 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2196 fi
2197 fi
Tim Rice43a1c132002-04-17 21:19:14 -07002198 fi ]
Damien Miller5a3e6831999-12-27 09:48:56 +11002199)
Tim Rice43a1c132002-04-17 21:19:14 -07002200if test "$USES_LOGIN_CONF" != "yes" ; then
2201 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2202 AC_SUBST(user_path)
2203fi
Damien Miller5a3e6831999-12-27 09:48:56 +11002204
Damien Millera18bbd32002-05-13 10:48:57 +10002205# Set superuser path separately to user path
Damien Millera18bbd32002-05-13 10:48:57 +10002206AC_ARG_WITH(superuser-path,
2207 [ --with-superuser-path= Specify different path for super-user],
2208 [
2209 if test "x$withval" != "xno" ; then
2210 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2211 superuser_path=$withval
2212 fi
2213 ]
2214)
2215
2216
Damien Miller61e50f12000-05-08 20:49:37 +10002217AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10002218IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11002219AC_ARG_WITH(4in6,
2220 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2221 [
2222 if test "x$withval" != "xno" ; then
2223 AC_MSG_RESULT(yes)
2224 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002225 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002226 else
2227 AC_MSG_RESULT(no)
2228 fi
2229 ],[
2230 if test "x$inet6_default_4in6" = "xyes"; then
2231 AC_MSG_RESULT([yes (default)])
2232 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10002233 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11002234 else
2235 AC_MSG_RESULT([no (default)])
2236 fi
2237 ]
2238)
2239
Damien Miller60396b02001-02-18 17:01:00 +11002240# Whether to enable BSD auth support
Damien Miller6c21c512002-01-22 21:57:53 +11002241BSD_AUTH_MSG=no
Damien Miller60396b02001-02-18 17:01:00 +11002242AC_ARG_WITH(bsd-auth,
2243 [ --with-bsd-auth Enable BSD auth support],
2244 [
2245 if test "x$withval" != "xno" ; then
2246 AC_DEFINE(BSD_AUTH)
Damien Miller6c21c512002-01-22 21:57:53 +11002247 BSD_AUTH_MSG=yes
Damien Miller60396b02001-02-18 17:01:00 +11002248 fi
2249 ]
2250)
2251
Damien Millera22ba012000-03-02 23:09:20 +11002252# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11002253piddir=/var/run
Damien Miller78315eb2000-09-29 23:01:36 +11002254# make sure the directory exists
2255if test ! -d $piddir ; then
2256 piddir=`eval echo ${sysconfdir}`
2257 case $piddir in
2258 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2259 esac
2260fi
2261
Tim Rice88f2ab52002-03-17 12:17:34 -08002262AC_ARG_WITH(pid-dir,
2263 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2264 [
2265 if test "x$withval" != "xno" ; then
2266 piddir=$withval
2267 if test ! -d $piddir ; then
2268 AC_MSG_WARN([** no $piddir directory on this system **])
2269 fi
2270 fi
2271 ]
2272)
2273
Ben Lindstrom226cfa02001-01-22 05:34:40 +00002274AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11002275AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11002276
andre2ff7b5d2000-06-03 14:57:40 +00002277dnl allow user to disable some login recording features
2278AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002279 [ --disable-lastlog disable use of lastlog even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002280 [
2281 if test "x$enableval" = "xno" ; then
2282 AC_DEFINE(DISABLE_LASTLOG)
2283 fi
2284 ]
andre2ff7b5d2000-06-03 14:57:40 +00002285)
2286AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00002287 [ --disable-utmp disable use of utmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002288 [
2289 if test "x$enableval" = "xno" ; then
2290 AC_DEFINE(DISABLE_UTMP)
2291 fi
2292 ]
andre2ff7b5d2000-06-03 14:57:40 +00002293)
2294AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00002295 [ --disable-utmpx disable use of utmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002296 [
2297 if test "x$enableval" = "xno" ; then
2298 AC_DEFINE(DISABLE_UTMPX)
2299 fi
2300 ]
andre2ff7b5d2000-06-03 14:57:40 +00002301)
2302AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00002303 [ --disable-wtmp disable use of wtmp even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002304 [
2305 if test "x$enableval" = "xno" ; then
2306 AC_DEFINE(DISABLE_WTMP)
2307 fi
2308 ]
andre2ff7b5d2000-06-03 14:57:40 +00002309)
2310AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00002311 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002312 [
2313 if test "x$enableval" = "xno" ; then
2314 AC_DEFINE(DISABLE_WTMPX)
2315 fi
2316 ]
andre2ff7b5d2000-06-03 14:57:40 +00002317)
2318AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00002319 [ --disable-libutil disable use of libutil (login() etc.) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002320 [
2321 if test "x$enableval" = "xno" ; then
2322 AC_DEFINE(DISABLE_LOGIN)
2323 fi
2324 ]
andre2ff7b5d2000-06-03 14:57:40 +00002325)
2326AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00002327 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002328 [
2329 if test "x$enableval" = "xno" ; then
2330 AC_DEFINE(DISABLE_PUTUTLINE)
2331 fi
2332 ]
andre2ff7b5d2000-06-03 14:57:40 +00002333)
2334AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00002335 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
Darren Tuckera3020db2003-06-28 12:54:33 +10002336 [
2337 if test "x$enableval" = "xno" ; then
2338 AC_DEFINE(DISABLE_PUTUTXLINE)
2339 fi
2340 ]
andre2ff7b5d2000-06-03 14:57:40 +00002341)
2342AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00002343 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11002344 [
2345 if test "x$withval" = "xno" ; then
2346 AC_DEFINE(DISABLE_LASTLOG)
2347 else
2348 conf_lastlog_location=$withval
2349 fi
2350 ]
2351)
andre2ff7b5d2000-06-03 14:57:40 +00002352
2353dnl lastlog, [uw]tmpx? detection
2354dnl NOTE: set the paths in the platform section to avoid the
2355dnl need for command-line parameters
2356dnl lastlog and [uw]tmp are subject to a file search if all else fails
2357
2358dnl lastlog detection
2359dnl NOTE: the code itself will detect if lastlog is a directory
2360AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2361AC_TRY_COMPILE([
2362#include <sys/types.h>
2363#include <utmp.h>
2364#ifdef HAVE_LASTLOG_H
2365# include <lastlog.h>
2366#endif
Damien Miller2994e082000-06-04 15:51:47 +10002367#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002368# include <paths.h>
2369#endif
Ben Lindstrom19d7b8d2001-08-16 00:09:49 +00002370#ifdef HAVE_LOGIN_H
2371# include <login.h>
2372#endif
andre2ff7b5d2000-06-03 14:57:40 +00002373 ],
2374 [ char *lastlog = LASTLOG_FILE; ],
2375 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10002376 [
2377 AC_MSG_RESULT(no)
2378 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2379 AC_TRY_COMPILE([
2380#include <sys/types.h>
2381#include <utmp.h>
2382#ifdef HAVE_LASTLOG_H
2383# include <lastlog.h>
2384#endif
2385#ifdef HAVE_PATHS_H
2386# include <paths.h>
2387#endif
2388 ],
2389 [ char *lastlog = _PATH_LASTLOG; ],
2390 [ AC_MSG_RESULT(yes) ],
2391 [
andree441aa32000-06-12 22:34:38 +00002392 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10002393 system_lastlog_path=no
2394 ])
2395 ]
andre2ff7b5d2000-06-03 14:57:40 +00002396)
Damien Miller2994e082000-06-04 15:51:47 +10002397
andre2ff7b5d2000-06-03 14:57:40 +00002398if test -z "$conf_lastlog_location"; then
2399 if test x"$system_lastlog_path" = x"no" ; then
2400 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10002401 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00002402 conf_lastlog_location=$f
2403 fi
2404 done
2405 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00002406 AC_MSG_WARN([** Cannot find lastlog **])
2407 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00002408 fi
2409 fi
2410fi
2411
2412if test -n "$conf_lastlog_location"; then
2413 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2414fi
2415
2416dnl utmp detection
2417AC_MSG_CHECKING([if your system defines UTMP_FILE])
2418AC_TRY_COMPILE([
2419#include <sys/types.h>
2420#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002421#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002422# include <paths.h>
2423#endif
2424 ],
2425 [ char *utmp = UTMP_FILE; ],
2426 [ AC_MSG_RESULT(yes) ],
2427 [ AC_MSG_RESULT(no)
2428 system_utmp_path=no ]
2429)
2430if test -z "$conf_utmp_location"; then
2431 if test x"$system_utmp_path" = x"no" ; then
2432 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2433 if test -f $f ; then
2434 conf_utmp_location=$f
2435 fi
2436 done
2437 if test -z "$conf_utmp_location"; then
2438 AC_DEFINE(DISABLE_UTMP)
2439 fi
2440 fi
2441fi
2442if test -n "$conf_utmp_location"; then
2443 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2444fi
2445
2446dnl wtmp detection
2447AC_MSG_CHECKING([if your system defines WTMP_FILE])
2448AC_TRY_COMPILE([
2449#include <sys/types.h>
2450#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10002451#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002452# include <paths.h>
2453#endif
2454 ],
2455 [ char *wtmp = WTMP_FILE; ],
2456 [ AC_MSG_RESULT(yes) ],
2457 [ AC_MSG_RESULT(no)
2458 system_wtmp_path=no ]
2459)
2460if test -z "$conf_wtmp_location"; then
2461 if test x"$system_wtmp_path" = x"no" ; then
2462 for f in /usr/adm/wtmp /var/log/wtmp; do
2463 if test -f $f ; then
2464 conf_wtmp_location=$f
2465 fi
2466 done
2467 if test -z "$conf_wtmp_location"; then
2468 AC_DEFINE(DISABLE_WTMP)
2469 fi
2470 fi
2471fi
2472if test -n "$conf_wtmp_location"; then
2473 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2474fi
2475
2476
2477dnl utmpx detection - I don't know any system so perverse as to require
2478dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2479dnl there, though.
2480AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2481AC_TRY_COMPILE([
2482#include <sys/types.h>
2483#include <utmp.h>
2484#ifdef HAVE_UTMPX_H
2485#include <utmpx.h>
2486#endif
Damien Miller2994e082000-06-04 15:51:47 +10002487#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002488# include <paths.h>
2489#endif
2490 ],
2491 [ char *utmpx = UTMPX_FILE; ],
2492 [ AC_MSG_RESULT(yes) ],
2493 [ AC_MSG_RESULT(no)
2494 system_utmpx_path=no ]
2495)
2496if test -z "$conf_utmpx_location"; then
2497 if test x"$system_utmpx_path" = x"no" ; then
2498 AC_DEFINE(DISABLE_UTMPX)
2499 fi
2500else
2501 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2502fi
2503
2504dnl wtmpx detection
2505AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2506AC_TRY_COMPILE([
2507#include <sys/types.h>
2508#include <utmp.h>
2509#ifdef HAVE_UTMPX_H
2510#include <utmpx.h>
2511#endif
Damien Miller2994e082000-06-04 15:51:47 +10002512#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00002513# include <paths.h>
2514#endif
2515 ],
2516 [ char *wtmpx = WTMPX_FILE; ],
2517 [ AC_MSG_RESULT(yes) ],
2518 [ AC_MSG_RESULT(no)
2519 system_wtmpx_path=no ]
2520)
2521if test -z "$conf_wtmpx_location"; then
2522 if test x"$system_wtmpx_path" = x"no" ; then
2523 AC_DEFINE(DISABLE_WTMPX)
2524 fi
2525else
2526 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2527fi
2528
Damien Miller4018c192000-04-30 09:30:44 +10002529
Damien Miller29ea30d2000-03-17 10:54:15 +11002530if test ! -z "$blibpath" ; then
Damien Millereab4bae2003-04-29 23:22:40 +10002531 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2532 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
Damien Miller29ea30d2000-03-17 10:54:15 +11002533fi
2534
Tim Rice4cec93f2002-02-26 08:40:48 -08002535dnl remove pam and dl because they are in $LIBPAM
2536if test "$PAM_MSG" = yes ; then
Tim Rice7d2d1f12002-02-26 22:05:11 -08002537 LIBS=`echo $LIBS | sed 's/-lpam //'`
2538fi
2539if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2540 LIBS=`echo $LIBS | sed 's/-ldl //'`
Tim Rice4cec93f2002-02-26 08:40:48 -08002541fi
2542
Damien Millerbac2d8a2000-09-05 16:13:06 +11002543AC_EXEEXT
Tim Rice13aae5e2001-10-21 17:53:58 -07002544AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2545AC_OUTPUT
Damien Miller0437b332000-05-02 09:56:41 +10002546
Damien Miller7b22d652000-06-18 14:07:04 +10002547# Print summary of options
2548
Damien Miller7b22d652000-06-18 14:07:04 +10002549# Someone please show me a better way :)
2550A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2551B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2552C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2553D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00002554E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00002555F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10002556G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Damien Millerf58c6722002-05-13 13:15:42 +10002557H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2558I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2559J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
Damien Miller7b22d652000-06-18 14:07:04 +10002560
2561echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00002562echo "OpenSSH has been configured with the following options:"
Damien Millerf58c6722002-05-13 13:15:42 +10002563echo " User binaries: $B"
2564echo " System binaries: $C"
2565echo " Configuration files: $D"
2566echo " Askpass program: $E"
2567echo " Manual pages: $F"
2568echo " PID file: $G"
2569echo " Privilege separation chroot path: $H"
Tim Rice43a1c132002-04-17 21:19:14 -07002570if test "$USES_LOGIN_CONF" = "yes" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002571echo " At runtime, sshd will use the path defined in /etc/login.conf"
Tim Rice43a1c132002-04-17 21:19:14 -07002572else
Damien Millerf58c6722002-05-13 13:15:42 +10002573echo " sshd default user PATH: $I"
Tim Rice43a1c132002-04-17 21:19:14 -07002574fi
Damien Millera18bbd32002-05-13 10:48:57 +10002575if test ! -z "$superuser_path" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002576echo " sshd superuser user PATH: $J"
Damien Millera18bbd32002-05-13 10:48:57 +10002577fi
Damien Millerf58c6722002-05-13 13:15:42 +10002578echo " Manpage format: $MANTYPE"
Damien Miller9d2be482003-05-15 11:12:19 +10002579echo " DNS support: $DNS_MSG"
Damien Miller7abe09b2003-05-15 10:53:49 +10002580echo " PAM support: $PAM_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002581echo " KerberosV support: $KRB5_MSG"
2582echo " Smartcard support: $SCARD_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002583echo " S/KEY support: $SKEY_MSG"
2584echo " TCP Wrappers support: $TCPW_MSG"
2585echo " MD5 password support: $MD5_MSG"
Damien Miller903e1152002-05-13 14:41:31 +10002586echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
Damien Millerf58c6722002-05-13 13:15:42 +10002587echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2588echo " BSD Auth support: $BSD_AUTH_MSG"
2589echo " Random number source: $RAND_MSG"
Damien Miller6c21c512002-01-22 21:57:53 +11002590if test ! -z "$USE_RAND_HELPER" ; then
Damien Millerf58c6722002-05-13 13:15:42 +10002591echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
Damien Miller60396b02001-02-18 17:01:00 +11002592fi
2593
Damien Miller7b22d652000-06-18 14:07:04 +10002594echo ""
2595
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00002596echo " Host: ${host}"
2597echo " Compiler: ${CC}"
2598echo " Compiler flags: ${CFLAGS}"
2599echo "Preprocessor flags: ${CPPFLAGS}"
2600echo " Linker flags: ${LDFLAGS}"
Tim Rice4cec93f2002-02-26 08:40:48 -08002601echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002602
2603echo ""
2604
Damien Miller82cf0ce2000-12-20 13:34:48 +11002605if test "x$PAM_MSG" = "xyes" ; then
Damien Miller6c21c512002-01-22 21:57:53 +11002606 echo "PAM is enabled. You may need to install a PAM control file "
2607 echo "for sshd, otherwise password authentication may fail. "
2608 echo "Example PAM control files can be found in the contrib/ "
2609 echo "subdirectory"
Damien Miller6f9c3372000-10-25 10:06:04 +11002610 echo ""
2611fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002612
Damien Miller6c21c512002-01-22 21:57:53 +11002613if test ! -z "$RAND_HELPER_CMDHASH" ; then
2614 echo "WARNING: you are using the builtin random number collection "
2615 echo "service. Please read WARNING.RNG and request that your OS "
2616 echo "vendor includes kernel-based random number collection in "
2617 echo "future versions of your OS."
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002618 echo ""
2619fi
Damien Miller60396b02001-02-18 17:01:00 +11002620